public class Action extends Call
<action method="..." args="...">
<action method="..." args="component_id[,...]" class="...">
An Action reproduces a user semantic action (such as a mouse click, menu
selection, or drag/drop action) on a particular component. The id of the
component being operated on must be the first argument, and the class of
that component must be identified by the class tag if the action is not
provided by the base ComponentTester
classNote that the method name is the name of the actionXXX method, e.g. to click a button (actionClick on AbstractButtonTester), the XML would appear thus:
<action method="actionClick" args="My Button" class=javax.swing.AbstractButton>
Note that if the first argument is a Component, the class tag is required.
Note also that the specified class is the tested class, not the
target class for the method invocation.
The target class for the method invocation is always a ComponentTester-derived 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 |
---|
Action(Resolver resolver,
java.util.Map attributes) |
Action(Resolver resolver,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args)
Action for a method in the ComponentTester base class.
|
Action(Resolver resolver,
java.lang.String description,
java.lang.String methodName,
java.lang.String[] args,
java.lang.Class targetClass) |
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)
Convert the String representation of the arguments into actual
arguments.
|
java.util.Map |
getAttributes()
Return custom attributes for an Action.
|
java.lang.String |
getDefaultDescription()
Return a default description for this action.
|
java.lang.reflect.Method |
getMethod()
Resolve the method name into its final form.
|
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 |
getUsage()
Return the proper XML usage for this step.
|
java.lang.String |
getXMLTag()
Return the XML tag for this step.
|
protected java.lang.reflect.Method[] |
resolveMethods(java.lang.String name,
java.lang.Class cls,
java.lang.Class returnType)
Remove deprecated methods from those looked up.
|
void |
setTargetClassName(java.lang.String cn)
Ensure the default class name is DEFAULT_CLASS_NAME
The target class must be a subclass of java.awt.Component.
|
evaluateParameters, getArgs, getArguments, getArgumentsDescription, getEncodedArguments, getMethodName, getMethods, getTargetClassName, invoke, resolveMethod, runStep, setArguments, setArguments, setMethodName
addAttributes, addContent, createAttributeMap, createStep, createStep, getDescription, getResolver, parseAttributes, resolveClass, resolveTester, run, setDescription, setScriptError, simpleClassName, toEditableString, toString, toXML, toXMLString, usage, usage
public Action(Resolver resolver, java.util.Map attributes)
public Action(Resolver resolver, java.lang.String description, java.lang.String methodName, java.lang.String[] args)
public Action(Resolver resolver, java.lang.String description, java.lang.String methodName, java.lang.String[] args, java.lang.Class targetClass)
public void setTargetClassName(java.lang.String cn)
setTargetClassName
in class Call
public java.lang.String getXMLTag()
public java.util.Map getAttributes()
getAttributes
in class Call
public java.lang.String getUsage()
public java.lang.String getDefaultDescription()
getDefaultDescription
in class Call
public java.lang.Class getTargetClass() throws java.lang.ClassNotFoundException
Call
getTargetClass
in class Call
java.lang.ClassNotFoundException
protected java.lang.Object evaluateParameter(java.lang.reflect.Method m, java.lang.String param, java.lang.Class type) throws java.lang.Exception
evaluateParameter
in class Call
java.lang.Exception
protected java.lang.Object getTarget(java.lang.reflect.Method m) throws java.lang.ClassNotFoundException
protected java.lang.reflect.Method[] resolveMethods(java.lang.String name, java.lang.Class cls, java.lang.Class returnType) throws java.lang.NoSuchMethodException
resolveMethods
in class Call
java.lang.NoSuchMethodException
- if no matching method is foundCall.getArguments()
public java.lang.reflect.Method getMethod() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
protected java.lang.reflect.Method disambiguateMethod(java.lang.reflect.Method[] methods)
Call
disambiguateMethod
in class Call
Abbot is hosted on