Interface Node<C extends EngineExecutionContext>
-
- Type Parameters:
C- the type ofEngineExecutionContextused by theHierarchicalTestEngine
- All Known Implementing Classes:
ClassTestDescriptor,JupiterEngineDescriptor,JupiterTestDescriptor,NestedClassTestDescriptor,TestFactoryTestDescriptor,TestMethodTestDescriptor,TestTemplateInvocationTestDescriptor,TestTemplateTestDescriptor
@API(status=MAINTAINED, since="1.0", consumers="org.junit.platform.engine.support.hierarchical") public interface Node<C extends EngineExecutionContext>
A node within the execution hierarchy.- Since:
- 1.0
- See Also:
HierarchicalTestEngine
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceNode.DynamicTestExecutorExecutor for additional, dynamic test descriptors discovered during execution of aNode.static classNode.ExecutionModeSupported execution modes for parallel execution.static classNode.SkipResultThe result of determining whether the execution of a givencontextshould be skipped.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidafter(C context)Execute the after behavior of this node.default Cbefore(C context)Execute the before behavior of this node.default voidcleanUp(C context)Cleanup the suppliedcontextafter execution.default Cexecute(C context, Node.DynamicTestExecutor dynamicTestExecutor)Execute the behavior of this node.default Set<ExclusiveResource>getExclusiveResources()Get the set of resources required to execute this node.default Node.ExecutionModegetExecutionMode()Get the preferred of execution mode for parallel execution of this node.default Cprepare(C context)Prepare the suppliedcontextprior to execution.default Node.SkipResultshouldBeSkipped(C context)Determine if the execution of the suppliedcontextshould be skipped.
-
-
-
Method Detail
-
prepare
default C prepare(C context) throws Exception
Prepare the suppliedcontextprior to execution.The default implementation returns the supplied
contextunmodified.- Throws:
Exception- See Also:
cleanUp(EngineExecutionContext)
-
cleanUp
default void cleanUp(C context) throws Exception
Cleanup the suppliedcontextafter execution.The default implementation does nothing.
- Throws:
Exception- Since:
- 1.1
- See Also:
prepare(EngineExecutionContext)
-
shouldBeSkipped
default Node.SkipResult shouldBeSkipped(C context) throws Exception
Determine if the execution of the suppliedcontextshould be skipped.The default implementation returns
Node.SkipResult.doNotSkip().- Throws:
Exception
-
before
default C before(C context) throws Exception
Execute the before behavior of this node.This method will be called once before execution of this node.
- Parameters:
context- the context to execute in- Returns:
- the new context to be used for children of this node
- Throws:
Exception- See Also:
execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor),after(C)
-
execute
default C execute(C context, Node.DynamicTestExecutor dynamicTestExecutor) throws Exception
Execute the behavior of this node.Containers typically do not implement this method since the
HierarchicalTestEnginehandles execution of their children.The supplied
dynamicTestExecutormay be used to submit additional dynamic tests for immediate execution.
-
after
default void after(C context) throws Exception
Execute the after behavior of this node.This method will be called once after execution of this node.
- Parameters:
context- the context to execute in- Throws:
Exception- See Also:
before(C),execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)
-
getExclusiveResources
@API(status=EXPERIMENTAL, since="1.3", consumers="org.junit.platform.engine.support.hierarchical") default Set<ExclusiveResource> getExclusiveResources()
Get the set of resources required to execute this node.- Returns:
- the set of resources required by this node; never
nullbut potentially empty - Since:
- 1.3
- See Also:
ExclusiveResource
-
getExecutionMode
@API(status=EXPERIMENTAL, since="1.3", consumers="org.junit.platform.engine.support.hierarchical") default Node.ExecutionMode getExecutionMode()
Get the preferred of execution mode for parallel execution of this node.- Returns:
- the preferred execution mode of this node; never
null - Since:
- 1.3
- See Also:
Node.ExecutionMode
-
-