background image
<< Generating scenario tests | Connecting to the Database via JDBC >>
<< Generating scenario tests | Connecting to the Database via JDBC >>

Using the Java Query Builder

72
Chapter 3 - Testing Enterprise JavaBeans
8
In the Define Verification Points dialog box, click
Yes
to add a verification point
for the first message in the diagram--
getBalance
.
9
In the Select Verification Point Type dialog box, select a verification point type and
click
OK
.
For this release, select the database verification point type--
DatabaseVP
.
10
At this point, the Query Builder wizard starts. Use the Query Builder to connect to
the database and to define a Select statement that can be used to query the
database. For more information about the Query Builder, see Using the Java Query
Builder to Add Database Verification Points
on page 72.
11
Repeat Steps 8 and 9 for each message in the diagram.
12
After the last message, you are prompted to add a verification point at the end of
the scenario. Click
Yes
.
13
Select a directory to store the tests in and click
OK
.
Note:
You can also start the scenario test generator by right-clicking a diagram in the
Rose browser and then clicking
QualityArchitect > Generate Scenario Test
.
Using the Java Query Builder to Add Database Verification
Points
The QualityArchitect Java Query Builder is a tool that helps you connect to and
interact with JDBC data sources for the purpose of defining database verification
points. The Query Builder uses a wizard-like interface that lets you build a query one
step at a time. Once built, the query is used with a database verification point.
To understand more about the Query Builder, consider what happens if you generate
a scenario test for the Multiple Correlated sequence diagram in the sample
application. (See Using EJB Scenario Tests to Test Transactions on page 70.) This
sequence diagram contains the following messages:
s
openCheckingAcct
s
deposit