Class Result.Listener

Enclosing class:
Result

@ThreadSafe private class Result.Listener extends RunListener
  • Constructor Details

    • Listener

      private Listener()
  • Method Details

    • testRunStarted

      public void testRunStarted(Description description) throws Exception
      Description copied from class: RunListener
      Called before any tests have been run. This may be called on an arbitrary thread.
      Overrides:
      testRunStarted in class RunListener
      Parameters:
      description - describes the tests to be run
      Throws:
      Exception
    • testRunFinished

      public void testRunFinished(Result result) throws Exception
      Description copied from class: RunListener
      Called when all tests have finished. This may be called on an arbitrary thread.
      Overrides:
      testRunFinished in class RunListener
      Parameters:
      result - the summary of the test run, including all the tests that failed
      Throws:
      Exception
    • testFinished

      public void testFinished(Description description) throws Exception
      Description copied from class: RunListener
      Called when an atomic test has finished, whether the test succeeds or fails.
      Overrides:
      testFinished in class RunListener
      Parameters:
      description - the description of the test that just ran
      Throws:
      Exception
    • testFailure

      public void testFailure(Failure failure) throws Exception
      Description copied from class: RunListener
      Called when an atomic test fails, or when a listener throws an exception.

      In the case of a failure of an atomic test, this method will be called with the same Description passed to RunListener.testStarted(Description), from the same thread that called RunListener.testStarted(Description).

      In the case of a listener throwing an exception, this will be called with a Description of Description.TEST_MECHANISM, and may be called on an arbitrary thread.

      Overrides:
      testFailure in class RunListener
      Parameters:
      failure - describes the test that failed and the exception that was thrown
      Throws:
      Exception
    • testIgnored

      public void testIgnored(Description description) throws Exception
      Description copied from class: RunListener
      Called when a test will not be run, generally because a test method is annotated with Ignore.
      Overrides:
      testIgnored in class RunListener
      Parameters:
      description - describes the test that will not be run
      Throws:
      Exception
    • testAssumptionFailure

      public void testAssumptionFailure(Failure failure)
      Description copied from class: RunListener
      Called when an atomic test flags that it assumes a condition that is false
      Overrides:
      testAssumptionFailure in class RunListener
      Parameters:
      failure - describes the test that failed and the AssumptionViolatedException that was thrown