public class Call extends Step
<call method="..." args="..." class="...">
TAG_ACTION, TAG_APPLETVIEWER, TAG_ARCHIVE, TAG_ARGS, TAG_ASSERT, TAG_AWT, TAG_AWTTESTSCRIPT, TAG_BORDER_TITLE, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_CODE, TAG_CODEBASE, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_EXPR, TAG_FILENAME, TAG_FIXTURE, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ICON, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LABEL, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_ROOT, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_TEXT, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WEIGHTED, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y
Constructor and Description |
---|
Call(Resolver resolver,
java.util.Map attributes) |
Call(Resolver resolver,
java.lang.String description,
java.lang.String className,
java.lang.String methodName,
java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.reflect.Method |
disambiguateMethod(java.lang.reflect.Method[] methods)
Try to distinguish betwenn the given methods.
|
protected java.lang.Object |
evaluateParameter(java.lang.reflect.Method m,
java.lang.String param,
java.lang.Class type) |
protected java.lang.Object[] |
evaluateParameters(java.lang.reflect.Method m,
java.lang.String[] params)
Convert the String representation of the arguments into actual
arguments.
|
java.lang.String[] |
getArgs()
Deprecated.
use getArguments().
|
java.lang.String[] |
getArguments()
Return the arguments as an array of String.
|
protected java.lang.String |
getArgumentsDescription() |
java.util.Map |
getAttributes()
Attributes to save in script.
|
java.lang.String |
getDefaultDescription()
Return a reasonable default description for this script step.
|
java.lang.String |
getEncodedArguments()
Convert our argument vector into a single String.
|
java.lang.reflect.Method |
getMethod()
Return matching methods to be used for invocation.
|
java.lang.String |
getMethodName()
Method name to save in script.
|
protected java.lang.reflect.Method[] |
getMethods()
Return matching methods to be used for invocation.
|
protected java.lang.Object |
getTarget(java.lang.reflect.Method m)
Return the target of the invocation.
|
java.lang.Class |
getTargetClass()
Get the class of the target of the method invocation.
|
java.lang.String |
getTargetClassName() |
java.lang.String |
getUsage()
Provide a usage String for this step.
|
java.lang.String |
getXMLTag()
Define the XML tag to use for this script step.
|
protected java.lang.Object |
invoke()
Make the target method invocation.
|
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 with the requested
return type, having the number of arguments in this step.
|
protected java.lang.reflect.Method[] |
resolveMethods(java.lang.String name,
java.lang.Class cls,
java.lang.Class returnType)
Look up all methods in the given class with the given name and return
type, having the number of arguments in this step.
|
protected void |
runStep()
Implement the step's behavior here.
|
void |
setArguments(java.lang.String encodedArgs)
Designate the arguments for this Call step.
|
void |
setArguments(java.lang.String[] args)
Set the String representation of the arguments for this Call step.
|
void |
setMethodName(java.lang.String mn) |
void |
setTargetClassName(java.lang.String cn) |
addAttributes, addContent, createAttributeMap, createStep, createStep, getDescription, getResolver, parseAttributes, resolveClass, resolveTester, run, setDescription, setScriptError, simpleClassName, toEditableString, toString, toXML, toXMLString, usage, usage
public Call(Resolver resolver, java.util.Map attributes)
public Call(Resolver resolver, java.lang.String description, java.lang.String className, java.lang.String methodName, java.lang.String[] args)
public java.lang.String getDefaultDescription()
Step
getDefaultDescription
in class Step
public java.lang.String getUsage()
Step
public java.lang.String getXMLTag()
Step
public java.lang.String getEncodedArguments()
protected java.lang.String getArgumentsDescription()
public void setArguments(java.lang.String[] args)
public void setArguments(java.lang.String encodedArgs)
public void setMethodName(java.lang.String mn)
public java.lang.String getMethodName()
public java.lang.String getTargetClassName()
public void setTargetClassName(java.lang.String cn)
public java.util.Map getAttributes()
getAttributes
in class Step
public java.lang.String[] getArgs()
public java.lang.String[] getArguments()
protected void runStep() throws java.lang.Throwable
Step
protected java.lang.Object evaluateParameter(java.lang.reflect.Method m, java.lang.String param, java.lang.Class type) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object[] evaluateParameters(java.lang.reflect.Method m, java.lang.String[] params) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object invoke() throws java.lang.Throwable
evaluateParameters
to convert the String representation
of the arguments into actual arguments.
Tries all matching methods of N arguments.java.lang.Throwable
public java.lang.reflect.Method getMethod() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
protected java.lang.reflect.Method[] getMethods() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
public java.lang.Class getTargetClass() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected java.lang.Object getTarget(java.lang.reflect.Method m) throws java.lang.Throwable
java.lang.Throwable
protected java.lang.reflect.Method[] resolveMethods(java.lang.String name, java.lang.Class cls, java.lang.Class returnType) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
- if no matching method is foundgetArguments()
protected java.lang.reflect.Method resolveMethod(java.lang.String name, java.lang.Class cls, java.lang.Class returnType) throws java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
- if not exactly one match existsjava.lang.NoSuchMethodException
getArguments()
protected java.lang.reflect.Method disambiguateMethod(java.lang.reflect.Method[] methods)
java.lang.IllegalArgumentException
- indicating the appropriate target
method can't be distinguished.
Abbot is hosted on