com.canoo.webtest.extension
Class ScriptStep

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.canoo.webtest.steps.Step
              extended by com.canoo.webtest.extension.ScriptStep
All Implemented Interfaces:
Serializable, Cloneable

public class ScriptStep
extends Step

Wrapper class for the ant script command.

Author:
Paul King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.canoo.webtest.steps.Step
DEFAULT_DESCRIPTION, ELEMENT_ATTRIBUTE_ID, ELEMENT_ATTRIBUTE_NAME, PROPERTY_TYPE_ANT, PROPERTY_TYPE_ANT_STRICT, PROPERTY_TYPE_DEFAULT, PROPERTY_TYPE_DYNAMIC
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
ScriptStep()
           
 
Method Summary
protected  void addComputedParameters(Map map)
          override to add actual attribute values to the reporting
 void addText(String text)
          The script text if inlined.
 void doExecute()
          Perform the step's actual work.
static String evalByRunner(ResetScriptRunner runner, String script, Step step)
           
static String evalScriptExpression(Context context, String expression, Step step)
           
static void executeByRunner(ResetScriptRunner runner, String script, Step step, Project project)
           
 String getKeep()
           
 String getLanguage()
           
 File getSrc()
           
 boolean isKeep()
           
 void setKeep(String keep)
          Flag to indicate that the scripting engine should be kept after the step completes and re-used for future script steps.
 void setLanguage(String language)
          Defines the language (required).
 void setSrc(File fileName)
          Defines the src file containing scripting code (optional).
protected  void verifyParameters()
          Verify that language is set
 
Methods inherited from class com.canoo.webtest.steps.Step
clone, emptyParamCheck, execute, getComputedParameters, getContext, getDefaultPropertyType, getDescription, getDuration, getParameterDictionary, getStepLabel, getVerifier, getWebtestProperties, getWebtestProperties, getWebtestProperty, getWebtestProperty, handleException, hasDescription, integerParamCheck, isCompleted, isPerformingAction, isStarted, isSuccessful, notifyCompleted, notifyStarted, notifyStepResultsListeners, notifySuccess, nullParamCheck, nullResponseCheck, optionalIntegerParamCheck, paramCheck, positiveOrZeroParamCheck, setStepid, setWebtestProperty, setWebtestProperty, toString
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptStep

public ScriptStep()
Method Detail

doExecute

public void doExecute()
               throws Exception
Perform the step's actual work.

Specified by:
doExecute in class Step
Throws:
Exception - if a problem occurred

evalScriptExpression

public static String evalScriptExpression(Context context,
                                          String expression,
                                          Step step)

executeByRunner

public static void executeByRunner(ResetScriptRunner runner,
                                   String script,
                                   Step step,
                                   Project project)
                            throws BuildException
Throws:
BuildException

evalByRunner

public static String evalByRunner(ResetScriptRunner runner,
                                  String script,
                                  Step step)
                           throws BuildException
Throws:
BuildException

verifyParameters

protected void verifyParameters()
Verify that language is set

Overrides:
verifyParameters in class Step
Throws:
StepExecutionException - if a mandatory attribute is not set

addComputedParameters

protected void addComputedParameters(Map map)
override to add actual attribute values to the reporting

Overrides:
addComputedParameters in class Step
Parameters:
map - the map in which the parameters should be added

setLanguage

public void setLanguage(String language)
Defines the language (required).

Parameters:
language - Sets the scripting language.

getLanguage

public String getLanguage()

setSrc

public void setSrc(File fileName)
Defines the src file containing scripting code (optional).

Parameters:
fileName - Sets the name of the file containing script code.

getSrc

public File getSrc()

setKeep

public void setKeep(String keep)
Flag to indicate that the scripting engine should be kept after the step completes and re-used for future script steps.

Parameters:
keep - Indicates that the script engine should be kept for future steps.

getKeep

public String getKeep()

isKeep

public boolean isKeep()

addText

public void addText(String text)
The script text if inlined.

Parameters:
text - The nested scripting code.

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.