Package org.junit.platform.launcher.core
Class DefaultLauncher
java.lang.Object
org.junit.platform.launcher.core.DefaultLauncher
- All Implemented Interfaces:
Launcher
Default implementation of the
Launcher
API.
External clients can obtain an instance by invoking
LauncherFactory.create()
.
- Since:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EngineDiscoveryOrchestrator
private final EngineExecutionOrchestrator
private final LauncherListenerRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLauncher
(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters) Construct a newDefaultLauncher
with the supplied test engines. -
Method Summary
Modifier and TypeMethodDescriptiondiscover
(LauncherDiscoveryRequest discoveryRequest) Discover tests and build aTestPlan
according to the suppliedLauncherDiscoveryRequest
by querying all registered engines and collecting their results.private LauncherDiscoveryResult
discover
(LauncherDiscoveryRequest discoveryRequest, EngineDiscoveryOrchestrator.Phase phase) private void
execute
(InternalTestPlan internalTestPlan, TestExecutionListener[] listeners) void
execute
(LauncherDiscoveryRequest discoveryRequest, TestExecutionListener... listeners) Execute aTestPlan
which is built according to the suppliedLauncherDiscoveryRequest
by querying all registered engines and collecting their results, and notify registered listeners about the progress and results of the execution.void
execute
(TestPlan testPlan, TestExecutionListener... listeners) Execute the suppliedTestPlan
and notify registered listeners about the progress and results of the execution.void
registerLauncherDiscoveryListeners
(LauncherDiscoveryListener... listeners) Register one or more listeners for test discovery.void
registerTestExecutionListeners
(TestExecutionListener... listeners) Register one or more listeners for test execution.
-
Field Details
-
listenerRegistry
-
executionOrchestrator
-
discoveryOrchestrator
-
-
Constructor Details
-
DefaultLauncher
DefaultLauncher(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters) Construct a newDefaultLauncher
with the supplied test engines.- Parameters:
testEngines
- the test engines to delegate to; nevernull
or emptypostDiscoveryFilters
- the additional post discovery filters for discovery requests; nevernull
-
-
Method Details
-
registerLauncherDiscoveryListeners
Description copied from interface:Launcher
Register one or more listeners for test discovery.- Specified by:
registerLauncherDiscoveryListeners
in interfaceLauncher
- Parameters:
listeners
- the listeners to be notified of test discovery events; nevernull
or empty
-
registerTestExecutionListeners
Description copied from interface:Launcher
Register one or more listeners for test execution.- Specified by:
registerTestExecutionListeners
in interfaceLauncher
- Parameters:
listeners
- the listeners to be notified of test execution events; nevernull
or empty
-
discover
Description copied from interface:Launcher
Discover tests and build aTestPlan
according to the suppliedLauncherDiscoveryRequest
by querying all registered engines and collecting their results.- Specified by:
discover
in interfaceLauncher
- Parameters:
discoveryRequest
- the launcher discovery request; nevernull
- Returns:
- an unmodifiable
TestPlan
that contains all resolved identifiers from all registered engines
-
execute
Description copied from interface:Launcher
Execute aTestPlan
which is built according to the suppliedLauncherDiscoveryRequest
by querying all registered engines and collecting their results, and notify registered listeners about the progress and results of the execution.Supplied test execution listeners are registered in addition to already registered listeners but only for the supplied launcher discovery request.
-
execute
Description copied from interface:Launcher
Execute the suppliedTestPlan
and notify registered listeners about the progress and results of the execution.Supplied test execution listeners are registered in addition to already registered listeners but only for the execution of the supplied test plan.
-
discover
private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, EngineDiscoveryOrchestrator.Phase phase) -
execute
-