Database Verification Point Reference

prevnext

DatabaseVPData Class


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 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.


Overview

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

Applicability

Commonly used with QualityArchitect.

This class requires QualityArchitect.


Summary

This class contains the following methods:

Method Description
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.

Methods Inherited from Class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait


Constructor


Syntax

public DatabaseVPData()

DatabaseVPData.getColumns()

Retrieves the column names in the table.


Syntax

public java.lang.String[] getColumns()

Comments

This method is specified by getColumns() in interface DataTable.


DatabaseVPData.getData()

Retrieves data from the table. Each array contains one row of data.


Syntax

public java.util.Vector getData()

Return Value

A Vector of arrays of strings, with each array representing one row of data from the recordset.


Comments

This method is specified by getData() in the DataTable interface.


DatabaseVPData.getFileExtension()

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.


Syntax

public java.lang.String getFileExtension()

Return Value

The extension of the file used to store the data object.


Comments

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.


DatabaseVPData.getNumCols()

Retrieves the number of columns in the table.


Syntax

public int getNumCols()

Return Value

The number of columns in the table.


Comments

This method is specified by getNumCols() in the DataTable interface.


DatabaseVPData.getNumRows()

Retrieves the number of rows in the table.


Syntax

public int getNumRows()

Return Value

The number of rows in the table.


Comments

This method is specified by getNumRows() in the DataTable interface.


DatabaseVPData.readFile()

Reads the expected or actual data object from the specified InputStream.


Syntax

public void readFile(java.io.InputStream in)

Element Description
in The InputStream from which the data is read.


Exceptions

This method throws the following exception:


Comments

This method is specified by readFile() in the VerificationPointData interface.


DatabaseVPData.setColumns()

Specifies the column names in the table.


Syntax

public void setColumns(java.lang.String[] asColumns)

Element Description
asColumns The array of the column names in the table.


Comments

This method is specified by setColumns() in the DataTable interface.


Example

For an example of this method, see Example of a Dynamic Database Verification Point.


DatabaseVPData.setData()

Specifies the data in the table. Each element in the Vector is an array of strings containing one row of data.


Syntax

public void setData(java.util.Vector vData)

Element Description
vData The data in the table.


Comments

This method is specified by setData() in the DataTable interface.


Example

For an example of this method, see Example of a Dynamic Database Verification Point.


DatabaseVPData.writeFile()

Writes the expected or actual data object to the specified OutputStream.


Syntax

public void writeFile(java.io.OutputStream out)

Element Description
out The OutputStream to which the object is written.


Exceptions

This method throws the following exception:


Comments

This method is specified by writeFile() in the VerificationPointData interface.

prevnext


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