Interface Node<C extends EngineExecutionContext>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  Node.DynamicTestExecutor
      Executor for additional, dynamic test descriptors discovered during execution of a Node.
      static class  Node.SkipResult
      The result of determining whether the execution of a given context 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 supplied context after execution.
      default C execute​(C context, Node.DynamicTestExecutor dynamicTestExecutor)
      Execute the behavior of this node.
      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.
    • Method Detail

      • prepare

        default C prepare​(C context)
                   throws java.lang.Exception
        Prepare the supplied context 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 supplied context 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 supplied context should be skipped.

        The default implementation returns Node.SkipResult.doNotSkip().

        Throws:
        java.lang.Exception
      • 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.

        Parameters:
        context - the context to execute in
        dynamicTestExecutor - the executor to submit dynamic tests to
        Returns:
        the new context to be used for children of this node and for the after behavior of the parent of this node, if any
        Throws:
        java.lang.Exception
        See Also:
        before(C), after(C)