com.eviware.soapui.impl.wsdl.support
Class AbstractTestRunner<T extends TestRunnable,T2 extends TestRunContext>

java.lang.Object
  extended by com.eviware.soapui.impl.wsdl.support.AbstractTestRunner<T,T2>
All Implemented Interfaces:
TestRunner, java.lang.Runnable
Direct Known Subclasses:
WsdlProjectRunner, WsdlTestCaseRunner, WsdlTestSuiteRunner

public abstract class AbstractTestRunner<T extends TestRunnable,T2 extends TestRunContext>
extends java.lang.Object
implements java.lang.Runnable, TestRunner

WSDL TestCase Runner - runs all steps in a testcase and collects performance data

Author:
Ole.Matzura

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.eviware.soapui.model.testsuite.TestRunner
TestRunner.Status
 
Constructor Summary
AbstractTestRunner(T modelItem, StringToObjectMap properties)
           
 
Method Summary
 void cancel(java.lang.String reason)
          Cancels an ongoing test run with the specified reason
abstract  T2 createContext(StringToObjectMap properties)
           
 void fail(java.lang.String reason)
          Fails an ongoing test run with the specified reason
 java.lang.Throwable getError()
           
 int getId()
           
 java.lang.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()
           
 java.lang.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(java.lang.String reason2)
           
protected  void onFail(java.lang.String reason)
           
 void run()
           
protected  void setError(java.lang.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)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTestRunner

public AbstractTestRunner(T modelItem,
                          StringToObjectMap properties)
Method Detail

createContext

public abstract T2 createContext(StringToObjectMap properties)

getRunContext

public T2 getRunContext()
Specified by:
getRunContext in interface TestRunner

start

public void start(boolean async)
Description copied from interface: TestRunner
Starts running this TestRunners TestCase. If the async flag is set to true, this method will return directly, otherwise it will block until the TestCase is finished

Specified by:
start in interface TestRunner
Parameters:
async - flag controlling if TestCase should be run in seperate or callers thread.

cancel

public void cancel(java.lang.String reason)
Description copied from interface: TestRunner
Cancels an ongoing test run with the specified reason

Specified by:
cancel in interface TestRunner

onCancel

protected void onCancel(java.lang.String reason2)

fail

public void fail(java.lang.String reason)
Description copied from interface: TestRunner
Fails an ongoing test run with the specified reason

Specified by:
fail in interface TestRunner

onFail

protected void onFail(java.lang.String reason)

getStatus

public TestRunner.Status getStatus()
Description copied from interface: TestRunner
Gets the current status of this TestRunner

Specified by:
getStatus in interface TestRunner

getId

public int getId()

getThread

public java.lang.Thread getThread()

run

public void run()
Specified by:
run in interface java.lang.Runnable

setStartTime

protected void setStartTime()

isRunning

public boolean isRunning()

isCanceled

public boolean isCanceled()

isFailed

public boolean isFailed()

setStatus

protected void setStatus(TestRunner.Status status)

setError

protected void setError(java.lang.Throwable error)

internalRun

protected abstract void internalRun(T2 runContext2)
                             throws java.lang.Exception
Throws:
java.lang.Exception

internalFinally

protected abstract void internalFinally(T2 runContext2)

startTimeoutTimer

protected void startTimeoutTimer(long timeout)

getTestRunnable

public T getTestRunnable()
Specified by:
getTestRunnable in interface TestRunner

waitUntilFinished

public TestRunner.Status waitUntilFinished()
Description copied from interface: TestRunner
Blocks until this runner is finished, (returns directly if it already has finished)

Specified by:
waitUntilFinished in interface TestRunner

setTimeTaken

protected void setTimeTaken()

getTimeTaken

public long getTimeTaken()
Description copied from interface: TestRunner
Returns the time taken by this runner since its last start

Specified by:
getTimeTaken in interface TestRunner

getStartTime

public long getStartTime()
Description copied from interface: TestRunner
Returns the time this runner was last started

Specified by:
getStartTime in interface TestRunner

getError

public java.lang.Throwable getError()

getReason

public java.lang.String getReason()
Description copied from interface: TestRunner
Gets the reason why a running test was canceled or failed.

Specified by:
getReason in interface TestRunner


Copyright © 2005-2010 eviware.com. All Rights Reserved.