Working with test projects and units
All resources in an Eclipse-based platform are contained in projects. You
must create integration component library projects to contain integration
components, you must create user projects to contain shortcuts to components,
and you must create test projects in the Integrated Test Environment
to contain definitions for tests.
A test unit is a resource created in the workbench that defines a test.
Integrated Test Environment is designed to let you test an entire interface,
and an interface typically centers around a collaboration object, so a
test unit centers around a collaboration object as well. You can define
all the test units you want to run in a single test project, or can create
multiple test projects and add test units to them as appropriate to organize
them according to your preference.
Configuring test project preferences
Before creating either test projects or test units you should configure
the preferences related to both. Do the following to configure your preferences
related to test projects and units:
-
Select Window > Preferences from the menu bar of the workbench.
-
Select Integrated Test Environment.
Figure 58 shows
the Integrated Test Environment preferences.
-
Enable the Create a default ITE project automatically if none exists
checkbox if you want Integrated Test Environment to create a default project
named DefaultITEProject if you are creating a test unit and no
project already exists.
-
Enable the Open the new test unit in the editor upon creation checkbox
if you want to automatically open a test unit definition in the Test Unit
Editor after you create it.
-
Enable the Deploy only if the artifact is not in the server (by default)
checkbox if you only want to deploy a component if it does not already
exist in the server repository.
-
Click OK.
Creating a test project
Do the following to create a test project to store the individual test
units you will create:
-
Select File > New > Other from the menu bar.
-
Select Integrated Test Environment from the list of wizards.
-
Select WBI ITE Project from the list of projects.
-
Click Next.
-
At the "New Integrated Test Environment Project" screen, type a name for
the test project in the Project name field.
Project names can only contain alphanumeric characters and underscores,
and must be specified in English.
-
To have the folder for the library created in the default location (your
workspace) and with a name identical to the name specified for the library,
leave the Use default location checkbox enabled.
If you want to specify the name and location of the library folder,
do the following:
-
Clear the Use default location checkbox.
-
Type the full path and name of the directory that you want to use for the
library in the Location field, or click Browse to select
an existing directory.
-
Note:
-
There is no way to create the folder for a library in the path of the workspace
other than to let System Manager do it by use of the Use default location
checkbox.
Figure 59 shows the "New Integrated Test
Environment Project" wizard.
Figure 59. Creating a new WBI ITE
project
-
Click Finish.
The project is created and a folder is added for it to the "ITE Navigator"
view.
Creating test units
A test unit is the workbench resource that contains the configuration information
for a test you want to perform. You can either create a test unit from
within Integrated Test Environment, or from within System Manager.
If you have the Open the new test unit in the editor upon creation
checkbox enabled in the Integrated Test Environment preferences, then the
test unit opens after you create it. If you do not have this preference
enabled then you must open the test unit using the instructions in Opening
a test unit.
Creating a test unit within Integrated
Test Environment
Do the following to create a test unit within Integrated Test Environment:
-
Select File > New > Other from the menu bar.
-
Select Integrated Test Environment from the list of wizards.
-
Select WBI ITE Test Unit from the list of projects.
-
Click Next.
-
At the "Select Collaboration" screen, select the collaboration object you
want to test from the list of all the collaboration objects in all the
integration component libraries defined in the system.
Figure 60 shows the "Select Collaboration"
screen.
Figure 60. Selecting a collaboration
to test
-
Click Next.
-
At the "Create ITE Test Unit" screen, do the following:
-
Type a name for the test unit in the Test Unit field.
-
Select the test project in which the should be created in from the
ITE
Project drop-down menu.
Figure 61 shows the "Create ITE Test
Unit" screen.
Figure 61. Specifying the test unit
name and project
-
Click Finish.
Creating a test unit within System Manager
Do the following to create a test unit from within System Manager:
-
Create a test project to contain the test unit as described in Creating
a test project.
-
Right-click the collaboration object that represents the interface and
select Debug in Testing Environment from the context menu.
-
At the "Create ITE Test Unit" screen, type a name for the test unit in
the Test Unit field, and select the test project it should be created
in from the ITE Project drop-down menu.
Figure 61 shows the "Create ITE Test
Unit" screen.
-
Click Finish.
Opening a test unit
Once you have created a test unit you can open it to view its layout and
configure it. Do the following to open a test unit:
-
Expand the test project that contains the test unit in the "ITE Navigator"
view.
-
Do one of the following to open a test unit:
-
Right-click the test unit you want to work with and choose Open
from the context menu.
-
Double-click the test unit you want to work with.
The test unit opens, displaying a representation of the collaboration object
in the Test Unit editor and populating the views of the perspective with
information specific to the interface. Figure
56 shows the appearance of the Integrated Test Environment perspective
after you have opened a test unit.
[ Top of Page | Table
of Contents ]
