Package net.thucydides.junit.listeners
Class JUnitStepListener
java.lang.Object
org.junit.runner.notification.RunListener
net.thucydides.junit.listeners.JUnitStepListener
- Direct Known Subclasses:
ParameterizedJUnitStepListener
public class JUnitStepListener
extends org.junit.runner.notification.RunListener
Intercepts JUnit events and reports them to Thucydides.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
org.junit.runner.notification.RunListener.ThreadSafe -
Constructor Summary
Constructors Modifier Constructor Description protectedJUnitStepListener(java.lang.Class<?> testClass, BaseStepListener baseStepListener, StepListener... listeners) -
Method Summary
Modifier and Type Method Description voiddropListeners()BaseStepListenergetBaseStepListener()net.thucydides.core.model.stacktrace.FailureCausegetError()java.util.Map<java.lang.String,java.util.List<java.lang.String>>getFailedTests()protected java.lang.Class<?>getTestClass()java.util.List<net.thucydides.core.model.TestOutcome>getTestOutcomes()booleanhasRecordedFailures()voidregisterThucydidesListeners()voidtestFailure(org.junit.runner.notification.Failure failure)voidtestFinished(org.junit.runner.Description description)voidtestIgnored(org.junit.runner.Description description)voidtestRunFinished(org.junit.runner.Result result)voidtestRunStarted(org.junit.runner.Description description)voidtestStarted(org.junit.runner.Description description)Called when a test starts.static JUnitStepListenerBuilderwithOutputDirectory(java.io.File outputDirectory)Methods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testSuiteFinished, testSuiteStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JUnitStepListener
protected JUnitStepListener(java.lang.Class<?> testClass, BaseStepListener baseStepListener, StepListener... listeners)
-
-
Method Details
-
withOutputDirectory
-
registerThucydidesListeners
public void registerThucydidesListeners() -
getBaseStepListener
-
testRunStarted
public void testRunStarted(org.junit.runner.Description description) throws java.lang.Exception- Overrides:
testRunStartedin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
testRunFinished
public void testRunFinished(org.junit.runner.Result result) throws java.lang.Exception- Overrides:
testRunFinishedin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
testStarted
public void testStarted(org.junit.runner.Description description)Called when a test starts. We also need to start the test suite the first time, as the testRunStarted() method is not invoked for some reason.- Overrides:
testStartedin classorg.junit.runner.notification.RunListener
-
testFinished
public void testFinished(org.junit.runner.Description description) throws java.lang.Exception- Overrides:
testFinishedin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
testFailure
public void testFailure(org.junit.runner.notification.Failure failure) throws java.lang.Exception- Overrides:
testFailurein classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
testIgnored
public void testIgnored(org.junit.runner.Description description) throws java.lang.Exception- Overrides:
testIgnoredin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
getTestOutcomes
public java.util.List<net.thucydides.core.model.TestOutcome> getTestOutcomes() -
getError
public net.thucydides.core.model.stacktrace.FailureCause getError() -
hasRecordedFailures
public boolean hasRecordedFailures() -
dropListeners
public void dropListeners() -
getTestClass
protected java.lang.Class<?> getTestClass() -
getFailedTests
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getFailedTests()
-