Verification Point Framework Reference

prevnext

IVerificationPoint Interface


An implementation of this interface must contain the verification point's metadata -- that is, the information that determines the data to capture for this verification point. Examples of verification point metadata include the connection string for connecting to a target database and the SQL statement for querying the database.

Don't confuse metadata with the data being verified. The data being verified is encapsulated by an implementation of the interface IVerificationPointData.

A verification point's metadata can be defined in either of these ways:

For more information about specifying metadata, see Step 1. Specify the Metadata for the Verification Point.

An implementation of this interface must also implement its own serialization. By requiring your specific verification point implementations to perform their own serialization, you can support all file formats (such as INI and XML).

Note: The current release only supports the .vpm and .ini formats.


Overview

Extends IVPFramework.

IVPFramework extends IVPDispatch.

Known subclass:
IDatabaseVP


Applicability

Commonly used with QualityArchitect.

QualityArchitect is required for use of this interface.


Summary

This interface contains the following property:

Property Description
Options Retrieves or sets options associated with the current verification point. This property stores any options that affect the behavior of IVerificationPointComparator or IVerificationPointDataProvider. Options include the following pre-defined options plus any user-defined options:
  • VPOPTION_COMPARE_CASEINSENSITIVE. Text comparisons are not case sensitive. By default, text comparisons are case sensitive.

  • VPOPTION_EXPECT_FAILURE. The verification point's expected result is failure. If the comparison fails and this option is set, the verification point succeeds.

  • VPOPTION_USER_ACKNOWLEDGE_BASELINE. The first run of a static verification point should display the captured data for the tester to validate before storing it as the expected (baseline) data object

This interface contains the following methods:

Method Description
CodeFactory
GetConstructorInvocation
Declares a variable for the verification point being constructed.
CodeFactory
GetExternalizedInputDecl
Declares a variable for each value being input programmatically to the constructor.
CodeFactory
GetExternalizedInputInit
Initializes a variable for each value being input programmatically to the constructor.
CodeFactory
GetNumExternalizedInputs
Specifies the number of responses (inputs) that a tester provided when defining verification point metadata interactively through a UI.
CodeFactory
GetNumPropertySet
Specifies the number of calls to CodeFactoryGetPropertySet that are required to fully specify the verification point's definition.
CodeFactory
GetPropertySet
Sets a given property for the verification point.
DefineVP Provides a way to capture the metadata for the verification point -- typically, by presenting the tester with a UI device, such as the Query Builder tool provided with QualityArchitect (for use with the database verification point).

Note: For more information about these code factory methods, see The Code Factory Methods.


IVerificationPoint.CodeFactoryGetConstructorInvocation

Declares a variable for the verification point being constructed.


Syntax

CodeFactoryGetConstructorInvocation(Language As CTDScriptTypes) 
As String

Element Description
Language The language of your verification point implementation. Valid values include:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP


Return Value

A string containing a declaration for this verification point type. The declaration is syntactically correct for the specified language.


Comments

This method is never called from the test script. This method is called when a test script is generated from a Rose model.

This method provides a constructor call. This call plus the variables declared by CodeFactoryGetExternalizedInputDecl and set by CodeFactoryGetPropertySet allow the QualityArchitect code generator to create a fully specified verification point in the generated test script code.

For information about the QualityArchitect code generator, see the Generating Test Assets in the Rational QualityArchitect online documentation.


IVerificationPoint.CodeFactoryGetExternalizedInputDecl

Declares a variable for each value being input programmatically to the constructor.


Syntax

CodeFactoryGetExternalizedInputDecl(Language As CTDScriptTypes, 
InputNumber As Integer) As String

Element Description
Language The language of your verification point implementation. Valid values include:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP

InputNumber A number that indicates the current variable to declare. The number should start at 0 and increment by 1 in a loop.


Return Value

A line of code that declares the variable indicated by InputNumber. The code is syntactically correct for the specified language.


Comments

This method is never called from the test script. This method is called when a test script is generated from a Rose model.

The Rose scenario test generator calls this method in a loop that iterates as many times as there are variables to declare (that is, the number retrieved from CodeFactoryGetNumExternalizedInputs).

Variables declared with this method are used in the code generated by CodeFactoryGetPropertySet and CodeFactoryGetExternalizedInputInit.


IVerificationPoint.CodeFactoryGetExternalizedInputInit

Initializes a variable for each value being input programmatically to the constructor.


Syntax

CodeFactoryGetExternalizedInputInit(Language As CTDScriptTypes, 
InputNumber As Integer) As String

Element Description
Language The language of your verification point implementation. Valid values include:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP

InputNumber A number that indicates the current variable to initialize. The number should start at 0 and increment by 1 in a loop.


Return Value

A line of code that initializes the variable indicated by InputNumber. The code is syntactically correct for the specified language.


Comments

This method is never called from the test script. This method is called when a test script is generated from a Rose model.

The Rose scenario test generator calls this method in a loop that iterates as many times as there are variables to initialize (that is, the number returned from CodeFactoryGetNumExternalizedInputs).

Variables initialized with this method are declared by CodeFactoryGetExternalizedInputDecl and used by CodeFactoryGetPropertySet.


IVerificationPoint.CodeFactoryGetNumExternalizedInputs

Specifies the number of responses (inputs) that a tester provided when defining verification point metadata interactively through a UI. The UI was presented to the tester through the DefineVP method.


Syntax

CodeFactoryGetNumExternalizedInputs(Language As CTDScriptTypes) 
As Integer

Element Description
Language The language of your verification point implementation. Valid values include:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP


Return Value

The number of tester inputs that require variable declarations to be made in the specified language.


Comments

This method is never called from the test script. This method is called when a test script is generated from a Rose model.


IVerificationPoint.CodeFactoryGetNumPropertySet

Specifies the number of CodeFactoryGetPropertySet calls that are required to fully specify the verification point's definition.


Syntax

CodeFactoryGetNumPropertySet(Language As CTDScriptTypes) As 
Integer

Element Description
Language The language of your verification point implementation. Valid values:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP


Return Value

The number of calls that are required to CodeFactoryGetPropertySet.


Comments

NumProps represents the total number of properties that need to be set for the verification point. Each property is set through a separate call to CodeFactoryGetPropertySet in syntax appropriate for the specified language.

This method is never called from the test script. This method is called when a test script is generated from a Rose model.


IVerificationPoint.CodeFactoryGetPropertySet

Sets a given property for the verification point.


Syntax

CodeFactoryGetPropertySet(Language As CTDScriptTypes, 
InputNumber As Integer) As String

Element Description
Language The language of your verification point implementation. Valid values:
  • CTD_SCRIPTTYPE_JAVA

  • CTD_SCRIPTTYPE_VB

  • CTD_SCRIPTTYPE_CPP

InputNumber A number that indicates the current property to set. The number should start at 0 and increment by 1 in a loop.


Return Value

A line of code that sets the property indicated by InputNumber. The code is syntactically correct for the specified language.


Comments

This method is never called from the test script. This method is called when a test script is generated from a Rose model.

The Rose scenario test generator calls this method in a loop that iterates as many times as there are properties to set (that is, the number retrieved by CodeFactoryGetNumPropertySet).


IVerificationPoint.DefineVP

Provides a way to capture the metadata for the verification point -- typically, by presenting the tester with a UI device, such as the Query Builder tool provided with QualityArchitect (for use with the database verification point).


Syntax

DefineVP()

Comments

The framework automatically invokes this method if the verification point is not fully defined when the PerformTest method is invoked.

When DefineVP is invoked, it should capture, presumably through some UI, any information necessary to fully define the metadata for the verification point, and then populate the verification point's attributes with the captured metadata. For example, the DefineVP method included with the database verification point provided with QualityArchitect invokes the Query Builder software. Query Builder captures the connection string for the target database plus a SQL statement, and then populates the database verification point object with the captured metadata, resulting in a fully defined verification point.

This method applies to the verification point metadata, not to the data itself that is captured in accordance with the metadata. The specialized Verification Point Data Provider interface uses the metadata to determine which data to capture.

If the verification point is being generated through a Rose model, this method is invoked at script generation time. The resulting verification point metadata will automatically be provided to the test script. As a result, the DefineVP method will not be invoked at script playback time.

Implement this method only if you are implementing a new verification point.

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