public abstract class TestStepProcessor extends SAFSProcessor
Each concrete subclass will extend this class and implement the required processComponentFunction method.
The SAFSTestRunner should expect to execute from Properties with the following settings:
Upon a valid and complete execution the SAFSTestRunner is expected to return:
Any command returning a REMOTERESULTINFO should format it in the exact manner documented in the SAFS Keyword Reference for that command. This processor will simply forward that info into the testRecordData used by the engine using this processor.
As specific commands require additional parameters they are sent as:
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
debugPrefix |
command_timeout, compname, compobj, comprec, dgcd, dgov, inst, KEY_COMPOBJ, params, resourceDetailMsg, resourceMsg, robot, secsWaitForComponent, secsWaitForWindow, solo, TAG, testObjectCache, testrunner, winname, winobj, winrec
INITIAL_CACHE_SIZE, remoteCommand, testRunner
Constructor and Description |
---|
TestStepProcessor(DSAFSTestRunner testrunner) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkParameterSize(int size,
java.util.Properties props)
To check if the parameter's size is enough.
If the parameter size if not enough, we set general error with resource message. and return false. |
protected boolean |
checkSolo(java.util.Properties props)
To check if the Solo object can be got or not.
If the Solo object can be got, we set general error with resource message. and return false. |
protected boolean |
commandNotExecuted(java.util.Properties props)
Test if the command has been executed or not.
|
java.lang.String[] |
convertCoords(java.lang.String coords)
Convert coordinates string of the formats:
"x;y"
"x,y"
"x y"
"Coords=x;y"
"Coords=x,y"
"Coords=x y"
into a java.awt.Point object.
|
protected abstract void |
processComponentFunction(java.util.Properties props)
Called internally by processProperties after the DGOV, WIN, and COMP components
have been found and are ready for action.
|
void |
processProperties(java.util.Properties props)
Implements Component Function handling initialization by first finding
the necessary Window and Component objects before routing the call to
processComponentFunction().
|
protected void |
retrieveParameters(java.util.Properties props)
Retrieve the parameters from the properties and put them in the global variable
SAFSProcessor.params The parameters are stored in a properties object, the key is: SAFSMessage.PARAM_1 SAFSMessage.PARAM_2 and so on. |
protected void |
setGeneralError3(java.util.Properties props,
ResourceMessageInfo detail)
Set a error result and send back error message as following:
Unable to perform remoteCommand on compname in winname. The parameter 'detail' of this method will contain the detail error message, and it will be also sent back |
protected void |
setGeneralErrorUnsupportedObjectType(java.util.Properties props)
Calls
SAFSProcessor.setGeneralErrorWithBundleMessage(Properties, ResourceMessageInfo, ResourceMessageInfo)
issuing the general error with the additional detail that the compobj is NOT of a supported type
for the action requested. |
protected void |
setGeneralErrorWithDetailBundle(java.util.Properties props,
ResourceMessageInfo detail)
Set a error result and send back error message as following:
winname:compname remoteCommand processed with a negative result. The parameter 'detail' of this method will contain the detail error message, and it will be also sent back |
protected void |
setGeneralSuccessWithBundle(java.util.Properties props)
Set a success result and send back success message as following:
winname:compname remoteCommand successful. |
protected void |
setGenericError(java.util.Properties props,
java.lang.String errorMsg)
Set a error result and send back error message as following:
*** ERROR *** Error Message. |
clearTestObjectCache, extractComponentProperties, getDgcd, getInstrumentation, getParams, getSecsWaitForComponent, getSecsWaitForWindow, getSolo, getTestObject, setDgcd, setGeneralErrorWithBundleMessage, setGeneralSuccessWithBundleMessage, setParams, setSecsWaitForComponent, setSecsWaitForWindow, setSolo, setTestObject
convertToKey, convertToKeys, convertToKeys, debug, getCachedItem, getStackTrace, makeUniqueCacheKey, processMessage, putCachedItem, removeCachedItem, resetExternalModeCache, setGeneralError, setGeneralError, setGeneralErrorWithSpecialInfo, setGeneralErrorWithSpecialInfo, setGeneralSuccess, setGeneralSuccess, setGeneralSuccessWithSpecialInfo, setGeneralWarningWithSpecialInfo, setRemoteCommand, stringIsMatched
public TestStepProcessor(DSAFSTestRunner testrunner)
public void processProperties(java.util.Properties props)
retrieveParameters(Properties)
to initialize SAFSProcessor.params
processProperties
in interface ProcessorInterface
processProperties
in class AbstractProcessor
ProcessorInterface.processProperties(Properties)
protected boolean commandNotExecuted(java.util.Properties props) throws ProcessorException
ProcessorException
protected void retrieveParameters(java.util.Properties props)
SAFSProcessor.params
SAFSMessage.PARAM_1
SAFSMessage.PARAM_2
props
- Properties contain the parameters sent from 'remote control side'protected boolean checkParameterSize(int size, java.util.Properties props)
size,
- int, the minimum number of parametersprops
- Properties, contains the output resultsSAFSProcessor.params
contain engough parameters.protected boolean checkSolo(java.util.Properties props)
props
- Properties, contains the output resultsSAFSProcessor.solo
is got correclty.protected void setGeneralSuccessWithBundle(java.util.Properties props)
props
- Properties, contains the output resultsprotected void setGeneralErrorWithDetailBundle(java.util.Properties props, ResourceMessageInfo detail)
props
- Properties, contains the output resultsdetail
- ResourceMessageInfo, contain the detail error message.protected void setGeneralError3(java.util.Properties props, ResourceMessageInfo detail)
props
- Properties, contains the output resultsdetail
- ResourceMessageInfo, contain the detail error message.protected void setGenericError(java.util.Properties props, java.lang.String errorMsg)
props
- Properties, contains the output resultserrorMsg
- String, the generic error message.protected void setGeneralErrorUnsupportedObjectType(java.util.Properties props)
SAFSProcessor.setGeneralErrorWithBundleMessage(Properties, ResourceMessageInfo, ResourceMessageInfo)
issuing the general error with the additional detail that the compobj is NOT of a supported type
for the action requested.props
- public java.lang.String[] convertCoords(java.lang.String coords)
Subclasses may override to convert alternative values, such as Row and Col values as is done in org.safs.rational.CFTable
coords,
- String x;y or x,y or Coords=x;y or Coords=x,yprotected abstract void processComponentFunction(java.util.Properties props)
props
- Copyright © SAS Institute. All Rights Reserved.