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 EngineDiscoveryOrchestratorprivate final EngineExecutionOrchestratorprivate final LauncherListenerRegistry -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLauncher(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters) Construct a newDefaultLauncherwith the supplied test engines. -
Method Summary
Modifier and TypeMethodDescriptiondiscover(LauncherDiscoveryRequest discoveryRequest) Discover tests and build aTestPlanaccording to the suppliedLauncherDiscoveryRequestby querying all registered engines and collecting their results.private LauncherDiscoveryResultdiscover(LauncherDiscoveryRequest discoveryRequest, EngineDiscoveryOrchestrator.Phase phase) private voidexecute(InternalTestPlan internalTestPlan, TestExecutionListener[] listeners) voidexecute(LauncherDiscoveryRequest discoveryRequest, TestExecutionListener... listeners) Execute aTestPlanwhich is built according to the suppliedLauncherDiscoveryRequestby querying all registered engines and collecting their results, and notify registered listeners about the progress and results of the execution.voidexecute(TestPlan testPlan, TestExecutionListener... listeners) Execute the suppliedTestPlanand notify registered listeners about the progress and results of the execution.voidregisterLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) Register one or more listeners for test discovery.voidregisterTestExecutionListeners(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 newDefaultLauncherwith the supplied test engines.- Parameters:
testEngines- the test engines to delegate to; nevernullor emptypostDiscoveryFilters- the additional post discovery filters for discovery requests; nevernull
-
-
Method Details
-
registerLauncherDiscoveryListeners
Description copied from interface:LauncherRegister one or more listeners for test discovery.- Specified by:
registerLauncherDiscoveryListenersin interfaceLauncher- Parameters:
listeners- the listeners to be notified of test discovery events; nevernullor empty
-
registerTestExecutionListeners
Description copied from interface:LauncherRegister one or more listeners for test execution.- Specified by:
registerTestExecutionListenersin interfaceLauncher- Parameters:
listeners- the listeners to be notified of test execution events; nevernullor empty
-
discover
Description copied from interface:LauncherDiscover tests and build aTestPlanaccording to the suppliedLauncherDiscoveryRequestby querying all registered engines and collecting their results.- Specified by:
discoverin interfaceLauncher- Parameters:
discoveryRequest- the launcher discovery request; nevernull- Returns:
- an unmodifiable
TestPlanthat contains all resolved identifiers from all registered engines
-
execute
Description copied from interface:LauncherExecute aTestPlanwhich is built according to the suppliedLauncherDiscoveryRequestby 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:LauncherExecute the suppliedTestPlanand 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
-