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 allTestEngine
implementations that wish to organize test suites hierarchically based on theNode
abstraction.- Since:
- 1.0
- See Also:
Node
-
-
Constructor Summary
Constructors Constructor Description HierarchicalTestEngine()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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.void
execute(ExecutionRequest request)
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
-
-
-
-
Method Detail
-
execute
public final void execute(ExecutionRequest request)
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:
Node
,createExecutorService(org.junit.platform.engine.ExecutionRequest)
,createExecutionContext(org.junit.platform.engine.ExecutionRequest)
-
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:
ForkJoinPoolHierarchicalTestExecutorService
,SameThreadHierarchicalTestExecutorService
-
createExecutionContext
protected abstract C createExecutionContext(ExecutionRequest request)
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
-
-