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 TestRunner
public void start(boolean async)
TestRunner
start
in interface TestRunner
async
- flag controlling if TestCase should be run in seperate or
callers thread.public void cancel(String reason)
TestRunner
cancel
in interface TestRunner
protected void onCancel(String reason2)
public void fail(String reason)
TestRunner
fail
in interface TestRunner
protected void onFail(String reason)
public TestRunner.Status getStatus()
TestRunner
getStatus
in interface TestRunner
public int getId()
public Thread getThread()
protected void setStartTime()
public boolean isRunning()
isRunning
in interface TestRunner
public 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 TestRunner
public TestRunner.Status waitUntilFinished()
TestRunner
waitUntilFinished
in interface TestRunner
protected void setTimeTaken()
public long getTimeTaken()
TestRunner
getTimeTaken
in interface TestRunner
public long getStartTime()
TestRunner
getStartTime
in interface TestRunner
public Throwable getError()
public String getReason()
TestRunner
getReason
in interface TestRunner
Copyright © 2019. All Rights Reserved.