EngineExecutionContext
used by the
HierarchicalTestEngine
HierarchicalTestEngine
Modifier and Type | Class and Description |
---|---|
public static interface | Node.
Executor for additional, dynamic test descriptors discovered during
execution of a |
public static enum | Node.
Supported execution modes for parallel execution. |
public static interface | Node.
the type of C extends EngineExecutionContext>EngineExecutionContext used by the HierarchicalTestEngine Represents an invocation that runs with the supplied context. |
public static class | Node.
The result of determining whether the execution of a given |
Modifier and Type | Method and Description |
---|---|
public default void | |
public default void | around(C
context the context to execute in context, Node.the wrapped invocation (must be invoked exactly once) invocationWraps around the invocation of |
public default C | Returns: the new context to be used for children of this node; nevernull the context to execute in context)Execute the before behavior of this node. |
public default void | |
public default C | Returns: the new context to be used for children of this node and for the after behavior of the parent of this node, if anythe context to execute in context, Node.the executor to submit dynamic tests to dynamicTestExecutorExecute the behavior of this node. |
public default Set | Returns: the set of exclusive resources required by this node; nevernull but potentially emptyGet the set of exclusive resources required to execute this node. |
public default Node. | Returns: the preferred execution mode of this node; nevernull Get the preferred of execution mode for parallel execution of this node. |
public default void | nodeFinished(C
the execution context context, TestDescriptor the test descriptor that was executed testDescriptor, TestExecutionResult the result of the execution result)Callback invoked when the execution of this node has finished. |
public default void | nodeSkipped(C
the execution context context, TestDescriptor the test descriptor that was skipped testDescriptor, Node.the result of skipped execution resultCallback invoked when the execution of this node has been skipped. |
public default C | |
public default Node. |
after | back to summary |
---|---|
public 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. The default implementation does nothing. |
around | back to summary |
---|---|
public default void around(C context, Node. Wraps around the invocation of
|
before | back to summary |
---|---|
public 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. The default implementation returns the supplied
|
cleanUp | back to summary |
---|---|
public default void cleanUp(C context) throws Exception Clean up the supplied The default implementation does nothing.
|
execute | back to summary |
---|---|
public default C execute(C context, Node. Execute the behavior of this node. Containers typically do not implement this method since the
The supplied The default implementation returns the supplied
|
getExclusiveResources | back to summary |
---|---|
public default Set Get the set of exclusive resources required to execute this node. The default implementation returns an empty set.
|
getExecutionMode | back to summary |
---|---|
public default Node. Get the preferred of execution mode for parallel execution of this node. The default implementation returns
|
nodeFinished | back to summary |
---|---|
public default void nodeFinished(C context, TestDescriptor testDescriptor, TestExecutionResult result) Callback invoked when the execution of this node has finished. The default implementation does nothing.
|
nodeSkipped | back to summary |
---|---|
public default void nodeSkipped(C context, TestDescriptor testDescriptor, Node. Callback invoked when the execution of this node has been skipped. The default implementation does nothing.
|
prepare | back to summary |
---|---|
public default C prepare(C context) throws Exception Prepare the supplied The default implementation returns the supplied
|
shouldBeSkipped | back to summary |
---|---|
public default Node. Determine if the execution of the supplied The default implementation returns |
Node
.
The test descriptors will be executed by the same
HierarchicalTestExecutor
that executes the submitting node.
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
public void | |
public void | execute(TestDescriptor
the test descriptor to be executed; never
testDescriptor)null Submit a dynamic test descriptor for immediate execution. |
public Future | Returns: a future to cancel or wait for the executionthe test descriptor to be executed; never
testDescriptor, EngineExecutionListener null the executionListener to be notified; never
executionListener)null Submit a dynamic test descriptor for immediate execution with a custom, potentially no-op, execution listener. |
awaitFinished | back to summary |
---|---|
public void awaitFinished() throws InterruptedException Block until all dynamic test descriptors submitted to this executor are finished. This method is useful if the node needs to perform actions in its
|
execute | back to summary |
---|---|
public void execute(TestDescriptor testDescriptor) Submit a dynamic test descriptor for immediate execution.
|
execute | back to summary |
---|---|
public Future Submit a dynamic test descriptor for immediate execution with a custom, potentially no-op, execution listener.
|
SAME_THREAD
, CONCURRENT
, Node#getExecutionMode()
Modifier and Type | Field and Description |
---|---|
public static final Node. | CONCURRENT
Allow concurrent execution with any other node. |
public static final Node. | SAME_THREAD
Force execution in same thread as the parent node. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static Node. | |
public static Node. |
CONCURRENT | back to summary |
---|---|
public static final Node. Allow concurrent execution with any other node.
|
SAME_THREAD | back to summary |
---|---|
public static final Node. Force execution in same thread as the parent node.
|
ExecutionMode | back to summary |
---|---|
private ExecutionMode() |
valueOf | back to summary |
---|---|
public static Node. |
values | back to summary |
---|---|
public static Node. |
EngineExecutionContext
used by the HierarchicalTestEngine
Modifier and Type | Method and Description |
---|---|
public void |
invoke | back to summary |
---|---|
public void invoke(C context) throws Exception Invoke this invocation with the supplied context.
|
context
should be skipped.
Modifier and Type | Field and Description |
---|---|
private static final Node. | |
private final Optional | |
private final boolean |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static Node. | |
public Optional | |
public boolean | Returns: true if the execution should be skippedWhether execution of the context should be skipped. |
public static Node. | |
public String |
alwaysExecuteSkipResult | back to summary |
---|---|
private static final Node. |
reason | back to summary |
---|---|
private final Optional<String> reason |
skipped | back to summary |
---|---|
private final boolean skipped |
SkipResult | back to summary |
---|---|
private SkipResult(boolean skipped, String reason) |
doNotSkip | back to summary |
---|---|
public static Node. Factory for creating do not skip results. A context that is not skipped will be executed as normal.
|
getReason | back to summary |
---|---|
public Optional Get the reason that execution of the context should be skipped, if available. |
isSkipped | back to summary |
---|---|
public boolean isSkipped() Whether execution of the context should be skipped.
|
skip | back to summary |
---|---|
public static Node. Factory for creating skipped results. A context that is skipped will be not be executed.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object. |