org.apache.tools.ant.taskdefs.optional.junit
Class TestListenerWrapper

java.lang.Object
  extended by org.apache.tools.ant.taskdefs.optional.junit.TestListenerWrapper
All Implemented Interfaces:
IgnoredTestListener

public class TestListenerWrapper
extends java.lang.Object
implements IgnoredTestListener


Constructor Summary
TestListenerWrapper(TestListener listener)
           
 
Method Summary
 void addError(Test test, java.lang.Throwable throwable)
           
 void addFailure(Test test, AssertionFailedError assertionFailedError)
           
 void endTest(Test test)
           
 void startTest(Test test)
           
 void testAssumptionFailure(Test test, java.lang.Throwable throwable)
          Receive a report that a test has failed an assumption.
 void testIgnored(Test test)
          Reports when a test has been marked with the @Ignore annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestListenerWrapper

public TestListenerWrapper(TestListener listener)
Method Detail

addError

public void addError(Test test,
                     java.lang.Throwable throwable)

addFailure

public void addFailure(Test test,
                       AssertionFailedError assertionFailedError)

endTest

public void endTest(Test test)

startTest

public void startTest(Test test)

testIgnored

public void testIgnored(Test test)
Description copied from interface: IgnoredTestListener
Reports when a test has been marked with the @Ignore annotation. The parameter should normally be typed to JUnit's junit.framework.JUnit4TestCaseFacade so implementing classes should be able to get the details of the ignore by casting the argument and retrieving the descriptor from the test.

Specified by:
testIgnored in interface IgnoredTestListener
Parameters:
test - the details of the test and failure that have triggered this report.

testAssumptionFailure

public void testAssumptionFailure(Test test,
                                  java.lang.Throwable throwable)
Description copied from interface: IgnoredTestListener
Receive a report that a test has failed an assumption. Within JUnit4 this is normally treated as a test being skipped, although how any listener handles this is up to that specific listener.
Note: Tests that throw assumption failures will still report the endTest method, which may differ from how the addError and addFailure methods work, it's up for any implementing classes to handle this.

Specified by:
testAssumptionFailure in interface IgnoredTestListener
Parameters:
test - the details of the test and failure that have triggered this report.
throwable - the AssumptionViolatedException thrown from the current assumption failure.