Open a B-unit file in the B-unit editor, and select Alarms from the Outline view. To add an alarm, right-mouse click on BPEL Unit.
Alarms refer to the wait activity and the onAlarm events in picks and event handlers. You can assert on an alarm deadline or duration.
You can define an alarm for a B-unit test as follows:
Select or add an alarm. Add an alarm by right-mouse clicking on BPEL Unit.
Specify the Process and Location Path of the alarm-based activity.
Add the Simulated Duration of the alarm. This is the time the B-unit test will wait for the alarm to be triggered.
If this activity is within a loop (for example, a For Each), you can specify a Count for the expected number of times to execute the activity.
Add a default alarm, and add the duration for the B-unit test to use.
Add an Assert.
Assert Deadline. Specify the actual deadline, converted to a duration, for the B-unit test. Specify a Precision value that is the period of time within which the deadline should fire. This value is specified in seconds.
Assert Duration
.
Same as deadline.
Add an assert iteration, if desired. If the alarm-based activity is within a loop, add an Index for this iteration. The index is the
nth
iteration within the count, specified for the alarm.