Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in EPL | Testing and Tuning EPL monitors | Using event files
Using event files
The following example shows how to use &TIME (Clock) events to explicitly set the correlator clock. To do this, the correlator must have been started in external clocking mode (the &TIME events give errors otherwise). Times are in seconds since the midnight, Jan 1970 epoch.
#seed initial time (seconds since Jan 1970 epoch)
# Send in configuration of heartbeat interval to
# 5 SecondsSetHeartbeatInterval(5.0)
# Advance the clock (5.5 seconds)
# Correlator should have sent heartbeat with id 1 –
# acknowledge all is well
Notice that the input event file has a lot of knowledge regarding the way in which the module will (should) respond. For example, the HeartbeatResponse event expects that the first HeartbeatRequest will have the ID of 1. There is necessarily a close coupling between the input scripts and the implementation of the module being tested. This is another reason why as much of this information should be extracted into the module's message exchange protocol and made explicit, and perhaps enforced by one or more interface intermediaries.
A single correlator context is guaranteed to generate the same output in the same order, even when EPL timers (such as on all wait()) are employed. This is a benefit of correlator determinism, and makes regression testing, even of temporal logic, possible.
Note: The correlator's behavior can be nondeterministic when events are sent between multiple contexts, or when plug-ins are used.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.