IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Unit testing > Manage test configurations > Editing the test configuration

Editing programmatic emulation files

You can edit any programmatic emulation file that you want to use with a programmatic emulator in the integration test client. This enables you to define an implementation file for a new programmatic emulator or redefine the implementation file for an existing programmatic emulator.

The programmatic emulation editor is the tool used to edit programmatic emulation files. It is opened in one of the following two ways:

To edit a programmatic emulation file:


Procedure

  1. If the programmatic emulation editor is not already open in the workbench, complete one of the following steps to open it:

    • If you want to edit a programmatic emulation file for a specific programmatic emulator that you currently have selected in the Configurations page of the integration test client, click the link on the name of the programmatic emulation file beneath the Programmatic Emulation radio button.

    • If you want to edit a programmatic emulation file in a module without first selecting a programmatic emulator in the Configurations page of the integration test client, go to the Business Integration view and right-click the module that contains your programmatic emulation file, then select Test > Load Emulator to open the Load Emulator wizard. Navigate to the programmatic emulator file (which has a default file extension of .emulate), then select it and click Finish.

    • If you want to edit a programmatic emulation file in a component test project without first selecting a programmatic emulator in the Configurations page of the integration test client, go to the Business Integration view and expand both your project and the Emulators subfolder, then right-click the programmatic emulation file and select Open.

    The programmatic emulation editor opens.

  2. If you want to move the programmatic emulation file to a different project, folder or package:

    1. In the programmatic emulation editor, click Move. The Move window opens.

    2. In the Choose destination list, select the project, folder or package where you want to move the programmatic emulation file.

    3. Click OK. The programmatic emulation file is moved and any references to the file are updated to reflect the new file location.

  3. If you want to rename the programmatic emulation file:

    1. In the programmatic emulation editor, click Rename. The Rename Compilation Unit window opens.

    2. In the New name field, type the new name that you want to assign to the programmatic emulation file.

    3. Click OK. The programmatic emulation file is renamed and any references to the file are updated to reflect the new file name.

  4. If your programmatic emulation file does not yet have any implementation and you now want to define an implementation for it:

    1. Beside the Overview tab at the bottom of the programmatic emulation editor, click the tab that is named for the operation that you are emulating. The Define Emulation page opens.
    2. Depending on whether you want to define the implementation as a visual snippet or a Java™ snippet, select either Visual snippet editor or Java snippet editor.

    3. Click Define Emulation. The Emulate Operation page opens with either a visual snippet editor pane or a Java snippet editor pane.

    4. In the visual snippet editor or the Java snippet editor, define the implementation for your programmatic emulation file. If that in the Java snippet editor, the Throws field displays the available exceptions that you can define in your code. At any time, you can click Clear Emulation to remove all content from the editor and start over. (Information about creating and using visual snippets is found in the IBM Integration Designer topic "Customizing behavior with visual snippets.")

    5. When you have finished defining the implementation, press Ctrl-S to save your changes and close the programmatic emulation editor.

  5. If your programmatic emulation file already has an implementation and you want to modify it but not redefine it as a different snippet type (visual snippet or Java snippet):

    1. Beside the Overview tab at the bottom of the programmatic emulation editor, click the tab that is named for the operation that you are emulating. Depending on whether the implementation is defined as a visual snippet or a Java snippet, the Emulate Operation page opens with either a visual snippet editor pane or a Java snippet editor pane that contains your implementation.

    2. In the visual snippet editor or the Java snippet editor, make the modifications to the implementation. If that in the Java snippet editor, the Throws field displays the available exceptions that you can define in your code. At any time, you can click Clear Emulation to remove all content from the editor and start over.

    3. When you have finished defining the implementation, press Ctrl-S to save your changes and close the programmatic emulation editor.

  6. If your programmatic emulation file already has an implementation and you want to redefine it as a different snippet type (visual snippet or Java snippet):

    1. Beside the Overview tab at the bottom of the programmatic emulation editor, click the tab that is named for the operation that you are emulating. Depending on whether the implementation is defined as a visual snippet or a Java snippet, the Emulate Operation page opens with either a visual snippet editor pane or a Java snippet editor pane that contains your implementation.

    2. Click Redefine Emulation. The Define Emulation page opens.
    3. Depending on whether you want to redefine the implementation as a visual snippet or a Java snippet, select either Visual snippet editor or Java snippet editor.

    4. Click Define Emulation. The Emulate Operation page opens with either a visual snippet editor pane or a Java snippet editor pane.

    5. In the visual snippet editor or the Java snippet editor, define the implementation for your programmatic emulation file. If that in the Java snippet editor, the Throws field displays the available exceptions that you can define in your code. At any time, you can click Clear Emulation to remove all content from the editor and start over. (Information about creating and using visual snippets is found in the topic "Customizing behavior with visual snippets.")

    6. When you have finished defining the implementation, press Ctrl-S to save your changes and close the programmatic emulation editor.


Example

If you have just finished creating and editing a new programmatic emulation file for a programmatic emulator that is currently selected in the Configurations page of the integration test client, the name of the new file appears beneath the Programmatic Emulation radio button and it is ready to be used with the programmatic emulator for testing.

Editing test configurations