Database Verification Point Reference |
This class encapsulates and serializes the data being verified by the database verification point.
The data that this class stores is conceptually just a recordset. The data is stored in two data constructs represented in the DataTable
interface:
vector
of arrays of strings, with each array representing one row of data from the recordset.
If you want to build a DatabaseVPData
object by hand in order to run a dynamic or manual verification point, you can do so by populating the Columns
and Data
objects using the get...
and set...
methods provided in this class.
You can find an example of a hand-built DatabaseVPData
object in the section Example of a Dynamic Database Verification Point on page145.
public class DatabaseVPData extends java.lang.Object implements com.rational.test.vp.VerificationPointData, com.rational.test.vp.DataTable java.lang.Object | +--com.rational.test.vp.DatabaseVPData
Commonly used with QualityArchitect.
This class requires QualityArchitect.
This class contains the following methods:
getColumns()
Retrieves the column names in the table.
getData()
Retrieves data from the table
getFileExtension()
Returns the extension of the file used to store the data object
getNumCols()
Retrieves the number of columns in the table.
getNumRows()
Retrieves the number of rows in the table.
readFile()
Reads the expected or actual data object from the specified InputStream.
setColumns()
Specifies the column names in the table.
setData()
Specifies the data in the table.
writeFile()
Writes the expected or actual data object to the specified OutputStream.
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
public DatabaseVPData
()
Retrieves the column names in the table.
public java.lang.String[] getColumns
()
This method is specified by getColumns()
in interface DataTable
.
Retrieves data from the table. Each array contains one row of data.
public java.util.Vector getData
()
A Vector
of arrays of strings, with each array representing one row of data from the recordset.
This method is specified by getData()
in the DataTable
interface.
Returns the extension of the file used to store the data object.
Note: In the current release, CSV is the only supported file format. Other formats will be supported in future releases.
public java.lang.String getFileExtension
()
The extension of the file used to store the data object.
The verification point framework uses the file extension to determine the format to use when it serializes files (for example, a CSV extension indicates a comma-separated-value text file).
This method is specified by getFileExtension()
in the VerificationPointData
interface.
Retrieves the number of columns in the table.
public int getNumCols
()
The number of columns in the table.
This method is specified by getNumCols()
in the DataTable
interface.
Retrieves the number of rows in the table.
public int getNumRows
()
The number of rows in the table.
This method is specified by getNumRows()
in the DataTable
interface.
Reads the expected or actual data object from the specified InputStream.
public voidreadFile
(java.io.InputStreamin
)
in
The InputStream from which the data is read.
This method throws the following exception:
This method is specified by readFile()
in the VerificationPointData
interface.
Specifies the column names in the table.
public voidsetColumns
(java.lang.String[]asColumns
)
asColumns
The array of the column names in the table.
This method is specified by setColumns()
in the DataTable
interface.
For an example of this method, see Example of a Dynamic Database Verification Point.
Specifies the data in the table. Each element in the Vector
is an array of strings containing one row of data.
public voidsetData
(java.util.VectorvData
)
This method is specified by setData()
in the DataTable
interface.
For an example of this method, see Example of a Dynamic Database Verification Point.
Writes the expected or actual data object to the specified OutputStream.
public voidwriteFile
(java.io.OutputStreamout
)
out
The OutputStream to which the object is written.
This method throws the following exception:
This method is specified by writeFile()
in the VerificationPointData
interface.
Rational Test Script Services for Java | Rational Software Corporation |
Copyright (c) 2003, Rational Software Corporation | http://www.rational.com support@rational.com info@rational.com |