|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.testing.threadtester.MainRunnableImpl<T>
T - the type under test. It is expected that the runnable will invoke a
method on this class in its ThrowingRunnable.run() method.public abstract class MainRunnableImpl<T>
Implementation of MainRunnable with empty methods. Provided as a
convenience class, so that subclasses only need to implement the methods that
they need.
| Constructor Summary | |
|---|---|
MainRunnableImpl()
|
|
| Method Summary | |
|---|---|
Class<T> |
getClassUnderTest()
Returns the class being tested by this runnable. |
T |
getMainObject()
Gets the main object being tested. |
Method |
getMethod()
Gets the method being tested by this runnable. |
String |
getMethodName()
Gets the name of the method being tested by this runnable. |
void |
initialize()
Invoked by the framework before running this runnable. |
void |
terminate()
Invoked by the framework after running this runnable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.testing.threadtester.ThrowingRunnable |
|---|
run |
| Constructor Detail |
|---|
public MainRunnableImpl()
| Method Detail |
|---|
public Class<T> getClassUnderTest()
MainRunnable
getClassUnderTest in interface MainRunnable<T>ClassInstrumentation,
Instrumentationpublic String getMethodName()
MainRunnableRunnable.run()
method. If this runnable is not testing an instrumented class, then this
method may return null. May return null if MainRunnable.getMethod() does not.
getMethodName in interface MainRunnable<T>
public Method getMethod()
throws NoSuchMethodException
MainRunnableThread.run() method. If
this runnable is not testing an instrumented class, then this method may
return null.
May throw a NoSuchMethodException if the method cannot be found. This will
cause the InterleavedRunner to throw an IllegalArgumentException. May
return null if MainRunnable.getMethodName() does not.
getMethod in interface MainRunnable<T>NoSuchMethodException
public void initialize()
throws Exception
MainRunnableInterleavedRunner.interleave(M, com.google.testing.threadtester.SecondaryRunnable) .
initialize in interface MainRunnable<T>Exceptionpublic T getMainObject()
MainRunnableMainRunnable.getMethod() on this object. This method will not be
called until MainRunnable.initialize() has been called. Typical implementations
will create a new instance of the test object in MainRunnable.initialize(), and
return it here.
getMainObject in interface MainRunnable<T>SecondaryRunnable.initialize(M)
public void terminate()
throws Exception
MainRunnableInterleavedRunner.interleave(M, com.google.testing.threadtester.SecondaryRunnable) .
terminate in interface MainRunnable<T>ExceptionRunResult
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||