Module org.junit.platform.launcher
Package org.junit.platform.launcher.core
Interface LauncherConfig
-
- All Known Implementing Classes:
DefaultLauncherConfig
@API(status=STABLE, since="1.7") public interface LauncherConfig
LauncherConfig
defines the configuration API for creatingLauncher
instances via theLauncherFactory
.Example
LauncherConfig launcherConfig = LauncherConfig.builder() .enableTestEngineAutoRegistration(false) .enableTestExecutionListenerAutoRegistration(false) .addTestEngines(new CustomTestEngine()) .addTestExecutionListeners(new CustomTestExecutionListener()) .build(); Launcher launcher = LauncherFactory.create(launcherConfig); LauncherDiscoveryRequest discoveryRequest = ... launcher.execute(discoveryRequest);
- Since:
- 1.3
- See Also:
builder()
,Launcher
,LauncherFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LauncherConfig.Builder
Builder API forLauncherConfig
.
-
Field Summary
Fields Modifier and Type Field Description static LauncherConfig
DEFAULT
The defaultLauncherConfig
which uses automatic registration for test engines, supported listeners, and post-discovery filters.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static LauncherConfig.Builder
builder()
Create a newLauncherConfig.Builder
.java.util.Collection<LauncherDiscoveryListener>
getAdditionalLauncherDiscoveryListeners()
Get the collection of additional launcher discovery listeners that should be added to theLauncher
.java.util.Collection<LauncherSessionListener>
getAdditionalLauncherSessionListeners()
Get the collection of additional launcher session listeners that should be added to theLauncher
.java.util.Collection<PostDiscoveryFilter>
getAdditionalPostDiscoveryFilters()
Get the collection of additional post discovery filters that should be added to theLauncher
.java.util.Collection<TestEngine>
getAdditionalTestEngines()
Get the collection of additional test engines that should be added to theLauncher
.java.util.Collection<TestExecutionListener>
getAdditionalTestExecutionListeners()
Get the collection of additional test execution listeners that should be added to theLauncher
.boolean
isLauncherDiscoveryListenerAutoRegistrationEnabled()
Determine if launcher discovery listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
isLauncherSessionListenerAutoRegistrationEnabled()
Determine if launcher session listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
isPostDiscoveryFilterAutoRegistrationEnabled()
Determine if post discovery filters should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
isTestEngineAutoRegistrationEnabled()
Determine if test engines should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
isTestExecutionListenerAutoRegistrationEnabled()
Determine if test execution listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.
-
-
-
Field Detail
-
DEFAULT
static final LauncherConfig DEFAULT
The defaultLauncherConfig
which uses automatic registration for test engines, supported listeners, and post-discovery filters.
-
-
Method Detail
-
isTestEngineAutoRegistrationEnabled
boolean isTestEngineAutoRegistrationEnabled()
Determine if test engines should be discovered at runtime using theServiceLoader
mechanism and automatically registered.- Returns:
true
if test engines should be automatically registered
-
isLauncherSessionListenerAutoRegistrationEnabled
@API(status=STABLE, since="1.10") boolean isLauncherSessionListenerAutoRegistrationEnabled()
Determine if launcher session listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.- Returns:
true
if launcher session listeners should be automatically registered- Since:
- 1.8
-
isLauncherDiscoveryListenerAutoRegistrationEnabled
@API(status=STABLE, since="1.10") boolean isLauncherDiscoveryListenerAutoRegistrationEnabled()
Determine if launcher discovery listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.- Returns:
true
if launcher discovery listeners should be automatically registered- Since:
- 1.8
-
isTestExecutionListenerAutoRegistrationEnabled
boolean isTestExecutionListenerAutoRegistrationEnabled()
Determine if test execution listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.- Returns:
true
if test execution listeners should be automatically registered
-
isPostDiscoveryFilterAutoRegistrationEnabled
@API(status=STABLE, since="1.10") boolean isPostDiscoveryFilterAutoRegistrationEnabled()
Determine if post discovery filters should be discovered at runtime using theServiceLoader
mechanism and automatically registered.- Returns:
true
if post discovery filters should be automatically registered- Since:
- 1.7
-
getAdditionalTestEngines
java.util.Collection<TestEngine> getAdditionalTestEngines()
Get the collection of additional test engines that should be added to theLauncher
.- Returns:
- the collection of additional test engines; never
null
but potentially empty
-
getAdditionalLauncherSessionListeners
@API(status=STABLE, since="1.10") java.util.Collection<LauncherSessionListener> getAdditionalLauncherSessionListeners()
Get the collection of additional launcher session listeners that should be added to theLauncher
.- Returns:
- the collection of additional launcher session listeners; never
null
but potentially empty - Since:
- 1.8
-
getAdditionalLauncherDiscoveryListeners
@API(status=STABLE, since="1.10") java.util.Collection<LauncherDiscoveryListener> getAdditionalLauncherDiscoveryListeners()
Get the collection of additional launcher discovery listeners that should be added to theLauncher
.- Returns:
- the collection of additional launcher discovery listeners; never
null
but potentially empty - Since:
- 1.8
-
getAdditionalTestExecutionListeners
java.util.Collection<TestExecutionListener> getAdditionalTestExecutionListeners()
Get the collection of additional test execution listeners that should be added to theLauncher
.- Returns:
- the collection of additional test execution listeners; never
null
but potentially empty
-
getAdditionalPostDiscoveryFilters
@API(status=STABLE, since="1.10") java.util.Collection<PostDiscoveryFilter> getAdditionalPostDiscoveryFilters()
Get the collection of additional post discovery filters that should be added to theLauncher
.- Returns:
- the collection of additional post discovery filters; never
null
but potentially empty - Since:
- 1.7
-
builder
static LauncherConfig.Builder builder()
Create a newLauncherConfig.Builder
.- Returns:
- a new builder; never
null
-
-