Class Actions


  • public final class Actions
    extends java.lang.Object
    Represents the actions of the test GUI inspired by old junit GUI. **** Moreover provides a wrapper to access junit and the access point to run the gui started from the class to be tested. **** The fundamental methods are runFromMain() which runs the test class from its main method and runTestClass(String) which runs a testclass with the given name.
    Version:
    1.0
    Author:
    Ernst Reissner
    See Also:
    GUIRunner, Created: Tue Jun 13 02:53:06 2006
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  Actions.BreakAction
      The action of breaking the sequence of testcases currently running.
      (package private) class  Actions.CoreRunner
      A thread in which a testclass is executed or at least a single testcase out of this testclass.
      (package private) static class  Actions.ExitAction
      The action of exiting the tester application.
      (package private) class  Actions.OpenAction
      The action of opening a java-file defining a test class and starting the tests defined by it.
      (package private) class  Actions.StartAction
      The action of starting the testcases in the loaded testclass.
      (package private) class  Actions.StopAction
      The action of stopping the test run// after having finished the currently running testcase.
    • Constructor Summary

      Constructors 
      Constructor Description
      Actions​(java.lang.String testClassName)
      Creates a new Actions instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Filter desc2filter​(Description desiredDesc)
      Returns a Filter that only runs methods in desiredDesc.
      private static boolean descShouldRun​(Description desc, Description desiredDesc)  
      (package private) javax.swing.AbstractAction getBreakAction()  
      (package private) javax.swing.AbstractAction getExitAction()  
      (package private) javax.swing.AbstractAction getOpenAction()  
      (package private) GUIRunner getRunner()  
      (package private) javax.swing.AbstractAction getStartAction()  
      (package private) javax.swing.AbstractAction getStopAction()  
      static void main​(java.lang.String[] args)  
      static void runFromMain()
      The fundamental method to start tests with the underlying JUnit-GUI.
      (package private) static void runTestClass​(java.lang.String testClassName)
      The fundamental method to start tests with the underlying JUnit-GUI.
      (package private) void setEnableForRun​(boolean isRunning)
      Updates the action-enablements depending on whether a test is running or not: Open and Start action are enabled iff no test is running, whereas stop and break actions are enabled iff some test is running.
      (package private) void setFilter​(Description filter)
      Sets filter according to filter.
      • Methods inherited from class java.lang.Object

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

      • Actions

        public Actions​(java.lang.String testClassName)
        Creates a new Actions instance.
        Parameters:
        testClassName - the name of the test class.
    • Method Detail

      • desc2filter

        public static Filter desc2filter​(Description desiredDesc)
        Returns a Filter that only runs methods in desiredDesc.
        Parameters:
        desiredDesc - a description of the tests to be run.
        Returns:
        a Filter that only runs methods in desiredDesc.
      • runTestClass

        static void runTestClass​(java.lang.String testClassName)
        The fundamental method to start tests with the underlying JUnit-GUI. The test class is supposed to define a method main with body Actions.run(<testclass>.class);.
        Parameters:
        testClassName - the name of the test class to represent and run.
        See Also:
        JUnitSingleTester, runFromMain()
      • runFromMain

        public static void runFromMain()
        The fundamental method to start tests with the underlying JUnit-GUI. The test class is supposed to define a method main with body Actions.runFromMain();. Essentially invokes runTestClass(String) with the proper test class name.
      • setFilter

        void setFilter​(Description filter)
        Sets filter according to filter.
        Parameters:
        filter - the filter for the tests to be run
      • setEnableForRun

        void setEnableForRun​(boolean isRunning)
        Updates the action-enablements depending on whether a test is running or not: Open and Start action are enabled iff no test is running, whereas stop and break actions are enabled iff some test is running.
        Parameters:
        isRunning - whether a test is running.
      • getOpenAction

        javax.swing.AbstractAction getOpenAction()
      • getStartAction

        javax.swing.AbstractAction getStartAction()
      • getStopAction

        javax.swing.AbstractAction getStopAction()
      • getBreakAction

        javax.swing.AbstractAction getBreakAction()
      • getExitAction

        javax.swing.AbstractAction getExitAction()
      • main

        public static void main​(java.lang.String[] args)