public class TestCaseExecutor extends Object implements ThreadFactory
The test case executor manages thread creation/deletion to execute a test case
WARNING: never give "privileged" rights in MSecurityManager to any of the threads generated here
| Modifier and Type | Class and Description |
|---|---|
static class |
TestCaseExecutor.TimeoutExceeded |
| Modifier and Type | Field and Description |
|---|---|
static String |
TEST_EXECUTION_THREAD
Name used to define the threads spawn by this factory
|
static String |
TEST_EXECUTION_THREAD_GROUP
Used to identify the threads spawn by the SUT
|
static int |
testsExecuted
Constant
testsExecuted=0 |
int |
threadCounter
Used when we spawn a new thread to give a unique name
|
static long |
timeExecuted
Constant
timeExecuted=0 |
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(ExecutionObserver observer)
addObserver
|
ExecutionResult |
execute(TestCase tc)
Execute a test case on a new scope
|
ExecutionResult |
execute(TestCase tc,
int timeout)
Execute a test case on a new scope
|
Set<ExecutionObserver> |
getExecutionObservers() |
static TestCaseExecutor |
getInstance()
Getter for the field
instance. |
int |
getNumStalledThreads()
getNumStalledThreads
|
static void |
initExecutor()
initExecutor
|
void |
newObservers()
newObservers
|
Thread |
newThread(Runnable r) |
static void |
pullDown()
pullDown
|
void |
removeObserver(ExecutionObserver observer)
removeObserver
|
static ExecutionResult |
runTest(TestCase test)
Execute a test case
|
void |
setExecutionObservers(Set<ExecutionObserver> observers) |
void |
setup()
setup
|
public static final String TEST_EXECUTION_THREAD_GROUP
public static final String TEST_EXECUTION_THREAD
public static long timeExecuted
timeExecuted=0public static int testsExecuted
testsExecuted=0public volatile int threadCounter
public static TestCaseExecutor getInstance()
Getter for the field instance.
TestCaseExecutor
object.public static ExecutionResult runTest(TestCase test)
test - The test case to executepublic void setup()
setup
public static void pullDown()
pullDown
public static void initExecutor()
initExecutor
public void addObserver(ExecutionObserver observer)
addObserver
observer - a ExecutionObserver
object.public void removeObserver(ExecutionObserver observer)
removeObserver
observer - a ExecutionObserver
object.public void newObservers()
newObservers
public Set<ExecutionObserver> getExecutionObservers()
public ExecutionResult execute(TestCase tc)
tc - a TestCase object.ExecutionResult object.public ExecutionResult execute(TestCase tc, int timeout)
tc - a TestCase object.ExecutionResult object.public int getNumStalledThreads()
getNumStalledThreads
public Thread newThread(Runnable r)
newThread in interface ThreadFactorypublic void setExecutionObservers(Set<ExecutionObserver> observers)
Copyright © 2010–2017 EvoSuite. All rights reserved.