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.
  • Constructor Details

    • JUnitStepListener

      protected JUnitStepListener(Class<?> testClass, net.thucydides.core.steps.BaseStepListener baseStepListener, net.thucydides.model.steps.StepListener... listeners)
  • Method Details

    • withOutputDirectory

      public static JUnitStepListenerBuilder withOutputDirectory(File outputDirectory)
    • registerThucydidesListeners

      public void registerThucydidesListeners()
    • getBaseStepListener

      public net.thucydides.core.steps.BaseStepListener getBaseStepListener()
    • testRunStarted

      public void testRunStarted(org.junit.runner.Description description) throws Exception
      Overrides:
      testRunStarted in class org.junit.runner.notification.RunListener
      Throws:
      Exception
    • testRunFinished

      public void testRunFinished(org.junit.runner.Result result) throws Exception
      Overrides:
      testRunFinished in class org.junit.runner.notification.RunListener
      Throws:
      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:
      testStarted in class org.junit.runner.notification.RunListener
    • testFinished

      public void testFinished(org.junit.runner.Description description) throws Exception
      Overrides:
      testFinished in class org.junit.runner.notification.RunListener
      Throws:
      Exception
    • testFailure

      public void testFailure(org.junit.runner.notification.Failure failure) throws Exception
      Overrides:
      testFailure in class org.junit.runner.notification.RunListener
      Throws:
      Exception
    • testIgnored

      public void testIgnored(org.junit.runner.Description description) throws Exception
      Overrides:
      testIgnored in class org.junit.runner.notification.RunListener
      Throws:
      Exception
    • getTestOutcomes

      public List<net.thucydides.model.domain.TestOutcome> getTestOutcomes()
    • getError

      public net.thucydides.model.domain.stacktrace.FailureCause getError()
    • hasRecordedFailures

      public boolean hasRecordedFailures()
    • dropListeners

      public void dropListeners()
    • getTestClass

      protected Class<?> getTestClass()
    • getFailedTests

      public Map<String,List<String>> getFailedTests()