avignon.handlers
Class TestScriptHandler

java.lang.Object
  extended byavignon.handlers.TestScriptHandler
All Implemented Interfaces:
AvignonTagHandler, ScriptRunner

public class TestScriptHandler
extends java.lang.Object
implements AvignonTagHandler, ScriptRunner

Includes an Avignon test script in the current test.
Attributes:


Constructor Summary
TestScriptHandler()
           
 
Method Summary
 void end(AvignonTestState state)
          Causes the script to be executed.
 void executeScript(AvignonTestState state, java.lang.String name)
          Replaces any parameters specified in calls to setScriptParameter and executes the script.
static java.lang.String getExecutedScript()
          Determines the name of the last script to be executed.
 void setScriptParameter(java.lang.String name, java.lang.String value)
          Adds a parameter to be replaced before the script is executed.
 void start(AvignonTestState state, org.xml.sax.Attributes attributes)
          Sets the name of the script to be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestScriptHandler

public TestScriptHandler()
Method Detail

getExecutedScript

public static java.lang.String getExecutedScript()
Determines the name of the last script to be executed.

Returns:
The name of the last script passed to executeScript.

setScriptParameter

public void setScriptParameter(java.lang.String name,
                               java.lang.String value)
Adds a parameter to be replaced before the script is executed.

Parameters:
name - Name of the parameter to replace. In the included file, the text #name# will be replaced with the given value.
value - Value of the parameter to used when executing the script.

start

public void start(AvignonTestState state,
                  org.xml.sax.Attributes attributes)
Sets the name of the script to be executed. Execution does not actually take place until the end method is called to allow parameters to be set.

Specified by:
start in interface AvignonTagHandler
Parameters:
state - Not used.
attributes - The name attribute must be set to the relative path of the script to be executed.

end

public void end(AvignonTestState state)
Causes the script to be executed.

Specified by:
end in interface AvignonTagHandler
Parameters:
state - AvignonTestState with which to execute the test.

executeScript

public void executeScript(AvignonTestState state,
                          java.lang.String name)
Replaces any parameters specified in calls to setScriptParameter and executes the script.

Specified by:
executeScript in interface ScriptRunner
Parameters:
state - The AvignonTestState on which to execute the test. By default, this will be same state that is being used for the surrounding test.
name - File name, relative to the ScriptRoot property, of the script to execute.

SourceForge.net Logo