Rational QualityArchitect User's Guide
Rational® QualityArchitect
Users Guide
Preface xi
1
Introduction 1
2
Basic Concepts 5
3
Testing Enterprise JavaBeans 29
4
Testing COM Components 99
A
Template Replacement Variables 119
B
Troubleshooting 139
Glossary 143
Index 147
Contents
Preface
Audience
Other Resources
Integrations Between Rational Testing Tools and OtherRational Products
Contacting Rational Technical Publications
Contacting Rational Customer Support
Introduction
What You Need to Get Started
Supported Environments
If You Are Testing Enterprise JavaBeans
If You Are Testing COM, DCOM, and COM+ Components
Installing Rational QualityArchitect
Quick Start
Step 1: Working in the Rational Administrator
Step 2: Working in Rose
Step 3: Working in Your IDE
Working In Visual Basic
Basic Concepts
Test Script Basics
Test Types
Storing Your Tests Scripts
Templates
Scenario Tests
Support for Performance Testing
Modifying the Template
Modifying a Generated Test Script
Executing the Load Test
Support for Verification Points
Templates for Scenario Test Generation
Message Signatures and Data Correlation
Signature Options
Message Syntax
Editing Message Signatures
How Message Signatures Correlate to Datapool Fields
Message Signature Examples
Stubs
Templates for Stub Generation
EJB
COM/VB
Test Script Services
Datapools
Datapools in Scenario Tests
Datapools in Unit Tests
Data Types
Verification Points
How Data Is Verified
Static, Dynamic, and Manual Verification Points
Database Verification Point
The Query Builder
Extensibility
Testing Enterprise JavaBeans
Overview
EJB TestScripts
Packages Imported Into EJB Test Scripts
Documentation Conventions
Requirements for EJB Testing
Supported JDKs
Application Server Classpath Requirements
Classpath Requirements for the Sun J2EE Reference Server
Classpath Requirements for WebLogic 5.1
Classpath Requirements for WebLogic 6.1
Classpath Requirements for Remote WebSphere 3.5
Rational Test Script Playback Requirements
EJB Session Recorder Requirements
Modifying the Additional Classpath Field
Rational TestManager Playback Requirements
Visual Age/WebSphere Requirements
Visual Cafe/WebLogic Requirements
Adding WebLogic to the Global Classpath in Visual Café
The Rational Bank Account Sample Application
Setting Up the Sample Application for VAJ/WebSphere
Importing the Sample into VAJ
Creating the Database
Configuring VAJ to Use the New Sample Database
Adding EJB Support
Deploying the Sample Application in the VAJ Test Environment
Importing the Required JAR Files
Deploying the Sample Application to a WebLogic Application Server
Deploying the Sample Application to WebLogic 5.1
Deploying the Sample Application to WebLogic 6.1
Deploying the Sample Application to the Sun J2EE Reference Server
Configuring Visual Cafe to Run the Sample Application
Adding Account Information to the Rational Bank Account Sample
Reverse Engineering a Deployed EJB into Rose
Generating EJB Test Assets
Generating EJB Test Scripts
Generating EJB Unit Test Scripts and Datapools from a Rose Model
Populating the Datapool
Generating Test Scripts with the EJB Session Recorder
Generating Stubs and Lookup Tables for the Unit Test
Populating the Lookup Tables
Importing Test Assets into Your IDE
Importing Test Assets into VAJ
Importing Test Assets into Visual Cafe
Deploying Stubs to a WebLogic Application Server
Deploying Stubs Permanently to a WebLogic Server
Deploying Stubs to a Running WebLogic Server (Hot Deployment)
The wl_deploy Build Folder
Building and Hot Deploying the Sample Application and Stubs
Undeploying the Sample Application
Deploying Your Own Stubs
Deploying Stubs to the Sun J2EE Reference Server
Executing Test Scripts
Editing Host Name and Port Number Variables
For WebLogic and Sun J2EE Application Servers
For WebSphere
Executing Test Scripts from VAJ
Executing Test Scripts from Visual Cafe
Executing Test Scripts from TestManager
Using EJB Scenario Tests to Test Transactions
Using the Java Query Builder to Add Database Verification Points
Connecting to the Database via JDBC
JDBC Driver
JDBC URL
User Name
Password
Designing a Custom Query Statement
Using the Query Design Wizard
Viewing and Verifying the SQL Query Results
Using the EJB Session Recorder
Setting Up the Java Runtime Environment (JRE)
Starting the EJB Session Recorder
Starting the EJB Session Recorder from the Console
Starting the EJB Session Recorder from Visual Cafe
Passing in Command Line Parameters (optional)
Starting the EJB Session Recorder from Visual Age for Java
Creating a New Project
Importing JavaHelp
Importing Xerces
Importing the Remaining Jar Files from the QualityArchitect Directory
Importing rttssjava.jar
Importing Deployed EJBs
Checking the Classpath and Launching the EJB Session Recorder
Passing in Command Line Parameters (optional)
Using the EJB Session Recorder with the Sample Application
Starting a Recording Session
Connecting to an EJB
Interacting with the Home Interface
Interacting with the Remote Interface
Inserting a Verification Point
Viewing the XML Log
Generating a Test Script from the XML Log
Testing COM Components
Overview
Testing Existing Objects
Testing with Iterative Development
Programming in Visual Basic
Requirements for Testing COM Components
Working with the Sample Model
Understanding the Component View
Understanding the Logical View
Generating COM Test Assets
Generating COM Unit Test Scripts and Datapools from a Rose Model
Populating the Datapool
Generating Stubs and Lookup Tables for the Unit Test
Populating the Lookup Tables
Recompiling with the Stub
Executing Test Scripts
Using COM Scenario Tests to Test Transactions
Using the OLE DB Query Builder to Add Database Verification Points
Connecting to the Database via OLE DB
Designing a Custom SQL Statement
Using the Query Design Wizard
Reviewing the Record Set
Accepting the Query
DatabaseVP Advanced Options
Template Replacement Variables
Replacement Variables for Unit Test Generation Templates
Variables Used in All Unit Test Generation Templates
Variables Used Only with the COM/Visual Basic Templates
Variables Used Only with the EJB Templates
Replacement Variables for Scenario Test Generation Templates
Variables Used in Both the COM/VB and EJB Templates
Variables Used Only in the COM/VB Scenario Test Templates
Variables Used Only in the EJB Scenario Test Templates
Replacement Variables for Stub Generation Templates
Replacement Variables for the COM/VB Stub Templates
Replacement Variables for the EJB Stub Templates
Troubleshooting
Resource File Not Found
Symptom
Explanation
COM Test Scripts Fail to Run from TestManager
Symptom
Explanation
Command Line Example
EJB Class or Interface Not Found Messages
Java Query Builder Failing to Connect to Cloudscape Database
java.naming.communication Error in Test Log Window
Glossary
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
Q
R
S
T
U
V
W
X
Index