IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Unit testing > Running unit tests in the test client
Create component test cases from unit tests
When you have finished running a unit test, you can create a component test case that populates its input and expected output values from those values specified in the unit test. Test cases can be created at the operation level or the scenario level, and you have the option of defining the individual steps for the test case (including steps for creating emulators and event verifications).
Familiarize yourself with test cases by reading Create and managing test cases.
If that you cannot create a component test case in the integration test client if you have opened the test client by selecting the Run Test pop-up menu item on a component test project, test suite, or test case in the Business Integration view.
To create test cases from unit tests...
Procedure
- Open the integration test client and perform a unit test by invoking an operation.
- In the Events area, right-click the Invoke event that was used to initiate the unit test and then click Create test case. The New Component Test Case wizard opens.
- In the Test project field, select the component test project that contains the test suite where you want to create the new test case.
- In the Test suite field, select the test suite where you want to create the new test case.
- From the Test pattern type area, select the type of component test pattern you want to use for the new component test case.
- Operation-level test cases: This option creates a separate test case for each operation included in the test.
- Scenario-level test case: This option creates a single test case for all selected operations.
- If you are creating a scenario-level test case, enter a name for the test case in the Test case name field.
- Determine whether you want to create a basic test case or whether you want to customize the test case by selecting specific events to include and the order in which the resulting steps occur.
- To create a basic test case, click Finish. The test suite editor opens and displays the new test case or cases, depending on whether you chose operation-level or scenario-level testing. This task is now complete.
- To customize the test case, click Next, and then continue to the next step in this procedure.
- From the Add Steps to the Test Case page, select those events you want to include in the test case. By default, all Invoke, Return, and Exception events are selected.
Tip: To quickly add or remove all events of a particular type, click the Select Types button. In the Select Event Types window that opens, select the event type or types you want to include or exclude.
- Click Next. The wizard creates a step for each selected event and displays a summary of the test case in the Test Case Summary page.
- Verify that the test case contains the appropriate steps and, if necessary, adjust the order of the steps using the arrow icons on the page.
- Click Finish. The test suite editor opens and displays the new test case or cases, depending on whether you chose operation-level or scenario-level testing.
- If you want to save your changes in the test suite editor, press Ctrl-S. The new test case is displayed under the associated test suite in the Business Integration view.