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:
  1. Select Window > Preferences from the menu bar of the workbench.
  2. Select Integrated Test Environment.

  3.  

     

    Figure 58 shows the Integrated Test Environment preferences.

  4. 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.
  5. 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.
  6. 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.
  7. Click OK.

Creating a test project

Do the following to create a test project to store the individual test units you will create:
  1. Select File > New > Other from the menu bar.
  2. Select Integrated Test Environment from the list of wizards.
  3. Select WBI ITE Project from the list of projects.
  4. Click Next.
  5. At the "New Integrated Test Environment Project" screen, type a name for the test project in the Project name field.

  6.  

     

    Project names can only contain alphanumeric characters and underscores, and must be specified in English.

  7. 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.

  8.  

     

    If you want to specify the name and location of the library folder, do the following:

    1. Clear the Use default location checkbox.
    2. 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

  9. Click Finish.

  10.  

     

    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:
  1. Select File > New > Other from the menu bar.
  2. Select Integrated Test Environment from the list of wizards.
  3. Select WBI ITE Test Unit from the list of projects.
  4. Click Next.
  5. 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.

  6.  

     

    Figure 60 shows the "Select Collaboration" screen.

    Figure 60. Selecting a collaboration to test

  7. Click Next.
  8. At the "Create ITE Test Unit" screen, do the following:
    1. Type a name for the test unit in the Test Unit field.
    2. 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

  9. Click Finish.

Creating a test unit within System Manager

Do the following to create a test unit from within System Manager:
  1. Create a test project to contain the test unit as described in Creating a test project.
  2. Right-click the collaboration object that represents the interface and select Debug in Testing Environment from the context menu.
  3. 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.

  4.  

     

    Figure 61 shows the "Create ITE Test Unit" screen.

  5. 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:
  1. Expand the test project that contains the test unit in the "ITE Navigator" view.
  2. Do one of the following to open a test unit:
  3. 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 ]

Copyright IBM Corp. 1997, 2003