Class NonConcurrentRunListener

  • All Implemented Interfaces:
    org.apache.maven.surefire.report.ConsoleOutputReceiver

    public class NonConcurrentRunListener
    extends org.apache.maven.surefire.common.junit4.JUnit4RunListener
    implements org.apache.maven.surefire.report.ConsoleOutputReceiver
    A class to be used when there is no JUnit parallelism (methods or/and class). This allow to workaround JUnit limitation a la Junit4 provider. Specifically, we can redirect properly the output even if we don't have class demarcation in JUnit. It works when if there is a JVM instance per test run, i.e. with forkMode=always or perthread.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener

        org.junit.runner.notification.RunListener.ThreadSafe
    • Field Summary

      • Fields inherited from class org.apache.maven.surefire.common.junit4.JUnit4RunListener

        reporter
    • Constructor Summary

      Constructors 
      Constructor Description
      NonConcurrentRunListener​(org.apache.maven.surefire.report.RunListener reporter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.maven.surefire.report.SimpleReportEntry createReportEntry​(org.junit.runner.Description description)  
      protected java.lang.String extractDescriptionClassName​(org.junit.runner.Description description)  
      protected java.lang.String extractDescriptionMethodName​(org.junit.runner.Description description)  
      void testAssumptionFailure​(org.junit.runner.notification.Failure failure)  
      void testFailure​(org.junit.runner.notification.Failure failure)  
      void testFinished​(org.junit.runner.Description description)  
      void testIgnored​(org.junit.runner.Description description)  
      void testRunFinished​(org.junit.runner.Result result)  
      void testRunStarted​(org.junit.runner.Description description)  
      void testStarted​(org.junit.runner.Description description)  
      void writeTestOutput​(byte[] buf, int off, int len, boolean stdout)  
      • Methods inherited from class org.apache.maven.surefire.common.junit4.JUnit4RunListener

        createStackTraceWriter, rethrowAnyTestMechanismFailures, testExecutionSkippedByUser
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NonConcurrentRunListener

        public NonConcurrentRunListener​(org.apache.maven.surefire.report.RunListener reporter)
                                 throws org.apache.maven.surefire.testset.TestSetFailedException
        Throws:
        org.apache.maven.surefire.testset.TestSetFailedException
    • Method Detail

      • writeTestOutput

        public void writeTestOutput​(byte[] buf,
                                    int off,
                                    int len,
                                    boolean stdout)
        Specified by:
        writeTestOutput in interface org.apache.maven.surefire.report.ConsoleOutputReceiver
      • createReportEntry

        protected org.apache.maven.surefire.report.SimpleReportEntry createReportEntry​(org.junit.runner.Description description)
        Overrides:
        createReportEntry in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
      • extractDescriptionClassName

        protected java.lang.String extractDescriptionClassName​(org.junit.runner.Description description)
        Overrides:
        extractDescriptionClassName in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
      • extractDescriptionMethodName

        protected java.lang.String extractDescriptionMethodName​(org.junit.runner.Description description)
        Overrides:
        extractDescriptionMethodName in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
      • testStarted

        public void testStarted​(org.junit.runner.Description description)
                         throws java.lang.Exception
        Overrides:
        testStarted in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
        Throws:
        java.lang.Exception
      • testFinished

        public void testFinished​(org.junit.runner.Description description)
                          throws java.lang.Exception
        Overrides:
        testFinished in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
        Throws:
        java.lang.Exception
      • testIgnored

        public void testIgnored​(org.junit.runner.Description description)
                         throws java.lang.Exception
        Overrides:
        testIgnored in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
        Throws:
        java.lang.Exception
      • testFailure

        public void testFailure​(org.junit.runner.notification.Failure failure)
                         throws java.lang.Exception
        Overrides:
        testFailure in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
        Throws:
        java.lang.Exception
      • testAssumptionFailure

        public void testAssumptionFailure​(org.junit.runner.notification.Failure failure)
        Overrides:
        testAssumptionFailure in class org.apache.maven.surefire.common.junit4.JUnit4RunListener
      • testRunStarted

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

        public void testRunFinished​(org.junit.runner.Result result)
                             throws java.lang.Exception
        Overrides:
        testRunFinished in class org.junit.runner.notification.RunListener
        Throws:
        java.lang.Exception