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 creating
Launcher
instances via the LauncherFactory
.
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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic LauncherConfig.Builder
builder()
Create a newLauncherConfig.Builder
.Get the collection of additional post discovery filters that should be added to theLauncher
.Get the collection of additional test engines that should be added to theLauncher
.Get the collection of additional test execution listeners that should be added to theLauncher
.boolean
Determine if post discovery filters should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
Determine if test engines should be discovered at runtime using theServiceLoader
mechanism and automatically registered.boolean
Determine if test execution listeners should be discovered at runtime using theServiceLoader
mechanism and automatically registered.
-
Method Details
-
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
-
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=EXPERIMENTAL, since="1.7") 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
-
getAdditionalTestEngines
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
-
getAdditionalTestExecutionListeners
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=EXPERIMENTAL, since="1.7") 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
-
builder
Create a newLauncherConfig.Builder
.- Returns:
- a new builder; never
null
-