org.safs
Class DriverCommand

java.lang.Object
  extended by org.safs.Processor
      extended by org.safs.DriverCommand
Direct Known Subclasses:
DCDriverCommand, DCDriverCommand, DCDriverCommand, DCDriverCommand, DCDriverDatabaseCommands, DCDriverFileCommands, DCDriverMiscCommands, DCDriverStringCommands, DCDriverTimerCommands

public abstract class DriverCommand
extends Processor


Purpose: abstract DriverCommand, enforces that the 'process' method be implemented

Since:
JUN 14, 2003
JUN 14, 2003 (DBauman) Original Release
NOV 10, 2003 (CANAGL) Added isSupportedRecordType() implementation.
NOV 14, 2003 (CANAGL) Refactoring with changes to Processor.

Field Summary
 
Fields inherited from class org.safs.Processor
breakpointsOn, CASE_INSENSITIVE_FLAG, CASEINSENSITIVE_FLAG, clearProxiesAlways, commandLineBreakpoint, customStr, customText, DEBUG_MESSAGE, debugStr, debugText, DEFAULT_CUSTOM_PROCESSOR_PACKAGE, DEFAULT_CUSTOM_PROCESSOR_SUBPACKAGE, DEFAULT_PROCESSOR_PACKAGE, FAILED_MESSAGE, FAILED_OK_MESSAGE, failedStr, failedText, FAILURE_DETAIL, GENERIC_MESSAGE, genericStr, genericText, LINE_FAILURE_4, log, myBreakpointsOn, otherStr, otherText, PARAM_SIZE_1, PARAM_SIZE_2, PARAM_SIZE_3, PARAM_SIZE_4, params, PASSED_MESSAGE, passedStr, passedText, PRE_TXT_SUCCESS_4, PRE_TXT_SUCCESS_5, processorConfigSet, processorMap, recordProcessed, RECTYPE_DRIVER_COMMAND, RECTYPE_DRIVER_COMMAND_F, RECTYPE_DRIVER_COMMAND_W, RECTYPE_TEST_STEP, RECTYPE_TEST_STEP_F, RECTYPE_TEST_STEP_W, SAFS_CLEARPROXIESALWAYS_ITEM, SAFS_COMMANDLINEBREAKPOINT_ITEM, SAFS_COMMANDLINEBREAKPOINT_VARIABLE, SAFS_PARAMS_FILE, SAFS_RESBUN_NAME, SAFS_SECSWAITFORCOMPONENT_ITEM, SAFS_SECSWAITFORCOMPONENT_VARIABLE, SAFS_SECSWAITFORWINDOW_ITEM, SAFS_SECSWAITFORWINDOW_VARIABLE, SAFS_TESTDOMAINS_ITEM, SAFS_TESTDOMAINS_VARIABLE, secsWaitForComponent, secsWaitForWindow, SENT_MSG_3, testDomains, testRecordData, TXT_FAILURE_1, TXT_FAILURE_2, TXT_FAILURE_3, TXT_FAILURE_4, TXT_FAILURE_5, TXT_SUCCESS_1, TXT_SUCCESS_2, TXT_SUCCESS_2a, TXT_SUCCESS_3, TXT_SUCCESS_3a, TXT_SUCCESS_4, TXT_SUCCESS_5, WARNING_MESSAGE, WARNING_OK_MESSAGE, warningStr, warningText
 
Constructor Summary
DriverCommand()
          
Purpose: constructor
 
Method Summary
protected  java.lang.String getStandardFailureDetail()
          Uses testRecordData to create standard failure text.
protected  java.lang.String getStandardWarningDetail()
          Uses testRecordData to create standard warning text.
protected  java.util.Collection interpretFields()
          
Purpose: Interprets the fields of the driver command record and puts the appropriate values into the fields of testRecordData.
protected  void issueActionFailure(java.lang.String error)
          Issue Unable to perform [action].
protected  void issueActionOnXFailure(java.lang.String x, java.lang.String error)
          Issue Unable to perform [action] on [value].
protected  void issueActionWarning(java.lang.String warning)
          Issue [command] was not successful.
protected  void issueErrorPerformingAction(java.lang.String error)
          "Error performing [action].
protected  void issueErrorPerformingActionOnX(java.lang.String x, java.lang.String error)
          "Error performing [action] on [x].
protected  void issueExecutionNegativeMessage(java.lang.String detail)
          "Action processed with a negative result." "[detail]"
Purpose: log a simple failure message when a test record got processed with negative result.
protected  void issueFileErrorFailure(java.lang.String filename)
          Issue a file error and failure message Filename does not need to be localized.
protected  void issueGenericSuccess(java.lang.String comment)
          issue OK status and generic message (not a PASSED message) string comment is expected to already be localized.
protected  void issueInputRecordFailure(java.lang.String error)
          Issue Unable to perform [action].
protected  void issueParameterCountFailure()
          Issue parameter count error and failure message
protected  void issueParameterCountFailure(java.lang.String detail)
          Issue parameter count error and failure message
protected  void issueParameterValueFailure(java.lang.String paramName)
          Issue parameter value error and failure message
protected  void issueUnknownErrorFailure(java.lang.String cause)
          Issue a generic error and failure message The cause parameter is expected to already be localized.
 boolean isSupportedRecordType(java.lang.String recordType)
          Supports standard DRIVER COMMAND record types (C, CW, CF)
 
Methods inherited from class org.safs.Processor
activateBreakpoint, checkBreakpoints, checkMyBreakpoints, delay, distributeConfigInformation, getAlternateParams, getAppMapItem, getChainedProcessor, getClassInstance, getClearProxiesAlways, getCustomProcClassNames, getCustomProcInstancePath, getLogUtilities, getParams, getProcClassNames, getProcInstance, getProcInstancePath, getRequiredField, getSecsWaitForComponent, getSecsWaitForWindow, getStandardErrorMessage, getTestRecordData, getVariable, hasChainedProcessor, initProcessorAndProcess, instanceProcessorAndProcess, isBreakpointsOn, isComponentFunctionRecord, isDriverCommandRecord, isEngineCommandRecord, isMyBreakpointsOn, isRecordProcessed, paramsFailedMsg, paramsFailedMsg, process, processCustomProcessor, processSubclassProcessor, setBreakpointsOn, setChainedProcessor, setClearProxiesAlways, setCommandLineBreakpoint, setCustomProcInstancePath, setLogUtilities, setMyBreakpointsOn, setParams, setProcInstance, setProcInstancePath, setRecordProcessed, setSecsWaitForComponent, setSecsWaitForWindow, setTestDomains, setTestRecordData, setVariable, standardFailureMessage, substituteVariable, validateParamSize, validProcessorClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DriverCommand

public DriverCommand()

Purpose: constructor

Method Detail

isSupportedRecordType

public boolean isSupportedRecordType(java.lang.String recordType)
Supports standard DRIVER COMMAND record types (C, CW, CF)

Specified by:
isSupportedRecordType in class Processor
Parameters:
recordType - -- String text of record type to match (ignoring case).
Returns:
'true' if the provided recordType is one this Processor can execute. Note, that SAFS record types are normally not case-sensitive. So the comparison to match the provided recordType should ignore case.


interpretFields

protected java.util.Collection interpretFields()
                                        throws SAFSException

Purpose: Interprets the fields of the driver command record and puts the appropriate values into the fields of testRecordData.
Side Effects: Processor.testRecordData fields are set from the inputRecord.
State Read: Processor.testRecordData, the inputRecord field
Assumptions: The following order:

Field #1: The DRIVER COMMAND record type (C).

Subsequent fields would be as follows (with a separator between each field):
Field: #2 #3 - N
============== ===============
COMMAND, [PARAMETER(S),]

Returns:
Collection of the parameter(s)
Throws:
SAFSException

issueGenericSuccess

protected void issueGenericSuccess(java.lang.String comment)
issue OK status and generic message (not a PASSED message) string comment is expected to already be localized.


getStandardFailureDetail

protected java.lang.String getStandardFailureDetail()
Uses testRecordData to create standard failure text.

Returns:
[command] failure in table [filename] at line [n]. Called by other routines.

getStandardWarningDetail

protected java.lang.String getStandardWarningDetail()
Uses testRecordData to create standard warning text.

Returns:
[command] warning in table [filename] at line [n]. Called by other routines.

issueActionWarning

protected void issueActionWarning(java.lang.String warning)
Issue [command] was not successful. [warning]. [command warning in table filename at line n]. Sets status to WARNING and issues a WARNING message. string warning is expected to already be localized.


issueInputRecordFailure

protected void issueInputRecordFailure(java.lang.String error)
Issue Unable to perform [action]. [error]. Details + [inputrecord] Sets status to FAILURE and issues a FAILED message. called by other issueFailure routines


issueActionFailure

protected void issueActionFailure(java.lang.String error)
Issue Unable to perform [action]. [error]. Details + [error] Sets status to FAILURE and issues a FAILED message. called by other issueFailure routines


issueActionOnXFailure

protected void issueActionOnXFailure(java.lang.String x,
                                     java.lang.String error)
Issue Unable to perform [action] on [value]. [error]. Details + [error] Sets status to FAILURE and issues a FAILED message.


issueErrorPerformingAction

protected void issueErrorPerformingAction(java.lang.String error)
"Error performing [action]. [error]" Details + [error]


issueErrorPerformingActionOnX

protected void issueErrorPerformingActionOnX(java.lang.String x,
                                             java.lang.String error)
"Error performing [action] on [x]. [error]" Details + [error]


issueParameterCountFailure

protected void issueParameterCountFailure()
Issue parameter count error and failure message


issueParameterCountFailure

protected void issueParameterCountFailure(java.lang.String detail)
Issue parameter count error and failure message

Parameters:
detail - detail about specific missing params or command format

issueParameterValueFailure

protected void issueParameterValueFailure(java.lang.String paramName)
Issue parameter value error and failure message

Parameters:
paramName - -- the Name of the action parameter in error.

issueFileErrorFailure

protected void issueFileErrorFailure(java.lang.String filename)
Issue a file error and failure message Filename does not need to be localized.


issueUnknownErrorFailure

protected void issueUnknownErrorFailure(java.lang.String cause)
Issue a generic error and failure message The cause parameter is expected to already be localized.


issueExecutionNegativeMessage

protected void issueExecutionNegativeMessage(java.lang.String detail)
"Action processed with a negative result." "[detail]"
Purpose: log a simple failure message when a test record got processed with negative result. When an action intends to make a judgment, a negative result is gotten if the logical result of the judgment is false; the test step will be logged as 'FAIL' although it got executed correctly. Called by some comparing actions. * @param detail -- a detail message