Package org.junit.runner
Class Result.Listener
- java.lang.Object
-
- org.junit.runner.notification.RunListener
-
- org.junit.runner.Result.Listener
-
- Enclosing class:
- Result
@ThreadSafe private class Result.Listener extends RunListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
RunListener.ThreadSafe
-
-
Constructor Summary
Constructors Modifier Constructor Description privateListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestAssumptionFailure(Failure failure)Called when an atomic test flags that it assumes a condition that is falsevoidtestFailure(Failure failure)Called when an atomic test fails, or when a listener throws an exception.voidtestFinished(Description description)Called when an atomic test has finished, whether the test succeeds or fails.voidtestIgnored(Description description)Called when a test will not be run, generally because a test method is annotated withIgnore.voidtestRunFinished(Result result)Called when all tests have finished.voidtestRunStarted(Description description)Called before any tests have been run.-
Methods inherited from class org.junit.runner.notification.RunListener
testStarted, testSuiteFinished, testSuiteStarted
-
-
-
-
Method Detail
-
testRunStarted
public void testRunStarted(Description description) throws java.lang.Exception
Description copied from class:RunListenerCalled before any tests have been run. This may be called on an arbitrary thread.- Overrides:
testRunStartedin classRunListener- Parameters:
description- describes the tests to be run- Throws:
java.lang.Exception
-
testRunFinished
public void testRunFinished(Result result) throws java.lang.Exception
Description copied from class:RunListenerCalled when all tests have finished. This may be called on an arbitrary thread.- Overrides:
testRunFinishedin classRunListener- Parameters:
result- the summary of the test run, including all the tests that failed- Throws:
java.lang.Exception
-
testFinished
public void testFinished(Description description) throws java.lang.Exception
Description copied from class:RunListenerCalled when an atomic test has finished, whether the test succeeds or fails.- Overrides:
testFinishedin classRunListener- Parameters:
description- the description of the test that just ran- Throws:
java.lang.Exception
-
testFailure
public void testFailure(Failure failure) throws java.lang.Exception
Description copied from class:RunListenerCalled 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
Descriptionpassed toRunListener.testStarted(Description), from the same thread that calledRunListener.testStarted(Description).In the case of a listener throwing an exception, this will be called with a
DescriptionofDescription.TEST_MECHANISM, and may be called on an arbitrary thread.- Overrides:
testFailurein classRunListener- Parameters:
failure- describes the test that failed and the exception that was thrown- Throws:
java.lang.Exception
-
testIgnored
public void testIgnored(Description description) throws java.lang.Exception
Description copied from class:RunListenerCalled when a test will not be run, generally because a test method is annotated withIgnore.- Overrides:
testIgnoredin classRunListener- Parameters:
description- describes the test that will not be run- Throws:
java.lang.Exception
-
testAssumptionFailure
public void testAssumptionFailure(Failure failure)
Description copied from class:RunListenerCalled when an atomic test flags that it assumes a condition that is false- Overrides:
testAssumptionFailurein classRunListener- Parameters:
failure- describes the test that failed and theAssumptionViolatedExceptionthat was thrown
-
-