Top Description Fields Constructors Methods
org.junit.platform.engine

public Class ExecutionRequest

extends Object
Class Inheritance
Annotations
@API
status:STABLE
since:1.0
Static Imports
org.apiguardian.api.API.Status.DEPRECATED, .API.Status.EXPERIMENTAL, .API.Status.INTERNAL, .API.Status.MAINTAINED, .API.Status.STABLE

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
TestEngine

Field Summary

Modifier and TypeField and Description
private final CancellationToken
private final ConfigurationParameters
private final EngineExecutionListener
private final @Nullable OutputDirectoryCreator
private final @Nullable NamespacedHierarchicalStore<Namespace>
private final TestDescriptor

Constructor Summary

AccessConstructor and Description
public
ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters)
Deprecated since 1.11. without replacement because it's an internal API.

private
ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters, @Nullable OutputDirectoryCreator outputDirectoryCreator, @Nullable NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken)

Method Summary

Modifier and TypeMethod and Description
public static ExecutionRequest

Returns:

a new ExecutionRequest; never null
create
(TestDescriptor
the engine's root TestDescriptor
rootTestDescriptor
,
EngineExecutionListener
the EngineExecutionListener to be notified of test execution events
engineExecutionListener
,
ConfigurationParameters
ConfigurationParameters that the engine may use to influence test execution
configurationParameters
)
Deprecated since 1.11. without replacement

Factory for creating an execution request.

public static ExecutionRequest

Returns:

a new ExecutionRequest; never null
create
(TestDescriptor
the engine's root TestDescriptor; never null
rootTestDescriptor
,
EngineExecutionListener
the EngineExecutionListener to be notified of test execution events; never null
engineExecutionListener
,
ConfigurationParameters
ConfigurationParameters that the engine may use to influence test execution; never null
configurationParameters
,
OutputDirectoryCreator
OutputDirectoryCreator for writing reports and other output files; never null
outputDirectoryCreator
,
NamespacedHierarchicalStore<Namespace>
NamespacedHierarchicalStore for storing request-scoped data; never null
requestLevelStore
,
CancellationToken cancellationToken)

Factory for creating an execution request.

public CancellationToken

Returns:

the CancellationToken for this request for engines to check whether they should cancel execution
getCancellationToken
()

Returns the CancellationToken for this request for engines to check whether they should cancel execution.

public ConfigurationParameters

Returns:

the ConfigurationParameters that the engine may use to influence test execution
getConfigurationParameters
()

Returns the ConfigurationParameters that the engine may use to influence test execution.

public EngineExecutionListener

Returns:

the EngineExecutionListener to be notified of test execution events
getEngineExecutionListener
()

Returns the EngineExecutionListener to be notified of test execution events.

public OutputDirectoryCreator

Returns:

the OutputDirectoryCreator for this request for writing reports and other output files
getOutputDirectoryCreator
()

Returns the OutputDirectoryCreator for this request for writing reports and other output files.

public OutputDirectoryProvider

Returns:

the org.junit.platform.engine.reporting.OutputDirectoryProvider for this request for writing reports and other output files
getOutputDirectoryProvider
()
Deprecated for removal since 1.14. Please use getOutputDirectoryCreator() instead

Returns the org.junit.platform.engine.reporting.OutputDirectoryProvider for this request for writing reports and other output files.

public TestDescriptor

Returns:

the root TestDescriptor of the engine that processes this request
getRootTestDescriptor
()

Returns the root TestDescriptor of the engine that processes this request.

public NamespacedHierarchicalStore<Namespace>

Returns:

the NamespacedHierarchicalStore for this request for storing request-scoped data
getStore
()

Returns the NamespacedHierarchicalStore for this request for storing request-scoped data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cancellationTokenback to summary
private final CancellationToken cancellationToken
configurationParametersback to summary
private final ConfigurationParameters configurationParameters
engineExecutionListenerback to summary
private final EngineExecutionListener engineExecutionListener
outputDirectoryCreatorback to summary
private final @Nullable OutputDirectoryCreator outputDirectoryCreator
requestLevelStoreback to summary
private final @Nullable NamespacedHierarchicalStore<Namespace> requestLevelStore
rootTestDescriptorback to summary
private final TestDescriptor rootTestDescriptor

Constructor Detail

ExecutionRequestback to summary
public ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters)

Deprecated

since 1.11.

without replacement because it's an internal API.

Annotations
@Deprecated
since:1.11
@API
status:DEPRECATED
since:1.11
ExecutionRequestback to summary
private ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters, @Nullable OutputDirectoryCreator outputDirectoryCreator, @Nullable NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken)

Method Detail

createback to summary
public static ExecutionRequest create(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters)

Deprecated

since 1.11.

without replacement

Factory for creating an execution request.

Parameters
rootTestDescriptor:TestDescriptor

the engine's root TestDescriptor

engineExecutionListener:EngineExecutionListener

the EngineExecutionListener to be notified of test execution events

configurationParameters:ConfigurationParameters

ConfigurationParameters that the engine may use to influence test execution

Returns:ExecutionRequest

a new ExecutionRequest; never null

Annotations
@Deprecated
since:1.11
@API
status:DEPRECATED
since:1.11
Since
1.9
createback to summary
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:TestDescriptor

the engine's root TestDescriptor; never null

engineExecutionListener:EngineExecutionListener

the EngineExecutionListener to be notified of test execution events; never null

configurationParameters:ConfigurationParameters

ConfigurationParameters that the engine may use to influence test execution; never null

outputDirectoryCreator:OutputDirectoryCreator

OutputDirectoryCreator for writing reports and other output files; never null

requestLevelStore:NamespacedHierarchicalStore<Namespace>

NamespacedHierarchicalStore for storing request-scoped data; never null

Returns:ExecutionRequest

a new ExecutionRequest; never null

Annotations
@API
status:INTERNAL
since:6.0
Since
6.0
getCancellationTokenback to summary
public CancellationToken getCancellationToken()

Returns the CancellationToken for this request for engines to check whether they should cancel execution.

Returns:CancellationToken

the CancellationToken for this request for engines to check whether they should cancel execution

Annotations
@API
status:EXPERIMENTAL
since:6.0
Since
6.0
See Also
CancellationToken#isCancellationRequested()
getConfigurationParametersback to summary
public ConfigurationParameters getConfigurationParameters()

Returns the ConfigurationParameters that the engine may use to influence test execution.

Returns:ConfigurationParameters

the ConfigurationParameters that the engine may use to influence test execution

getEngineExecutionListenerback to summary
public EngineExecutionListener getEngineExecutionListener()

Returns the EngineExecutionListener to be notified of test execution events.

Returns:EngineExecutionListener

the EngineExecutionListener to be notified of test execution events

getOutputDirectoryCreatorback to summary
public OutputDirectoryCreator getOutputDirectoryCreator()

Returns the OutputDirectoryCreator for this request for writing reports and other output files.

Returns:OutputDirectoryCreator

the OutputDirectoryCreator for this request for writing reports and other output files

Annotations
@API
status:MAINTAINED
since:1.14
Exceptions
PreconditionViolationException:
if the output directory creator is not available
Since
1.14
getOutputDirectoryProviderback to summary
public OutputDirectoryProvider getOutputDirectoryProvider()

Deprecated

for removal since 1.14.

Please use getOutputDirectoryCreator() instead

Returns the org.junit.platform.engine.reporting.OutputDirectoryProvider for this request for writing reports and other output files.

Returns:OutputDirectoryProvider

the org.junit.platform.engine.reporting.OutputDirectoryProvider for this request for writing reports and other output files

Annotations
@Deprecated
since:1.14
forRemoval:true
@API
status:DEPRECATED
since:1.14
@SuppressWarnings:removal
Exceptions
PreconditionViolationException:
if the output directory provider is not available
Since
1.12
getRootTestDescriptorback to summary
public TestDescriptor getRootTestDescriptor()

Returns the root TestDescriptor of the engine that processes this request.

Note

the root descriptor is the TestDescriptor returned by TestEngine#discover(EngineDiscoveryRequest, UniqueId).

Returns:TestDescriptor

the root TestDescriptor of the engine that processes this request

getStoreback to summary
public NamespacedHierarchicalStore<Namespace> getStore()

Returns the NamespacedHierarchicalStore for this request for storing request-scoped data.

All stored values that implement AutoCloseable are notified by invoking their close() methods when this request has been executed.

Returns:NamespacedHierarchicalStore<Namespace>

the NamespacedHierarchicalStore for this request for storing request-scoped data

Annotations
@API
status:EXPERIMENTAL
since:6.0
Since
1.13
See Also
NamespacedHierarchicalStore