public class JSAFSAdvancedRuntime extends DefaultDriver
SAFSROBOTJ
(IBM Rational Functional Tester) be available for demonstrating
certain command execution results. However, the sourcecode is a valuable usage reference
even if the SAFSROBOTJ engine is not available at runtime.
This class is intended to be executed as a standalone Java application--typically,
in its own JVM. The main(String[])
entry point will create a new instance and immediately invoke DefaultDriver.run()
.
Command-line Options and Configuration File Options are linked below. Custom sections
and items in associated configuration file(s) can readily be processed at runtime via
AbstractDriver.configInfo
ConfigureInterface
.
The default name of configuration files is "SAFSTID.INI". There is a hierarchy of configuration files that will be sought based on command-line parameters provided. This hierarchy is summarized in the Configuration File Options doc linked below and detailed below::
a project or test-specific config file, other than SAFSTID.INI, containing config information intended to override settings in the SAFSTID.INI file located in the PROJECT ROOT directory.
SAFSTID.INI located in the PROJECT ROOT directory. The PROJECT ROOT would normally be provided as a command-line parameter. It may instead be provided in the previous specified PROJECT config file. This file will normally contain settings specific to an entire project and these override any similar settings in the DRIVER config files.
Rarely used. A config file, other than SAFSTID.INI, intended to override settings in any SAFSTID.INI file located in the DRIVER ROOT directory.
SAFSTID.INI located in the DRIVER ROOT directory. The DRIVER ROOT would normally be provided in a previous config file or as a command-line parameter. This config file will contain configuration information that is specific to the driver and independent of any project or test being executed.
In general, you want to provide the bare minimum of command-line parameters and place all remaining info in one or more configuration files. The total of all command-line parameters and config file information must enable the driver to locate valid driver and project root directories, project subdirectories, and all other items necessary to run a specified test. See the DefaultDriver.run() link below for all the exciting things the driver will do prior to launching the test!
An example invocation, providing the bare minimum command-line parameters:
Sample JSAFSExample.INI in c:\SAFS\Project specific to one test:
[SAFS_PROJECT] ProjectRoot="C:\safs\project" [SAFS_TEST] CycleLogName="JSAFSExample" CycleLogMode="41" (or) CycleLogMode="TOOLLOG CONSOLELOG TEXTLOG" [SAFS_ENGINES] First=org.safs.tools.engines.SAFSROBOTJ [SAFS_ROBOTJ] AUTOLAUNCH=TRUE DATASTORE="C:\SAFS\DatastoreJ" TESTDOMAINS=HTML,JAVA
Sample SAFSTID.INI in c:\SAFS\Project used by all tests:
[SAFS_DRIVER] DriverRoot="C:\safs" [SAFS_MAPS] AUTOLAUNCH=TRUE [SAFS_INPUT] AUTOLAUNCH=TRUE [SAFS_VARS] AUTOLAUNCH=TRUE [SAFS_LOGS] AUTOLAUNCH=TRUE
And that is enough for us to run the Driver test.
Of course, more of the configuration parameters necessary for desired engines will have to be in those configuration files once the engines actually become available.
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
_args
Optional, command-line args exposed more globally.
|
static java.lang.String |
JSAFSRUNTIME
"JSAFSRuntime" custom Driver Name.
|
cycleLog, cycleStack, engineObjects, enginePreference, engines, safsmonitor, status, stepLog, stepStack, suiteLog, suiteStack, useSAFSMonitor
autoitcomponent, benchSource, configInfo, core, counterInfo, counts, cycleflowcontrol, cycleLinkedFac, cycleLogMode, cycleLogName, cycleSeparator, cycleSuffix, datapoolSource, debug, difSource, driverConfigPath, driverName, driverRootDir, exitCycle, exitSuite, expressionsOn, input, ipcommands, locator, logLevel, logs, logsSource, maps, millisBetweenRecords, perTableFlowControl, projectConfigPath, projectRootDir, statuscounts, stepflowcontrol, stepLinkedFac, stepLogMode, stepLogName, stepSeparator, stepSuffix, suiteflowcontrol, suiteLinkedFac, suiteLogMode, suiteLogName, suiteSeparator, suiteSuffix, testLevel, testName, testSource, tidcommands, tidcomponent, vars, verifySource
DRIVER_CONTROL_POF_VAR, DRIVER_CONTROL_POW_VAR, DRIVER_CONTROL_VAR
Constructor and Description |
---|
JSAFSAdvancedRuntime()
Default constructor using "JSAFSRuntime" Driver name.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getAppMapItem(java.lang.String mapname,
java.lang.String section,
java.lang.String item)
Convenience routine to get a value out of an app map.
|
protected TestRecordHelper |
initTestRecordData(TestRecordHelper store)
Convienience (re)initializer for a TestRecordHelper.
|
static void |
main(java.lang.String[] args)
Entry point for standalone Java execution.
|
protected StatusInterface |
processTest()
This is where the Driver developer implements the application-specific test!
|
protected void |
validateTestParameters()
Empty routine overrides superclass
DefaultDriver.validateTestParameters()
No initialization validation required for this sample advanced runtime. |
clearEnginePreferences, closeTestLogs, endEnginePreference, getEngineInterface, getEnginePreferences, getEngines, getFullEngineClass, getGenericInterface, getLogID, getPreferredEngine, getPreferredEngineIndex, getTestLevelSeparator, hasEnginePreferences, initializeMiscConfigInfo, initializePresetVariables, initializeRuntimeEngines, initializeRuntimeInterface, initLog, insertConfigureInterfaceSource, isPreferredEngine, isPreferredEngine, isUseSAFSMonitor, launchSAFSMonitor, openTestLogs, parseLogMode, run, setUseSAFSMonitor, shutdownRuntimeEngines, shutdownRuntimeInterface, startEnginePreference, validateLogParameters
addConfigureInterfaceSource, addStatusCounts, getAutoItComponentSupport, getBenchDir, getConfigureInterface, getConfigureLocator, getCoreInterface, getCountersInterface, getCycleLogMode, getCycleLogName, getCycleSeparator, getCycleSuffix, getDatapoolDir, getDebugInterface, getDifDir, getDriverName, getDriverRootDir, getFlowControlInterface, getInputInterface, getIPDriverCommands, getLogLevel, getLogsDir, getLogsInterface, getMapsInterface, getMillisBetweenRecords, getParameterValue, getProjectDirectoryInfo, getProjectRootDir, getRootDirectoryInfo, getRootVerifyDir, getStatusInterface, getStepLogMode, getStepLogName, getStepSeparator, getStepSuffix, getSuiteLogMode, getSuiteLogName, getSuiteSeparator, getSuiteSuffix, getTestDir, getTestLevel, getTestName, getTIDDriverCommands, getTIDGUIlessComponentSupport, getVarsInterface, incrementGeneralStatus, incrementTestStatus, isExitCycle, isExitSuite, isExpressionsEnabled, isModifiedConfig, isModifiedRoot, isPerTableFlowControl, logMessage, processEmbeddedVariable, resetModifiedProperties, setBenchDir, setDatapoolDir, setDifDir, setExitCycle, setExitSuite, setExpressionsEnabled, setLogsDir, setMillisBetweenRecords, setPerTableFlowControl, setProjectRootDir, setRootVerifyDir, setTestDir, validateRootConfigureParameters
public static final java.lang.String JSAFSRUNTIME
public static java.lang.String[] _args
public JSAFSAdvancedRuntime()
DefaultDriver.run()
is invoked.protected void validateTestParameters()
DefaultDriver.validateTestParameters()
No initialization validation required for this sample advanced runtime.
Superclass MUST be overridden or invalid/missing test table information
will cause the test initialization to fail and abort the test.validateTestParameters
in class DefaultDriver
protected TestRecordHelper initTestRecordData(TestRecordHelper store)
Instantiates and\or reinits a TestRecordHelper
and initializes key properties:
DriverConstant.STATUS_SCRIPT_NOT_EXECUTED
store
- - A TestRecordHelper to reinitialize or null to get a new one initialized.TestRecordData.reinit();
protected java.lang.String getAppMapItem(java.lang.String mapname, java.lang.String section, java.lang.String item)
mapname
- Name\ID of App Map to use. If null, use default map.section
- Named Section of App Map to search. If null, use default section.item
- Name of item in section to lookup.protected StatusInterface processTest()
Here you can invoke any test setup that might have to occur after standard SAFS initialization. That would be followed by the actual test code including:
AbstractDriver.configInfo
ConfigureInterface
StatusCounter
AbstractDriver.logs
LogsInterface
GENStrings
and FAILStrings
.Log
AbstractDriver.vars
VarsInterface
AbstractDriver.maps
MapsInterface
AbstractDriver.maps
MapsInterface
InputProcessor
EngineInterface
DefaultDriver.engineObjects
via DefaultDriver.getPreferredEngine(String)
STAFHelper
When this function returns, standard SAFS test shutdown will commence including the closing of all logs, engines, and STAF--as appropriate.
processTest
in class AbstractDriver
AbstractDriver.processTest()
public static void main(java.lang.String[] args)
Instances a new driver object and immediately executes run() for standard SAFS initialization.
The developer overrides processTest()
to proceed with any additional non-SAFS test setup,
execution, and non-SAFS teardown.
SAFS shutdown including engine and log closures will happen automatically after processTest()
returns to the DefaultDriver.run()
function that invoked it.
Copyright © SAS Institute. All Rights Reserved.