|
Rational QualityArchitect/Java API Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rational.test.ct.LookUpTable
This class lets a method in a stub access a lookup table.
A lookup table lets you test a component whose operation depends upon an associated component that is still in the development stages. To test the component, you first provide a stub of the unfinished component that contains the component's methods. When the component-under-test calls a method in the stub, the method simulates operation by retrieving information from the lookup table that would otherwise be generated during normal execution in the completed component. The method then presents the retrieved information to the calling component-under-test.
The information that a stub's method retrieves from the lookup table depends upon the values that the component-under-test passes to the method. In other words, a method finds the lookup-table row that contains the parameter values that the component-under-test passed to it, and then retrieves the appropriate value(s) (such as a return value and exceptions) from that same lookup-table row.
Typically, you create a lookup table for each stub method that is called during testing of the component-under-test.
A lookup table is actually an abstraction of a datapool, and the underlying files used for both lookup tables and datapools are the same. As a result, when it is time to replace the stub with the completed component, you can use the lookup table as a datapool when you test the associated component-under-test.
Field Summary | |
protected TestLog |
log
Provides access to the logging services in the TestLog class. |
Constructor Summary | |
LookUpTable()
Initializes the LookUpTable class. |
Method Summary | |
void |
close()
This method closes the current lookup table (that is, the lookup table associated with this instance of the LookUpTable class). |
boolean |
find(java.lang.String[] names,
java.lang.String[] values)
This method sets the cursor to the row in the current lookup table that contains the column value(s) passed to it. |
java.lang.Throwable |
getExpectedException()
This method returns the contents of the expectedException column in the current lookup table row. |
java.lang.String |
getReturnValue()
This method returns the contents of the expectedReturn column in the current lookup table row. |
java.lang.String |
getValue(java.lang.String colName)
This method returns the contents of the specified column in the current lookup table row. |
void |
open(java.lang.String tablename)
This method opens the specified lookup table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TestLog log
Constructor Detail |
public LookUpTable()
Method Detail |
public void close()
This method closes the current lookup table (that is, the lookup table associated with this instance of the LookUpTable class).
public boolean find(java.lang.String[] names, java.lang.String[] values) throws LookUpTableException
This method sets the cursor to the row in the current lookup table that contains the column value(s) passed to it. Subsequent value-retrieval methods act upon the row with the cursor.
If multiple rows contain the passed value(s), this method throws an exception.
names
- An array containing one or more lookup-table column names.values
- An array containing a value for each corresponding column name
passed to the method.true
, the cursor was successfully set to the row that
matched the specified criteria. If false
, a row could not be found
that matched the specified criteria.LookUpTableException
- Reports problems attempting
to set the cursor to a row in the lookup table.
If you handle this exception and do not log it, TestManager will not be aware of the exception and will not log a Fail result for it. The script will continue to run, and TestManager could log a Pass Result for the script.
public java.lang.Throwable getExpectedException() throws LookUpTableException
LookUpTableException
- Reports problems attempting
to retrieve the contents of the Exception column.
If you handle this exception and do not log it, TestManager will not be aware of the exception and will not log a Fail result for it. The script will continue to run, and TestManager could log a Pass Result for the script.
public java.lang.String getReturnValue() throws LookUpTableException
LookUpTableException
- Reports problems attempting to retrieve the contents of the Return Value column.
If you handle this exception and do not log it, TestManager will not be aware of the exception and will not log a Fail result for it. The script will continue to run, and TestManager could log a Pass Result for the script.
public java.lang.String getValue(java.lang.String colName) throws LookUpTableException
colName
- The name of the column containing the value to retrieve.LookUpTableException
- Reports problems attempting to retrieve the contents of the specified column.
If you handle this exception and do not log it, TestManager will not be aware of the exception and will not log a Fail result for it. The script will continue to run, and TestManager could log a Pass Result for the script.
public void open(java.lang.String tablename) throws LookUpTableException
This method opens the specified lookup table.
Only one lookup table can exist for a given instance of the LookUpTable
class.
tablename
- The name of the lookup table to open.LookUpTableException
- Reports problems attempting to open the specified lookup table.
If you handle this exception and do not log it, TestManager will not be aware of the exception and will not log a Fail result for it. The script will continue to run, and TestManager could log a Pass Result for the script.
|
30-Jun-2003 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |