Rational QualityArchitect/Java API
Version 1.0

com.rational.test.vp
Class DatabaseVPData

java.lang.Object
  |
  +--com.rational.test.vp.DatabaseVPData
All Implemented Interfaces:
DataTable, VerificationPointData

public class DatabaseVPData
extends java.lang.Object
implements VerificationPointData, DataTable

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:

If you want to build a DatabaseVPData object by hand in order to run a dynamic 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.

Since:
QualityArchitect 0.1
See Also:
DatabaseVP

Constructor Summary
DatabaseVPData()
           
 
Method Summary
 java.lang.String[] getColumns()
          This method retrieves the column names in the table.
 java.util.Vector getData()
          This method retrieves data from the table.
 java.lang.String getFileExtension()
          This method returns the extension of the file used to store the data object.
 int getNumCols()
          This method retrieves the number of columns in the table.
 int getNumRows()
          This method retrieves the number of rows in the table.
 void readFile(java.io.InputStream in)
          This method reads the expected or actual data object from the specified InputStream.
 void setColumns(java.lang.String[] asColumns)
          This method specifies the column names in the table.
 void setData(java.util.Vector vData)
          This method specifies the data in the table.
 void writeFile(java.io.OutputStream out)
          This method writes the expected or actual data object to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseVPData

public DatabaseVPData()
Method Detail

getColumns

public java.lang.String[] getColumns()
Description copied from interface: DataTable
This method retrieves the column names in the table.
Specified by:
getColumns in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Returns:
An array of the column names in the table.

getData

public java.util.Vector getData()
Description copied from interface: DataTable
This method retrieves data from the table. Each array contains one row of data.
Specified by:
getData in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Returns:
A Vector of arrays of data in the table.

getFileExtension

public java.lang.String getFileExtension()
Description copied from interface: VerificationPointData

This method returns the extension of the file used to store the data object. The framework uses the file extension to determine the type of file format to use when it serializes files (for example, a CSV extension indicates a comma-separated-value text file).

Note: In the current release, CSV is the only supported file format. Other formats will be supported in future releases.

Specified by:
getFileExtension in interface VerificationPointData
Following copied from interface: com.rational.test.vp.VerificationPointData
Returns:
The extension of the file used to store the data object.

getNumCols

public int getNumCols()
Description copied from interface: DataTable
This method retrieves the number of columns in the table.
Specified by:
getNumCols in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Returns:
The number of columns in the table.

getNumRows

public int getNumRows()
Description copied from interface: DataTable
This method retrieves the number of rows in the table.
Specified by:
getNumRows in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Returns:
The number of rows in the table.

readFile

public void readFile(java.io.InputStream in)
              throws java.io.IOException,
                     java.lang.ClassNotFoundException
Description copied from interface: VerificationPointData

This method reads the expected or actual data object from the specified InputStream.

Specified by:
readFile in interface VerificationPointData
Following copied from interface: com.rational.test.vp.VerificationPointData
Parameters:
in - The InputStream from which the object is read.
Throws:
java.io.IOException - An input/output error has occurred.

setColumns

public void setColumns(java.lang.String[] asColumns)
Description copied from interface: DataTable
This method specifies the column names in the table.
Specified by:
setColumns in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Parameters:
asColumns - The array of the column names in the table.

setData

public void setData(java.util.Vector vData)
Description copied from interface: DataTable
This method specifies the data in the table. Each element in the Vector is an array of strings containing one row of data.
Specified by:
setData in interface DataTable
Following copied from interface: com.rational.test.vp.DataTable
Parameters:
vData - The data in the table.

writeFile

public void writeFile(java.io.OutputStream out)
               throws java.io.IOException
Description copied from interface: VerificationPointData

This method writes the expected or actual data object to the specified OutputStream.

Specified by:
writeFile in interface VerificationPointData
Following copied from interface: com.rational.test.vp.VerificationPointData
Parameters:
out - The OutputStream to which the object is written.
Throws:
java.io.IOException - An input/output error has occurred.

30-Jun-2003

Rational QualityArchitect/Java Support Home Page
Copyright (c) 2000, Rational Software Corporation