public abstract class AbstractTestTable extends AbstractTestRecord
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
_commands |
static java.lang.String |
CYCLE_TABLE_FILE_EXTENSION
'CDD'
|
static java.lang.String |
DEFAULT_FIELD_SEPARATOR |
static java.lang.String |
STEP_TABLE_FILE_EXTENSION
'SDD'
|
static java.lang.String |
SUITE_TABLE_FILE_EXTENSION
'STD'
|
_parameters, BLOCKID_RECORD_TYPE, BREAKPOINT_RECORD_TYPE, COMPONENT_FUNCTION_FAILOK_RECORD_TYPE, COMPONENT_FUNCTION_RECORD_TYPE, COMPONENT_FUNCTION_WARNOK_RECORD_TYPE, DRIVER_COMMAND_FAILOK_RECORD_TYPE, DRIVER_COMMAND_RECORD_TYPE, DRIVER_COMMAND_WARNOK_RECORD_TYPE, EMPTY_PARAMETER, ENGINE_COMMAND_FAILOK_RECORD_TYPE, ENGINE_COMMAND_RECORD_TYPE, ENGINE_COMMAND_WARNOK_RECORD_TYPE, PROJECT_COMMAND_RECORD_TYPE, SKIPPED_RECORD_TYPE
Constructor and Description |
---|
AbstractTestTable(java.lang.String testTableName,
java.lang.String testTableFileExtension)
Create a new instance of a test table with the provided name and export file extension.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Command command)
Append the provided command\record to our table's store of test records.
|
java.lang.String |
exportTestRecord(java.lang.String fieldSeparator)
Exports the one record used to call the test table including the ending newline.
|
void |
exportToCSV(java.lang.String filePath)
Export the table to a field-delimited file in the specified filePath directory.
|
java.util.List |
getCommands()
Retrieve an unmodifiable List of this table's test record objects
|
protected java.lang.String |
getSAFSFileName()
Returns the concatenation of the table name, period, and table extension.
|
java.lang.String |
getTestRecordFieldSeparator()
Retrieve the single separator String character for this table.
|
java.lang.String |
getTestTableFileExtension()
Return the current file extension setting used during exports for this table.
|
java.lang.String |
getTestTableName()
Return the name of this test table.
|
boolean |
isExported()
Returns true if the table has already been exported.
|
void |
setTestRecordFieldSeparator(java.lang.String separator)
Specify an alternate single separator String (other than TAB) to be used to delimit
the fields in the records of this table.
|
void |
setTestTableFileExtension(java.lang.String testTableExtension)
Set the file extension to be used when exporting this test table.
|
protected void |
validateCommand(Command command)
Throw an IllegalArgumentException if the command is not valid.
|
addParameter, addParameters, appendParametersToTestRecord, getParameters
public static final java.lang.String DEFAULT_FIELD_SEPARATOR
public static final java.lang.String STEP_TABLE_FILE_EXTENSION
public static final java.lang.String SUITE_TABLE_FILE_EXTENSION
public static final java.lang.String CYCLE_TABLE_FILE_EXTENSION
protected java.util.List _commands
public AbstractTestTable(java.lang.String testTableName, java.lang.String testTableFileExtension)
testTableName
- -- the name cannot be null or zero-lengthtestTableFileExtension
- java.lang.IllegalArgumentException
- if testTableName is null or zero-lengthpublic final java.lang.String getTestTableName()
public final java.lang.String getTestTableFileExtension()
public final void setTestTableFileExtension(java.lang.String testTableExtension)
testTableExtension
- -- the file extension to use for this table.
Might be null or zero-length.public final java.lang.String getTestRecordFieldSeparator()
public final void setTestRecordFieldSeparator(java.lang.String separator)
separator
- -- String character used to delimite test record fieldsjava.lang.IllegalArgumentException
- if the provided separator is null or zero-length.public final java.util.List getCommands()
public final void add(Command command)
command
- java.lang.IllegalArgumentException
- if command is null or if validateCommand
throws the exception.public final boolean isExported()
protected void validateCommand(Command command)
Example: CallStep is not valid in Cycle and Suite tables.
Subclasses should override this method to check whether the specified command is valid for its test table type. If the command is not valid, an IllegalArgumentException with a detailed message should be thrown. Valid commands simply do not throw the exception.
command
- -- the command to validatejava.lang.IllegalArgumentException
- if the command is not valid for the current test table typeprotected java.lang.String getSAFSFileName()
public java.lang.String exportTestRecord(java.lang.String fieldSeparator)
A test table must export this test record when it is asked to do so.
fieldSeparator
- used to delimit fields in test recordpublic void exportToCSV(java.lang.String filePath)
filePath
- -- the full path to the directory in which the table should be exported.Copyright © SAS Institute. All Rights Reserved.