|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.testing.threadtester.Script<T>
T - the type of the object-under-test.public class Script<T>
A Script represents a sequence of operations carried out on an
object-under-test. Several different Scripts can be created, and combined
together by a Scripter. Each Script will run in a separate thread,
and will have the option of yielding control to other Scripts using the
releaseTo(com.google.testing.threadtester.Script method. This allows a series of operations to be
co-ordinated across multiple threads.
| Constructor Summary | |
|---|---|
Script(Script<T> other)
Creates a new Script that will operate on the same object-under-test as another Script. |
|
Script(T object)
Creates a new Script that will operate on the given object-under-test. |
|
| Method Summary | ||
|---|---|---|
void |
addTask(ScriptedTask<T> task)
Adds a task to this Script. |
|
Script<T> |
afterCalling(Object result)
|
|
Script<T> |
afterCallingLastMethod()
|
|
Script<T> |
atEndOf(Object result)
|
|
Script<T> |
atEndOfLastMethod()
|
|
Script<T> |
atStartOf(Object result)
|
|
Script<T> |
atStartOfLastMethod()
|
|
Script<T> |
beforeCalling(Object result)
|
|
Script<T> |
beforeCallingLastMethod()
|
|
|
createTarget(Class<T> clss)
|
|
Script<T> |
in(Object result)
|
|
Script<T> |
inLastMethod()
|
|
T |
object()
Returns a control object that can be used to define release points in the object-under-test. |
|
void |
releaseTo(Script<T> other)
Declares an intent to release control to another thread in the future, or performs the actual release now. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Script(T object)
public Script(Script<T> other)
Scripter.Scripter(Script, Script)| Method Detail |
|---|
public T object()
public <T> T createTarget(Class<T> clss)
public void addTask(ScriptedTask<T> task)
Scripter.execute() is called. Note that this method should not be invoked
after Scripter.execute() has been called.
public void releaseTo(Script<T> other)
object().) If it has,
then the release is scheduled when the position represented by the control
call has been reached, and the state of the control object is
cleared. Otherwise, the release is performed immediately.
Releasing control will block this script, and allow the released script to
start, or to resume execution. This script will remain blocked until
another script releases control back to it, or until the first Script
belonging to the Scripter is released.
Note that it is only possible to release to another Script that is being
run by the same Scripter.
public String toString()
toString in class Objectpublic Script<T> afterCalling(Object result)
public Script<T> afterCallingLastMethod()
public Script<T> atEndOf(Object result)
public Script<T> atEndOfLastMethod()
public Script<T> atStartOf(Object result)
public Script<T> atStartOfLastMethod()
public Script<T> beforeCalling(Object result)
public Script<T> beforeCallingLastMethod()
public Script<T> inLastMethod()
public Script<T> in(Object result)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||