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 OutputDirectoryCreator
for writing reports and
other output files.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExecutionRequest
(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.without replacement because it's an internal API. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutionRequest
create
(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.without replacementstatic ExecutionRequest
create
(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken) Factory for creating an execution request.Returns theCancellationToken
for this request for engines to check whether they should cancel execution.Returns theConfigurationParameters
that the engine may use to influence test execution.Returns theEngineExecutionListener
to be notified of test execution events.Returns theOutputDirectoryCreator
for this request for writing reports and other output files.Deprecated, for removal: This API element is subject to removal in a future version.Please usegetOutputDirectoryCreator()
insteadReturns the rootTestDescriptor
of the engine that processes this request.getStore()
Returns theNamespacedHierarchicalStore
for this request for storing request-scoped data.
-
Constructor Details
-
ExecutionRequest
@Deprecated(since="1.11") @API(status=DEPRECATED, since="1.11") public ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters) Deprecated.without replacement because it's an internal API.
-
-
Method Details
-
create
@Deprecated(since="1.11") @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 rootTestDescriptor
engineExecutionListener
- theEngineExecutionListener
to be notified of test execution eventsconfigurationParameters
-ConfigurationParameters
that 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, OutputDirectoryCreator outputDirectoryCreator, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken) Factory for creating an execution request.- Parameters:
rootTestDescriptor
- the engine's rootTestDescriptor
; nevernull
engineExecutionListener
- theEngineExecutionListener
to be notified of test execution events; nevernull
configurationParameters
-ConfigurationParameters
that the engine may use to influence test execution; nevernull
outputDirectoryCreator
-OutputDirectoryCreator
for writing reports and other output files; nevernull
requestLevelStore
-NamespacedHierarchicalStore
for storing request-scoped data; nevernull
- Returns:
- a new
ExecutionRequest
; nevernull
- Since:
- 6.0
-
getRootTestDescriptor
Returns the rootTestDescriptor
of the engine that processes this request.Note: the root descriptor is the
TestDescriptor
returned byTestEngine.discover(EngineDiscoveryRequest, UniqueId)
.- Returns:
- the root
TestDescriptor
of the engine that processes this request
-
getEngineExecutionListener
Returns theEngineExecutionListener
to be notified of test execution events.- Returns:
- the
EngineExecutionListener
to be notified of test execution events
-
getConfigurationParameters
Returns theConfigurationParameters
that the engine may use to influence test execution.- Returns:
- the
ConfigurationParameters
that the engine may use to influence test execution
-
getOutputDirectoryProvider
@Deprecated(since="6.0", forRemoval=true) @API(status=DEPRECATED, since="6.0") public OutputDirectoryProvider getOutputDirectoryProvider()Deprecated, for removal: This API element is subject to removal in a future version.Please usegetOutputDirectoryCreator()
insteadReturns theOutputDirectoryProvider
for this request for writing reports and other output files.- Returns:
- the
OutputDirectoryProvider
for this request for writing reports and other output files - Throws:
PreconditionViolationException
- if the output directory provider is not available- Since:
- 1.12
-
getOutputDirectoryCreator
Returns theOutputDirectoryCreator
for this request for writing reports and other output files.- Returns:
- the
OutputDirectoryCreator
for this request for writing reports and other output files - Throws:
PreconditionViolationException
- if the output directory creator is not available- Since:
- 6.0
-
getStore
Returns theNamespacedHierarchicalStore
for this request for storing request-scoped data.All stored values that implement
AutoCloseable
are notified by invoking theirclose()
methods when this request has been executed.- Returns:
- the
NamespacedHierarchicalStore
for this request for storing request-scoped data - Since:
- 1.13
- See Also:
-
getCancellationToken
Returns theCancellationToken
for this request for engines to check whether they should cancel execution.- Returns:
- the
CancellationToken
for this request for engines to check whether they should cancel execution - Since:
- 6.0
- See Also:
-