Class TestListenerWrapper
java.lang.Object
org.apache.tools.ant.taskdefs.optional.junit.TestListenerWrapper
- All Implemented Interfaces:
junit.framework.TestListener
,IgnoredTestListener
public class TestListenerWrapper
extends Object
implements junit.framework.TestListener, IgnoredTestListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFailure
(junit.framework.Test test, junit.framework.AssertionFailedError assertionFailedError) void
endTest
(junit.framework.Test test) void
startTest
(junit.framework.Test test) void
testAssumptionFailure
(junit.framework.Test test, Throwable throwable) Receive a report that a test has failed an assumption.void
testIgnored
(junit.framework.Test test) Reports when a test has been marked with the @Ignore annotation.
-
Constructor Details
-
TestListenerWrapper
public TestListenerWrapper(junit.framework.TestListener listener)
-
-
Method Details
-
addError
- Specified by:
addError
in interfacejunit.framework.TestListener
-
addFailure
public void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError assertionFailedError) - Specified by:
addFailure
in interfacejunit.framework.TestListener
-
endTest
public void endTest(junit.framework.Test test) - Specified by:
endTest
in interfacejunit.framework.TestListener
-
startTest
public void startTest(junit.framework.Test test) - Specified by:
startTest
in interfacejunit.framework.TestListener
-
testIgnored
public void testIgnored(junit.framework.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'sJUnit4TestCaseFacade
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 interfaceIgnoredTestListener
- Parameters:
test
- the details of the test and failure that have triggered this report.
-
testAssumptionFailure
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 interfaceIgnoredTestListener
- Parameters:
test
- the details of the test and failure that have triggered this report.throwable
- the AssumptionViolatedException thrown from the current assumption failure.
-