Database Verification Point Reference

prevnext

DatabaseVP Class


This class implements a database verification point.

The DatabaseVP object contains the metadata needed for encapsulating data in a DatabaseVPData object -- namely:

In addition, the DatabaseVP object contains the database verification point name. It also contains options for affecting the behavior of the verification point.

To execute the database verification point, call the performTest() method in this class (inherited from the VerificationPoint class).


Overview

public class DatabaseVP 
extends com.rational.test.vp.VerificationPoint
java.lang.Object 
  |
  +--com.rational.test.vp.VerificationPoint
        |
        +--com.rational.test.vp.DatabaseVP

Applicability

Commonly used with QualityArchitect.

This class requires QualityArchitect.


Summary

This class contains the following field:

Field Description
OPTION_TRIM static int. Specifies that values captured from the DatabaseVP should have whitespace trimmed from the right and left sides.

Fields Inherited from the VerificationPoint Class
bIsDefined, bIsValid, COMPARE_CASEINSENSITIVE, COMPARE_CASESENSITIVE, OPTION_EXPECT_FAILURE, OPTION_USER_ACKNOWLEDGE_BASELINE, sFailureDescription, VERIFICATION_ERROR, VERIFICATION_FAILED, VERIFICATION_NO_RESULT, VERIFICATION_SUCCEEDED

Note: To turn on multiple options, use the OR (|) operator. To remove an option after you have set it, but leave all other options unchanged, use the AND (&) and NOT (~) operators. The following are examples of turning options on and off:

This class contains the following methods:

Method Description
getCon() Retrieves the current connection object used to connect to the JDBC data source.
getJDBCdriver() Retrieves the current driver used in the connection to the JDBC data source.
getJDBCpassword() Retrieves the current password for connecting to the JDBC data source.
getJDBCurl() Retrieves the current URL used to connect to the JDBC data source.
getJDBCuser() Retrieves the current user ID for connecting to the JDBC data source.
getSQL() Retrieves the current SQL statement used to capture data from the JDBC data source.
getStmt() Retrieves the current JDBC statement.
readFile() Deserializes a verification point object from the specified InputStream.
setCon() Sets the connection object for the JDBC data source.
setJDBCdriver() Sets the JDBC driver used to connect to the JDBC data source.
setJDBCpassword() Sets the password for the connection to the JDBC data source.
setJDBCurl() Sets the JDBC URL used in the connection to the JDBC data source.
setJDBCuser() Sets the user ID for the connection to the JDBC data source.
setSQL() Sets the SQL statement to use in capturing data from the JDBC data source.
setStmt() Sets the JDBC statement.
writeFile() Serializes the verification point object to the specified OutputStream.

Methods Inherited from the VerificationPoint Class
codeFactory_getPrefix, codeFactory_setPrefix, getIsDefined, getLog, getLogActualFile, getLogBaselineFile, getLogMetaFile, getMasterBaselineFile, getMasterMetaFile, getOptions, getVPname, initializeVP, performTest, performTest, performTest, setIsDefined, setOptions, setVPname


Constructor

The constructor takes one of three forms, depending on the parameters passed to it:


Syntax 1

This constructor specifies only the name of the verification point. If you execute the verification point before specifying its metadata, the tester is prompted to specify the verification point's metadata. The metadata includes JDBC connection information and a SQL statement to capture the data to test.

public DatabaseVP(java.lang.String sVPname)

Element Description
sVPname The name of the verification point (40 characters maximum).


Syntax 2

This constructor specifies the name of the verification point plus the verification point's metadata.

public DatabaseVP(java.lang.String sVPname, java.lang.String 
sSQL, java.lang.String sJDBCuser, java.lang.String 
sJDBCpassword, java.lang.String sJDBCdriver, 
java.lang.String sJDBCurl)

Element Description
sVPname The name of the verification point (40 characters maximum).
sSQL The select statement that this DatabaseVP uses to capture data from the data source.
sJDBCVuser The JDBC user name.
sJDBCpassword The JDBC password for the user.
sJDBCdriver The Java class for the JDBC driver for this data source.
sJDBCurl The URL specifying the target JDBC data source.


Syntax 3

This constructor specifies the name of the verification point, the verification point's metadata, and any options that customize the behavior of the verification point.

public DatabaseVP(java.lang.String sVPname, java.lang.String 
sSQL, java.lang.String sJDBCuser, java.lang.String 
sJDBCpassword, java.lang.String sJDBCdriver, 
java.lang.String sJDBCurl, int iOptions)

Element Description
sVPname The name of the verification point (40 characters maximum).
sSql The select statement that this DatabaseVP uses to capture data from the data source.
sJDBCuser The JDBC user name.
sJDBCpassword The JDBC password for the user.
sJDBCdriver The Java class for the JDBC driver for this data source.
sJDBCurl The URL specifying the target JDBC data source.
iOptions A bitfield of options that customize the behavior of this verification point. Options can include the following pre-defined options and any user-defined options:
  • OPTION_TRIM

  • The following options inherited from VerificationPoint:

  • COMPARE_CASESENSITIVE

  • COMPARE_CASEINSENSITIVE

  • OPTION_USER_ACKNOWLEDGE_BASELINE

  • OPTION_EXPECT_FAILURE

COMPARE_CASESENSITIVE is the default.


DatabaseVP.getCon()

Retrieves the current connection object used to connect to the JDBC data source.


Syntax

public java.sql.Connection getCon()

Return Value

The current connection object.


DatabaseVP.getJDBCdriver()

Retrieves the current driver used in the connection to the JDBC data source.


Syntax

public java.lang.String getJDBCdriver()

Return Value

The current JDBC driver.


DatabaseVP.getJDBCpassword()

Retrieves the current password for connecting to the JDBC data source.


Syntax

public java.lang.String getJDBCpassword()

Returns Value

The current password.


DatabaseVP.getJDBCurl()

Retrieves the current URL used to connect to the JDBC data source.


Syntax

public java.lang.String getJDBCurl()

Return Value

The current URL.


DatabaseVP.getJDBCuser()

Retrieves the current user ID for connecting to the JDBC data source.


Syntax

public java.lang.String getJDBCuser()

Return Value

The current user ID.


DatabaseVP.getSQL()

Retrieves the current SQL statement used to capture data from the JDBC data source.


Syntax

public java.lang.String getSQL()

Return Value

The current SQL statement.


DatabaseVP.getStmt()

Retrieves the current JDBC statement.


Syntax

public java.sql.Statement getStmt()

Return Value

The current JDBC statement.


DatabaseVP.readFile()

Deserializes a verification point object from the specified InputStream.


Syntax

public void readFile(java.io.InputStream in)

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


Exceptions

This method throws the following exception:


Comments

This method implements readFile() in the VerificationPoint class.


DatabaseVP.setCon()

Sets the connection object for the JDBC data source.


Syntax

public void setCon(java.sql.Connection con)

Element Description
con The connection object to use in connecting to the JDBC data source.


Comments

If con is not provided, a new object is created by the database verification point, as necessary.


DatabaseVP.setJDBCdriver()

Sets the JDBC driver used to connect to the JDBC data source.


Syntax

public void setJDBCdriver(java.lang.String sJDBCdriver)

Element Description
sJDBCdriver The driver used to connect to the JDBC data source.


DatabaseVP.setJDBCpassword()

Sets the password for the connection to the JDBC data source.


Syntax

public void setJDBCpassword(java.lang.String sJDBCpassword)

Element Description
sJDBCpassword The password for connecting to the JDBC data source.


DatabaseVP.setJDBCurl()

Sets the JDBC URL used in the connection to the JDBC data source.


Syntax

public void setJDBCurl(java.lang.String sJDBCurl)

Element Description
sJDBCurl The URL used in the connection to the JDBC data source.


DatabaseVP.setJDBCuser()

Sets the user ID for the connection to the JDBC data source.


Syntax

public void setJDBCuser(java.lang.String sJDBCuser)

Element Description
sJDBCuser The user ID for connecting to the JDBC data source.


DatabaseVP.setSQL()

Sets the SQL statement to use in capturing data from the JDBC data source.


Syntax

public void setSQL(java.lang.String sSQL)

Element Description
sSQL The SQL statement to use.


DatabaseVP.setStmt()

Sets the JDBC statement.


Syntax

public void setStmt(java.sql.Statement stmt)

Element Description
stmt The JDBC statement.


Comments

If stmt is not provided, a new object is created by the database verification point, as necessary.


DatabaseVP.writeFile()

Serializes the verification point 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

Metafile format is used so that the Rational comparators can read the file. For information, see Step 5. Provide Serialization Services for the Metadata.

This method implements writeFile() in the VerificationPoint class.

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