Module org.junit.platform.engine
Class HierarchicalTestEngine<C extends EngineExecutionContext>
java.lang.Object
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine<C>
- Type Parameters:
C
- the type ofEngineExecutionContext
used 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract C
createExecutionContext
(ExecutionRequest request) Create the initial execution context for executing the supplied request.protected HierarchicalTestExecutorService
createExecutorService
(ExecutionRequest request) Create the executor service to use for executing the supplied request.protected ThrowableCollector.Factory
Create the factory for creatingThrowableCollector
instances used to handle exceptions that occur during execution of this engine's tests.final void
execute
(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.junit.platform.engine.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.- Specified by:
execute
in interfaceTestEngine
- Parameters:
request
- the request to execute tests for; nevernull
- See Also:
-
createExecutorService
@API(status=EXPERIMENTAL, since="1.3") 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=EXPERIMENTAL, since="1.3") protected ThrowableCollector.Factory createThrowableCollectorFactory(ExecutionRequest request) Create the factory for creatingThrowableCollector
instances 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
-