Verification Services |
This section outlines the actions that you, the test designer, need to take to set up a verification point in a test script.
Use the following actions outlined as a guideline for setting up a verification point. You may need to perform other actions to accommodate the requirements of a particular verification point implementation.
Note that the verification point framework does much of the work that is required to perform a verification.
To set up a static verification point:
The following sections provide information to help you perform these steps.
The specialized VerificationPoint
class encapsulates a verification point's metadata. Metadata includes the following kinds of information:
Verification point metadata can be specified either explicitly or implicitly:
VerificationPoint
class, or it is specified through user-defined set...
methods in the specialized VerificationPoint
class.
Verification points that you record using the Rational QualityArchitect Session Recorder or that you generate through a Rational Rose model are explicitly defined -- that is, the metadata is automatically hard-coded to the constructor.
Note: Because explicitly provided metadata can be assigned to test script variables, you can use datapools to supply metadata information to your test scripts.
defineVPcallback()
method. This method runs a user-defined UI that prompts the tester for the metadata information. (The UI is typically developed by the verification point implementer.) After the metadata is captured, the framework writes the metadata to the datastore.
Note: Because implicitly provided metadata is retrieved from the datastore rather than being assigned to test script variables, you cannot use datapools with this type of metadata.
For more information about how to provide verification point metadata, see VerificationPoint Class.
To execute a verification point, call the performTest()
method in the specialized VerificationPoint
class, as follows:
performTest()
method.
null
to the performTest()
method.
Using the metadata in the specialized VerificationPoint
class, the framework captures the actual data for the test. The framework also checks the datastore for an expected (baseline) data object to compare against the actual data:
However, if no expected data object exists and you have included the OPTION_USER_ACKNOWLEDGE_BASELINE
option in the setOptions()
method, the framework first invokes an implementer-defined UI that prompts the tester to verify that the captured data is correct.
If the tester accepts the displayed data as being correct, the framework stores the data object in the datastore as the expected data for subsequent tests. If the tester rejects the displayed data, the framework logs an error, and verification point execution ends. No expected data object is stored.
For an example of a static verification point setup in a test script, see Example of a Static Database Verification Point.
Setting up a dynamic verification point is similar to setting up a static verification point. However, before the test script executes the verification point, the test script must create the expected data object. The framework is responsible for capturing and building the actual data object, just as it does for a static verification point.
You create the expected data object using the appropriate implementation of the VerificationPointData
interface.
After the expected data object is created, you can pass it to the performTest()
method when you execute the verification point.
For an example of a dynamic verification point setup in a test script, see Example of a Dynamic Database Verification Point.
Setting up a manual verification point is similar to setting up a static verification point. However, before the test script executes the verification point, the test script must create both the expected and actual data objects.
You create the expected and actual data objects using the appropriate implementation of the VerificationPointData
interface.
After the expected and actual data objects are created, you can pass them to the performTest()
method when you execute the verification point.
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 |