Class GUIRunListener


  • public final class GUIRunListener
    extends ExtRunListener
    An ExtRunListener which notifies the GUI GUIRunner of the events occuring while running a testsuite and which comprises a textual run listener. Created: Sat Jun 3 17:17:23 2006
    Version:
    1.0
    Author:
    Ernst Reissner
    • Nested Class Summary

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void testAssumptionFailure​(org.junit.runner.notification.Failure failure)
      Called when an atomic test flags that it assumes a condition that is false.
      void testClassStructureLoaded​(org.junit.runner.Description desc)
      Invoked if a test class is loaded defining a testsuite described by desc.
      void testFailure​(org.junit.runner.notification.Failure failure)
      Called when an atomic test fails to execute properly throwing a Throwable.
      void testFinished​(org.junit.runner.Description desc)
      Called when an atomic test has finished, whether the test succeeds or fails.
      void testIgnored​(org.junit.runner.Description desc)
      Called when a test will not be run, generally because a test method is annotated with @Ignored.
      void testRunAborted()
      Invoked for stop and for break originated by the user.
      void testRunFinished​(org.junit.runner.Result result)
      Called when all tests have finished.
      void testRunStarted​(org.junit.runner.Description desc)
      Called before any tests have been run.
      void testStarted​(org.junit.runner.Description desc)
      Called when an atomic test is about to be started.
      void testSuiteFinished​(org.junit.runner.Description desc)
      Called when a test suite has finished, whether the test suite succeeds or fails.
      void testSuiteStarted​(org.junit.runner.Description desc)
      Called when a test suite is about to be started.
    • Constructor Detail

      • GUIRunListener

        public GUIRunListener​(GUIRunner guiRunner)
    • Method Detail

      • testRunStarted

        public void testRunStarted​(org.junit.runner.Description desc)
                            throws Exception
        Called before any tests have been run. Updates the enablement of the GUI-Actions and then delegates to GUIRunner.testRunStarted(Description). Updates the enablement of the GUI-Actions and ***** OVERWRITTEN FOR ALL
        Overrides:
        testRunStarted in class org.junit.runner.notification.RunListener
        Parameters:
        desc - describes the tests to be run
        Throws:
        Exception
      • testRunFinished

        public void testRunFinished​(org.junit.runner.Result result)
                             throws Exception
        Called when all tests have finished. Prints a statistics on the result to the standard output, a summary to the status bar of the GUI and updates the enablement of the GUI-Actions.
        Overrides:
        testRunFinished in class org.junit.runner.notification.RunListener
        Parameters:
        result - the summary of the test run, including all the tests that failed
        Throws:
        Exception
      • testSuiteStarted

        public void testSuiteStarted​(org.junit.runner.Description desc)
                              throws Exception
        Called when a test suite is about to be started. If this method is called for a given Description, then testSuiteFinished(Description) will also be called for the same Description.

        Note that not all runners will call this method, so runners should be prepared to handle testStarted(Description) calls for tests where there was no cooresponding testSuiteStarted(Description) call for the parent Description.

        Overrides:
        testSuiteStarted in class ExtRunListener
        Parameters:
        desc - the description of the test suite that is about to be run (generally a class name)
        Throws:
        Exception
        Since:
        4.13
      • testSuiteFinished

        public void testSuiteFinished​(org.junit.runner.Description desc)
                               throws Exception
        Called when a test suite has finished, whether the test suite succeeds or fails. This method will not be called for a given Description unless testSuiteStarted(Description) was called for the same Description.
        Overrides:
        testSuiteFinished in class ExtRunListener
        Parameters:
        desc - the description of the test suite that just ran
        Throws:
        Exception
        Since:
        4.13
      • testStarted

        public void testStarted​(org.junit.runner.Description desc)
                         throws Exception
        Called when an atomic test is about to be started. An ignored test is never started.
        Overrides:
        testStarted in class org.junit.runner.notification.RunListener
        Parameters:
        desc - the description of the test that is about to be started (generally a class and method name)
        Throws:
        Exception
        See Also:
        testIgnored(Description)
      • testFinished

        public void testFinished​(org.junit.runner.Description desc)
                          throws Exception
        Called when an atomic test has finished, whether the test succeeds or fails. This method must be invoked after a test has been started which was indicated by testStarted(Description) before. An ignored test is never finished.
        Overrides:
        testFinished in class org.junit.runner.notification.RunListener
        Parameters:
        desc - the description of the test that just ran
        Throws:
        Exception
        See Also:
        testIgnored(Description)
      • testFailure

        public void testFailure​(org.junit.runner.notification.Failure failure)
                         throws Exception
        Called when an atomic test fails to execute properly throwing a Throwable. This method is invoked after testStarted(Description) and before testFinished(Description) with the according description. In case of a failed assumption, instead of this method testAssumptionFailure(Failure) is invoked for the according test.
        Overrides:
        testFailure in class org.junit.runner.notification.RunListener
        Parameters:
        failure - describes the test that failed and the exception that was thrown
        Throws:
        Exception
      • testAssumptionFailure

        public void testAssumptionFailure​(org.junit.runner.notification.Failure failure)
        Called when an atomic test flags that it assumes a condition that is false. This is treated as ignored with the description of the failure. This method is invoked after testStarted(Description) and before testFinished(Description) with the according description. A failed assertion does not count as a failure and so testFailure(Failure) is not invoked for the according test.

        CAUTION: Although a failed assertion is like an ignored test, testRunFinished(Result) does not count this as ignored test but rather than a passed test.

        Overrides:
        testAssumptionFailure in class org.junit.runner.notification.RunListener
        Parameters:
        failure - describes the test that failed and the AssumptionViolatedException that was thrown.
        See Also:
        testIgnored(Description)
      • testRunAborted

        public void testRunAborted()
        Invoked for stop and for break originated by the user.
        Overrides:
        testRunAborted in class ExtRunListener
      • testClassStructureLoaded

        public void testClassStructureLoaded​(org.junit.runner.Description desc)
        Invoked if a test class is loaded defining a testsuite described by desc.
        Overrides:
        testClassStructureLoaded in class ExtRunListener