Database Verification Point Reference

prevnext

About the Database Verification Point


A database verification point is a pre-constructed verification point used to verify data in a data source. This is the verification point that you typically use in COM/DCOM testing.

You can use this verification point within a test script to ensure that the changes that the component-under-test makes to the data source are correct.

Note: To see Interface Definition Language (IDL) equivalents of the methods in this chapter, see IDL Equivalents.


Requirements for Using the Database Verification Point

The database verification point requires Rational QualityArchitect.


Components of the Database Verification Point

The database verification point uses the following interfaces:


Type Libraries

The interfaces in this chapter are defined in the type library RTIVP.TLB. Using the Visual Basic OLE/COM object viewer, you can find information about this type library under "Rational QualityArchitect COM Verification Point Interface Type Library" (RTIVP in the Object Browser).

The coclasses in this chapter are implemented in the type library RTCOMVP.DLL. Using the Visual Basic OLE/COM object viewer, you can find information about this type library under "Rational Quality Architect Playback Type Library" (RTCOMVPLib in the Object Browser).

RTIVP.TLB and RTCOMVP.DLL are located in the Rational\Rational Test\QualityArchitect folder.


Examples

This section contains examples of how you can insert a static and a dynamic database verification point into a test script.

Note that the verification point framework does much of the work for you. The test script defines the verification point's metadata and callis the PerformTest method in the specialized Verification Point interface. Depending on whether you are inserting a static, dynamic, or manual verification point, the test script might also build the expected data object and the actual data object.

For an overview of the steps that are required to insert a verification point into a script, see Setting Up Verification Points in Test Scripts.


Example of a Static Database Verification Point

In a static verification point, the PerformTest method does not pass data objects to the verification point. As a result, the framework must provide both the expected (baseline) and actual data objects.

Dim StaticVP As New DatabaseVP
StaticVP.VPname = "NewTest1"
StaticVP.SQL = "SELECT * FROM COFFEES"
StaticVP.ConnectionString = 
	 	 	 "Provider=MSDASQL.1;Persist Security Info=False;
	 	 	 Data Source=COFFEEBREAK"
StaticVP.PerformTest 0

Dynamic Database Verification Point Example

In a dynamic verification point, the test script creates a DatabaseVPData object for the expected data and passes the expected data object to the verification point through the PerformTest method. As a result, the framework encapsulates only the actual data object.

Dim DynamicVP As New DatabaseVP
Dim myExpected As New DatabaseVPData
Dim Columns(1 To 3) As String
Dim Row(1 To 3) As String
Dim result As VPResult

Columns(1) = "ID"
Columns(2) = "Brand"
Columns(3) = "Price"

Row(1) = "1"
Row(2) = "Peets"
Row(3) = "5.5"

myExpected.Columns = Columns
myExpected.Row(0) = Row

DynamicVP.VPname = "DynamicVP"
DynamicVP.SQL = "SELECT * FROM COFFEES WHERE ID = 1"
DynamicVP.ConnectionString = 
	 	 	 "Provider=MSDASQL.1;Persist Security Info=False;
	 	 	 Data Source=COFFEEBREAK"
result = DynamicVP.PerformTest(0, myExpected)

prevnext


Rational Test Script Services for Visual Basic Rational Software Corporation
Copyright (c) 2003, Rational Software Corporation http://www.rational.com
support@rational.com
info@rational.com