public abstract class DDGUIUtilities extends STAFRequester
DDGUIUtilities handles interfacing to the text-based App Map files handled by SAFSMAPS. When doing this, it also forms a cache of all App Maps referenced AND the objects or items retrieved from those App Maps. These are all handled and stored in ApplicationMap objects and their subclasses.
For example, a Rational subclass for ApplicationMap would use the basic interface to lookup object recognition strings, but then would extend that functionality to actually store tool-dependent TestObject references in the RApplicationMap objects stored in this DDGUIUtilities.
As a subclass of STAFRequester, this class is expecting an implementation specific subclass to instantiate and provide a valid STAFHelper object.
Modifier and Type | Field and Description |
---|---|
protected static java.util.Hashtable |
appmaps
The storage of all ApplicationMaps ever opened or registered thru this
class.
|
protected static int |
DEBUG_MESSAGE
Convenience for local referencing instead of referencing AbstractLogFacility.
|
protected static int |
FAILED_MESSAGE
Log MessageType for local referencing.
|
protected static int |
FAILED_OK_MESSAGE
Log MessageType for local referencing.
|
protected static int |
GENERIC_MESSAGE
Convenience for local referencing instead of referencing AbstractLogFacility.
|
protected LogUtilities |
log |
protected static int |
PASSED_MESSAGE
Log MessageType for local referencing.
|
protected TestRecordData |
trdata |
protected static int |
WARNING_MESSAGE
Log MessageType for local referencing.
|
protected static int |
WARNING_OK_MESSAGE
Log MessageType for local referencing.
|
staf
Constructor and Description |
---|
DDGUIUtilities() |
Modifier and Type | Method and Description |
---|---|
void |
clearAllAppMapCaches()
clear all known local App Maps' caches.
|
void |
clearAppMapCache(java.lang.String mapname)
clear a single local App Map cache of all old references.
|
protected ApplicationMap |
createAppMapInstance(java.lang.String mapname)
Create an ApplicationMap instance.
|
abstract java.util.List |
extractListItems(java.lang.Object obj,
java.lang.String countProp,
java.lang.String itemProp)
Extract items from a List or Array type of object property.
|
abstract Tree |
extractMenuBarItems(java.lang.Object obj)
Extract a menu hierarchy from a MenuBar pseudo-object reference.
|
abstract Tree |
extractMenuItems(java.lang.Object obj)
Extract a menu hierarchy from a object.
|
abstract java.lang.Object |
findPropertyMatchedChild(java.lang.Object obj,
java.lang.String property,
java.lang.String bench,
boolean exactMatch)
Attempt to locate a child object based on a matching property value.
|
protected ApplicationMap |
getAppMap(java.lang.String mapname)
Retrieve a named ApplicationMap object from storage.
|
abstract java.lang.String |
getListItem(java.lang.Object obj,
int i,
java.lang.String itemProp)
Get a single list item from a List or Array type of object property.
|
LogUtilities |
getLogUtilities() |
TestRecordData |
getTestRecordData() |
boolean |
isAppMapRegistered(java.lang.String mapname)
Checks for an ApplicationMap object stored with the given name.
|
boolean |
openAppMap(java.lang.String mapname,
java.lang.String mapfile)
Attempts to open an ApplicationMap file via the SAFSMAPS service in STAF.
|
protected void |
registerAppMap(java.lang.String mapname,
ApplicationMap map)
Store a named AppMap that has been successfully opened or found already
opened.
|
boolean |
registerAppMap(java.lang.String mapname,
java.lang.String mapfile)
Store a named AppMap that has been successfully opened or found already
opened.
|
abstract int |
setActiveWindow(java.lang.String appMapName,
java.lang.String windowName,
java.lang.String compName)
"Activate" the specified component's topmost parent.
|
void |
setLogUtilities(LogUtilities log)
A one-time setting of the LogUtilities to be used by this instance.
|
void |
setTestRecordData(TestRecordData trdata)
A one-time setting of the RTestRecordData to be used by this instance.
|
abstract int |
waitForObject(java.lang.String appMapName,
java.lang.String windowName,
java.lang.String compName,
long secTimeout)
Wait up to a maximum timeout value for the specified component to "exist".
|
getSTAFHelper, setSTAFHelper
protected static java.util.Hashtable appmaps
protected static final int DEBUG_MESSAGE
protected static final int GENERIC_MESSAGE
protected static final int FAILED_MESSAGE
protected static final int FAILED_OK_MESSAGE
protected static final int PASSED_MESSAGE
protected static final int WARNING_MESSAGE
protected static final int WARNING_OK_MESSAGE
protected TestRecordData trdata
protected LogUtilities log
protected ApplicationMap getAppMap(java.lang.String mapname)
The retrieved ApplicationMap may have to be cast to the appropriate ApplicationMap subclass. For example RApplicationMap for Rational.
mapname
- -- the name by which the ApplicationMap will be known.
protected ApplicationMap createAppMapInstance(java.lang.String mapname)
protected void registerAppMap(java.lang.String mapname, ApplicationMap map)
mapname
- -- the name by which the ApplicationMap will be known.
map
- -- the ApplicationMap to store with the given mapname.public boolean registerAppMap(java.lang.String mapname, java.lang.String mapfile)
mapname
- -- the name by which the ApplicationMap will be known.
mapfile
- -- the ApplicationMap to store with the given mapname.public boolean isAppMapRegistered(java.lang.String mapname)
mapname
- -- the name for the AppMap
public boolean openAppMap(java.lang.String mapname, java.lang.String mapfile)
The routine will NOT call STAF to open the file if an ApplicationMap object is already registered for a map with the given name.
mapname
- -- the name for the AppMap
mapfile
- -- the AppMap file to open. May be a full or relative path
depending upon how SAFSMAPS is configured. If the mapfile
value is null, then we will attempt to use the mapname as
the filename.
public void clearAppMapCache(java.lang.String mapname)
mapname
- of the App Map to clearpublic void clearAllAppMapCaches()
public abstract int waitForObject(java.lang.String appMapName, java.lang.String windowName, java.lang.String compName, long secTimeout) throws SAFSObjectNotFoundException, SAFSException
appMapName
- name of AppMap used to lookup component.windowName
- name of Window in AppMap.compName
- name of Window Component in AppMap.
If the Window IS the desired Component, then both windowName
and compName will be the same.secTimeout
- maximum wait in secondsSAFSObjectNotFoundException
- if the component or its parent cannot be found.SAFSException
- if some other problems occur, public abstract int setActiveWindow(java.lang.String appMapName, java.lang.String windowName, java.lang.String compName) throws SAFSObjectNotFoundException
appMapName
- name of AppMap used to lookup component.windowName
- name of Window in AppMap.compName
- name of Window Component in AppMap.
If the Window IS the desired Component, then both windowName
and compName will be the same.SAFSObjectNotFoundException
- if the component or its parent cannot be found.public abstract java.lang.Object findPropertyMatchedChild(java.lang.Object obj, java.lang.String property, java.lang.String bench, boolean exactMatch) throws SAFSObjectNotFoundException
obj
- -- the pseudo-object reference whose children will be evaluated.
property
- -- the property of each child that will be evaluated. The property is
expected to be one that can successfully return a value
cast as type String.
bench
- -- the benchmark value for the property to be used in comparisons.
exactMatch
- -- if true, an exact case-sensitive match of the bench value
provided is required to signal a match.SAFSObjectNotFoundException
- if no matching child object is found.
StringUtils.isCaseContainsMatch(String,String,boolean)
public abstract java.util.List extractListItems(java.lang.Object obj, java.lang.String countProp, java.lang.String itemProp) throws SAFSException
obj,
- pseudo-object identifying object to extract from.countProp,
- String, the property which will contain an Integer count of itemsitemProp,
- String, the property which will contain the List or Array of itemsSAFSException
public abstract java.lang.String getListItem(java.lang.Object obj, int i, java.lang.String itemProp) throws SAFSException
obj,
- pseudo-object identifying object to extract from.i,
- int, index into object list or array.itemProp,
- String, the property which will contain the List or Array of itemsSAFSException
public abstract Tree extractMenuBarItems(java.lang.Object obj) throws SAFSException
obj,
- pseudo-object referenceSAFSException
public abstract Tree extractMenuItems(java.lang.Object obj) throws SAFSException
obj,
- pseudo-object referenceSAFSException
public void setTestRecordData(TestRecordData trdata)
public TestRecordData getTestRecordData()
public void setLogUtilities(LogUtilities log)
public LogUtilities getLogUtilities()
Copyright © SAS Institute. All Rights Reserved.