Class HierarchicalTestEngine<C extends EngineExecutionContext>
java.lang.Object
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine<C>
- Type Parameters:
C- the type ofEngineExecutionContextused by this engine
- All Implemented Interfaces:
TestEngine
- Direct Known Subclasses:
JupiterTestEngine
@API(status=MAINTAINED,
since="1.0")
public abstract class HierarchicalTestEngine<C extends EngineExecutionContext>
extends Object
implements TestEngine
Abstract base class for all
TestEngine implementations that wish
to organize test suites hierarchically based on the Node abstraction.- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CcreateExecutionContext(ExecutionRequest request) Create the initial execution context for executing the supplied request.protected HierarchicalTestExecutorServicecreateExecutorService(ExecutionRequest request) Create the executor service to use for executing the supplied request.protected ThrowableCollector.FactoryCreate the factory for creatingThrowableCollectorinstances used to handle exceptions that occur during execution of this engine's tests.final voidexecute(ExecutionRequest request) Create an executor service; create an initial execution context; execute the behavior of all nodes in the hierarchy starting with the suppliedrequest's root and notify its execution listener of test execution events.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TestEngine
discover, getArtifactId, getGroupId, getId, getVersion
-
Constructor Details
-
HierarchicalTestEngine
public HierarchicalTestEngine()
-
-
Method Details
-
execute
Create an executor service; create an initial execution context; execute the behavior of all nodes in the hierarchy starting with the suppliedrequest's root and notify its execution listener of test execution events.Supports cancellation via the
CancellationTokenpassed in the suppliedrequest.- Specified by:
executein interfaceTestEngine- Parameters:
request- the request to execute tests for; nevernull- See Also:
-
createExecutorService
@API(status=STABLE, since="1.10") protected HierarchicalTestExecutorService createExecutorService(ExecutionRequest request) Create the executor service to use for executing the supplied request.An engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of service to return or how to configure it.
By default, this method returns an instance of
SameThreadHierarchicalTestExecutorService.- Parameters:
request- the request about to be executed- Since:
- 1.3
- See Also:
-
createThrowableCollectorFactory
@API(status=STABLE, since="1.10") protected ThrowableCollector.Factory createThrowableCollectorFactory(ExecutionRequest request) Create the factory for creatingThrowableCollectorinstances used to handle exceptions that occur during execution of this engine's tests.An engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of factory to return or how to configure it.
By default, this method returns a factory that always creates instances of
OpenTest4JAwareThrowableCollector.- Parameters:
request- the request about to be executed- Since:
- 1.3
- See Also:
-
createExecutionContext
Create the initial execution context for executing the supplied request.- Parameters:
request- the request about to be executed- Returns:
- the initial context that will be passed to nodes in the hierarchy
-