Class TestExecutionResult



  • @API(status=STABLE,
         since="1.0")
    public class TestExecutionResult
    extends java.lang.Object
    Result of executing a single test or container.

    A TestExecutionResult consists of a mandatory TestExecutionResult.Status and an optional Throwable.

    Since:
    1.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TestExecutionResult.Status
      Status of executing a single test or container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TestExecutionResult aborted​(java.lang.Throwable throwable)
      Obtain a TestExecutionResult for an aborted execution of a test or container with the supplied throwable.
      static TestExecutionResult failed​(java.lang.Throwable throwable)
      Obtain a TestExecutionResult for a failed execution of a test or container with the supplied throwable.
      TestExecutionResult.Status getStatus​()
      Get the status of this result.
      java.util.Optional<java.lang.Throwable> getThrowable​()
      Get the throwable that caused this result, if available.
      static TestExecutionResult successful​()
      Obtain a TestExecutionResult for a successful execution of a test or container.
      java.lang.String toString​()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • successful

        public static TestExecutionResult successful​()
        Obtain a TestExecutionResult for a successful execution of a test or container.
      • aborted

        public static TestExecutionResult aborted​(java.lang.Throwable throwable)
        Obtain a TestExecutionResult for an aborted execution of a test or container with the supplied throwable.
        Parameters:
        throwable - the throwable that caused the aborted execution; may be null
      • failed

        public static TestExecutionResult failed​(java.lang.Throwable throwable)
        Obtain a TestExecutionResult for a failed execution of a test or container with the supplied throwable.
        Parameters:
        throwable - the throwable that caused the failed execution; may be null
      • getThrowable

        public java.util.Optional<java.lang.Throwable> getThrowable​()
        Get the throwable that caused this result, if available.
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object