Package eu.simuline.testhelpers
Class Actions.CoreRunner
- java.lang.Object
-
- java.lang.Thread
-
- eu.simuline.testhelpers.Actions.CoreRunner
-
- All Implemented Interfaces:
Runnable
- Enclosing class:
- Actions
class Actions.CoreRunner extends Thread
A thread in which a testclass is executed or at least a single testcase out of this testclass. Essentially, this is defined by the classtestClassName. The major task of this class is, to reloadtestClassNameusing a classloader which allows reloading each test run without restarting the tester application. The core of the code is copied fromJUnitCore.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description private RunNotifiernotifierThe notifier to run the tests as in JUnitCore.private StringtestClassNameThe name of the class to be tested.-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description CoreRunner(Actions.CoreRunner other)Copy constructor.CoreRunner(String testClassName)Creates a runner running all testcases in the given test class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpleaseStop()voidrun()Loads the class with nametestClassNamewith aTestCaseClassLoaderto allow reloading.voidrun(Request request)-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
notifier
private final RunNotifier notifier
The notifier to run the tests as in JUnitCore.
-
testClassName
private final String testClassName
The name of the class to be tested.
-
-
Constructor Detail
-
CoreRunner
CoreRunner(String testClassName)
Creates a runner running all testcases in the given test class.
-
CoreRunner
CoreRunner(Actions.CoreRunner other)
Copy constructor.
-
-
Method Detail
-
run
public void run()
Loads the class with nametestClassNamewith aTestCaseClassLoaderto allow reloading. Then creates aRequestfiltering it withActions.filterdefining the tests to be run and runs those tests invokingrun(Request).
-
run
public void run(Request request)
-
pleaseStop
public void pleaseStop()
-
-