Class OrderedRunNotifier
java.lang.Object
org.junit.runner.notification.RunNotifier
com.carrotsearch.ant.tasks.junit4.slave.OrderedRunNotifier
public class OrderedRunNotifier
extends org.junit.runner.notification.RunNotifier
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Notify listeners in the requested order -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinkedList
<org.junit.runner.notification.RunListener> A linked list is more convenient for descending iterators.private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFirstListener
(org.junit.runner.notification.RunListener listener) Adds a listener at the head of the listener list.void
addListener
(org.junit.runner.notification.RunListener listener) Add a listener at the end of the listener list.void
fireTestAssumptionFailed
(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test flagged that it assumed something false.void
fireTestFailure
(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test failed.void
fireTestFinished
(org.junit.runner.Description description) Invoke to tell listeners that an atomic test finished.void
fireTestIgnored
(org.junit.runner.Description description) Invoke to tell listeners that an atomic test was ignored.void
fireTestRunFinished
(org.junit.runner.Result result) Do not invoke.void
fireTestRunStarted
(org.junit.runner.Description description) Do not invoke.void
fireTestStarted
(org.junit.runner.Description description) Invoke to tell listeners that an atomic test is about to start.void
Ask that the tests run stop before starting the next test.void
removeListener
(org.junit.runner.notification.RunListener listener) Remove a listener from the listener list.Methods inherited from class org.junit.runner.notification.RunNotifier
fireTestSuiteFinished, fireTestSuiteStarted
-
Field Details
-
listeners
A linked list is more convenient for descending iterators. -
stopRequested
private volatile boolean stopRequested
-
-
Constructor Details
-
OrderedRunNotifier
public OrderedRunNotifier()
-
-
Method Details
-
addListener
public void addListener(org.junit.runner.notification.RunListener listener) Add a listener at the end of the listener list.- Overrides:
addListener
in classorg.junit.runner.notification.RunNotifier
-
addFirstListener
public void addFirstListener(org.junit.runner.notification.RunListener listener) Adds a listener at the head of the listener list.- Overrides:
addFirstListener
in classorg.junit.runner.notification.RunNotifier
-
removeListener
public void removeListener(org.junit.runner.notification.RunListener listener) Remove a listener from the listener list.- Overrides:
removeListener
in classorg.junit.runner.notification.RunNotifier
-
fireTestRunStarted
public void fireTestRunStarted(org.junit.runner.Description description) Do not invoke.- Overrides:
fireTestRunStarted
in classorg.junit.runner.notification.RunNotifier
-
fireTestRunFinished
public void fireTestRunFinished(org.junit.runner.Result result) Do not invoke.- Overrides:
fireTestRunFinished
in classorg.junit.runner.notification.RunNotifier
-
fireTestStarted
public void fireTestStarted(org.junit.runner.Description description) throws org.junit.runner.notification.StoppedByUserException Invoke to tell listeners that an atomic test is about to start.- Overrides:
fireTestStarted
in classorg.junit.runner.notification.RunNotifier
- Parameters:
description
- the description of the atomic test (generally a class and method name)- Throws:
org.junit.runner.notification.StoppedByUserException
- thrown if a user has requested that the test run stop
-
fireTestFailure
public void fireTestFailure(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test failed.- Overrides:
fireTestFailure
in classorg.junit.runner.notification.RunNotifier
- Parameters:
failure
- the description of the test that failed and the exception thrown
-
fireTestAssumptionFailed
public void fireTestAssumptionFailed(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test flagged that it assumed something false.- Overrides:
fireTestAssumptionFailed
in classorg.junit.runner.notification.RunNotifier
- Parameters:
failure
- the description of the test that failed and theAssumptionViolatedException
thrown
-
fireTestIgnored
public void fireTestIgnored(org.junit.runner.Description description) Invoke to tell listeners that an atomic test was ignored.- Overrides:
fireTestIgnored
in classorg.junit.runner.notification.RunNotifier
- Parameters:
description
- the description of the ignored test
-
fireTestFinished
public void fireTestFinished(org.junit.runner.Description description) Invoke to tell listeners that an atomic test finished. Always invokefireTestFinished(Description)
if you invokefireTestStarted(Description)
as listeners are likely to expect them to come in pairs.- Overrides:
fireTestFinished
in classorg.junit.runner.notification.RunNotifier
- Parameters:
description
- the description of the test that finished
-
pleaseStop
public void pleaseStop()Ask that the tests run stop before starting the next test. Phrased politely because the test currently running will not be interrupted. It seems a little odd to put this functionality here, but theRunNotifier
is the only object guaranteed to be shared amongst the many runners involved.- Overrides:
pleaseStop
in classorg.junit.runner.notification.RunNotifier
-