Class IgnoredTestResult

java.lang.Object
junit.framework.TestResult
org.apache.tools.ant.taskdefs.optional.junit.IgnoredTestResult

public class IgnoredTestResult
extends junit.framework.TestResult
Records ignored and skipped tests reported as part of the execution of JUnit 4 tests.
  • Field Summary

    Fields inherited from class junit.framework.TestResult

    fErrors, fFailures, fListeners, fRunTests
  • Constructor Summary

    Constructors 
    Constructor Description
    IgnoredTestResult()  
  • Method Summary

    Modifier and Type Method Description
    void addListener​(junit.framework.TestListener listener)  
    long ignoredCount()
    Report how many tests were ignored.
    void removeListener​(junit.framework.TestListener listener)  
    long skippedCount()
    Report how many tests has assumption failures.
    void testAssumptionFailure​(junit.framework.Test test, java.lang.Throwable cause)
    Records a test as having an assumption failure so JUnit will no longer be executing it.
    void testIgnored​(junit.framework.Test test)
    Record a test as having been ignored, normally by the @Ignore annotation.

    Methods inherited from class junit.framework.TestResult

    addError, addFailure, endTest, errorCount, errors, failureCount, failures, run, runCount, runProtected, shouldStop, startTest, stop, wasSuccessful

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addListener

      public void addListener​(junit.framework.TestListener listener)
      Overrides:
      addListener in class junit.framework.TestResult
    • removeListener

      public void removeListener​(junit.framework.TestListener listener)
      Overrides:
      removeListener in class junit.framework.TestResult
    • testIgnored

      public void testIgnored​(junit.framework.Test test) throws java.lang.Exception
      Record a test as having been ignored, normally by the @Ignore annotation.
      Parameters:
      test - the test that was ignored.
      Throws:
      java.lang.Exception - is the listener thrown an exception on handling the notification.
    • ignoredCount

      public long ignoredCount()
      Report how many tests were ignored.
      Returns:
      the number of tests reported as ignored during the current execution.
    • testAssumptionFailure

      public void testAssumptionFailure​(junit.framework.Test test, java.lang.Throwable cause)
      Records a test as having an assumption failure so JUnit will no longer be executing it. Under normal circumstances this would be counted as a skipped test.
      Parameters:
      test - the test to record
      cause - the details of the test and assumption failure.
    • skippedCount

      public long skippedCount()
      Report how many tests has assumption failures.
      Returns:
      the number of tests that reported assumption failures during the current execution.