Class JUnit4RunListener

    • Field Detail

      • failureFlag

        private final java.lang.ThreadLocal<java.lang.Boolean> failureFlag
        This flag is set after a failure has occurred so that a RunListener.testSucceeded(org.apache.maven.surefire.report.ReportEntry) event is not fired. This is necessary because JUnit4 always fires a RunListener.testRunFinished(org.junit.runner.Result) event-- even if there was a failure.
    • Constructor Detail

      • JUnit4RunListener

        public JUnit4RunListener​(RunListener reporter)
        Constructor.
        Parameters:
        reporter - the reporter to log testing events to
    • Method Detail

      • testIgnored

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

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

        public void testFailure​(org.junit.runner.notification.Failure failure)
                         throws java.lang.Exception
        Called when a specific test has failed.
        Overrides:
        testFailure in class org.junit.runner.notification.RunListener
        Throws:
        java.lang.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 java.lang.Exception
        Called after a specific test has finished.
        Overrides:
        testFinished in class org.junit.runner.notification.RunListener
        Throws:
        java.lang.Exception
        See Also:
        RunListener.testFinished(org.junit.runner.Description)
      • getClassName

        private java.lang.String getClassName​(org.junit.runner.Description description)
      • createStackTraceWriter

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

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

        protected java.lang.String extractDescriptionClassName​(org.junit.runner.Description description)
      • extractDescriptionMethodName

        protected java.lang.String extractDescriptionMethodName​(org.junit.runner.Description description)
      • isInsaneJunitNullString

        private static boolean isInsaneJunitNullString​(java.lang.String value)