public class DynamicEnabler
extends java.lang.Object
Essentially, we must already know a window handle, process ID, or process name before we can tell FT to inject itself into that process and enable testing. Since a testing framework that is application-independent cannot be hard-coded to know the desired processname, and cannot readily make assumptions about the correct Window handle or process ID, we are going to effectively enable as many Win32 and .NET environments as we can properly identify.
There is an issue, of course, when attempting to distribute and use this new feature in older XDE Tester and RobotJ environments that do not have this functionality. SAFS code attempting to use it must be wrapped in try\catch(Throwable) blocks because XDE Tester and RobotJ will NOT be able to properly load and initialize this class and they will issue an Error, not an Exception.
This class uses external resource files (text files) to indicate which classes running on the system are to be enabled, and which classes are to be ignored. These files do not represent an all-inclusive list and are subject to updates. There are seperate text files for Windows and Unix. These text files are:
The WindowsClassMap and WindowsIgnoreClassMap files are provided in the distributed JAR file. The Unix files are not yet distributed as their contents has not yet been deduced.
This class allows a user or tester to place an identically named resource file in the same directory where the JAR file is found and that external file will add additional mappings and ignores to those in the JAR file.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DOTNET_CLASS_MAP
"DotNetClassMap.dat"
|
static java.lang.String |
DEFAULT_SWT_CLASS_MAP
"SWTClassMap.dat"
|
static java.lang.String |
DEFAULT_UNIX_CLASS_MAP
"UnixClassMap.dat"
|
static java.lang.String |
DEFAULT_UNIX_IGNORE_CLASS_MAP
"UnixIgnoreClassMap.dat"
|
static java.lang.String |
DEFAULT_WINDOWS_CLASS_MAP
"WindowsClassMap.dat"
|
static java.lang.String |
DEFAULT_WINDOWS_IGNORE_CLASS_MAP
"WindowsIgnoreClassMap.dat"
|
(package private) static java.util.Vector |
enabledomains |
(package private) static java.util.Vector |
enablenet
.NET classes that CAN be enabled.
|
(package private) static java.util.Vector |
enableprocs
Strings.
|
(package private) static java.util.Vector |
enableswt
SWT classes that CAN be enabled.
|
(package private) static java.util.Vector |
enablewins
Window classes or processes that CAN be enabled.
|
(package private) static java.lang.String |
GENERIC_WILDCARD
"*"
|
(package private) static boolean |
ignore_classmap_read |
(package private) static java.lang.String |
ignoremap |
(package private) static java.util.Vector |
ignorewins
Window classes or processes that should be ignored.
|
(package private) static java.lang.String |
mainmap |
(package private) static boolean |
net_classmap_read |
(package private) static java.lang.String |
netmap |
(package private) static java.lang.String |
REGEX_WILDCARD
".*"
|
(package private) static com.rational.test.ft.object.interfaces.RootTestObject |
rto
FT 6.x Unique Class object for dynamic enabling
|
(package private) static boolean |
swt_classmap_read |
(package private) static java.lang.String |
swtmap |
(package private) static boolean |
win_classmap_read |
(package private) static java.util.Vector |
winenabled
Window classes or processes that HAVE already been enabled.
|
Constructor and Description |
---|
DynamicEnabler() |
Modifier and Type | Method and Description |
---|---|
static void |
addEnabledDomain(java.lang.String domainname) |
static void |
addEnabledProc(java.lang.String procname) |
static void |
clearEnabledDomains() |
static void |
clearEnabledProcs() |
static java.util.Vector |
enableNetWindows() |
static java.util.Vector |
enableSWTWindows() |
protected static int |
enableUniqueWinsWithJNA() |
static java.util.Vector |
enableWinWindows() |
static com.rational.test.ft.object.interfaces.TestObject[] |
getJNAProtectedDomainTopObjects(com.rational.test.ft.object.interfaces.DomainTestObject domain)
Calls domain.getTopObjects() ONLY if the domain's process is determined to
have active UI resources.
|
static java.util.ArrayList |
getRootTestObjectWindows(java.util.Vector classes)
Returns all found matching classes in the provided domain as an ArrayList of
TestObjects.
|
static boolean |
hasEnabledDomain() |
static boolean |
hasEnabledProc() |
static boolean |
ignoreTopWindow(java.lang.String classname)
Determine if a particular classname is one we know to ignore.
|
static boolean |
isEnabledDomain(java.lang.String domainname) |
static boolean |
isEnabledProc(java.lang.String procname) |
static boolean |
isTopParentWinFocused(Script script,
int processID)
Try to "find" the TopLevelWindow associated with a processID and return true if it is the topmost window--
the one with keyboard focus.
|
protected static void |
loadWinEnabled() |
protected static long |
simpleEnableTopWindows()
Dynamically enable all Top Windows or processes.
|
public static final java.lang.String DEFAULT_WINDOWS_CLASS_MAP
public static final java.lang.String DEFAULT_WINDOWS_IGNORE_CLASS_MAP
public static final java.lang.String DEFAULT_SWT_CLASS_MAP
public static final java.lang.String DEFAULT_DOTNET_CLASS_MAP
public static final java.lang.String DEFAULT_UNIX_CLASS_MAP
public static final java.lang.String DEFAULT_UNIX_IGNORE_CLASS_MAP
static com.rational.test.ft.object.interfaces.RootTestObject rto
static java.util.Vector ignorewins
static boolean ignore_classmap_read
static java.util.Vector enablewins
static boolean win_classmap_read
static java.util.Vector enableswt
static boolean swt_classmap_read
static java.util.Vector enablenet
static boolean net_classmap_read
static java.util.Vector winenabled
static java.lang.String swtmap
static java.lang.String mainmap
static java.lang.String netmap
static java.lang.String ignoremap
static java.util.Vector enableprocs
static java.util.Vector enabledomains
static java.lang.String REGEX_WILDCARD
static java.lang.String GENERIC_WILDCARD
public static void clearEnabledProcs()
public static void clearEnabledDomains()
public static void addEnabledProc(java.lang.String procname)
public static boolean hasEnabledProc()
public static boolean isEnabledProc(java.lang.String procname)
public static void addEnabledDomain(java.lang.String domainname)
public static boolean hasEnabledDomain()
public static boolean isEnabledDomain(java.lang.String domainname)
public static java.util.Vector enableSWTWindows()
public static java.util.Vector enableWinWindows()
public static java.util.Vector enableNetWindows()
public static java.util.ArrayList getRootTestObjectWindows(java.util.Vector classes)
classes
- domain
- public static boolean isTopParentWinFocused(Script script, int processID)
script
- processID
- RDDGUIUtilities.getParentTestObject(TestObject)
protected static void loadWinEnabled()
protected static int enableUniqueWinsWithJNA()
protected static long simpleEnableTopWindows()
#getRootTestObjectWindows(Vector, String)
,
enableprocs
public static boolean ignoreTopWindow(java.lang.String classname)
classname
- of an object found within the list of all running classes.public static com.rational.test.ft.object.interfaces.TestObject[] getJNAProtectedDomainTopObjects(com.rational.test.ft.object.interfaces.DomainTestObject domain)
domain
- Copyright © SAS Institute. All Rights Reserved.