Interface TestReport

All Known Subinterfaces:
TestSuiteReport
All Known Implementing Classes:
DefaultTestReport, DefaultTestSuiteReport

public interface TestReport
Defines the interface of a TestReport produced by a Test case.
Version:
$Id: TestReport.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Details

    • ERROR_INTERNAL_TEST_FAILURE

      static final String ERROR_INTERNAL_TEST_FAILURE
      Error code to be used when a Test fails in its own operation (i.e., the Test itself fails, not what it is testing. An internal failure is reported when any type of exception occurs while running the test.
      See Also:
    • ERROR_TEST_FAILED

      static final String ERROR_TEST_FAILED
      Very generic error code which can be used to report that the test failed.
      See Also:
    • ERROR_ASSERTION_FAILED

      static final String ERROR_ASSERTION_FAILED
      Generic error code to report test assertion failures.
      See Also:
    • ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_CLASS

      static final String ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_CLASS
      Entry describing the class of the internal exception that caused the test's internal failure
      See Also:
    • ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_MESSAGE

      static final String ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_MESSAGE
      Entry describing the messages of the internal exception that caused the test's internal failure
      See Also:
    • ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_STACK_TRACE

      static final String ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_STACK_TRACE
      Entry with the stack trace for the internal exception that caused the test's internal failure
      See Also:
    • ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_CLASS

      static final String ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_CLASS
      Entry with the class of the exception that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_CLASS, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which the Test author probably created a specific error code.
      See Also:
    • ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_MESSAGE

      static final String ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_MESSAGE
      Entry with the message of the exception that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_MESSAGE, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which the Test author probably created a specific error code.
      See Also:
    • ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_STACK_TRACE

      static final String ENTRY_KEY_REPORTED_TEST_FAILURE_EXCEPTION_STACK_TRACE
      Entry with the stack trace that caused the test to fail. Note that this is different from ENTRY_KEY_INTERNAL_TEST_FAILURE_EXCEPTION_STACK_TRACE, in which case, the test itself failed unexpectedly. In this case, the entry is used to describe an expected exception for which the Test author probably created a specific error code.
      See Also:
    • ENTRY_KEY_ERROR_CONDITION_STACK_TRACE

      static final String ENTRY_KEY_ERROR_CONDITION_STACK_TRACE
      Entry with the stack trace for a specific test error condition.
      See Also:
  • Method Details

    • hasPassed

      boolean hasPassed()
      Returns the overall test result
    • getErrorCode

      String getErrorCode()
      Returns the error code. This should never be null if the test failed (i.e., if hasPassed returns false).
    • getDescription

      TestReport.Entry[] getDescription()
      Returns an array of Entry objects describing the test result. Accepted value types are String objects, URL objects, File objects and TestReport objects. File objects should be considered as temporary files
    • addDescriptionEntry

      void addDescriptionEntry(String key, Object value)
      Appends entry to the array of description entry.
    • getTest

      Test getTest()
      Returns the Test object that generated this TestReport
    • getParentReport

      TestSuiteReport getParentReport()
      Returns the parent report in case this TestReport is part of a TestSuiteReport. This may be null.
    • setParentReport

      void setParentReport(TestSuiteReport parent)
      Set this report's parent.