junit.extensions.awt.script
Class MethodInvocation
java.lang.Object
|
+--junit.extensions.awt.script.Step
|
+--junit.extensions.awt.script.MethodInvocation
- All Implemented Interfaces:
- Tags, XMLifiable
- Direct Known Subclasses:
- Action, Assert, Launch
- public abstract class MethodInvocation
- extends Step
Meta class for script steps that basically consist of a method
invocation. Derived classes should determine on what class the method name
should be resolved by implementing resolveMethod().
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 |
MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.util.HashMap attributes)
|
MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args)
|
MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args,
boolean thread)
|
Method Summary |
protected java.lang.String |
getArgList()
Convert our argument vector into an XML attribute. |
protected java.lang.String[] |
getArgs()
|
protected java.lang.String |
getAttributes()
Attributes to save in script. |
protected java.lang.reflect.Method |
getMethod()
Resolve the method name into an actual method. |
protected java.lang.String |
getMethodName()
Method name to save in script. |
protected boolean |
getThreadedDefault()
|
protected boolean |
isThreaded()
|
protected void |
launch()
Deferred evaluation of arguments allows us to refer to components that
don't necessarily exist when the script is read in. |
protected abstract java.lang.reflect.Method |
resolveMethod()
The implementation of this method should invoke the defined
resolveMethod with the appropriate arguments. |
protected java.lang.reflect.Method |
resolveMethod(java.lang.String name,
java.lang.Class cls,
java.lang.Class returnType)
Look up the given method name in the given class. |
protected void |
runStep()
Main run method, which stores any failures or exceptions for later
retrieval. |
Methods inherited from class junit.extensions.awt.script.Step |
addStepListener, clearFailures, createAttributeMap, createStep, createStep, fireStepEnd, fireStepError, fireStepEvent, fireStepEvent, fireStepEvent, fireStepFailure, fireStepProgress, fireStepStart, getContents, getDefaultDescription, getDescription, getError, getFailure, getFinder, getResolver, getStopOnError, getStopOnFailure, getTester, getUsage, getXMLTag, parseAttributes, removeStepListener, resolve, resolveTester, run, setDescription, setError, setFailure, setStopOnError, setStopOnFailure, simpleClassName, toString, toXML, usage, usage |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MethodInvocation
public MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.util.HashMap attributes)
throws InvalidScriptException
MethodInvocation
public MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args)
MethodInvocation
public MethodInvocation(Resolver resolver,
ComponentFinder finder,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args,
boolean thread)
getArgList
protected java.lang.String getArgList()
- Convert our argument vector into an XML attribute.
getMethodName
protected java.lang.String getMethodName()
- Method name to save in script.
getAttributes
protected java.lang.String getAttributes()
- Attributes to save in script. FIXME use a hash table
- Overrides:
getAttributes
in class Step
getThreadedDefault
protected boolean getThreadedDefault()
isThreaded
protected final boolean isThreaded()
getMethod
protected java.lang.reflect.Method getMethod()
- Resolve the method name into an actual method.
getArgs
protected java.lang.String[] getArgs()
runStep
protected void runStep()
throws java.lang.Throwable
- Description copied from class:
Step
- Main run method, which stores any failures or exceptions for later
retrieval.
- Overrides:
runStep
in class Step
launch
protected void launch()
- Deferred evaluation of arguments allows us to refer to components that
don't necessarily exist when the script is read in.
resolveMethod
protected abstract java.lang.reflect.Method resolveMethod()
- The implementation of this method should invoke the defined
resolveMethod with the appropriate arguments.
resolveMethod
protected java.lang.reflect.Method resolveMethod(java.lang.String name,
java.lang.Class cls,
java.lang.Class returnType)
- Look up the given method name in the given class.