IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > Testing monitor models > Emitting test events > Use the Integrated Test Client to send events
Importing events for testing
You can use the Integrated Test Client to import events when the test script runs. These events can come from an existing file or you can choose to create a file from previously recorded events. Recording and playing back events enables you to iteratively test your monitor model without having to rerun the application that it will be monitoring.
If you want to import events from the CEI database, you must manually enable the event data store as described in Using the Common Base Event browser to view Common Base Events.
For more control over recording and playing back events, including filtering and managing the events, use Recorded Event Management in the WebSphere Application Server administrative console.
To have the script import events when it runs:
Procedure
- In the test script, click Import Events
.
- To import events from an existing file when the script runs, select File containing events. Click Browse and navigate to one of the following files:
- A recorded events file that has been exported from the administrative console
- An XML file that contains Common Base Events
- To use the events that were recorded while the server was running, select IBM Business Monitor recorded events. Verify that the Target Server tab of the Integrated Test Client refers to the server where the events were recorded. Recording events is enabled by default in the test environment. You can change the settings by right-clicking a test server in the Servers view and selecting IBM Business Monitor Event Recording. You can enable or disable recording, and clear recorded events. For more information about recording events, see Recording and playing back events.
Click Browse and navigate to the directory where you want to save the file of recorded events. Enter a name for the file. The recorded events are extracted to the file.
- To include events from the Common Event Infrastructure (CEI) database, select Extract events from CEI database. The events will be extracted from the database and put into an XML file. Navigate to the location where you want to store that file, and enter a file name.
Important: To import events from CEI, you must have a running test server selected in the Target Server tab of the Integrated Test Client. If you are using the monitor model debugger, click the Target Server tab and select a running test server from the drop-down list to import Common Base Events. After you specify the events, re-select the debugger from the drop-down list for sending the events.
Optionally, click Next to limit the events that are put into the file from the CEI database.
For example, you might want only 20 events, or you might want only the events that were sent between the beginning and the end of last week. You can use the following filters to limit the events that are put into the file:
- Extension. Include events with the extensionName attribute that you specify. Not all events contain an extensionName, but events emitted by BPEL processes contain extensionName attributes like BPC.BFM.VARIABLE.STATUS.
- Start time. Include events with a creationTime attribute equal to or later than the date and time you specify
- End time. Include events with a creationTime attribute equal to or earlier than the date and time you specify
For the start and end times, a time zone is required. You might want to find out which time zone the event source uses.
For example, if events are produced with GMT-based date and time information, you might find it more convenient to specify times in GMT.
- Severity. Include events with the level of severity that you specify or higher
- Maximum number. Limit the number of events to the number that you specify
- Click Finish. An import command that imports the file that you specified is added to the script.
Results
After you import recorded events or events from the CEI database into a file, the file is available to use for other test scripts.The following restrictions apply:
- The events will be sent in the same order as they are written in the file.
- There is no pause time between events.
- The events cannot be edited in the Integrated Test Client.
What to do next
If you want to change the order of the events using the Move Up and Move Down buttons, or add delay or sleep commands between events, you can extract individual events from the file using a text or XML editor, and add import commands to the script for each of the resulting individual files. Then you can rearrange the import commands, or intersperse delay or sleep commands.
Use the Integrated Test Client to send events
Related information:
Use the Common Base Event browser to view Common Base Events