Database Verification Point Reference |
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).
public class DatabaseVP extends com.rational.test.vp.VerificationPoint java.lang.Object | +--com.rational.test.vp.VerificationPoint | +--com.rational.test.vp.DatabaseVP
Commonly used with QualityArchitect.
This class requires QualityArchitect.
This class contains the following field:
OPTION_TRIM
static int
. Specifies that values captured from the DatabaseVP
should have whitespace trimmed from the right and left sides.
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:
MyVP.setOptions(OPTION_TRIM | OPTION_EXPECT_FAILURE);
OPTION_TRIM
option, but leaves all other options unchanged:
MyVP.setOptions(MyVP.Options & (~OPTION_TRIM));
This class contains the following methods:
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.
The constructor takes one of three forms, depending on the parameters passed to it:
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.
publicDatabaseVP
(java.lang.StringsVPname
)
sVPname
The name of the verification point (40 characters maximum).
This constructor specifies the name of the verification point plus the verification point's metadata.
publicDatabaseVP
(java.lang.StringsVPname
, java.lang.StringsSQL
, java.lang.StringsJDBCuser
, java.lang.StringsJDBCpassword
, java.lang.StringsJDBCdriver
, java.lang.StringsJDBCurl
)
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.
publicDatabaseVP
(java.lang.StringsVPname
, java.lang.StringsSQL
, java.lang.StringsJDBCuser
, java.lang.StringsJDBCpassword
, java.lang.StringsJDBCdriver
, java.lang.StringsJDBCurl
, intiOptions
)
Retrieves the current connection object used to connect to the JDBC data source.
public java.sql.Connection getCon
()
The current connection object.
Retrieves the current driver used in the connection to the JDBC data source.
public java.lang.String getJDBCdriver
()
Retrieves the current password for connecting to the JDBC data source.
public java.lang.String getJDBCpassword
()
Retrieves the current URL used to connect to the JDBC data source.
public java.lang.String getJDBCurl
()
Retrieves the current user ID for connecting to the JDBC data source.
public java.lang.String getJDBCuser
()
Retrieves the current SQL statement used to capture data from the JDBC data source.
public java.lang.String getSQL
()
Retrieves the current JDBC statement.
public java.sql.Statement getStmt
()
Deserializes a verification point object from the specified InputStream.
public voidreadFile
(java.io.InputStreamin
)
in
The InputStream from which the object is read.
This method throws the following exception:
This method implements readFile()
in the VerificationPoint
class.
Sets the connection object for the JDBC data source.
public voidsetCon
(java.sql.Connectioncon
)
con
The connection object to use in connecting to the JDBC data source.
If con
is not provided, a new object is created by the database verification point, as necessary.
Sets the JDBC driver used to connect to the JDBC data source.
public voidsetJDBCdriver
(java.lang.StringsJDBCdriver
)
sJDBCdriver
The driver used to connect to the JDBC data source.
Sets the password for the connection to the JDBC data source.
public voidsetJDBCpassword
(java.lang.StringsJDBCpassword
)
sJDBCpassword
The password for connecting to the JDBC data source.
Sets the JDBC URL used in the connection to the JDBC data source.
public voidsetJDBCurl
(java.lang.StringsJDBCurl
)
sJDBCurl
The URL used in the connection to the JDBC data source.
Sets the user ID for the connection to the JDBC data source.
public voidsetJDBCuser
(java.lang.StringsJDBCuser
)
sJDBCuser
The user ID for connecting to the JDBC data source.
Sets the SQL statement to use in capturing data from the JDBC data source.
public voidsetSQL
(java.lang.StringsSQL
)
sSQL
The SQL statement to use.
public voidsetStmt
(java.sql.Statementstmt
)
If stmt
is not provided, a new object is created by the database verification point, as necessary.
Serializes the verification point 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:
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.
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 |