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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LauncherConfigThe defaultLauncherConfigwhich uses automatic registration for test engines, supported listeners, and post-discovery filters. -
Method Summary
Modifier and TypeMethodDescriptionstatic LauncherConfig.Builderbuilder()Create a newLauncherConfig.Builder.Get the collection of additional launcher discovery listeners that should be added to theLauncher.Get the collection of additional launcher session listeners that should be added to theLauncher.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.booleanDetermine if launcher discovery listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.booleanDetermine if launcher session listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.booleanDetermine if post discovery filters should be discovered at runtime using theServiceLoadermechanism and automatically registered.booleanDetermine if test engines should be discovered at runtime using theServiceLoadermechanism and automatically registered.booleanDetermine if test execution listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.
-
Field Details
-
DEFAULT
The defaultLauncherConfigwhich uses automatic registration for test engines, supported listeners, and post-discovery filters.
-
-
Method Details
-
isTestEngineAutoRegistrationEnabled
boolean isTestEngineAutoRegistrationEnabled()Determine if test engines should be discovered at runtime using theServiceLoadermechanism and automatically registered.- Returns:
trueif test engines should be automatically registered
-
isLauncherSessionListenerAutoRegistrationEnabled
Determine if launcher session listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.- Returns:
trueif launcher session listeners should be automatically registered- Since:
- 1.8
-
isLauncherDiscoveryListenerAutoRegistrationEnabled
Determine if launcher discovery listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.- Returns:
trueif launcher discovery listeners should be automatically registered- Since:
- 1.8
-
isTestExecutionListenerAutoRegistrationEnabled
boolean isTestExecutionListenerAutoRegistrationEnabled()Determine if test execution listeners should be discovered at runtime using theServiceLoadermechanism and automatically registered.- Returns:
trueif test execution listeners should be automatically registered
-
isPostDiscoveryFilterAutoRegistrationEnabled
Determine if post discovery filters should be discovered at runtime using theServiceLoadermechanism and automatically registered.- Returns:
trueif post discovery filters should be automatically registered- Since:
- 1.7
-
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
nullbut potentially empty
-
getAdditionalLauncherSessionListeners
@API(status=STABLE, since="1.10") 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
nullbut potentially empty - Since:
- 1.8
-
getAdditionalLauncherDiscoveryListeners
@API(status=STABLE, since="1.10") 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
nullbut potentially empty - Since:
- 1.8
-
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
nullbut potentially empty
-
getAdditionalPostDiscoveryFilters
@API(status=STABLE, since="1.10") 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
nullbut potentially empty - Since:
- 1.7
-
builder
Create a newLauncherConfig.Builder.- Returns:
- a new builder; never
null
-