Top Description Fields Constructors Methods
org.junit.platform.launcher.core

pack-priv Class DefaultLauncher

extends Object
implements Launcher
Class Inheritance
All Implemented Interfaces
org.junit.platform.launcher.Launcher
Static Imports
java.util.Collections.unmodifiableCollection, org.junit.platform.engine.support.store.NamespacedHierarchicalStore.CloseAction.closeAutoCloseables, org.junit.platform.launcher.core.LauncherPhase.DISCOVERY, .LauncherPhase.EXECUTION

Default implementation of the Launcher API.

External clients can obtain an instance by invoking LauncherFactory#create().

Since
1.0
See Also
Launcher, LauncherFactory

Field Summary

Modifier and TypeField and Description
private final EngineDiscoveryOrchestrator
private final EngineExecutionOrchestrator
private final LauncherListenerRegistry
private final NamespacedHierarchicalStore<Namespace>

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultLauncher(Iterable<TestEngine>
the test engines to delegate to; never null or empty
testEngines
,
Collection<PostDiscoveryFilter>
the additional post discovery filters for discovery requests; never null
postDiscoveryFilters
,
NamespacedHierarchicalStore<Namespace> sessionLevelStore)

Construct a new DefaultLauncher with the supplied test engines.

Method Summary

Modifier and TypeMethod and Description
private NamespacedHierarchicalStore<Namespace>
public TestPlan
discover(LauncherDiscoveryRequest discoveryRequest)

Implements org.junit.platform.launcher.Launcher.discover.

Discover tests and build a TestPlan according to the supplied LauncherDiscoveryRequest by querying all registered engines and collecting their results.

private LauncherDiscoveryResult
public void
execute(LauncherDiscoveryRequest discoveryRequest, TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.execute.

Execute a TestPlan which is built according to the supplied LauncherDiscoveryRequest by querying all registered engines and collecting their results, and notify registered listeners about the progress and results of the execution.

public void
execute(TestPlan testPlan, TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.execute.

Execute the supplied TestPlan and notify registered listeners about the progress and results of the execution.

public void
execute(LauncherExecutionRequest launcherExecutionRequest)

Implements org.junit.platform.launcher.Launcher.execute.

Execute tests according to the supplied LauncherExecutionRequest and notify registered listeners about the progress and results of the execution.

private void
execute(InternalTestPlan internalTestPlan, Collection<? extends TestExecutionListener> listeners, CancellationToken cancellationToken)

public void
public void
registerTestExecutionListeners(TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.registerTestExecutionListeners.

Register one or more listeners for test execution.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

discoveryOrchestratorback to summary
private final EngineDiscoveryOrchestrator discoveryOrchestrator
executionOrchestratorback to summary
private final EngineExecutionOrchestrator executionOrchestrator
listenerRegistryback to summary
private final LauncherListenerRegistry listenerRegistry
sessionLevelStoreback to summary
private final NamespacedHierarchicalStore<Namespace> sessionLevelStore

Constructor Detail

DefaultLauncherback to summary
pack-priv DefaultLauncher(Iterable<TestEngine> testEngines, Collection<PostDiscoveryFilter> postDiscoveryFilters, NamespacedHierarchicalStore<Namespace> sessionLevelStore)

Construct a new DefaultLauncher with the supplied test engines.

Parameters
testEngines:Iterable<TestEngine>

the test engines to delegate to; never null or empty

postDiscoveryFilters:Collection<PostDiscoveryFilter>

the additional post discovery filters for discovery requests; never null

Method Detail

createRequestLevelStoreback to summary
private NamespacedHierarchicalStore<Namespace> createRequestLevelStore()
discoverback to summary
public TestPlan discover(LauncherDiscoveryRequest discoveryRequest)

Implements org.junit.platform.launcher.Launcher.discover.

Doc from org.junit.platform.launcher.Launcher.discover.

Discover tests and build a TestPlan according to the supplied LauncherDiscoveryRequest by querying all registered engines and collecting their results.

Annotations
@Override
discoverback to summary
private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, LauncherPhase phase)
executeback to summary
public void execute(LauncherDiscoveryRequest discoveryRequest, TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.execute.

Doc from org.junit.platform.launcher.Launcher.execute.

Execute a TestPlan which is built according to the supplied LauncherDiscoveryRequest 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.

Annotations
@Override
executeback to summary
public void execute(TestPlan testPlan, TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.execute.

Doc from org.junit.platform.launcher.Launcher.execute.

Execute the supplied TestPlan 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.

Annotations
@Override
executeback to summary
public void execute(LauncherExecutionRequest launcherExecutionRequest)

Implements org.junit.platform.launcher.Launcher.execute.

Doc from org.junit.platform.launcher.Launcher.execute.

Execute tests according to the supplied LauncherExecutionRequest and notify registered listeners about the progress and results of the execution.

Test execution listeners supplied as part of the request are registered in addition to already registered listeners but only for the supplied execution request.

Annotations
@Override
executeback to summary
private void execute(InternalTestPlan internalTestPlan, Collection<? extends TestExecutionListener> listeners, CancellationToken cancellationToken)
registerLauncherDiscoveryListenersback to summary
public void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners)

Implements org.junit.platform.launcher.Launcher.registerLauncherDiscoveryListeners.

Doc from org.junit.platform.launcher.Launcher.registerLauncherDiscoveryListeners.

Register one or more listeners for test discovery.

Annotations
@Override
registerTestExecutionListenersback to summary
public void registerTestExecutionListeners(TestExecutionListener... listeners)

Implements org.junit.platform.launcher.Launcher.registerTestExecutionListeners.

Doc from org.junit.platform.launcher.Launcher.registerTestExecutionListeners.

Register one or more listeners for test execution.

Annotations
@Override