|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.safs.Processor
public abstract class Processor
Abstract Processor, enforces that the 'process' and 'isSupportedRecordType' methods be implemented.
| Field Summary | |
|---|---|
protected static boolean |
breakpointsOn
All processor instances may enable/disable and force breakpoints where they deem this appropriate. |
static java.lang.String |
CASE_INSENSITIVE_FLAG
|
static java.lang.String |
CASEINSENSITIVE_FLAG
|
protected static boolean |
clearProxiesAlways
|
protected static boolean |
commandLineBreakpoint
|
protected static java.lang.String |
customStr
|
protected static GetText |
customText
|
protected static int |
DEBUG_MESSAGE
Convenience for local referencing instead of referencing AbstractLogFacility. |
protected static java.lang.String |
debugStr
|
protected static GetText |
debugText
|
static java.lang.String |
DEFAULT_CUSTOM_PROCESSOR_PACKAGE
|
static java.lang.String |
DEFAULT_CUSTOM_PROCESSOR_SUBPACKAGE
|
static java.lang.String |
DEFAULT_PROCESSOR_PACKAGE
"org.safs" Default package for Processor subclasses used to execute test data. |
protected static int |
FAILED_MESSAGE
Log MessageType for local referencing. |
protected static int |
FAILED_OK_MESSAGE
Log MessageType for local referencing. |
protected static java.lang.String |
failedStr
|
protected static GetText |
failedText
|
protected static java.lang.String |
FAILURE_DETAIL
GetText.text() keyword. |
protected static int |
GENERIC_MESSAGE
Convenience for local referencing instead of referencing AbstractLogFacility. |
protected static java.lang.String |
genericStr
|
protected static GetText |
genericText
|
protected static java.lang.String |
LINE_FAILURE_4
GetText.text() keyword. |
protected LogUtilities |
log
|
protected boolean |
myBreakpointsOn
Individual processor instances may enable/disable and force breakpoints where they deem this appropriate. |
protected static java.lang.String |
otherStr
|
protected static GetText |
otherText
|
protected static java.lang.String |
PARAM_SIZE_1
GetText.text() keyword. |
protected static java.lang.String |
PARAM_SIZE_2
GetText.text() keyword. |
protected static java.lang.String |
PARAM_SIZE_3
GetText.text() keyword. |
protected static java.lang.String |
PARAM_SIZE_4
GetText.text() keyword. |
protected java.util.Collection |
params
Purpose: the collection of params Initialized: constructor |
protected static int |
PASSED_MESSAGE
Log MessageType for local referencing. |
protected static java.lang.String |
passedStr
|
protected static GetText |
passedText
|
protected static java.lang.String |
PRE_TXT_SUCCESS_4
GetText.text() keyword. |
protected static java.lang.String |
PRE_TXT_SUCCESS_5
GetText.text() keyword. |
protected static boolean |
processorConfigSet
|
protected java.util.Map |
processorMap
keeps instantiated processors for reuse |
protected boolean |
recordProcessed
Status for whether the processor processed the record, if the processor fails to support the record it has been given, then the processor should set this to false, so that any processor chain can continue to the next processor, if one is available. |
static java.lang.String |
RECTYPE_DRIVER_COMMAND
"C" Record Type Constant |
static java.lang.String |
RECTYPE_DRIVER_COMMAND_F
"CF" Record Type Constant |
static java.lang.String |
RECTYPE_DRIVER_COMMAND_W
"CW" Record Type Constant |
static java.lang.String |
RECTYPE_TEST_STEP
"T" Record Type Constant |
static java.lang.String |
RECTYPE_TEST_STEP_F
"TF" Record Type Constant |
static java.lang.String |
RECTYPE_TEST_STEP_W
"TW" Record Type Constant |
protected static boolean |
RFSMCache
|
protected static boolean |
RFSMOnly
|
static java.lang.String |
RFT_FIND_SEARCH_MODE_ALGORITHM
"RFSMOnly" |
static java.lang.String |
RFT_FIND_SEARCH_MODE_CACHE
"RFSMCache" |
static java.lang.String |
SAFS_CLEARPROXIESALWAYS_ITEM
"clearProxiesAlways" |
static java.lang.String |
SAFS_COMMANDLINEBREAKPOINT_ITEM
"commandLineBreakpoint" |
static java.lang.String |
SAFS_COMMANDLINEBREAKPOINT_VARIABLE
"safs.commandLineBreakpoint" |
static java.lang.String |
SAFS_PARAMS_FILE
"safsparams.dat" |
static java.lang.String |
SAFS_RESBUN_NAME
|
static java.lang.String |
SAFS_SECSWAITFORCOMPONENT_ITEM
"secsWaitForComponent" |
static java.lang.String |
SAFS_SECSWAITFORCOMPONENT_VARIABLE
"safs.secsWaitForComponent" |
static java.lang.String |
SAFS_SECSWAITFORWINDOW_ITEM
"secsWaitForWindow" |
static java.lang.String |
SAFS_SECSWAITFORWINDOW_VARIABLE
"safs.secsWaitForWindow" |
static java.lang.String |
SAFS_TESTDOMAINS_ITEM
"testDomains" Config setting should contain semi-colon delimited combinations of values: Java;Html;Net;Win |
static java.lang.String |
SAFS_TESTDOMAINS_VARIABLE
"safs.testDomains" |
protected static int |
secsWaitForComponent
|
protected static int |
secsWaitForWindow
|
protected static java.lang.String |
SENT_MSG_3
GetText.text() keyword. |
protected static java.lang.String |
testDomains
|
protected TestRecordHelper |
testRecordData
Purpose: holds the testRecordData info Initialized: constructor |
protected static java.lang.String |
TXT_FAILURE_1
GetText.text() keyword. |
protected static java.lang.String |
TXT_FAILURE_2
GetText.text() keyword. |
protected static java.lang.String |
TXT_FAILURE_3
GetText.text() keyword. |
protected static java.lang.String |
TXT_FAILURE_4
GetText.text() keyword. |
protected static java.lang.String |
TXT_FAILURE_5
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_1
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_2
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_2a
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_3
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_3a
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_4
GetText.text() keyword. |
protected static java.lang.String |
TXT_SUCCESS_5
GetText.text() keyword. |
protected static int |
WARNING_MESSAGE
Log MessageType for local referencing. |
protected static int |
WARNING_OK_MESSAGE
Log MessageType for local referencing. |
protected static java.lang.String |
warningStr
|
protected static GetText |
warningText
|
| Constructor Summary | |
|---|---|
Processor()
Purpose: constructor |
|
| Method Summary | |
|---|---|
protected static void |
activateBreakpoint(java.lang.String breakpoint_message)
Activate the SAFSBreakpointException breakpoint. |
protected static void |
checkBreakpoints(java.lang.String breakpoint_message)
test for enabled breakpoints and active a breakpoint if enabled. |
protected void |
checkMyBreakpoints(java.lang.String breakpoint_message)
test for enabled breakpoints and active a breakpoint if enabled. |
protected boolean |
delay(int millisec)
|
void |
distributeConfigInformation()
|
java.util.Collection |
getAlternateParams()
|
protected java.lang.String |
getAppMapItem(java.lang.String appMapID,
java.lang.String section,
java.lang.String item)
|
Processor |
getChainedProcessor()
Returns chained processor to interpret test data, if any. |
protected Processor |
getClassInstance(java.lang.String classname)
Instance a given Processor from the provided classname. |
static boolean |
getClearProxiesAlways()
|
protected java.util.ArrayList |
getCustomProcClassNames()
Attempts to locate a class for the current customProcInstancePath. |
java.lang.String |
getCustomProcInstancePath()
Return the current customProcInstancePath setting. |
LogUtilities |
getLogUtilities()
|
java.util.Collection |
getParams()
|
protected java.util.ArrayList |
getProcClassNames()
Attempts to locate a class for the current procInstancePath. |
Processor |
getProcInstance()
Return/Create an instance of the actual processor used to interpret test data. |
java.lang.String |
getProcInstancePath()
Return the current procInstancePath setting. |
protected boolean |
getRequiredField(int findex,
java.lang.String fname,
java.lang.String fvalue)
Retrieve a non-empty field value from the testRecordData inputrecord. |
static int |
getSecsWaitForComponent()
|
static int |
getSecsWaitForWindow()
|
protected java.lang.String |
getStandardErrorMessage(java.lang.String failure)
Retrieve the standard "SOMETHING failure in filename FILENAME at line LINENUMBER" message. |
TestRecordHelper |
getTestRecordData()
|
protected java.lang.String |
getVariable(java.lang.String var)
|
boolean |
hasChainedProcessor()
True if this processor has an instance of a chained processor to interpret test data if this one does not succeed in processing the data. |
protected boolean |
initProcessorAndProcess(Processor aprocessor,
java.util.Collection params)
Init the processor and process a record Initializes the processor by passing it the currently active LogUtilities, TestRecordHelper, and extracted record parameters. |
protected boolean |
instanceProcessorAndProcess(java.lang.String instanceName,
java.util.Collection params)
Tries to instance a processor and then process a record. |
static boolean |
isBreakpointsOn()
test if breakpoints is enabled. |
boolean |
isComponentFunctionRecord(java.lang.String recordType)
Convenience routine for isSupportedRecordType to return true if the Processor supports standard Component Function records. |
boolean |
isDriverCommandRecord(java.lang.String recordType)
Convenience routine for isSupportedRecordType to return true if the Processor supports standard Driver Command records. |
boolean |
isEngineCommandRecord(java.lang.String recordType)
Convenience routine for isSupportedRecordType to return true if the Processor supports standard Engine Command records. |
boolean |
isMyBreakpointsOn()
test if breakpoints is enabled. |
boolean |
isRecordProcessed()
|
static boolean |
isRFSMCache()
|
static boolean |
isRFSMOnly()
|
abstract boolean |
isSupportedRecordType(java.lang.String recordType)
Determine support for a particular record type. |
protected void |
paramsFailedMsg()
Purpose: log a FAILED_MESSAGE about the wrong number of parameters; this version is used by DriverCommands |
protected void |
paramsFailedMsg(java.lang.String windowName,
java.lang.String compName)
Purpose: log a FAILED_MESSAGE about the wrong number of parameters |
void |
process()
The primary method that all subclasses must implement. |
protected boolean |
processCustomProcessor(java.util.Collection params)
|
protected boolean |
processSubclassProcessor(java.util.Collection params)
|
static void |
setBreakpointsOn(boolean enabled)
This may be set by any means. |
void |
setChainedProcessor(Processor aprocessor)
Set the instance of the chained processor to interpret test data if this one does not succeed in processing the data. |
static void |
setClearProxiesAlways(boolean enabled)
|
static void |
setCommandLineBreakpoint(boolean enabled)
|
void |
setCustomProcInstancePath(java.lang.String pkgname)
Change the procInstancePath setting. |
void |
setLogUtilities(LogUtilities log)
|
void |
setMyBreakpointsOn(boolean enabled)
This may be set by any means. |
void |
setParams(java.util.Collection params)
|
void |
setProcInstance(Processor aprocessor)
Provide a Processor object to interpret test data. |
void |
setProcInstancePath(java.lang.String pkgname)
Change the procInstancePath setting. |
void |
setRecordProcessed(boolean processed)
|
static void |
setRFSMCache(boolean enable)
|
static void |
setRFSMOnly(boolean enable)
|
static void |
setSecsWaitForComponent(int secs)
|
static void |
setSecsWaitForWindow(int secs)
|
static void |
setTestDomains(java.lang.String domains)
|
void |
setTestRecordData(TestRecordHelper testRecordData)
|
protected boolean |
setVariable(java.lang.String var,
java.lang.String val)
|
protected void |
standardFailureMessage(java.lang.String failure,
java.lang.String detail)
log the more standard FAILED_MESSAGE with detail. |
java.lang.String |
substituteVariable(java.lang.String str)
Purpose: if leading ^ found, then substitue variable. |
protected boolean |
validateParamSize(int minparams)
check if params.size() < minparams If params.size() is insufficient we set testRecordData.setStatusCode to GENERAL_SCRIPT_FAILURE and log a paramsFailedMsg and return 'false'. |
protected boolean |
validProcessorClassName(java.lang.String classname)
Validate that a given classname is valid and assignable to org.safs.Processor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_PROCESSOR_PACKAGE
public static final java.lang.String DEFAULT_CUSTOM_PROCESSOR_PACKAGE
public static final java.lang.String DEFAULT_CUSTOM_PROCESSOR_SUBPACKAGE
public static final java.lang.String CASEINSENSITIVE_FLAG
public static final java.lang.String CASE_INSENSITIVE_FLAG
protected static boolean breakpointsOn
protected boolean myBreakpointsOn
protected static final java.lang.String TXT_SUCCESS_1
protected static final java.lang.String TXT_SUCCESS_2
protected static final java.lang.String TXT_SUCCESS_2a
protected static final java.lang.String TXT_SUCCESS_3
protected static final java.lang.String TXT_SUCCESS_3a
protected static final java.lang.String TXT_SUCCESS_4
protected static final java.lang.String PRE_TXT_SUCCESS_4
protected static final java.lang.String TXT_SUCCESS_5
protected static final java.lang.String PRE_TXT_SUCCESS_5
protected static final java.lang.String SENT_MSG_3
protected static final java.lang.String TXT_FAILURE_1
protected static final java.lang.String TXT_FAILURE_2
protected static final java.lang.String TXT_FAILURE_3
protected static final java.lang.String TXT_FAILURE_4
protected static final java.lang.String LINE_FAILURE_4
protected static final java.lang.String TXT_FAILURE_5
protected static final java.lang.String FAILURE_DETAIL
protected static final java.lang.String PARAM_SIZE_1
protected static final java.lang.String PARAM_SIZE_2
protected static final java.lang.String PARAM_SIZE_3
protected static final java.lang.String PARAM_SIZE_4
public static final java.lang.String RECTYPE_DRIVER_COMMAND
public static final java.lang.String RECTYPE_DRIVER_COMMAND_W
public static final java.lang.String RECTYPE_DRIVER_COMMAND_F
public static final java.lang.String RECTYPE_TEST_STEP
public static final java.lang.String RECTYPE_TEST_STEP_W
public static final java.lang.String RECTYPE_TEST_STEP_F
protected static final int DEBUG_MESSAGE
protected static final int GENERIC_MESSAGE
protected static final int FAILED_MESSAGE
protected static final int FAILED_OK_MESSAGE
protected static final int PASSED_MESSAGE
protected static final int WARNING_MESSAGE
protected static final int WARNING_OK_MESSAGE
protected TestRecordHelper testRecordData
protected LogUtilities log
public static final java.lang.String SAFS_RESBUN_NAME
protected static final java.lang.String genericStr
protected static final java.lang.String passedStr
protected static final java.lang.String failedStr
protected static final java.lang.String warningStr
protected static final java.lang.String otherStr
protected static final java.lang.String customStr
protected static final java.lang.String debugStr
protected static GetText genericText
protected static GetText passedText
protected static GetText failedText
protected static GetText warningText
protected static GetText otherText
protected static GetText customText
protected static GetText debugText
protected java.util.Collection params
protected java.util.Map processorMap
protected boolean recordProcessed
protected static int secsWaitForWindow
protected static int secsWaitForComponent
protected static boolean commandLineBreakpoint
protected static java.lang.String testDomains
protected static boolean clearProxiesAlways
protected static boolean RFSMOnly
protected static boolean RFSMCache
public static final java.lang.String SAFS_PARAMS_FILE
public static final java.lang.String SAFS_CLEARPROXIESALWAYS_ITEM
public static final java.lang.String SAFS_TESTDOMAINS_ITEM
public static final java.lang.String SAFS_SECSWAITFORWINDOW_ITEM
public static final java.lang.String SAFS_SECSWAITFORCOMPONENT_ITEM
public static final java.lang.String SAFS_COMMANDLINEBREAKPOINT_ITEM
public static final java.lang.String SAFS_SECSWAITFORWINDOW_VARIABLE
public static final java.lang.String SAFS_SECSWAITFORCOMPONENT_VARIABLE
public static final java.lang.String SAFS_COMMANDLINEBREAKPOINT_VARIABLE
public static final java.lang.String SAFS_TESTDOMAINS_VARIABLE
protected static boolean processorConfigSet
public static final java.lang.String RFT_FIND_SEARCH_MODE_ALGORITHM
public static final java.lang.String RFT_FIND_SEARCH_MODE_CACHE
| Constructor Detail |
|---|
public Processor()
| Method Detail |
|---|
protected Processor getClassInstance(java.lang.String classname)
classname - should not be null or 0 length
protected boolean validProcessorClassName(java.lang.String classname)
protected java.util.ArrayList getProcClassNames()
Subclasses should override this method to return additional classnames that are based off a root package name stored in procInstancePath.
Use validProcessorClassName before adding a classname to the list.
protected java.util.ArrayList getCustomProcClassNames()
Subclasses, however, can also override this method to return specific classnames that are based off a root package name stored in customProcInstancePath.
Use validProcessorClassName before adding a classname to the list.
public Processor getProcInstance()
public void setProcInstance(Processor aprocessor)
public boolean hasChainedProcessor()
public Processor getChainedProcessor()
public void setChainedProcessor(Processor aprocessor)
For example, we may store an org.safs.DriverCommandProcessor object to provide default handling of Driver Command records not overridden by some subclass.
Can be set to null to remove any existing chainedProcessor.
public java.lang.String getProcInstancePath()
public void setProcInstancePath(java.lang.String pkgname)
public java.lang.String getCustomProcInstancePath()
public void setCustomProcInstancePath(java.lang.String pkgname)
public static void setBreakpointsOn(boolean enabled)
public static boolean isBreakpointsOn()
protected static void checkBreakpoints(java.lang.String breakpoint_message)
protected static void activateBreakpoint(java.lang.String breakpoint_message)
public void setMyBreakpointsOn(boolean enabled)
public boolean isMyBreakpointsOn()
protected void checkMyBreakpoints(java.lang.String breakpoint_message)
public TestRecordHelper getTestRecordData()
public void setTestRecordData(TestRecordHelper testRecordData)
public LogUtilities getLogUtilities()
public void setLogUtilities(LogUtilities log)
public java.util.Collection getParams()
public void setParams(java.util.Collection params)
public java.util.Collection getAlternateParams()
public boolean isRecordProcessed()
public void setRecordProcessed(boolean processed)
protected boolean instanceProcessorAndProcess(java.lang.String instanceName,
java.util.Collection params)
aprocessor, - Processorparams, - Collection
public void distributeConfigInformation()
protected boolean initProcessorAndProcess(Processor aprocessor,
java.util.Collection params)
aprocessor, - Processorparams, - Collection
protected boolean delay(int millisec)
protected boolean setVariable(java.lang.String var,
java.lang.String val)
throws SAFSException
SAFSException
protected java.lang.String getVariable(java.lang.String var)
throws SAFSException
SAFSException
protected java.lang.String getAppMapItem(java.lang.String appMapID,
java.lang.String section,
java.lang.String item)
public java.lang.String substituteVariable(java.lang.String str)
str, - String string to search for ^ at beginning
protected boolean processSubclassProcessor(java.util.Collection params)
protected boolean processCustomProcessor(java.util.Collection params)
public void process()
Thus, any subclassing Processor should attempt to process it's own commands and then invoke super.process() to try any chained Processor(s).
Otherwise, by default executes setRecordProcessed(false) if no chainedProcessor is present.
public abstract boolean isSupportedRecordType(java.lang.String recordType)
recordType - -- String text of record type to match (ignoring case).
public boolean isDriverCommandRecord(java.lang.String recordType)
public boolean isComponentFunctionRecord(java.lang.String recordType)
public boolean isEngineCommandRecord(java.lang.String recordType)
protected void paramsFailedMsg()
throws SAFSException
SAFSException
protected void paramsFailedMsg(java.lang.String windowName,
java.lang.String compName)
throws SAFSException
windowName, - StringcompName, - String
SAFSExceptionprotected boolean validateParamSize(int minparams)
minparams - - minimum number of parameters required for processing
protected boolean getRequiredField(int findex,
java.lang.String fname,
java.lang.String fvalue)
findex - - 0-based index of field to extract from input record.fname - - field name to use in issuing any Invalid Parameter error messages.fvalue - - String to receive the desired field value on success.
protected java.lang.String getStandardErrorMessage(java.lang.String failure)
failure - -- text to appear before the filname and line number info.
protected void standardFailureMessage(java.lang.String failure,
java.lang.String detail)
failure - -- the failure text that precedes the 'failure in filename' message.detail - -- the detail that will be used unmodified.public static void setSecsWaitForWindow(int secs)
public static int getSecsWaitForWindow()
public static void setSecsWaitForComponent(int secs)
public static int getSecsWaitForComponent()
public static void setCommandLineBreakpoint(boolean enabled)
public static void setTestDomains(java.lang.String domains)
public static void setClearProxiesAlways(boolean enabled)
public static boolean getClearProxiesAlways()
public static void setRFSMOnly(boolean enable)
public static boolean isRFSMOnly()
public static void setRFSMCache(boolean enable)
public static boolean isRFSMCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||