Interface Node<C extends EngineExecutionContext>
-
- Type Parameters:
C
- the type ofEngineExecutionContext
used by theHierarchicalTestEngine
- All Known Implementing Classes:
ClassTestDescriptor
,JupiterEngineDescriptor
,JupiterTestDescriptor
,NestedClassTestDescriptor
,TestFactoryTestDescriptor
,TestMethodTestDescriptor
,TestTemplateInvocationTestDescriptor
,TestTemplateTestDescriptor
@API(status=MAINTAINED, since="1.0") 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 interface
Node.DynamicTestExecutor
Executor for additional, dynamic test descriptors discovered during execution of aNode
.static class
Node.SkipResult
The result of determining whether the execution of a givencontext
should be skipped.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
after(C context)
Execute the after behavior of this node.default C
before(C context)
Execute the before behavior of this node.default void
cleanUp(C context)
Cleanup the suppliedcontext
after execution.default C
execute(C context, Node.DynamicTestExecutor dynamicTestExecutor)
Execute the behavior of this node.default C
prepare(C context)
Prepare the suppliedcontext
prior to execution.default Node.SkipResult
shouldBeSkipped(C context)
Determine if the execution of the suppliedcontext
should be skipped.
-
-
-
Method Detail
-
prepare
default C prepare(C context) throws java.lang.Exception
Prepare the suppliedcontext
prior to execution.The default implementation returns the supplied
context
unmodified.- Throws:
java.lang.Exception
- See Also:
cleanUp(EngineExecutionContext)
-
cleanUp
default void cleanUp(C context) throws java.lang.Exception
Cleanup the suppliedcontext
after execution.The default implementation does nothing.
- Throws:
java.lang.Exception
- Since:
- 1.1
- See Also:
prepare(EngineExecutionContext)
-
shouldBeSkipped
default Node.SkipResult shouldBeSkipped(C context) throws java.lang.Exception
Determine if the execution of the suppliedcontext
should be skipped.The default implementation returns
Node.SkipResult.doNotSkip()
.- Throws:
java.lang.Exception
-
before
default C before(C context) throws java.lang.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:
java.lang.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 java.lang.Exception
Execute the behavior of this node.Containers typically do not implement this method since the
HierarchicalTestEngine
handles execution of their children.The supplied
dynamicTestExecutor
may be used to submit additional dynamic tests for immediate execution.
-
after
default void after(C context) throws java.lang.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:
java.lang.Exception
- See Also:
before(C)
,execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)
-
-