public abstract class AbstractTestRunner<T extends TestRunnable,T2 extends TestRunContext> extends Object implements Runnable, TestRunner
TestRunner.Status| Constructor and Description |
|---|
AbstractTestRunner(T modelItem,
StringToObjectMap properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(String reason)
Cancels an ongoing test run with the specified reason
|
abstract T2 |
createContext(StringToObjectMap properties) |
void |
fail(String reason)
Fails an ongoing test run with the specified reason
|
Throwable |
getError() |
int |
getId() |
String |
getReason()
Gets the reason why a running test was canceled or failed.
|
T2 |
getRunContext() |
long |
getStartTime()
Returns the time this runner was last started
|
TestRunner.Status |
getStatus()
Gets the current status of this TestRunner
|
T |
getTestRunnable() |
Thread |
getThread() |
long |
getTimeTaken()
Returns the time taken by this runner since its last start
|
protected abstract void |
internalFinally(T2 runContext2) |
protected abstract void |
internalRun(T2 runContext2) |
boolean |
isCanceled() |
boolean |
isFailed() |
boolean |
isRunning() |
protected void |
onCancel(String reason2) |
protected void |
onFail(String reason) |
void |
run() |
protected void |
setError(Throwable error) |
protected void |
setStartTime() |
protected void |
setStatus(TestRunner.Status status) |
protected void |
setTimeTaken() |
void |
start(boolean async)
Starts running this TestRunners TestCase.
|
protected void |
startTimeoutTimer(long timeout) |
TestRunner.Status |
waitUntilFinished()
Blocks until this runner is finished, (returns directly if it already has
finished)
|
public AbstractTestRunner(T modelItem, StringToObjectMap properties)
public abstract T2 createContext(StringToObjectMap properties)
public T2 getRunContext()
getRunContext in interface TestRunnerpublic void start(boolean async)
TestRunnerstart in interface TestRunnerasync - flag controlling if TestCase should be run in seperate or
callers thread.public void cancel(String reason)
TestRunnercancel in interface TestRunnerprotected void onCancel(String reason2)
public void fail(String reason)
TestRunnerfail in interface TestRunnerprotected void onFail(String reason)
public TestRunner.Status getStatus()
TestRunnergetStatus in interface TestRunnerpublic int getId()
public Thread getThread()
protected void setStartTime()
public boolean isRunning()
isRunning in interface TestRunnerpublic boolean isCanceled()
public boolean isFailed()
protected void setStatus(TestRunner.Status status)
protected void setError(Throwable error)
protected abstract void internalFinally(T2 runContext2)
protected void startTimeoutTimer(long timeout)
public T getTestRunnable()
getTestRunnable in interface TestRunnerpublic TestRunner.Status waitUntilFinished()
TestRunnerwaitUntilFinished in interface TestRunnerprotected void setTimeTaken()
public long getTimeTaken()
TestRunnergetTimeTaken in interface TestRunnerpublic long getStartTime()
TestRunnergetStartTime in interface TestRunnerpublic Throwable getError()
public String getReason()
TestRunnergetReason in interface TestRunnerCopyright © 2019. All Rights Reserved.