If you've ever wondered how to deliver DEF (Dynamic Event Framework) events to a monitor model so that unit testing can be conducted, this post is for you!
I recently worked with a client who had developed a sample test monitor model based on Business Monitor v8.5.5 using the new event delivery method known as DEF (Dynamic Event Framework). He wanted to unit test it using the Integration test client (ITC) provided with Integration Designer 8.5.5, but ITC only generates the CBE based events and is not available for Business Monitor v8.5.5 DEF.
Below are suggestions for how to deliver events to a monitor model so that unit testing can be conducted.
Enable event recording so that emitted events will be saved.
Refer to "Recording events" in the product documentation.
Construct and emit event XML.
If the event emitting system that will ultimately emit events to the monitor model is available, this would be the best option for emitting events for testing. Events should generally reflect the format that will be used in the future.
If the event emitting system is not available, then event XML would have to be constructed manually the first time a particular type of event is needed. This event XML could then be included within the XML structure used for recorded events so that the events can be imported into the Recorded Events Management feature (and then later the events could be played back). When importing recorded events, a file with a top-level tag of archivedEvents:ArchivedEvents is used. Then each event is wrapped in archivedEvents:ArchivedEvent tags. A unique "timeInserted" value should be specified for each event. A Recorded-Events-Example-Structure.xml file has been attached as a zip here: Recorded-Events-Example-Structure.zip
If the event emitting system is not available and the preceding option isn't chosen, then event XML could be constructed manually and then emitted using the REST event emitter. Refer to the "Using the REST event emitter to emit events" topic in the product documentation.
Review the events that were recorded in the Recorded Events Management listing and determine if the expected events were emitted.
Refer to the "Viewing and managing recorded events" topic in the product documentation.
Inspect how the monitor model is operating based on the events emitted.
Iterative tests can be performed as needed based on the first group of events that are emitted.
a. Export recorded events to a file.
b. Modify the exported events to change values to modify instance identifiers, values used to set metrics, etc. as needed for the desired test.
c. Import an events file with modified events into Recorded Events Management. Refer to the "Viewing and managing recorded events" topic in the product documentation (for this step and the two steps above).
d. Use the Event Playback feature to play back the events that were imported. Refer to the "Playing back events" topic in product documentation.
title image (modified) credit: (cc) Some rights reserved by OpenClips