public class SAFSProcessor extends AbstractProcessor
26 APR, 2012 (LeiWang) Add 2 methods to return the embedded Solo object and Instrumentation object.
07 FEB, 2013 (LeiWang) Move initialization of DGuiClassData to method DSAFSTestRunner.beforeStart()
.
19 APR, 2013 (LeiWang) Add cache to store testObject by windowName and componentName.
Modifier and Type | Field and Description |
---|---|
protected static int |
command_timeout |
protected static java.lang.String |
compname |
protected static java.lang.Object |
compobj |
protected static java.lang.String |
comprec |
protected static DGuiClassData |
dgcd |
protected static DGuiObjectVector |
dgov |
protected android.app.Instrumentation |
inst
ints is the Instrumentation object embedded in testrunner
it will be used to do the real automation work
Instrumentation object is provided by Android
|
protected static java.lang.String |
KEY_COMPOBJ
KEY used in the Properties object passed between processors.
|
protected java.util.Collection<java.lang.String> |
params
params contain the parameters of the keyword to be processed
|
protected ResourceMessageInfo |
resourceDetailMsg
resourceMsg is used to contain information of NLS detail message in resource bundle
|
protected ResourceMessageInfo |
resourceMsg
resourceMsg is used to contain information of NLS message in resource bundle
|
protected SAFSRobot |
robot |
protected static int |
secsWaitForComponent |
protected static int |
secsWaitForWindow |
protected com.robotium.solo.Solo |
solo
solo is the Solo object embedded in testrunner
it will be used to do the real automation work
Solo object is provided by Robotium
|
static java.lang.String |
TAG |
protected static java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.Object>> |
testObjectCache
local cache for containing the test objects.
|
protected DSAFSTestRunner |
testrunner
A 2nd field of superClass testRunner cast here to type DSAFSTestRunner for convenience.
|
protected static java.lang.String |
winname |
protected static java.lang.Object |
winobj |
protected static java.lang.String |
winrec |
INITIAL_CACHE_SIZE, remoteCommand, testRunner
Constructor and Description |
---|
SAFSProcessor(DSAFSTestRunner testrunner) |
Modifier and Type | Method and Description |
---|---|
void |
clearTestObjectCache() |
protected boolean |
extractComponentProperties(java.util.Properties props)
Load our local component name and recognition static fields with the
property string values from:
|
static DGuiClassData |
getDgcd() |
android.app.Instrumentation |
getInstrumentation()
The field
testrunner is the Instrumentation object.The Instrumentation object can be used to do the automation directly on Android GUI object. |
java.util.Collection<java.lang.String> |
getParams() |
static int |
getSecsWaitForComponent() |
static int |
getSecsWaitForWindow() |
com.robotium.solo.Solo |
getSolo()
Return the Solo object contained in
testrunner Attention: Only after the method RobotiumTestRunner.launchApplication() has beencalled, the Solo object can be initialized. Before, the Solo object is null. |
java.lang.Object |
getTestObject(java.lang.String windowName,
java.lang.String componentName)
According to windowName and componentName, try to get the testObject
from the cache. |
static void |
setDgcd(DGuiClassData dgcd) |
protected void |
setGeneralErrorWithBundleMessage(java.util.Properties props,
ResourceMessageInfo message,
ResourceMessageInfo detailMessage)
set the isremoteresult to "true"
set the remoteresultcode to a constant code Message.STATUS_REMOTERESULT_FAIL_STRING Note: This method will concatenate AbstractProcessor.remoteCommand with 'resultInfo', then with SoloMessage.RESULT_INFO_GENERAL_FAIL and set this string to remoteresultinfo set the 'resource bundle information', so that the remote-controller can log NLS message. |
protected void |
setGeneralSuccessWithBundleMessage(java.util.Properties props,
ResourceMessageInfo message,
ResourceMessageInfo detailMessage)
set the isremoteresult to "true"
set the remoteresultcode to a constant code Message.STATUS_REMOTERESULT_OK_STRING Note: This method will concatenate AbstractProcessor.remoteCommand with SoloMessage.RESULT_INFO_GENERAL_SUCCESS and set this string to remoteresultinfo set the 'resource bundle information', so that the remote-controller can log NLS message. |
void |
setParams(java.util.Collection<java.lang.String> params) |
static void |
setSecsWaitForComponent(int secsWaitForComponent) |
static void |
setSecsWaitForWindow(int secsWaitForWindow) |
void |
setSolo(com.robotium.solo.Solo solo)
Set the Solo object to be used for processing.
|
java.lang.Object |
setTestObject(java.lang.String windowName,
java.lang.String componentName,
java.lang.Object testobject)
According to windowName and componentName, set the testObject to
the cache. |
convertToKey, convertToKeys, convertToKeys, debug, getCachedItem, getStackTrace, makeUniqueCacheKey, processMessage, processProperties, putCachedItem, removeCachedItem, resetExternalModeCache, setGeneralError, setGeneralError, setGeneralErrorWithSpecialInfo, setGeneralErrorWithSpecialInfo, setGeneralSuccess, setGeneralSuccess, setGeneralSuccessWithSpecialInfo, setGeneralWarningWithSpecialInfo, setRemoteCommand, stringIsMatched
public static java.lang.String TAG
protected DSAFSTestRunner testrunner
protected SAFSRobot robot
protected static final java.lang.String KEY_COMPOBJ
protected static java.util.Hashtable<java.lang.String,java.util.Hashtable<java.lang.String,java.lang.Object>> testObjectCache
AbstractProcessor
protected static int secsWaitForWindow
protected static int secsWaitForComponent
protected static int command_timeout
protected static java.lang.Object winobj
protected static java.lang.Object compobj
protected static java.lang.String winname
protected static java.lang.String compname
protected static java.lang.String winrec
protected static java.lang.String comprec
protected static DGuiObjectVector dgov
protected static DGuiClassData dgcd
protected com.robotium.solo.Solo solo
protected android.app.Instrumentation inst
protected java.util.Collection<java.lang.String> params
protected ResourceMessageInfo resourceMsg
#setGeneralErrorWithBundleMessage(java.util.Properties, ResourceMessageInfo, ResourceMessageInfo)}
,
#setGeneralSuccessWithBundleMessage(java.util.Properties, ResourceMessageInfo, ResourceMessageInfo)}
protected ResourceMessageInfo resourceDetailMsg
#setGeneralErrorWithBundleMessage(java.util.Properties, ResourceMessageInfo, ResourceMessageInfo)}
,
#setGeneralSuccessWithBundleMessage(java.util.Properties, ResourceMessageInfo, ResourceMessageInfo)}
public SAFSProcessor(DSAFSTestRunner testrunner)
public java.lang.Object getTestObject(java.lang.String windowName, java.lang.String componentName)
public java.lang.Object setTestObject(java.lang.String windowName, java.lang.String componentName, java.lang.Object testobject)
public void clearTestObjectCache()
public java.util.Collection<java.lang.String> getParams()
public void setParams(java.util.Collection<java.lang.String> params)
public static int getSecsWaitForWindow()
public static void setSecsWaitForWindow(int secsWaitForWindow)
secsWaitForWindow
- the secsWaitForWindow to set (in seconds)public static int getSecsWaitForComponent()
public static void setSecsWaitForComponent(int secsWaitForComponent)
secsWaitForComponent
- the secsWaitForComponent to set (in seconds)protected boolean extractComponentProperties(java.util.Properties props)
winname = KEY_WINNAME,
compname = KEY_COMPNAME,
winrec = KEY_WINREC,
comprec = KEY_COMPREC,
command_timeout = PARAM_TIMEOUT
props
- resourceMsg
values and
setGeneralErrorWithBundleMessage(Properties, ResourceMessageInfo, ResourceMessageInfo)
and return false.public static DGuiClassData getDgcd()
public static void setDgcd(DGuiClassData dgcd)
public com.robotium.solo.Solo getSolo()
testrunner
RobotiumTestRunner.launchApplication()
has beenRobotiumTestRunner.launchApplication()
public void setSolo(com.robotium.solo.Solo solo)
solo
- public android.app.Instrumentation getInstrumentation()
testrunner
is the Instrumentation object.protected void setGeneralSuccessWithBundleMessage(java.util.Properties props, ResourceMessageInfo message, ResourceMessageInfo detailMessage)
Message.STATUS_REMOTERESULT_OK_STRING
AbstractProcessor.remoteCommand
with SoloMessage.RESULT_INFO_GENERAL_SUCCESS
props
- The Properties object containing the in and out parametersmessage
- ResourceMessageInfo, information about the resource bundle messagedetailMessage
- ResourceMessageInfo, information about the resource bundle detail message#setResourceBundleInformation(Properties, ResourceMessageInfo, ResourceMessageInfo))
protected void setGeneralErrorWithBundleMessage(java.util.Properties props, ResourceMessageInfo message, ResourceMessageInfo detailMessage)
Message.STATUS_REMOTERESULT_FAIL_STRING
AbstractProcessor.remoteCommand
with 'resultInfo', then with SoloMessage.RESULT_INFO_GENERAL_FAIL
props
- The Properties object containing the in and out parametersmessage
- ResourceMessageInfo, information about the resource bundle messagedetailMessage
- ResourceMessageInfo, information about the resource bundle detail message#setResourceBundleInformation(Properties, ResourceMessageInfo, ResourceMessageInfo))
Copyright © SAS Institute. All Rights Reserved.