background image
<< Reverse Engineering | Generating Unit Test Scripts >>
<< Reverse Engineering | Generating Unit Test Scripts >>

Generating EJB Test Assets

Generating EJB Test Assets
51
There are two ways to reverse engineer EJBs:
s
You can drag and drop an EJB JAR file onto a class diagram.
s
You can use the filter field on the Reverse Engineering dialog box (
Java > Reverse
Engineer Java
) to reverse engineer a JAR file or to reverse engineer the .class or
.java files and the .xml files that comprise an EJB.
When you use the Reverse Engineering dialog box to select the .class or .java files that
are part of an EJB, you must also select the XML deployment descriptor (the .xml file)
in the same reverse engineering operation. The deployment descriptor defines the
associations that make up an EJB. Without the deployment descriptor, Rose J cannot
recreate an accurate view of your EJB classes.
Also, in order for Rose J to resolve references to J2EE API classes, you will need to
update your classpath setting with a path to the
j2ee.jar
file (for example,
d:\j2sdkee1.2.1\lib\j2ee.jar
). For information about extending the classpath within Rose,
see the Classpath Help topic in the Rose J Help. For additional information and
requirements, see About Reverse Engineering in the Rose J Help.
Generating EJB Test Assets
This section explains how to generate the various test assets you need to test EJBs
with QualityArchitect. Test assets include test scripts, datapools, stubs, and lookup
tables.
Generating EJB Test Scripts
QualityArchitect provides two ways to create EJB test scripts. The method you choose
depends on the processes in place on your development and testing team and on the
state of the component-under-test.
The recommended way to create test scripts is to model the component-under-test in
Rational Rose and generate test scripts from the Rose model. However, if you have
already built or partially built a component, you can do the following:
s
Reverse engineer the component into Rose and generate test scripts from the
model.
s
Use the EJB Session Recorder to interactively generate test scripts from the log file.