|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.sqlunit.SymbolTable
public final class SymbolTable
Models a HashMap as a symbol table to store temporary variables and their values that are needed for a SQLUnit test case.
Field Summary | |
---|---|
static java.lang.String |
CURRENT_COL_KEY
Keeps track of current column in row |
static java.lang.String |
CURRENT_RESULTSET_KEY
Keeps track of current resultset |
static java.lang.String |
CURRENT_ROW_KEY
Keeps track of current row in resultset |
static java.lang.String |
DEBUG_LOGGER
Contains the debugging logger if set |
static java.lang.String |
FAILURE_MESSAGE_OBJ
Contains the failure message if available |
static java.lang.String |
FILE_HEADER
Indicates that the value is a LOB file name |
static java.lang.String |
JAVA_OBJECT_SUPPORT
Indicates if Java Object Support is enabled |
static java.lang.String |
OUT_PARAM
Contains outparam index mapping header |
static java.lang.String |
REPORTER_KEY
Holds a reference to the Reporter object |
static java.lang.String |
SKIP_REASON
Holds a reference to the most recent skipped reason |
static java.lang.String |
TEST_ELAPSED_TIME
Contains elapsed time for a test in milliseconds |
Method Summary | |
---|---|
static void |
dump()
Dumps the contents of the symbol table for inspection. |
static java.lang.String |
getCurrentResultKey()
Returns the current result key as a String. |
static java.lang.Object |
getObject(java.lang.String param)
Returns an object keyed by the param string from the symbol table. |
static java.util.Iterator |
getSymbols()
Returns an Iterator containing all the symbols in the Symbol table. |
static java.lang.String |
getValue(java.lang.String param)
Returns the value of the named variable. |
static boolean |
isVariableName(java.lang.String str)
By definition, a string which matches the pattern ${var} is considered to be a variable name in SQLUnit. |
static java.lang.String |
removeSymbol(java.lang.String param)
Removes a symbol from the symbol table. |
static void |
removeUserVariables()
Removes the references to the user variables set in a test after all tests are completed. |
static java.lang.String |
replaceVariables(java.lang.String text)
Replaces all variables in a string from the symbol table. |
static void |
setCurrentCol(java.lang.String colId)
Sets the current col for the test. |
static void |
setCurrentResultSet(java.lang.String resultSetId)
Sets the current resultset for the test. |
static void |
setCurrentRow(java.lang.String rowId)
Sets the current row for the test. |
static void |
setObject(java.lang.String param,
java.lang.Object obj)
Sets an object keyed by the param string into the symbol table. |
static void |
setSymbols(DatabaseResult target,
DatabaseResult source,
java.lang.String namespace)
Updates the symbol table with variables from a target resultset that are populated by a SQL or stored procedure call. |
static void |
setValue(java.lang.String param,
java.lang.String value)
Updates the symbol table with the symbol's value if it exists or creates a new entry in tha table with the given value if it does not. |
static void |
update(DatabaseResult target,
DatabaseResult source)
Scans the source DatabaseResult and the symbol table and updates the target DatabaseResult object in place. |
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 JAVA_OBJECT_SUPPORT
public static final java.lang.String FAILURE_MESSAGE_OBJ
public static final java.lang.String DEBUG_LOGGER
public static final java.lang.String FILE_HEADER
public static final java.lang.String OUT_PARAM
public static final java.lang.String TEST_ELAPSED_TIME
public static final java.lang.String CURRENT_RESULTSET_KEY
public static final java.lang.String CURRENT_ROW_KEY
public static final java.lang.String CURRENT_COL_KEY
public static final java.lang.String REPORTER_KEY
public static final java.lang.String SKIP_REASON
Method Detail |
---|
public static java.lang.Object getObject(java.lang.String param)
param
- the key into the symbol table.
public static void setObject(java.lang.String param, java.lang.Object obj)
param
- the key into the symbol table.obj
- the object keyed by the param value.public static java.lang.String getValue(java.lang.String param)
param
- the key into the symbol table.
public static void setValue(java.lang.String param, java.lang.String value)
param
- the variable name.value
- the value of the variable.public static java.util.Iterator getSymbols()
public static java.lang.String removeSymbol(java.lang.String param)
param
- the variable name to remove.
public static void setSymbols(DatabaseResult target, DatabaseResult source, java.lang.String namespace) throws SQLUnitException
target
- the target DatabaseResult containing variables.source
- the source DatabaseResult generated by a SQL or stored
procedure call.namespace
- the namespace in which the variables will be stored.
SQLUnitException
- if there was a problem.public static void update(DatabaseResult target, DatabaseResult source) throws SQLUnitException
source
- the source DatabaseResult returned from the SQL call.target
- the target DatabaseResult to update.
SQLUnitException
- if a variable does not appear in either
the source or the symbol table.public static boolean isVariableName(java.lang.String str)
str
- the String to check if it is a symbol.
public static java.lang.String replaceVariables(java.lang.String text) throws SQLUnitException
text
- the text with replaceable variables.
SQLUnitException
- if one or more variables is not found.public static void setCurrentResultSet(java.lang.String resultSetId)
resultSetId
- the id of the resultset tag.public static void setCurrentRow(java.lang.String rowId)
rowId
- the id of the row tag.public static void setCurrentCol(java.lang.String colId)
colId
- the id of the col tag.public static java.lang.String getCurrentResultKey()
public static void removeUserVariables()
public static void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |