|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.safs.jvmagent.ObjectAgent
| Field Summary | |
protected LocalAgent |
alternateAncestor
|
protected java.lang.String |
alternateAncestorClassname
AlternateAncestorUser implementation. |
protected LocalAgentFactory |
factory
LocalAgentFactoryUser implementation. |
static java.lang.String[] |
OBJECT_PROPERTIES
Array of property names specific to Object types. |
static java.lang.String |
objectType
"Object" (Subclasses will override) The generic object type supported by this Agent helper class. |
| Constructor Summary | |
ObjectAgent()
Constructor for ObjectAgent. |
|
| Method Summary | |
LocalAgent |
getAlternateAncestor()
AlternateAncestorUser interface. |
java.lang.String |
getAlternateAncestorClassname()
AlternateAncestorUser interface. |
protected LocalAgent |
getAncestorAgent()
Used internally by processAncestor and subclasses to attempt to retrieve the alternateAncestor locally or via any stored LocalAgentFactory. |
java.lang.String |
getCaption(java.lang.Object object)
Retrieve the Caption of the object if one exits. |
int |
getChildCount(java.lang.Object parent)
Return the number of children available in the provided parent. |
java.lang.Object[] |
getChildren(java.lang.Object parent)
Return an array representing the children of the provided parent object. |
java.lang.String |
getClassName(java.lang.Object object)
Return the Class name of the object. |
java.lang.String |
getID(java.lang.Object object)
Retrieve the ID of the object if the object has an ID. |
int |
getLevel(java.lang.Object object)
Return the Z-Order level of the object (generally for a top level window). |
LocalAgentFactory |
getLocalAgentFactory()
LocalAgentFactoryUser Interface. |
java.lang.Object |
getMatchingPathObject(java.lang.Object theObject,
java.lang.String thePath)
Mechanism to retrieve a subitem/object identified by the provided Path. |
java.lang.String |
getName(java.lang.Object object)
Retrieve the name of the object if the object is named. |
java.lang.String |
getProperty(java.lang.Object object,
java.lang.String property)
Retrieve the property value of the object if the object has the property. |
java.lang.String[] |
getPropertyNames(java.lang.Object object)
Retrieve the list of available properties for the object. |
java.lang.String[][] |
getStringData(java.lang.Object object,
java.lang.Object dataInfo)
Return whatever data is extractable (normally visible) from the object. |
java.lang.String[] |
getSuperClassNames(java.lang.Object object)
Return the array of all superclass names for the object. |
java.lang.String |
getText(java.lang.Object object)
Retrieve the displayed text value of the object if the object has a text value. |
boolean |
isMatchingPath(java.lang.Object theObject,
java.lang.String thePath)
Mechanism to determine if the object contains a subitem/object identified by the provided Path. |
boolean |
isShowing(java.lang.Object object)
Return true if the object is showing/visible. |
boolean |
isValid(java.lang.Object object)
Return true if the object is still valid/finadable in the JVM. |
void |
process(java.lang.Object object,
TestRecordData testRecordData)
Process the action provided in the testRecordData. |
void |
processAncestor(java.lang.Object object,
TestRecordData testRecordData)
Attempts to retrieve the alternateAncestor if defined and execute process on that. |
void |
setAlternateAncestor(LocalAgent ancestor)
AlternateAncestorUser interface. |
void |
setAlternateAncestorClassname(java.lang.String ancestorClassname)
AlternateAncestorUser interface. |
void |
setLocalAgentFactory(LocalAgentFactory factory)
LocalAgentFactoryUser Interface. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String objectType
GuiClassData.getGenericObjectType(String)public static final java.lang.String[] OBJECT_PROPERTIES
getPropertyNames(Object)protected LocalAgentFactory factory
protected java.lang.String alternateAncestorClassname
protected LocalAgent alternateAncestor
| Constructor Detail |
public ObjectAgent()
| Method Detail |
public int getChildCount(java.lang.Object parent)
LocalAgentgetChildCount in interface LocalAgentparent - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getChildCount(Object)public java.lang.Object[] getChildren(java.lang.Object parent)
LocalAgentgetChildren in interface LocalAgentparent - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getChildren(Object)public java.lang.String getCaption(java.lang.Object object)
LocalAgentgetCaption in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getCaption(Object)public java.lang.String getName(java.lang.Object object)
LocalAgentgetName in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getName(Object)public java.lang.String getID(java.lang.Object object)
LocalAgentgetID in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getID(Object)public java.lang.String getText(java.lang.Object object)
LocalAgentgetText in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getText(Object)public java.lang.String[] getPropertyNames(java.lang.Object object)
LocalAgentgetPropertyNames in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getPropertyNames(Object)
public java.lang.String getProperty(java.lang.Object object,
java.lang.String property)
throws NoSuchPropertyException
LocalAgentgetProperty in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.property - -- case-sensitive name of the property to retrieveNoSuchPropertyException - LocalAgent.getProperty(Object, String)public java.lang.String getClassName(java.lang.Object object)
LocalAgentgetClassName in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getClassName(Object)public int getLevel(java.lang.Object object)
LocalAgentgetLevel in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getLevel(Object)public boolean isShowing(java.lang.Object object)
LocalAgentisShowing in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.isShowing(Object)public boolean isValid(java.lang.Object object)
isValid in interface LocalAgentobject - An object from getTopLevelWindows or from a previous call to getChildren.public java.lang.String[] getSuperClassNames(java.lang.Object object)
LocalAgentgetSuperClassNames in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.LocalAgent.getSuperClassNames(Object)
public java.lang.Object getMatchingPathObject(java.lang.Object theObject,
java.lang.String thePath)
LocalAgentEx:
File->Exit
Root->Branch->Leaf
getMatchingPathObject in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.thePath - LocalAgent.getMatchingPathObject(Object, String)
public boolean isMatchingPath(java.lang.Object theObject,
java.lang.String thePath)
LocalAgentEx:
File->Exit
Root->Branch->Leaf
isMatchingPath in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.thePath - LocalAgent.isMatchingPath(Object, String)
public java.lang.String[][] getStringData(java.lang.Object object,
java.lang.Object dataInfo)
LocalAgentgetStringData in interface LocalAgentobject - -- the actual object or component to be checked -- not a pseudo reference.dataInfo - LocalAgent.getStringData(Object, Object)public void setLocalAgentFactory(LocalAgentFactory factory)
setLocalAgentFactory in interface LocalAgentFactoryUserpublic LocalAgentFactory getLocalAgentFactory()
getLocalAgentFactory in interface LocalAgentFactoryUserpublic LocalAgent getAlternateAncestor()
getAlternateAncestor in interface AlternateAncestorUserpublic void setAlternateAncestor(LocalAgent ancestor)
setAlternateAncestor in interface AlternateAncestorUserpublic java.lang.String getAlternateAncestorClassname()
getAlternateAncestorClassname in interface AlternateAncestorUserpublic void setAlternateAncestorClassname(java.lang.String ancestorClassname)
setAlternateAncestorClassname in interface AlternateAncestorUserprotected LocalAgent getAncestorAgent()
public void process(java.lang.Object object,
TestRecordData testRecordData)
Subclasses in the org.safs.jvmagent package should always attempt to processAncestor
if they themselves do not handle the command in the testRecordData. This is shown
below:
if (testRecordData.getStatusCode() == StatusCodes.SCRIPT_NOT_EXECUTED)
processAncestor(object, testRecordData);
Subclasses in other packages like org.safs.abbot should typically always call
super.process() if they themselves do not handle the command in the testRecordData.
This is shown below:
if (testRecordData.getStatusCode() == StatusCodes.SCRIPT_NOT_EXECUTED)
super.process(object, testRecordData);
In this way, the proper order of processing in-package classes and superclasses
is maintained.
An Agent may throw various types of Agent-specific RuntimeExceptions depending upon failure modes.
process in interface LocalAgenttestRecordData - provides all the information needed by the Agent to perform the action and
to get/set the process statuscode.
public void processAncestor(java.lang.Object object,
TestRecordData testRecordData)
processAncestor in interface AlternateAncestorUser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||