Working with test projects and units
All resources in an Eclipse-based platform are contained
in projects, as described 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, as described in Interfaces, 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 62 shows the Integrated
Test Environment preferences.
Figure 62. Integrated Test Environment preferences
- Enable the Create a default Integrated Test Environment 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.
For more information about opening test units if you decide not
to enable this option, see Opening a test unit.
- Enable the Show Server Context Overlay always checkbox
if you want to always have the Server Context Overlay enabled.
For more information about the Server Context Overlay, see Using the Server Context Overlay.
- 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 > Integrated Test Environment Project from
the menu bar.
- 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 63 shows the "New
Integrated Test Environment Project" wizard.
Figure 63. Creating a new WBI ITE project
- Click Finish.
The project is created and a folder is added for it to the "Integrated
Test Environment 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,
open the test unit using the instructions in Opening a test unit. For more information on Integrated Test Environment
preferences, see Configuring test project preferences.
Creating a test unit within Integrated Test Environment
Do the following to create a test unit within Integrated
Test Environment:
- Select File > New > Integrated Test Environment Test Unit from
the menu bar.
- 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 64 shows the "Select
Collaboration" screen.
Figure 64. Selecting a collaboration to test
- Click Next.
- At the "Create Integrated Test Environment 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 test unit should be created
from the ITE Project drop-down menu.
Figure 65 shows the "Create
Integrated Test Environment Test Unit" screen.
Figure 65. 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 Integrated Test Environment from
the context menu.
- At the "Create Integrated Test Environment 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 65 shows the "Create
Integrated Test Environment 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 "Integrated
Test Environment 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 60 shows the appearance of the Integrated Test Environment
perspective after you have opened a test unit.
