public class IJavaHook extends JavaHook
The STAF name predefined for this IOS Engine is "SAFS/IOS".
As of this writing, this hook uses standard org.safs.LogUtilities.
The SAFS/IOS engine does require IOS-specific implementations of
If the engine is being launched manually or via a batch file or script then the following Java System property MUST be set on the Java command line:
testpath is the file path to the test configuration INI file,
projectpath is the file path to the project configuration INI file,
driverpath is the file path to the SAFS driver configuration INI file.
-Dsafs.config.paths=<testpath>:<projectpath>:<driverpath> Example: -Dsafs.config.paths=/Library/safs/Project/iostest.ini:/Library/safs/Project/safstid.ini:/Library/safs/safstid.ini
At least one INI file path must be specified or the engine will abort due to insufficient configuration information being provided.
The configuration file(s) must minimally provide the following information:
The configuration file(s) can also provide the following:
The configuration file(s) can optionally also contain other relevant information as described in the SAFSIOS Java Engine. Also see SAFSTID Config Files for more information.
Assuming everything is properly CLASSPATHed and the config file(s) have proper settings then the Engine can then be launched with:
java -Dsafs.config.paths=<paths> org.safs.ios.IJavaHook
SeleniumGUIUtilities
,
STestRecordHelper
,
JVMAgentTestStepProcessor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IOS_COMMANDS
Our predefined STAF process name: "SAFS/IOS"
|
data, DEBUG_MESSAGE, errorText, FAILED_MESSAGE, FAILED_OK_MESSAGE, GENERIC_ERROR, GENERIC_MESSAGE, helper, hookconfig, log, PASSED_MESSAGE, PAUSE_EXECUTION, PAUSE_SWITCH_OFF, PAUSE_SWITCH_ON, process_name, processor, REQUEST_PROCEED_TESTING, REQUEST_USER_STOPPED_SCRIPT_REQUEST, RUNNING_EXECUTION, semaphore_name, SHUTDOWN_RECORD, STAF_ERROR, STEP_EXECUTION, STEP_RETRY_EXECUTION, STEPPING_EXECUTION, STEPPING_RETRY_EXECUTION, trd_name, utils, WARNING_MESSAGE, WARNING_OK_MESSAGE
Constructor and Description |
---|
IJavaHook()
No-arg constructor for IJavaHook
Simply calls the super()
|
IJavaHook(java.lang.String process_name)
Constructor for IJavaHook
Simply calls super(process_name)
|
IJavaHook(java.lang.String process_name,
LogUtilities logs)
Constructor for IJavaHook
Simply calls super(process_name, logs)
|
IJavaHook(java.lang.String process_name,
java.lang.String trd_name)
Constructor for IJavaHook
Simply calls super(process_name, trd_name)
|
IJavaHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs)
Constructor for IavaHook
Simply calls super(process_name, trd_name, logs)
|
IJavaHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs,
TestRecordHelper trd_data,
DDGUIUtilities gui_utils,
ProcessRequest aprocessor)
Advanced Constructor for IJavaHook.
|
Modifier and Type | Method and Description |
---|---|
DDGUIUtilities |
getGUIUtilities()
Use this method to retrieve/create the current/default DDGUIUtilities instance.
|
LogUtilities |
getLogUtilities()
Use this method to retrieve/create the current/default LogUtilities instance.
|
ProcessRequest |
getRequestProcessor()
Use this method to retrieve/create the current/default ProcessRequest instance.
|
TestRecordHelper |
getTRDData()
Use this method to retrieve/create the current/default TestRecordHelper instance.
|
protected boolean |
hook_shutdown()
Perform final hook shutdown activities.
|
static void |
main(java.lang.String[] args)
Launches a default instance of the SAFS/IOS engine.
|
void |
start()
Insert this SAFS Engine hook into the STAF system.
|
void |
stopJavaHOOK()
Used by SPC to imitate sending a SHUTDOWN_RECORD to JavaHook
who is waiting in getNextHookTestEvent() for a record-dispatched event. |
allowSystemExit, checkConfiguration, driverShutdownRequest, evaluateRuntimeException, getHelper, getProcessName, getSemaphoreName, getTRDName, initConfigPaths, instantiateHookConfig, setGUIUtilities, setHelper, setLogUtilities, setProcessName, setRequestProcessor, setSemaphoreName, setTRDData, setTRDName
public static final java.lang.String IOS_COMMANDS
public IJavaHook()
public IJavaHook(java.lang.String process_name)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/IOS".public IJavaHook(java.lang.String process_name, LogUtilities logs)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/IOS".logs
- the LogUtilities to be used by the Engine. Currently we can
use the default org.safs.LogUtilitiesorg.safs.LogUtilites
public IJavaHook(java.lang.String process_name, java.lang.String trd_name)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/IOS".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.STAFHelper.SAFS_HOOK_TRD
public IJavaHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/IOS".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.logs
- the LogUtilities to be used by the Engine. Currently we can
use the default org.safs.LogUtilitiesSTAFHelper.SAFS_HOOK_TRD
,
org.safs.LogUtilites
public IJavaHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs, TestRecordHelper trd_data, DDGUIUtilities gui_utils, ProcessRequest aprocessor)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/IOS".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.logs
- the LogUtilities to be used by the Engine.trd_data
- -- ITestRecordHelper to hold TestRecordData.
The IOS engine expects an instance of ITestRecordHelper.gui_utils
- -- IGuiUtilities the hook will use for handling components.
The IOS engine expects an instance of IGUIUtilities.aprocessor
- -- ProcessRequest object the hook will use for routing records.
The IOS engine uses the standard ProcessRequest class and a standard TestStepProcessor.STAFHelper.SAFS_HOOK_TRD
,
org.safs.LogUtilites
,
ITestRecordHelper
,
IGUIUtilities
,
ProcessRequest
,
TestStepProcessor
public TestRecordHelper getTRDData()
Note that there is a known circular execution between getTRDData and getGUIUtilities if neither was previously set. Each routine calls the other which may result in a second call to the other. This has not been a problem.
getTRDData
in class JavaHook
ITestRecordHelper
,
JavaHook.getHelper()
,
getGUIUtilities()
,
JavaHook.getTRDData()
public DDGUIUtilities getGUIUtilities()
Note that there is a known circular execution between getTRDData and getGUIUtilities if neither was previously set. Each routine calls the other which may result in a second call to the other. This has not been a problem.
getGUIUtilities
in class JavaHook
JavaHook.getGUIUtilities()
,
JavaHook.getHelper()
,
getTRDData()
,
IGUIUtilities
public LogUtilities getLogUtilities()
getLogUtilities
in class JavaHook
JavaHook.getLogUtilities()
,
org.safs.LogUtilities
public ProcessRequest getRequestProcessor()
Note that the call to getTRDData() may force the instantiation of the default ITestRecordHelper if one has not already been set. A call to getLogUtilities() may also force the instantiation of the default LogUtilities if one has not already been set.
getRequestProcessor
in class JavaHook
JavaHook.getRequestProcessor()
,
ProcessRequest
,
STestRecordHelper
,
getTRDData()
,
getLogUtilities()
,
org.safs.LogUtilities
,
IDriverCommand
,
ITestStepProcessor
public void stopJavaHOOK()
protected boolean hook_shutdown()
hook_shutdown
in class JavaHook
JavaHook.hook_shutdown()
,
JavaHook.allowSystemExit()
public void start()
public static void main(java.lang.String[] args)
Assuming everything is properly CLASSPATHed, the default SAFS/Selenium Engine can be launched simply with:
Copyright © SAS Institute. All Rights Reserved.