|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.canoo.webtest.steps.Step
public abstract class Step
Abstract superclass for all test steps. Provides generic services for all subclasses.
| Field Summary | |
|---|---|
static String |
DEFAULT_DESCRIPTION
Deprecated. The default is now not to set the value at all. |
static String |
ELEMENT_ATTRIBUTE_ID
|
static String |
ELEMENT_ATTRIBUTE_NAME
|
static String |
PROPERTY_TYPE_ANT
The property is an ant property. |
static String |
PROPERTY_TYPE_ANT_STRICT
The property is an ant property that must not overwrite an existing property. |
static String |
PROPERTY_TYPE_DEFAULT
The property type is set according to webtest's defaultPropertyType. |
static String |
PROPERTY_TYPE_DYNAMIC
The property is a dynamic property. |
| 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 | |
|---|---|
protected |
Step()
This is the abstract base class for all test step specifications. |
| Method Summary | |
|---|---|
protected void |
addComputedParameters(Map map)
Adds parameters that are not issued from the config file but computed at runtime by the step |
Object |
clone()
This creates a bitwise copy of the receiver. |
abstract void |
doExecute()
Called to perform the step's functionality. |
protected void |
emptyParamCheck(String param,
String paramName)
|
void |
execute()
Ant calls this method to invoke this task's functionality. |
protected Map |
getComputedParameters()
TODO: would be cleaner to notify the result listener and to give him this information |
Context |
getContext()
|
protected String |
getDefaultPropertyType()
|
String |
getDescription(String prefix,
String suffix)
Gets the description with a prefix and suffix if the description is set. |
long |
getDuration()
Gets the execution time for a completed step. |
Map |
getParameterDictionary()
Gets a snapshot of the values. |
protected String |
getStepLabel()
|
protected static IStringVerifier |
getVerifier(boolean useRegex)
|
Map |
getWebtestProperties()
|
Map |
getWebtestProperties(String propertyType)
|
String |
getWebtestProperty(String name)
Gets a property of the default type. |
String |
getWebtestProperty(String name,
String propertyType)
Gets a property of the specified type |
protected void |
handleException(Throwable t)
Called if doExecute() throws an exception |
boolean |
hasDescription()
|
protected void |
integerParamCheck(String param,
String paramName,
boolean nonNegative)
|
boolean |
isCompleted()
|
boolean |
isPerformingAction()
Indicates if this step performs an action on the browser |
boolean |
isStarted()
|
boolean |
isSuccessful()
|
void |
notifyCompleted()
Called after doExecute() has completed (successfully or not) |
void |
notifyStarted()
Called before calling doExecute() |
protected void |
notifyStepResultsListeners()
Notifies the interested project build listeners (typically only the StepExecutionListener)
that this step has produced results |
void |
notifySuccess()
|
protected void |
nullParamCheck(Object param,
String paramName)
|
protected void |
nullResponseCheck()
|
protected void |
optionalIntegerParamCheck(String param,
String paramName,
boolean nonNegative)
|
protected void |
paramCheck(boolean condition,
String message)
Throw an exception if the condition holds. |
protected void |
positiveOrZeroParamCheck(int value,
String paramName)
Checks that the parameter's value is non negative |
void |
setStepid(String description)
Deprecated. since June 10 2005. Use ProjectComponent.setDescription(String)
(setter should not be removed for compatibility with existing test sequences) |
void |
setWebtestProperty(String name,
String value)
Sets a property of the default type. |
void |
setWebtestProperty(String name,
String value,
String propertyType)
Sets a property of the default type. |
String |
toString()
|
protected void |
verifyParameters()
Called to let the step's implementation validate its parameters. |
| 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 |
| Field Detail |
|---|
public static final String ELEMENT_ATTRIBUTE_NAME
public static final String ELEMENT_ATTRIBUTE_ID
public static final String DEFAULT_DESCRIPTION
public static final String PROPERTY_TYPE_DEFAULT
public static final String PROPERTY_TYPE_DYNAMIC
public static final String PROPERTY_TYPE_ANT
public static final String PROPERTY_TYPE_ANT_STRICT
| Constructor Detail |
|---|
protected Step()
| Method Detail |
|---|
public Context getContext()
public abstract void doExecute()
throws Exception
Exceptionpublic void execute()
execute in class Taskpublic boolean isPerformingAction()
protected void notifyStepResultsListeners()
StepExecutionListener)
that this step has produced results
protected void verifyParameters()
doExecute().
This implementation does nothing, overwrite as needed.
public boolean hasDescription()
public String getDescription(String prefix,
String suffix)
prefix - A string to display before the description.suffix - A string to display after the description.
public long getDuration()
protected String getStepLabel()
public boolean isCompleted()
public boolean isStarted()
public boolean isSuccessful()
public void notifyCompleted()
doExecute() has completed (successfully or not)
public void notifyStarted()
doExecute()
public void notifySuccess()
public void setStepid(String description)
ProjectComponent.setDescription(String)
(setter should not be removed for compatibility with existing test sequences)
description - public String toString()
toString in class Objectprotected String getDefaultPropertyType()
public void setWebtestProperty(String name,
String value)
name - The name of the property.value - The value of the property.
public void setWebtestProperty(String name,
String value,
String propertyType)
name - The name of the property.value - The value of the property.propertyType - The kind of property desired. One of PROPERTY_TYPE_ANT,
PROPERTY_TYPE_ANT_STRICT, PROPERTY_TYPE_DYNAMIC or PROPERTY_TYPE_DEFAULT.public String getWebtestProperty(String name)
name - The name of the property.
public String getWebtestProperty(String name,
String propertyType)
name - The name of the property.propertyType - The kind of property desired. One of PROPERTY_TYPE_ANT,
PROPERTY_TYPE_DYNAMIC or PROPERTY_TYPE_DEFAULT.
public Map getWebtestProperties()
public Map getWebtestProperties(String propertyType)
public Object clone()
throws CloneNotSupportedException
clone in class ProjectComponentCloneNotSupportedExceptionprotected static IStringVerifier getVerifier(boolean useRegex)
protected void handleException(Throwable t)
doExecute() throws an exception
t - the thrown exception
protected void paramCheck(boolean condition,
String message)
condition - If true, throws the exception.message - The error message.
protected void nullParamCheck(Object param,
String paramName)
protected void emptyParamCheck(String param,
String paramName)
protected void positiveOrZeroParamCheck(int value,
String paramName)
paramName - the name of the parametervalue - the parameter value
StepExecutionException - if the value is negative
protected void integerParamCheck(String param,
String paramName,
boolean nonNegative)
protected void optionalIntegerParamCheck(String param,
String paramName,
boolean nonNegative)
protected void nullResponseCheck()
public Map getParameterDictionary()
This method returns all the parameters that were discovered at build time and stored in the .attributes resource. Overwrite this method if your step doesn't have a .attributes resource
protected void addComputedParameters(Map map)
map - the map in which the parameters should be addedprotected Map getComputedParameters()
|
Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||