Package eu.simuline.testhelpers
Class Actions.CoreRunner
- java.lang.Object
-
- java.lang.Thread
-
- eu.simuline.testhelpers.Actions.CoreRunner
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- Actions
class Actions.CoreRunner extends java.lang.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 reloadtestClassName
using a classloader which allows reloading each test run without restarting the tester application. The core of the code is copied fromJUnitCore
.
-
-
Field Summary
Fields Modifier and Type Field Description private RunNotifier
notifier
The notifier to run the tests as in JUnitCore.private java.lang.String
testClassName
The name of the class to be tested.
-
Constructor Summary
Constructors Constructor Description CoreRunner(Actions.CoreRunner other)
Copy constructor.CoreRunner(java.lang.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 void
pleaseStop()
void
run()
Loads the class with nametestClassName
with aTestCaseClassLoader
to allow reloading.void
run(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 java.lang.String testClassName
The name of the class to be tested.
-
-
Constructor Detail
-
CoreRunner
CoreRunner(java.lang.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 nametestClassName
with aTestCaseClassLoader
to allow reloading. Then creates aRequest
filtering it withActions.filter
defining the tests to be run and runs those tests invokingrun(Request)
.- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
run
public void run(Request request)
-
pleaseStop
public void pleaseStop()
-
-