Class TestResult

java.lang.Object
org.testframe.engine.TestResult

public class TestResult extends Object
Holds the results of a test. Includes a Throwable if it was provided to hold the stack trace.
Since:
1.0
Author:
Alonso del Arte
  • Constructor Details

    • TestResult

      public TestResult(Method procedure, TestResultStatus status, Throwable information)
      Constructor.
      Parameters:
      procedure - The test procedure the test result is for. Such as, for example, testNoDivisionByZero().
      status - The test result status, one of TestResultStatus.PASSED, TestResultStatus.FAILED, TestResultStatus.ERROR or TestResultStatus.SKIPPED.
      information - An error or exception object presumably holding a stack trace pertinent to the test, or null if not applicable (such as ought to be the case for a passing or skipped test). For example, an ArithmeticException object with a stack trace that includes a line in testNoDivisionByZero().
  • Method Details

    • getProcedure

      public Method getProcedure()
      Gets the test procedure the result is for.
      Returns:
      The test procedure the result is for. Such as, for example, testNoDivisionByZero().
    • getStatus

      public TestResultStatus getStatus()
      Gets the test result status.
      Returns:
      The test result status, one of TestResultStatus.PASSED, TestResultStatus.FAILED, TestResultStatus.ERROR or TestResultStatus.SKIPPED.
    • hasStackTrace

      public boolean hasStackTrace()
      Tells whether the result has a stack trace or not.
      Returns:
      True if a Throwable object presumably holding a stack trace was provided to the constructor, false otherwise.
    • getInformation

      public Throwable getInformation()
      Retrieves the Throwable that was provided to the constructor.
      Returns:
      A Throwable object that presumably holds a stack trace.