org.safs
Class TestRecordData

java.lang.Object
  extended by org.safs.TestRecordData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RMITestRecordData, TestRecordHelper

public abstract class TestRecordData
extends java.lang.Object
implements java.io.Serializable


Purpose:TestRecordData: holds key data used by a driver, like step driver. Based on the SAFS Test Record Data doc.

This is the RobotJ equivalent class to the AUGUIInfo seen in Classic.

This can be populated from a STAF Variables pool, although that mechanism would be provided by a helper class (TestRecordHelper.java). Notice that the DEDUCED fields are not populated from the Variables pool. They would later be set by a processor or Driver object one time.

This object can then be used by a Driver object.

The RobotJ Driver class should be a RobotJ test script(object) called with nothing more than the this TestRecordData object as parameter. The driver should have everything it needs inside the TestRecordData instance. In order to be sure of that, the processor must derive the DEDUCED fields once before proceeding.

Initially, we expect to only forward "C" Driver Commands and "T" step-level test records to RobotJ. So the driver will then route this instance to either a DriverCommands processor (another RobotJ object/script), or a ComponentFunctions processor (another object/script) based on the record type. Although none of that logic is found here, this is stated for context of how this data will later be used.

Since:
MAY 30, 2003
MAY 30, 2003 (DBauman) Original Release
APR 12, 2004 (CANAGL) Added unique fileID field.
JUN 28, 2004 (CANAGL) Added setShutdownData.
NOV 15, 2005 (bolawl) Added support for new TRD statusinfo field (RJL).
See Also:
Serialized Form

Field Summary
static java.lang.String[] possibleSeparator
           
 
Constructor Summary
TestRecordData()
          
Purpose: no-arg constructor to make this fully qualified javabean
 
Method Summary
 TestRecordData copyData(TestRecordData target)
          Copies the object's data into the target data and returns the target.
 java.lang.String getAltCompType()
          
Purpose: accessor method(s)
 java.lang.String getAppMapName()
          
Purpose: accessor method(s)
 java.lang.String getCommand()
          
Purpose: accessor method(s)
 java.lang.String getCompClass()
          
Purpose: accessor method(s)
 java.lang.String getCompGuiId()
          
Purpose: accessor method(s)
 java.lang.String getCompModule()
          
Purpose: accessor method(s)
 java.lang.String getCompName()
          
Purpose: accessor method(s)
 java.lang.String getCompType()
          
Purpose: accessor method(s)
 java.lang.String getEnvironment()
          
Purpose: accessor method(s)
 java.lang.String getFac()
          
Purpose: accessor method(s)
 java.lang.String getFileID()
          
Purpose: accessor method(s)
 java.lang.String getFilename()
          
Purpose: accessor method(s)
 java.lang.String getInputRecord()
          
Purpose: accessor method(s)
 java.lang.String getInputRecordToken(int n)
          
Purpose: get the inputRecord token, based on 'separator' starting from 0.
 java.lang.String getInstanceName()
          Prefix used to retrieve and store SAFSVARS TestRecordData values.
 long getLineNumber()
          
Purpose: accessor method(s)
 java.lang.String getNotSeparatorString()
           
 java.lang.String getRecordType()
          
Purpose: accessor method(s)
The first token before the separator is the record type (from the inputRecord)
There is no setter method because this is a deduced property
 java.lang.String getSeparator()
          
Purpose: accessor method(s)
 int getStatusCode()
          
Purpose: accessor method(s)
 java.lang.String getStatusInfo()
          
Purpose: accessor method(s)
 java.lang.String getTestLevel()
          
Purpose: accessor method(s)
 java.lang.String getTrimmedUnquotedInputRecordToken(int n)
          
Purpose: This method takes the index 'n', retrieves the token from getInputRecordToken, trim() leading and trailing whitespace, and strips one leading and/or trailing quotation mark(#34)--if they exist.
 java.lang.String getWindowGuiId()
          
Purpose: accessor method(s)
 java.lang.String getWindowName()
          
Purpose: accessor method(s)
 int inputRecordSize()
          
Purpose: int, the number of tokens in the inputRecord (based on separator)
Assumptions: don't pass along IndexOutOfBoundsException, that is caught and a length of zero is the correct size.
 void reinit()
          
Purpose: reinit this object to be reused over again.
 void setAltCompType(java.lang.String altCompType)
           
 void setAppMapName(java.lang.String appMapName)
           
 void setCommand(java.lang.String command)
           
 void setCompClass(java.lang.String compClass)
           
 void setCompGuiId(java.lang.String compGuiId)
           
 void setCompModule(java.lang.String compModule)
           
 void setCompName(java.lang.String compName)
           
 void setCompType(java.lang.String compType)
           
 void setEnvironment(java.lang.String environment)
           
 void setFac(java.lang.String fac)
           
 void setFileID(java.lang.String fileID)
           
 void setFilename(java.lang.String filename)
           
 void setInputRecord(java.lang.String inputRecord)
           
 void setInstanceName(java.lang.String instanceName)
          Prefix used to retrieve and store SAFSVARS TestRecordData values.
 void setLineNumber(long lineNumber)
           
 void setRecordType(java.lang.String recordType)
           
 void setSeparator(java.lang.String separator)
           
 void setShutdownData()
           
 void setStatusCode(int statusCode)
           
 void setStatusInfo(java.lang.String statusInfo)
           
 void setTestLevel(java.lang.String testLevel)
           
 void setWindowGuiId(java.lang.String windowGuiId)
           
 void setWindowName(java.lang.String windowName)
           
 java.lang.String toString()
          toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

possibleSeparator

public static java.lang.String[] possibleSeparator
Constructor Detail

TestRecordData

public TestRecordData()

Purpose: no-arg constructor to make this fully qualified javabean

Method Detail

reinit

public void reinit()

Purpose: reinit this object to be reused over again.
Assumptions: fields set to null (or primitive values 0, false, ...):
fileID
filename
lineNumber
inputRecord
inputRecordTokens
separator
testLevel
appMapName
recordType
command
windowName
windowGuiId
compName
compGuiId
compType
compClass
compModule
environment
fac
statusCode
statusInfo


getFileID

public java.lang.String getFileID()

Purpose: accessor method(s)


setFileID

public void setFileID(java.lang.String fileID)

getFilename

public java.lang.String getFilename()

Purpose: accessor method(s)


setFilename

public void setFilename(java.lang.String filename)

getLineNumber

public long getLineNumber()

Purpose: accessor method(s)


setLineNumber

public void setLineNumber(long lineNumber)

getInputRecord

public java.lang.String getInputRecord()

Purpose: accessor method(s)


setInputRecord

public void setInputRecord(java.lang.String inputRecord)

getSeparator

public java.lang.String getSeparator()

Purpose: accessor method(s)


setSeparator

public void setSeparator(java.lang.String separator)

getTestLevel

public java.lang.String getTestLevel()

Purpose: accessor method(s)


setTestLevel

public void setTestLevel(java.lang.String testLevel)

getAppMapName

public java.lang.String getAppMapName()

Purpose: accessor method(s)


setAppMapName

public void setAppMapName(java.lang.String appMapName)

getRecordType

public java.lang.String getRecordType()

Purpose: accessor method(s)
The first token before the separator is the record type (from the inputRecord)
There is no setter method because this is a deduced property


setRecordType

public void setRecordType(java.lang.String recordType)

getCommand

public java.lang.String getCommand()

Purpose: accessor method(s)


setCommand

public void setCommand(java.lang.String command)

getWindowName

public java.lang.String getWindowName()
                               throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setWindowName

public void setWindowName(java.lang.String windowName)

getWindowGuiId

public java.lang.String getWindowGuiId()
                                throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setWindowGuiId

public void setWindowGuiId(java.lang.String windowGuiId)

getCompName

public java.lang.String getCompName()

Purpose: accessor method(s)


setCompName

public void setCompName(java.lang.String compName)

getCompGuiId

public java.lang.String getCompGuiId()
                              throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setCompGuiId

public void setCompGuiId(java.lang.String compGuiId)

getCompType

public java.lang.String getCompType()
                             throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setCompType

public void setCompType(java.lang.String compType)

getAltCompType

public java.lang.String getAltCompType()

Purpose: accessor method(s)


setAltCompType

public void setAltCompType(java.lang.String altCompType)

getCompClass

public java.lang.String getCompClass()
                              throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setCompClass

public void setCompClass(java.lang.String compClass)

getCompModule

public java.lang.String getCompModule()
                               throws SAFSException

Purpose: accessor method(s)

Throws:
SAFSException

setCompModule

public void setCompModule(java.lang.String compModule)

getEnvironment

public java.lang.String getEnvironment()

Purpose: accessor method(s)


setEnvironment

public void setEnvironment(java.lang.String environment)

getFac

public java.lang.String getFac()

Purpose: accessor method(s)


setFac

public void setFac(java.lang.String fac)

getStatusCode

public int getStatusCode()

Purpose: accessor method(s)


setStatusCode

public void setStatusCode(int statusCode)

getStatusInfo

public java.lang.String getStatusInfo()

Purpose: accessor method(s)


setStatusInfo

public void setStatusInfo(java.lang.String statusInfo)

getInputRecordToken

public java.lang.String getInputRecordToken(int n)
                                     throws SAFSNullPointerException

Purpose: get the inputRecord token, based on 'separator' starting from 0.
Side Effects: inputRecordTokens (lazily set first time in)
State Read: inputRecordTokens, inputRecord
Assumptions: We use lazy instantiation to populate the ArrayList inputRecordTokens. Initially it is null. We use StringTokenizer first time only.
We also assume that inputRecord and separator are already setup when we are called.

Parameters:
n, - int, the index of which token to return,
Returns:
The n(th) token from the 'inputRecord' based on 'separator' is returned. if either 'inputRecord' or 'separator' are null, then SAFSException is thrown
Throws:
java.lang.IndexOutOfBoundsException - - if n is out of range (n < 0 || n >= inputRecordTokens.size()).
SAFSNullPointerException, - if either 'inputRecord' or 'separator' are null
SAFSNullPointerException

inputRecordSize

public int inputRecordSize()
                    throws SAFSNullPointerException

Purpose: int, the number of tokens in the inputRecord (based on separator)
Assumptions: don't pass along IndexOutOfBoundsException, that is caught and a length of zero is the correct size.

Returns:
int, the number of tokens in the inputRecord
Throws:
SAFSNullPointerException, - if either 'inputRecord' or 'separator' are null
SAFSNullPointerException

getTrimmedUnquotedInputRecordToken

public java.lang.String getTrimmedUnquotedInputRecordToken(int n)
                                                    throws SAFSNullPointerException

Purpose: This method takes the index 'n', retrieves the token from getInputRecordToken, trim() leading and trailing whitespace, and strips one leading and/or trailing quotation mark(#34)--if they exist.

Parameters:
n, - int, the index of which token to return,
Returns:
The n(th) token from the 'inputRecord' based on 'separator' is returned. if either 'inputRecord' or 'separator' are null, then SAFSException is thrown
Throws:
java.lang.IndexOutOfBoundsException - - if n is out of range (n < 0 || n >= inputRecordTokens.size()).
SAFSNullPointerException, - if either 'inputRecord' or 'separator' are null
SAFSNullPointerException

getNotSeparatorString

public java.lang.String getNotSeparatorString()

toString

public java.lang.String toString()
toString method

Overrides:
toString in class java.lang.Object

setShutdownData

public void setShutdownData()

getInstanceName

public java.lang.String getInstanceName()
Prefix used to retrieve and store SAFSVARS TestRecordData values. The most common instance name is STAFHelper.SAFS_HOOK_TRD This rarely ever needs to be changed by subclasses.


setInstanceName

public void setInstanceName(java.lang.String instanceName)
Prefix used to retrieve and store SAFSVARS TestRecordData values. The most common instance name is STAFHelper.SAFS_HOOK_TRD This rarely ever needs to be set/changed by subclasses.


copyData

public TestRecordData copyData(TestRecordData target)
Copies the object's data into the target data and returns the target.