C - the type of EngineExecutionContext used by the
HierarchicalTestEngine@API(status=MAINTAINED,
since="1.0",
consumers="org.junit.platform.engine.support.hierarchical")
public interface Node<C extends EngineExecutionContext>
HierarchicalTestEngine| Modifier and Type | Interface and Description |
|---|---|
static interface |
Node.DynamicTestExecutor
Executor for additional, dynamic test descriptors discovered during
execution of a
Node. |
static class |
Node.ExecutionMode
Supported execution modes for parallel execution.
|
static interface |
Node.Invocation<C extends EngineExecutionContext>
Represents an invocation that runs with the supplied context.
|
static class |
Node.SkipResult
The result of determining whether the execution of a given
context
should be skipped. |
| Modifier and Type | Method and Description |
|---|---|
default void |
after(C context)
Execute the after behavior of this node.
|
default void |
around(C context,
Node.Invocation<C> invocation)
Wraps around the invocation of
before(EngineExecutionContext),
execute(EngineExecutionContext, DynamicTestExecutor), and
after(EngineExecutionContext). |
default C |
before(C context)
Execute the before behavior of this node.
|
default void |
cleanUp(C context)
Clean up the supplied
context after execution. |
default C |
execute(C context,
Node.DynamicTestExecutor dynamicTestExecutor)
Execute the behavior of this node.
|
default java.util.Set<ExclusiveResource> |
getExclusiveResources()
Get the set of exclusive resources
required to execute this node.
|
default Node.ExecutionMode |
getExecutionMode()
Get the preferred of execution mode for
parallel execution of this node.
|
default void |
nodeFinished(C context,
TestDescriptor testDescriptor,
TestExecutionResult result)
Callback invoked when the execution of this node has finished.
|
default void |
nodeSkipped(C context,
TestDescriptor testDescriptor,
Node.SkipResult result)
Callback invoked when the execution of this node has been skipped.
|
default C |
prepare(C context)
Prepare the supplied
context prior to execution. |
default Node.SkipResult |
shouldBeSkipped(C context)
Determine if the execution of the supplied
context should be
skipped. |
default C prepare(C context) throws java.lang.Exception
context prior to execution.
The default implementation returns the supplied context unmodified.
java.lang.ExceptioncleanUp(EngineExecutionContext)default void cleanUp(C context) throws java.lang.Exception
context after execution.
The default implementation does nothing.
context - the context to execute injava.lang.Exceptionprepare(EngineExecutionContext)default Node.SkipResult shouldBeSkipped(C context) throws java.lang.Exception
context should be
skipped.
The default implementation returns Node.SkipResult.doNotSkip().
java.lang.Exceptiondefault C before(C context) throws java.lang.Exception
This method will be called once before execution of this node.
The default implementation returns the supplied context unmodified.
context - the context to execute innulljava.lang.Exceptionexecute(EngineExecutionContext, DynamicTestExecutor),
after(EngineExecutionContext)default C execute(C context, Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.Exception
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.
The default implementation returns the supplied context unmodified.
default void after(C context) throws java.lang.Exception
This method will be called once after execution of this node.
The default implementation does nothing.
context - the context to execute injava.lang.Exceptionbefore(C),
execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)@API(status=EXPERIMENTAL,
since="1.4")
default void around(C context,
Node.Invocation<C> invocation)
throws java.lang.Exception
before(EngineExecutionContext),
execute(EngineExecutionContext, DynamicTestExecutor), and
after(EngineExecutionContext).context - context the context to execute ininvocation - the wrapped invocation (must be invoked exactly once)java.lang.Exception@API(status=EXPERIMENTAL,
since="1.4",
consumers="org.junit.platform.engine.support.hierarchical")
default void nodeSkipped(C context,
TestDescriptor testDescriptor,
Node.SkipResult result)
The default implementation does nothing.
context - the execution contexttestDescriptor - the test descriptor that was skippedresult - the result of skipped execution@API(status=EXPERIMENTAL,
since="1.4",
consumers="org.junit.platform.engine.support.hierarchical")
default void nodeFinished(C context,
TestDescriptor testDescriptor,
TestExecutionResult result)
The default implementation does nothing.
context - the execution contexttestDescriptor - the test descriptor that was executedresult - the result of the execution@API(status=EXPERIMENTAL,
since="1.3",
consumers="org.junit.platform.engine.support.hierarchical")
default java.util.Set<ExclusiveResource> getExclusiveResources()
The default implementation returns an empty set.
null but potentially emptyExclusiveResource@API(status=EXPERIMENTAL,
since="1.3",
consumers="org.junit.platform.engine.support.hierarchical")
default Node.ExecutionMode getExecutionMode()
The default implementation returns Node.ExecutionMode.CONCURRENT.
nullNode.ExecutionMode