Class JUnit4RunListener

java.lang.Object
org.junit.runner.notification.RunListener
org.apache.maven.surefire.common.junit4.JUnit4RunListener
All Implemented Interfaces:
TestOutputReceiver<OutputReportEntry>, RunModeSetter
Direct Known Subclasses:
JUnitCoreRunListener, NonConcurrentRunListener

public class JUnit4RunListener extends org.junit.runner.notification.RunListener implements TestOutputReceiver<OutputReportEntry>, RunModeSetter
RunListener for JUnit4, delegates to our own RunListener
  • Field Details

  • Constructor Details

  • Method Details

    • getConsoleLogger

      public final ConsoleLogger getConsoleLogger()
    • setRunMode

      public void setRunMode(RunMode runMode)
      Specified by:
      setRunMode in interface RunModeSetter
    • getRunMode

      protected final RunMode getRunMode()
    • testIgnored

      public void testIgnored(org.junit.runner.Description description) throws Exception
      Called when a specific test has been skipped (for whatever reason).
      Overrides:
      testIgnored in class org.junit.runner.notification.RunListener
      Throws:
      Exception
      See Also:
      • RunListener.testIgnored(org.junit.runner.Description)
    • testStarted

      public void testStarted(org.junit.runner.Description description) throws Exception
      Called when a specific test has started.
      Overrides:
      testStarted in class org.junit.runner.notification.RunListener
      Throws:
      Exception
      See Also:
      • RunListener.testStarted(org.junit.runner.Description)
    • testFailure

      public void testFailure(org.junit.runner.notification.Failure failure) throws Exception
      Called when a specific test has failed.
      Overrides:
      testFailure in class org.junit.runner.notification.RunListener
      Throws:
      Exception
      See Also:
      • RunListener.testFailure(org.junit.runner.notification.Failure)
    • testAssumptionFailure

      public void testAssumptionFailure(org.junit.runner.notification.Failure failure)
      Overrides:
      testAssumptionFailure in class org.junit.runner.notification.RunListener
    • testFinished

      public void testFinished(org.junit.runner.Description description) throws Exception
      Called after a specific test has finished.
      Overrides:
      testFinished in class org.junit.runner.notification.RunListener
      Throws:
      Exception
      See Also:
      • RunListener.testFinished(org.junit.runner.Description)
    • testExecutionSkippedByUser

      public void testExecutionSkippedByUser()
    • createStackTraceWriter

      protected StackTraceWriter createStackTraceWriter(org.junit.runner.notification.Failure failure)
    • createReportEntry

      protected SimpleReportEntry createReportEntry(org.junit.runner.Description description)
    • rethrowAnyTestMechanismFailures

      public static void rethrowAnyTestMechanismFailures(org.junit.runner.Result run) throws TestSetFailedException
      Throws:
      TestSetFailedException
    • writeTestOutput

      public void writeTestOutput(OutputReportEntry reportEntry)
      Description copied from interface: TestOutputReceiver
      Forwards process output from the running test-case into the reporting system
      Specified by:
      writeTestOutput in interface TestOutputReceiver<OutputReportEntry>
      Parameters:
      reportEntry - wraps test output with descriptive information of the output