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 classNotify 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 TypeMethodDescriptionvoidaddFirstListener(org.junit.runner.notification.RunListener listener) Adds a listener at the head of the listener list.voidaddListener(org.junit.runner.notification.RunListener listener) Add a listener at the end of the listener list.voidfireTestAssumptionFailed(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test flagged that it assumed something false.voidfireTestFailure(org.junit.runner.notification.Failure failure) Invoke to tell listeners that an atomic test failed.voidfireTestFinished(org.junit.runner.Description description) Invoke to tell listeners that an atomic test finished.voidfireTestIgnored(org.junit.runner.Description description) Invoke to tell listeners that an atomic test was ignored.voidfireTestRunFinished(org.junit.runner.Result result) Do not invoke.voidfireTestRunStarted(org.junit.runner.Description description) Do not invoke.voidfireTestStarted(org.junit.runner.Description description) Invoke to tell listeners that an atomic test is about to start.voidAsk that the tests run stop before starting the next test.voidremoveListener(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:
addListenerin 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:
addFirstListenerin classorg.junit.runner.notification.RunNotifier
-
removeListener
public void removeListener(org.junit.runner.notification.RunListener listener) Remove a listener from the listener list.- Overrides:
removeListenerin classorg.junit.runner.notification.RunNotifier
-
fireTestRunStarted
public void fireTestRunStarted(org.junit.runner.Description description) Do not invoke.- Overrides:
fireTestRunStartedin classorg.junit.runner.notification.RunNotifier
-
fireTestRunFinished
public void fireTestRunFinished(org.junit.runner.Result result) Do not invoke.- Overrides:
fireTestRunFinishedin 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:
fireTestStartedin 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:
fireTestFailurein 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:
fireTestAssumptionFailedin classorg.junit.runner.notification.RunNotifier- Parameters:
failure- the description of the test that failed and theAssumptionViolatedExceptionthrown
-
fireTestIgnored
public void fireTestIgnored(org.junit.runner.Description description) Invoke to tell listeners that an atomic test was ignored.- Overrides:
fireTestIgnoredin 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:
fireTestFinishedin 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 theRunNotifieris the only object guaranteed to be shared amongst the many runners involved.- Overrides:
pleaseStopin classorg.junit.runner.notification.RunNotifier
-