Class ExecutionRequest
java.lang.Object
org.junit.platform.engine.ExecutionRequest
Provides a single
TestEngine access to the information necessary to
execute its tests.
A request contains an engine's root TestDescriptor, the
EngineExecutionListener to be notified of test execution events, the
ConfigurationParameters that the engine may use to influence test
execution, and an OutputDirectoryProvider for writing reports and
other output files.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutionRequestcreate(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.without replacementstatic ExecutionRequestcreate(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters, OutputDirectoryProvider outputDirectoryProvider, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken) Factory for creating an execution request.Returns theCancellationTokenfor this request for engines to check whether they should cancel execution.Returns theConfigurationParametersthat the engine may use to influence test execution.Returns theEngineExecutionListenerto be notified of test execution events.Returns theOutputDirectoryProviderfor this request for writing reports and other output files.Returns the rootTestDescriptorof the engine that processes this request.getStore()Returns theNamespacedHierarchicalStorefor this request for storing request-scoped data.
-
Constructor Details
-
ExecutionRequest
@Deprecated @API(status=DEPRECATED, since="1.11") public ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.
-
-
Method Details
-
create
@Deprecated @API(status=DEPRECATED, since="1.11") public static ExecutionRequest create(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.without replacementFactory for creating an execution request.- Parameters:
rootTestDescriptor- the engine's rootTestDescriptorengineExecutionListener- theEngineExecutionListenerto be notified of test execution eventsconfigurationParameters-ConfigurationParametersthat the engine may use to influence test execution- Returns:
- a new
ExecutionRequest; nevernull - Since:
- 1.9
-
create
@API(status=INTERNAL, since="6.0") public static ExecutionRequest create(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters, OutputDirectoryProvider outputDirectoryProvider, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken) Factory for creating an execution request.- Parameters:
rootTestDescriptor- the engine's rootTestDescriptor; nevernullengineExecutionListener- theEngineExecutionListenerto be notified of test execution events; nevernullconfigurationParameters-ConfigurationParametersthat the engine may use to influence test execution; nevernulloutputDirectoryProvider-OutputDirectoryProviderfor writing reports and other output files; nevernullrequestLevelStore-NamespacedHierarchicalStorefor storing request-scoped data; nevernull- Returns:
- a new
ExecutionRequest; nevernull - Since:
- 6.0
-
getRootTestDescriptor
Returns the rootTestDescriptorof the engine that processes this request.Note: the root descriptor is the
TestDescriptorreturned byTestEngine.discover(EngineDiscoveryRequest, UniqueId).- Returns:
- the root
TestDescriptorof the engine that processes this request
-
getEngineExecutionListener
Returns theEngineExecutionListenerto be notified of test execution events.- Returns:
- the
EngineExecutionListenerto be notified of test execution events
-
getConfigurationParameters
Returns theConfigurationParametersthat the engine may use to influence test execution.- Returns:
- the
ConfigurationParametersthat the engine may use to influence test execution
-
getOutputDirectoryProvider
Returns theOutputDirectoryProviderfor this request for writing reports and other output files.- Returns:
- the
OutputDirectoryProviderfor this request for writing reports and other output files - Throws:
PreconditionViolationException- if the output directory provider is not available- Since:
- 1.12
-
getStore
Returns theNamespacedHierarchicalStorefor this request for storing request-scoped data.All stored values that implement
AutoCloseableare notified by invoking theirclose()methods when this request has been executed.- Returns:
- the
NamespacedHierarchicalStorefor this request for storing request-scoped data - Since:
- 1.13
- See Also:
-
getCancellationToken
Returns theCancellationTokenfor this request for engines to check whether they should cancel execution.- Returns:
- the
CancellationTokenfor this request for engines to check whether they should cancel execution - Since:
- 6.0
- See Also:
-