org.safs.rational
Class RApplicationMap

java.lang.Object
  extended by org.safs.STAFRequester
      extended by org.safs.ApplicationMap
          extended by org.safs.rational.RApplicationMap

public class RApplicationMap
extends ApplicationMap

Extends org.safs.ApplicationMap to use Rational specific mechanisms for locating objects in the tested Application.

Creates a SingletonSTAFHelper to satisfy the STAFHelper requirements of the ApplicationMap superclass if it has not already been created.

Since:
JUN 26, 2003

Field Summary
 
Fields inherited from class org.safs.ApplicationMap
mapname
 
Fields inherited from class org.safs.STAFRequester
staf
 
Constructor Summary
RApplicationMap(java.lang.String mapname, Script script)
          Creates a RApplicationMap handler with the necessary name and RobotJ object.
 
Method Summary
 TestObject findChild(TestObject parent, java.lang.String childPath)
          Find children from parent object.
 TestObject findMappedChild(java.lang.String windowName, java.lang.String childName, boolean ignoreCache, java.util.List gather)
          Attempts to provide the RobotJ TestObject matching the named references.
 TestObject findMappedChild(java.lang.String windowName, java.lang.String wildcardChildName, java.lang.String nameString)
          Attempts to provide the RobotJ TestObject matching the named references.
 TestObject findMappedParent(java.lang.String windowName, boolean ignoreCache)
          Attempts to provide the RobotJ TestObject matching the named references.
 TestObject findParent(java.lang.String windowName)
          Find parent from the root object.
 TestObject getChildTestObject(java.lang.String windowName, java.lang.String childName, boolean ignoreCache)
          Retrieves the object stored for the given window's child.
 TestObject getParentTestObject(java.lang.String windowName, boolean ignoreCache)
          Retrieves the actual Object for the given windowName.
static boolean isGUIIDDynamic(java.lang.String recognition)
          Override superclass static method.
 
Methods inherited from class org.safs.ApplicationMap
clearMap, extractTaggedGUIID, getChildGUIID, getChildGUIID, getChildObject, getMapName, getParentGUIID, getParentGUIID, getParentObject, setChildObject, setParentObject
 
Methods inherited from class org.safs.STAFRequester
getSTAFHelper, setSTAFHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RApplicationMap

public RApplicationMap(java.lang.String mapname,
                       Script script)
Creates a RApplicationMap handler with the necessary name and RobotJ object. This may also create our inherited STAF handle with the SingletonSTAFHelper.

Parameters:
mapname - the name of the map. This should be identical to the name of an AppMap handled by the SAFSMAPS service.

script - the RobotJ script object needed for RobotJ API calls.
Method Detail

getParentTestObject

public TestObject getParentTestObject(java.lang.String windowName,
                                      boolean ignoreCache)
Retrieves the actual Object for the given windowName. Looks in the internal ApplicationMap cache first. Then attempts to find this in the Script's Object Map. This command will NOT attempt to traverse the object hierarchy to locate an object.

Parameters:
windowName - the name of the parent object stored in the AppMap.

ignoreCache - will ignore the cached TestObject, and refind it if true.
Returns:
TestObject the parent object if found, or null.

getChildTestObject

public TestObject getChildTestObject(java.lang.String windowName,
                                     java.lang.String childName,
                                     boolean ignoreCache)
Retrieves the object stored for the given window's child. Looks in the internal ApplicationMap cache first. Then attempts to find this in the Script's Object Map. This command will NOT attempt to traverse the object hierarchy to locate an object.

Parameters:
windowName - the name of the parent as stored in the AppMap.

childName - the name of the parent's child.

ignoreCache - will ignore the cached TestObject, and refind it if true.
Returns:
TestObject the object if found, or null.

isGUIIDDynamic

public static boolean isGUIIDDynamic(java.lang.String recognition)
Override superclass static method. Returns true if Mapped Test Object used.

Parameters:
recognition -
Returns:
true if the recognition is found to be a mappedTestObject.

findMappedParent

public TestObject findMappedParent(java.lang.String windowName,
                                   boolean ignoreCache)
Attempts to provide the RobotJ TestObject matching the named references. This is a workhorse routine that finds our objects for testing. The routine will interrogate any Object Map in use by RobotJ. It will check for previously stored objects in our local storage. And, if all else fails, it will attempt to locate the object using the recognition strings stored in the associated SAFS AppMap file handled by the SAFSMAPS service in STAF.

WIN domains are handled last so that the other domains have a chance to locate their objects before the more generic WIN domain processes them.

Parameters:
windowName - the name of the parent window to retrieve.

ignoreCache - will ignore the cached TestObject, and refind it if true.

Returns:
the corresponding TestObject, or null if not found or an error occurs.

findMappedChild

public TestObject findMappedChild(java.lang.String windowName,
                                  java.lang.String childName,
                                  boolean ignoreCache,
                                  java.util.List gather)
Attempts to provide the RobotJ TestObject matching the named references. This is the workhorse routine that provides our objects for testing. The routine will interrogate any Object Map in use by RobotJ. It will check for previously stored objects in our local storage. And, if all else fails, it will attempt to locate the object using the recognition strings stored in the associated SAFS AppMap file handled by the SAFSMAPS service in STAF.

Parameters:
windowName - the name of the parent window to search.

childName - the name of the parent's child to find. This value should be identical to windowName if it is the window itself that we are seeking.

ignoreCache - will ignore the cached TestObject, and refind it if true.
gather, - List containing names matched, if null, then match first name
Returns:
the corresponding TestObject, or null if not found or an error occurs.

findMappedChild

public TestObject findMappedChild(java.lang.String windowName,
                                  java.lang.String wildcardChildName,
                                  java.lang.String nameString)
Attempts to provide the RobotJ TestObject matching the named references. This is the workhorse routine that provides our objects for testing. The routine will interrogate any Object Map in use by RobotJ. It will check for previously stored objects in our local storage. And, if all else fails, it will attempt to locate the object using the recognition strings stored in the associated SAFS AppMap file handled by the SAFSMAPS service in STAF.

Parameters:
windowName - the name of the parent window to search.

wildcardChildName - the name of the wildcard parent's child to find. It should have an appmap entry which ends with Name=* The 'nameString' value will be replaced for the *

nameString, - name of the actual component, (childName should end in Name=*)

Returns:
the corresponding TestObject, or null if not found or an error occurs.

findParent

public TestObject findParent(java.lang.String windowName)
Find parent from the root object. Use RFT find API to find main window. The search at "atChild()" since it likely direct child of the root object. The routine supports additional parent;\\;child information in the recognition string. If present, the routine will assume an FPSM (Full Path Search Mode) for the hierarchy and use atChild()--direct child--for the find() call.

Parameters:
windowProp - window path
Returns:
TestObject or null

findChild

public TestObject findChild(TestObject parent,
                            java.lang.String childPath)
Find children from parent object.

Parameters:
parent - - parent object
childPath - - child path (child window recognition string)
Returns:
TestObject or null