|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.extensions.awt.script.Step
Provides access to one step (line) from a script. A Step is the basic unit of execution. When run, a Step sends events to registered listener indicating STEP_START, optionally STEP_PROGRESS, and STEP_END events. If the Step encounters unexpected exceptions or test failures, it will send a STEP_ERROR or STEP_FAILURE event. By default, a Step will stop execution when a failure or error is encountered.
Field Summary | |
protected java.util.ArrayList |
listeners
|
protected static org.apache.xerces.parsers.DOMParser |
parser
|
static java.lang.String |
STEP_END
The step has finished. |
static java.lang.String |
STEP_ERROR
The step encountered an error. |
static java.lang.String |
STEP_FAILURE
The step failed. |
static java.lang.String |
STEP_PROGRESS
The step is N% complete. |
static java.lang.String |
STEP_START
The step has begun executing. |
Fields inherited from interface junit.extensions.awt.script.Tags |
TAG_ACTION, TAG_ARGS, TAG_ASSERT, TAG_AWTTESTSCRIPT, TAG_CLASS, TAG_COMPONENT, TAG_COUNT, TAG_DESC, TAG_EVENT, TAG_FILENAME, TAG_ID, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARENT, TAG_POLL_INTERVAL, TAG_SCRIPT, TAG_SEQUENCE, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_WAIT, TAG_WINDOW, TAG_X, TAG_Y |
Constructor Summary | |
Step(Resolver resolver,
ComponentFinder finder,
java.util.HashMap attributes)
|
|
Step(Resolver resolver,
ComponentFinder finder,
java.lang.String description)
|
Method Summary | |
void |
addStepListener(StepListener sl)
|
protected void |
clearFailures()
|
protected static java.util.HashMap |
createAttributeMap(org.w3c.dom.Element el)
|
static Step |
createStep(Resolver resolver,
ComponentFinder finder,
org.w3c.dom.Element el)
Factory method, equivalent to a "fromXML". |
static Step |
createStep(Resolver resolver,
ComponentFinder finder,
java.lang.String xml)
Create a new step from an XML string. |
protected void |
fireStepEnd()
|
protected void |
fireStepError()
|
protected void |
fireStepEvent(StepEvent event)
|
protected void |
fireStepEvent(java.lang.String type)
|
protected void |
fireStepEvent(java.lang.String type,
int val)
|
protected void |
fireStepFailure()
|
protected void |
fireStepProgress(int val)
|
protected void |
fireStepStart()
|
protected java.lang.String |
getAttributes()
Attributes to save in script. |
protected java.lang.String |
getContents()
Override if the step actually has some contents. |
protected abstract java.lang.String |
getDefaultDescription()
Return a reasonable default description for this script step. |
java.lang.String |
getDescription()
|
java.lang.Throwable |
getError()
|
junit.framework.AssertionFailedError |
getFailure()
|
ComponentFinder |
getFinder()
|
Resolver |
getResolver()
|
boolean |
getStopOnError()
|
boolean |
getStopOnFailure()
|
protected ComponentTester |
getTester()
|
protected abstract java.lang.String |
getUsage()
Provide a usage String for this step. |
protected abstract java.lang.String |
getXMLTag()
Define the XML tag to use for this script step. |
protected void |
parseAttributes(java.util.HashMap attributes)
|
void |
removeStepListener(StepListener sl)
|
protected java.awt.Component |
resolve(java.lang.String name)
Resolve the given name into a component. |
protected ComponentTester |
resolveTester()
Override this to provide a more specific tester. |
void |
run()
Main run method, which stores any failures or exceptions for later retrieval. |
protected abstract void |
runStep()
Main run method, which stores any failures or exceptions for later retrieval. |
void |
setDescription(java.lang.String desc)
|
protected void |
setError(java.lang.Throwable thr)
|
protected void |
setFailure(junit.framework.AssertionFailedError err)
|
void |
setStopOnError(boolean stop)
|
void |
setStopOnFailure(boolean stop)
|
protected java.lang.String |
simpleClassName(java.lang.Class cls)
|
java.lang.String |
toString()
Return a description of this script step. |
java.lang.String |
toXML()
Convert the object to XML. |
protected void |
usage()
Throw an invalid script exception describing the proper script usage. |
protected void |
usage(java.lang.String details)
Throw an invalid script exception describing the proper script usage. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String STEP_START
public static final java.lang.String STEP_PROGRESS
public static final java.lang.String STEP_END
public static final java.lang.String STEP_ERROR
public static final java.lang.String STEP_FAILURE
protected static org.apache.xerces.parsers.DOMParser parser
protected java.util.ArrayList listeners
Constructor Detail |
public Step(Resolver resolver, ComponentFinder finder, java.util.HashMap attributes)
public Step(Resolver resolver, ComponentFinder finder, java.lang.String description)
Method Detail |
protected void parseAttributes(java.util.HashMap attributes)
protected abstract void runStep() throws java.lang.Throwable
protected void clearFailures()
public void setStopOnFailure(boolean stop)
public void setStopOnError(boolean stop)
public boolean getStopOnFailure()
public boolean getStopOnError()
public void run() throws java.lang.Throwable
public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
public java.lang.Throwable getError()
protected void setError(java.lang.Throwable thr)
public junit.framework.AssertionFailedError getFailure()
protected void setFailure(junit.framework.AssertionFailedError err)
public void addStepListener(StepListener sl)
public void removeStepListener(StepListener sl)
protected void fireStepEvent(StepEvent event)
protected void fireStepEvent(java.lang.String type)
protected void fireStepEvent(java.lang.String type, int val)
protected void fireStepStart()
protected void fireStepProgress(int val)
protected void fireStepEnd()
protected void fireStepFailure()
protected void fireStepError()
protected abstract java.lang.String getXMLTag()
protected abstract java.lang.String getUsage()
protected abstract java.lang.String getDefaultDescription()
protected void usage() throws InvalidScriptException
protected void usage(java.lang.String details) throws InvalidScriptException
protected java.lang.String getAttributes()
protected java.awt.Component resolve(java.lang.String name) throws ComponentNotFoundException
protected ComponentTester resolveTester()
protected ComponentTester getTester()
public ComponentFinder getFinder()
public Resolver getResolver()
protected java.lang.String getContents()
public java.lang.String toXML()
toXML
in interface XMLifiable
public java.lang.String toString()
toString
in class java.lang.Object
public static Step createStep(Resolver resolver, ComponentFinder finder, java.lang.String xml) throws InvalidScriptException
protected static java.util.HashMap createAttributeMap(org.w3c.dom.Element el)
public static Step createStep(Resolver resolver, ComponentFinder finder, org.w3c.dom.Element el) throws InvalidScriptException
protected java.lang.String simpleClassName(java.lang.Class cls)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |