com.google.testing.threadtester
Class Scripter<T>

java.lang.Object
  extended by com.google.testing.threadtester.Scripter<T>
Type Parameters:
T - the type of object-under-test being scripted.

public class Scripter<T>
extends Object

Runs a sequence of Scripts. One Script is defined as the main script, and will be executed first. One or more secondary Scripts are also defined. It is expected that the main script will had control to one of the secondary scripts. A Script consists of a sequence of one or more ScriptedTasks. Each task typically performs an operation on the object-under-test.

Author:
alasdair.mackintosh@gmail.com (Alasdair Mackintosh)

Constructor Summary
Scripter(Script<T> main, Collection<Script<T>> secondaries)
          Creates a new Scripter that will run the given main and secondary scripts.
Scripter(Script<T> main, Script<T> secondary)
          Creates a new Scripter that will run the given main script and the given secondary script.
 
Method Summary
 void execute()
          Executes the scripts defined in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scripter

public Scripter(Script<T> main,
                Script<T> secondary)
Creates a new Scripter that will run the given main script and the given secondary script.


Scripter

public Scripter(Script<T> main,
                Collection<Script<T>> secondaries)
Creates a new Scripter that will run the given main and secondary scripts.

Method Detail

execute

public void execute()
             throws Exception
Executes the scripts defined in the constructor. The tasks belonging to the main script will be executed first. When the main script releases to another script, that other script will run.

This method will wait until the first script finishes all of its tasks. Once one script has finished,

Throws:
Exception


Copyright © 2013. All Rights Reserved.