Package eu.simuline.testhelpers
Class Actions
- java.lang.Object
-
- eu.simuline.testhelpers.Actions
-
public final class Actions extends 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 arerunFromMain()which runs the test class from its main method andrunTestClass(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) classActions.BreakActionThe action of breaking the sequence of testcases currently running.(package private) classActions.CoreRunnerA thread in which a testclass is executed or at least a single testcase out of this testclass.(package private) static classActions.ExitActionThe action of exiting the tester application.(package private) classActions.OpenActionThe action of opening ajava-file defining a test class and starting the tests defined by it.(package private) classActions.StartActionThe action of starting the testcases in the loaded testclass.(package private) classActions.StopActionThe action of stopping the test run// after having finished the currently running testcase.
-
Field Summary
Fields Modifier and Type Field Description private Actions.BreakActionbreakActionThe action to break execution of testcases.private Actions.CoreRunnercoreRunnerprivate org.junit.runner.DescriptionfilterDefines the filter for tests to be run. **** may be nullprivate GUIRunnerguiRunnerprivate booleanisRunningDefines whether a test is running.private ExtRunListenerlistenerprivate Actions.OpenActionopenActionThe action to open a new testclass.private Actions.StartActionstartActionThe action to run a testcase.private Actions.StopActionstopActionThe action to stop after having finished the currently running testcase.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.junit.runner.manipulation.Filterdesc2filter(org.junit.runner.Description desiredDesc)Returns aFilterthat only runs methods in desiredDesc.private static booleandescShouldRun(org.junit.runner.Description desc, org.junit.runner.Description desiredDesc)(package private) AbstractActiongetBreakAction()(package private) AbstractActiongetExitAction()(package private) AbstractActiongetOpenAction()(package private) GUIRunnergetRunner()(package private) AbstractActiongetStartAction()(package private) AbstractActiongetStopAction()static voidmain(String[] args)static voidrunFromMain()The fundamental method to start tests with the underlying JUnit-GUI.(package private) static voidrunTestClass(String testClassName)The fundamental method to start tests with the underlying JUnit-GUI.(package private) voidsetEnableForRun(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) voidsetFilter(org.junit.runner.Description filter)Setsfilteraccording tofilter.
-
-
-
Field Detail
-
openAction
private final Actions.OpenAction openAction
The action to open a new testclass.
-
startAction
private final Actions.StartAction startAction
The action to run a testcase.
-
stopAction
private final Actions.StopAction stopAction
The action to stop after having finished the currently running testcase.
-
breakAction
private final Actions.BreakAction breakAction
The action to break execution of testcases. Tries to break the currently running testcase and does not go on with further testcases.
-
guiRunner
private final GUIRunner guiRunner
-
coreRunner
private Actions.CoreRunner coreRunner
-
listener
private final ExtRunListener listener
-
isRunning
private boolean isRunning
Defines whether a test is running. This is used to activate/deactivate the actionsopenAction,startAction,stopActionandbreakAction.
-
filter
private org.junit.runner.Description filter
Defines the filter for tests to be run. **** may be null- See Also:
setFilter(Description),Actions.CoreRunner.run()
-
-
Constructor Detail
-
Actions
public Actions(String testClassName)
Creates a newActionsinstance.- Parameters:
testClassName- the name of the test class.
-
-
Method Detail
-
descShouldRun
private static boolean descShouldRun(org.junit.runner.Description desc, org.junit.runner.Description desiredDesc)
-
desc2filter
public static org.junit.runner.manipulation.Filter desc2filter(org.junit.runner.Description desiredDesc)
Returns aFilterthat only runs methods in desiredDesc.- Parameters:
desiredDesc- a description of the tests to be run.- Returns:
- a
Filterthat only runs methods indesiredDesc.
-
runTestClass
static void runTestClass(String testClassName)
The fundamental method to start tests with the underlying JUnit-GUI. The test class is supposed to define a methodmainwith bodyActions.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 methodmainwith bodyActions.runFromMain();. Essentially invokesrunTestClass(String)with the proper test class name.
-
getRunner
GUIRunner getRunner()
-
setFilter
void setFilter(org.junit.runner.Description filter)
Setsfilteraccording tofilter.- 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
AbstractAction getOpenAction()
-
getStartAction
AbstractAction getStartAction()
-
getStopAction
AbstractAction getStopAction()
-
getBreakAction
AbstractAction getBreakAction()
-
getExitAction
AbstractAction getExitAction()
-
main
public static void main(String[] args)
-
-