blob: e735fe934efa263ee474ec6acb88ae3b1ff2e360 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Raymond Leung">
<meta name="GENERATOR" content="Mozilla/4.72 [en] (Windows NT 5.0; U) [Netscape]">
<title>EJB-RDB Mapping Smoke Test</title>
</head>
<body>
<h2>
EJB-RDB Mapping Smoke Test (07/12/01)</h2>
<h3>
Top-down Scenario (also tests meet-in-middle functions):</h3>
<ol>
<li>
Open an empty workbench.</li>
<li>
Import university3.jar</li>
<ol TYPE=a>
<li>
Select Menu "File/Import".</li>
<li>
Select "EJB Jar File" as import source. Hit the "Next" button.</li>
<li>
Enter the path name to the EJB Jar file "university3.jar" or use the "browse"
button to locate the jar file.</li>
<li>
Give an EJB Project name "University".</li>
<li>
Hit the "Finish" button to import everything in the jar file.</li>
<li>
The wizard will take a while to import the EJB jar file.</li>
<li>
Verify that a project named "University" has been created in the Navigator
view.</li>
</ol>
<li>
Creating a Top-Down EJB-RDB Mapping</li>
<ol TYPE=a>
<li>
Select the "University" project, right click to bring up the pop-up menu
and select "New/Others...".</li>
<li>
A dialogue will come up. On the left pane, select "EJB". Then on the right
pane, select "EJB to RDB Mapping".</li>
<li>
Hit the "Next" button.</li>
<li>
Accept the default to create a Top Down mapping. Hit the "Next" button.</li>
<li>
Accept the default for Target Database etc. and hit the "Next" button to
go to the Advanced Option page.</li>
<li>
Mark the checkboxes for "VapFaculty", "VapInstructor" and "VapPartTimeInstructor"
and leave the checkbox for "VapSubstituteInstructor" unchecked.</li>
<li>
Hit the "Finish" button. The wizard will now create the mappings.</li>
<li>
Expand the "university" project if it is not already expanded by clicking
on the "+" sign.</li>
<li>
Expand along the folders "University/ejbModule/META-INF". Verify that there
is a folder "Schema".</li>
<li>
Expand the folder "Schema" and verify there is a file "Schema.dbxmi" in
it.</li>
<li>
Verify that there is also a file "Map.mapxmi" in the "META-INF" folder.</li>
</ol>
<li>
Open the Mapping</li>
<ol TYPE=a>
<li>
Select the file "Map.mapxmi".</li>
<li>
Double-click on it or select the menu item "Open" in the pop-up menu.</li>
<li>
Verify that the mapping editor is launched in the main window.</li>
<li>
Verify that at the upper left of the main window, the contents of the EJB
Jar is displayed, "VapFaculty", "VapCourse"...</li>
<li>
Verify that at the upper right of the main window, the contents contains
a database named "SAMPLE" containing RDB Tables "VAPFACULTY", "VAPCOURSE"...</li>
<li>
Verify that below the EJB Jar and RDB Table views is the Overview of the
mapping. Verify that both columns (EJBs and Tables) are not empty.</li>
<li>
Look for the Outline View. If it is not open, it can be opened by selecting
from the "Perspective" menu "Perspective/Show View/Outline".</li>
<li>
Verify that the outline view is not empty. Mappings are displayed using
the symbol "&lt;->".</li>
</ol>
<li>
Verify that different types of attributes and nested beans are imported.</li>
<ol TYPE=a>
<li>
Expand the "VapFaculty" EJB in the EJBs view.</li>
<li>
Verify that there is a "VapInstructor" EJB nested in it.</li>
<li>
Verify that there are attributes "hireDate", "name", "numberOfDependents",
"salary", "facultyNumber", "address" and "deptSortKey". Verify that "facultyNumber"
is a key.</li>
<li>
Verify that there are relationship roles "advisedStudents", "headsDepartment",
"classes" and "department".</li>
<li>
Expand the "VapInstructor" EJB.</li>
<li>
Verify that there are two EJBs nested inside it: "VapSubstituteInstructor"
and "VapPartTimeInstructor".</li>
<li>
Verify that there is also an attribute "terminationDate" under "VapInstructor".</li>
</ol>
<li>
Verify that the correct leaf tables are created.</li>
<ol TYPE=a>
<li>
Inspect the Tables view on the right hand side.</li>
<li>
Verify that there are tables "VAPFACULTY", "VAPINSTRUCTOR", "VAPPARTTIMEINSTRUCTOR".</li>
<li>
Verify that there is NO table named "VAPSUBSTITUTEINSTRUCTOR". Remember
"VapSubstituteInstructor" wais not marked as a leaf table when the mapping
was created.</li>
</ol>
<li>
Verify that the various views are in sync.</li>
<ol TYPE=a>
<li>
Collapse "VapFaculty" in the EJBs view.</li>
<li>
Select the "VapFaculty &lt;-> VAPFACULTY" item (mapping) in the Outline
view. Verify that the corresponding items in the EJBs view, Tables view
and Overview view are selected.</li>
<li>
Select the "VapCourse &lt;-> VAPCOURSE" item in the Outline view&nbsp;
and verify the selected items in the other views are updated correspondingly.</li>
<li>
Now, go to the EJBs view (upper left in the main window) and select the
"VapStudent" (single click). Verify that the "VapStudent &lt;-> VAPSTUDENT"
item in the Outline view is selected. Also verify that "VapStudent" is
selected in the Overview view. However, the Tables view should still stay
on "VAPCOURSE".</li>
<li>
Now, double-click "VapStudent" in the EJBs view, verify that "VAPSTUDENT"
in the Tables view is selected and no other selections should change.</li>
<li>
Next, select "VAPSCHEDULEDCLASS" in the Tables view (upper right in the
main window) and verify that the selected items in the Outline view and
Overview view change to "VapScheduledClass" and "VapScheduledClass &lt;->
VAPSCHEDULEDCLASS" correspondingly. However, the selection in the EJBs
view should still stay on "VapStudent".</li>
<li>
Now, double-click on "VAPSCHEDULEDCLASS" in the Tables view. verify that
"VapSheduledClass" in the EJBs view is selected. No other selections should
change.</li>
<li>
Now, select "VapDepartment" in the first column of the Overview view and
verify that the corresponding items in the other views are updated.</li>
<li>
Now, select "VAPSTAFF" in the 2nd column of the Overview view and verify
that the corresponding items in other views are updated.</li>
</ol>
<li>
Verify nested EJB mappings</li>
<ol TYPE=a>
<li>
Double-click on "VapFaculty" in the EJBs view. Verify that only "VAPFACULTY"
in the Tables view is selected.</li>
<li>
Expand "VapFaculty" in the EJBs view. Double-click on "VapInstructor".
Verify that both "VAPFACULTY" and "VAPINSTRUCTOR" are selected in the Tables
view.</li>
<li>
Expand "VapInstructor" in the EJBs view. Double-click on "VapSubstituteInstructor".
Verify that both "VAPFACULTY" and "VAPINSTRUCTOR" are selected in the Tables
view, i.e. same as for "VapInstructor".</li>
<li>
Double-click on "VapPartTimeInstructor" in the EJBs view and verify that
"VAPFACULTY", "VAPINSTRUCTOR" and "VAPPARTTIMEINSTRUCTOR" in Tables view
are selected.</li>
<li>
Now, double-click&nbsp; on "VAPFACULTY" in Tables view. Verify that "VapFaculty",
"VapInstructor", "VapSubstituteInstructor" and "VapPartTimeInstructor"
in the EJBs view are selected. Also verify that the 4 corresponding mappings
are selected in the Outline and Overview views.</li>
<li>
Double-click on "VAPINSTRUCTOR" in the Tables view. Verify that "VapInstructor",
"VapSubstituteInstructor" and "VapPartTimeInstructor" in the EJBs view
are selected. Also verify the 3 corresponding mappings are selected in
the Outline and Overview views.</li>
<li>
Double-click on "VAPPARTTIMEINSTRUCTOR" in the Tables view. Verify that
only "VapPartTimeInstructor" in the EJBs view is selected.</li>
</ol>
<li>
Verify that deletion and undo/redo work</li>
<ol TYPE=a>
<li>
Select "VapCourse &lt;-> VAPCOURSE" mapping in the Outline view.</li>
<li>
Right-click to bring up the pop-up menu and select "Delete".</li>
<li>
Verify that the row corresponding to this mapping in the Overview view
disappeared.</li>
<li>
Verify that the mapping icons for "VapFaculty" in the EJBs view and "VAPFACULTY"
in the Tables view now have a hollow circle indicating the items are not
mapped.</li>
<li>
From the menu bar, select "Edit/Undo Remove" to undo the deletion. Verify
that "VapFaculty" and "VAPFACULTY" reappear in the Overview view, the mapping
"VapFaculty &lt;-> VAPFACULTY" reappears in the Outline view and the mapping
icons in the EJBs view and Tables view become solid again.</li>
<li>
Right-click on the "VapFaculty" item in the EJBs view to bring up the pop-up
menu and select "Redo Remove". Verify that it goes back to the state before
the undo step.</li>
</ol>
<li>
Remove all tables. This is to prepare for the next two tests.</li>
<ol TYPE=a>
<li>
Select all the tables in the Tables view by clicking on the first table
and then holding down the shift-key and clicking on the last table.</li>
<li>
Select the "Delete" item from the "Edit" menu in the menu bar.</li>
<li>
Verify that there are no mappings, other than the root EJB &lt;-> Database
mapping, in the Overview and Outline views.</li>
</ol>
<li>
Verify that copy and paste works.</li>
<ol TYPE=a>
<li>
Select "VapStaff" in the EJBs view.</li>
<li>
Right-click to bring up the pop-up menu and select "Copy".</li>
<li>
Move over to the Tables view, right-click on "SAMPLE" and select "Paste".</li>
<li>
Verify that a table "VAPSTAFF" is created and mappings are established
between the attributes in "VapStaff" and the columns in "VAPSTAFF".</li>
</ol>
<li>
Verify that drag and drop works.</li>
<ol TYPE=a>
<li>
Select "VapDepartment" in the EJBs view.</li>
<li>
Drag and drop it onto "SAMPLE" in the Tables view.</li>
<li>
Verify that a table "VAPDEPARTMENT" is created and mappings are established
between the attributes in "VapDepartment" and the columns in "VAPDEPARTMENT".</li>
</ol>
<li>
Verify that there are no internal errors</li>
<ol TYPE=a>
<li>
Because the EJBs cross reference each other and these cross references
are mapped to foreign keys in Tables, the columns and their mappings are
not complete until tables corresponding to all the EJBs are created. Expand
the tables "VAPSTAFF" and "VAPDEPARTMENT" and click on some of the columns
(especially the foreigh keys) to display their properties. Verify that
there are no internal errors or exceptions.</li>
</ol>
<li>
Verify add/delete mapping actions are properly enabled</li>
<ol TYPE=a>
<li>
Select "VapStaff" on the EJBs view. (single click)</li>
<li>
Select "VAPSTAFF" on the Tables view. (single click)</li>
<li>
Verify that the icons for removing/creating mappings and matching items
are disabled.</li>
<li>
Click on the menu item "EJB to RDB Mapping Editor" in the menu bar and
verify that all the menu items for creating/removing mappings (including
matching items) are disabled.</li>
<li>
Expand "VapStaff" in the EJBs view and select "salary".</li>
<li>
Expand "VAPSTAFF" in the Tables view and select "SALARY".</li>
<li>
Verify that the remove mapping icon is enabled.</li>
<li>
Verify that the "Remove Mapping" menu item is enabled in the "EJB to RDB
Mapping Editor" menu.</li>
</ol>
<li>
Remove mappings.</li>
<ol TYPE=a>
<li>
Remove the mapping by clicking on the remove mapping icon (the scissors
icon).</li>
<li>
Verify that the icons for "salary" and "SALARY" have a hollow circle indicating
there are no mappings for the two items.</li>
<li>
Verify also that the corresponding items representing the mapping were
removed from the Overview and Outline views.</li>
<li>
Go to the Overview view and expand "VapStaff" if it is not already expanded.</li>
<li>
Select all the items under "VapStaff" (but not "VapStaff" itself) in the
first column. Use Shift-click or Ctrl-Click.</li>
<li>
Right click to bring up the pop-up menu and select "Delete".</li>
<li>
Verify all the mappings under "VapStaff" are deleted in both the Overview
and Outline views.</li>
<li>
Verify the columns "SALARY", "NUMBER", "NAME" etc. still exist under "VAPSTAFF"
in the Tables view. Only the mappings were deleted, not the columns themselves.</li>
<li>
Verify all the attributes under "VapStaff" and columns under "VAPSTAFF"
have no mappings by inspecting their icons.</li>
</ol>
<li>
Verify that "Remove Mapping" is enabled only when there are no sub-mappings.</li>
<ol TYPE=a>
<li>
Select "VapStaff" in the EJBs view and select "VAPSTAFF" in the Tables
view.</li>
<li>
Verify that the "Remove Mapping", "Match by Name" and "Match by Type" icons
and menu itmes under "EJB to RDB Mapping Editor" are enabled. Verify that
the "Create Mapping" menu item is disabled because there is already a mapping
between "VapStaff" and "VAPSTAFF". We only deleted the mappings between
the attributes and columns, not between the EJB and Table.</li>
</ol>
<li>
Rename column (Prepare for Match by Type/Name)</li>
<ol TYPE=a>
<li>
Find the Properties view. If it is not visible, you can add it to your
workbench through the menu "Perspective/Show View/Properties".</li>
<li>
Select the Column "SALARY" in Table "VAPSTAFF".</li>
<li>
Go to the Properties view and click on the value of the property "Name".
This will make the string editable.</li>
<li>
Move to the end of the string and add a "2", i.e. change the name from
"SALARY" to "SALARY2".</li>
<li>
Hit the "Enter" key and verify that the name of the column is updated on
all the other views.</li>
</ol>
<li>
Match by Type/Name.</li>
<ol TYPE=a>
<li>
With "VapStaff" selected in the EJBs view and "VAPSTAFF" in the Tables
view, click the "Match by Name" icon or select the "Match by Name" menu
item under the "EJB to RDB Mapping Editor" menu.</li>
<li>
Verify that "number", "name", "title", and "department" are mapped.</li>
<li>
Reselect "VapStaff" in the EJBs view and "VAPSTAFF" in the Tables view.</li>
<li>
Verify that now only the "Match by Type" icon and menu item is enabled.</li>
<li>
Click the "Match by Type" icon.</li>
<li>
Verify that the "salary" attribute under "VapStaff" is mapped.</li>
</ol>
<li>
Verify role / foreign key mapping.</li>
<ol TYPE=a>
<li>
Double-click on "department" under "VapStaff". Verify that the "DEPARTMENT"
foreign key under "VAPSTAFF" in the Tables view is selected.</li>
<li>
Double-click on "DEPARTMENT" under "VAPSTAFF" in the Tables view. Verify
that two roles are selected in the EJBs view: the "department" role under
"VapStaff" and the "staff" (reverse) role under "VapDepartment".</li>
</ol>
<li>
Undo the creatation of mappings.</li>
<ol TYPE=a>
<li>
Select the "Undo" menu item under the "Edit" menu to undo the "Match by
Type" action.</li>
<li>
Select the "Undo" menu item again to undo the "Match by Name" action.</li>
<li>
Verify that all the items under "VapStaff" and "VAPSTAFF" are not mapped
by inspecting their icons.</li>
</ol>
<li>
Verify that mapping icons are enabled base on types.</li>
<ol TYPE=a>
<li>
Select "salary" under "VapStaff" in the EJBs view.</li>
<li>
Select "SALARY" under "VAPSTAFF" in the Tables view.</li>
<li>
Verify that the "Create Mapping", "Match by Type" and "Match by Name" icons
and menu items are enabled.</li>
<li>
Select "NUMBER" under "VAPSTAFF" in the Tables view.</li>
<li>
Verify that the "Create Mapping", "Match by Type" and "Match by Name" icons
and menu items are now disabled.</li>
</ol>
<li>
Verify Redo of Match commands work.</li>
<ol TYPE=a>
<li>
Select "Redo Match by Name" under the "Edit" menu on the menu bar.</li>
<li>
Verify that now "number", "name", "title", and "department" are mapped.</li>
<li>
Verify there are no exceptions or internal errors.</li>
<li>
Select "Redo Match by Type" under the "Edit" menu on the menu bar.</li>
<li>
Verify that now "salary" is also mapped.</li>
</ol>
</ol>
<h3>
Bottom-Up Scenario:</h3>
<ol>
<li>
Open an empty workbench or close all editors and delete the "University"
project.</li>
<li>
Create a Database by importing the univeristy3.jar, creating a top-down
mapping and then deleting everything except the tables in the database.</li>
<ol TYPE=a>
<li>
Import university3.jar and create a Top-Down EJB-RDB Mapping as described
in step 2 and 3 above.</li>
<li>
Expand "University/ejbModule/META-INF" in the Navigator view.</li>
<li>
Delete everything under the "University" project except "ejbModule/META-INF/Schema/Schema.dbxmi",
especially the "Map.mapxmi", "ejb-jar.xmi", "ibm-ejb-jar-bnd.xmi", "ibm-ejb-jar-ext.xmi"
files under "ejbModule/META-INF".</li>
</ol>
<li>
Create a Bottom-Up Mapping.</li>
<ol TYPE=a>
<li>
Select the project "University" in the Navigator view.</li>
<li>
Right-click to bring up the pop-up menu. Select "Generate for enterprise
bean(s)/Create EJB to RDB Mapping".</li>
<li>
A "Create new EJB/RDB Mapping" dialog will come up with the "Bottom Up"
option selected.</li>
<li>
Hit the "Finish" button.</li>
<li>
Verify that "ejb-jar.xml", "ibm-ejb-jar-ext.xmi" and "Map.mapxmi" are created
under "ejbModule/META-INF".</li>
<li>
Verify that some java files are created under the "bottom/up" folder.</li>
</ol>
<li>
Open the mapping.</li>
<ol TYPE=a>
<li>
Select "Map.mapxmi" and double-click on it.</li>
<li>
Expand all the EJBs and verify that all the attributes and roles are mapped
(i.e. the icons have solid circles)</li>
<li>
Verify that all the attributes have a type.</li>
<li>
Expand the EJB "Vapstaff".</li>
<li>
Verify that the "salary" attribute has a type "java.math.BigDecimal".</li>
<li>
Verify that the "number" attribute is a key (the icon has a key).</li>
<li>
Verify that the type for "number" is "byte[]".</li>
<li>
Verify that there is a role "department" and the type is "Vapdepartment".</li>
</ol>
<li>
Verify that tables cannot be deleted.</li>
<ol TYPE=a>
<li>
Select the table "VAPSTAFF" in the Tables view.</li>
<li>
Right-click to bring up the pop-up menu and verify that the "Delete" item
is disabled.</li>
<li>
Click on the "Edit' menu on the menu bar and verify that the "Delete" item
is disabled.</li>
</ol>
<li>
Delete an EJB and undo.</li>
<ol TYPE=a>
<li>
Select the EJB "Vapstaff" in the EJBs view.</li>
<li>
Right-click to bring up the pop-up menu and select "Delete" to delete the
EJB "Vapstaff".</li>
<li>
Verify that the EJB "Vapstaff" disappears from the EJBs view.</li>
<li>
Verify that there are no mappings in the Outline and Overview views that
reference "Vapstaff" and "VAPSTAFF".</li>
<li>
Verify that there is no mappings in the Outline and Overview views that
reference a null object.</li>
<li>
Select "Edit/Undo Remove" from the menu bar.</li>
<li>
Verify that the EJB "Vapstaff" reappears and all the mappings between "Vapstaff"
and "VAPSTAFF" also reappear.</li>
</ol>
<li>
Change the name of an EJB.</li>
<ol TYPE=a>
<li>
Open the Properties view if it is not already open by selecting "Perspective/Show
View/Properties".</li>
<li>
Select "Vapstaff" in the EJBs view.</li>
<li>
Click on the value field of the property "Name", i.e. the string "Vapstaff".
This should enable editing of the cell.</li>
<li>
Change the string to "Vapstaff2". Hit the enter key.</li>
<li>
Verify that "Vapstaff" is now changed to "Vapstaff2" in the EJBs view as
well as in the Overview and Outline views.</li>
</ol>
<li>
Change properties of an EJB attribute.</li>
<ol TYPE=a>
<li>
Select the "salary" attribute of "Vapstaff2".</li>
<li>
Go to the Properties view and change the name to "salary2".</li>
<li>
Hit the return key and verify that "salary" is changed to "salary2" everywhere.</li>
<li>
Click on the value field for "Type" in the Properties view. The field should
turn into a combo box with a button on the right.</li>
<li>
Click on the button to reveal the list of possible types. Select a different
type, say, "java.lang.Integer".</li>
<li>
Verify that the type of the "salary2" is changed in all the various views.</li>
</ol>
<li>
Order of EJBs can be re-arranged by drag-and-drop.</li>
<ol TYPE=a>
<li>
Select the EJB "Vapstaff2" in the EJBs view.</li>
<li>
Hold down the left mouse button and drag the item away from its location.
A horizontal line should appear as an indication the new position of the
dragged item. Move the mouse upwards until the line indicate that "Vapstaff2"
will be the first item in the ejb-jar. Release the mouse button.</li>
<li>
Verify that "Vapstaff2" is now the first EJB in the ejb-jar.</li>
</ol>
<li>
EJBs can be made subtypes by drag-and-drop.</li>
<ol TYPE=a>
<li>
Select the EJB "Vapstaff2" in the EJBs view.</li>
<li>
Hold down the left mouse button and drag and drop it onto EJB "Vapstudent".</li>
<li>
Verify that "Vapstaff2" is now an unmapped subtype of "Vapstudent".</li>
</ol>
<li>
Verify that the content of the Database cannot be changed.</li>
<ol TYPE=a>
<li>
Select Table "VAPSTAFF". Click the left mouse button and drag the item
away from its current location.</li>
<li>
Verify that no horizontal line appears and the order of the tables cannot
be changed.</li>
</ol>
</ol>
</body>
</html>