The testing API helps applications construct CME MDP 3.0 messages and send them to a handler through synthetic multicast feeds. It is intended for repeatable integration tests of message processing, recovery, order-book maintenance, filtering, and event notification without a live CME connection.
The API is declared under OnixS::CME::MDH::Test. Include <OnixS/CME/MDH/Testing.h> for the complete testing API. For more focused dependencies, include <OnixS/CME/MDH/testing/Messages.h> for all typed message builders and the individual testing headers for facilities such as DataFeed, MulticastFeed, PacketHolder, and the free asSpan helper. The testing API is supplied by the same library as the handler; no separate testing library is required.
A typical test performs these steps:
- Configure test multicast endpoints in the same FeedSettings used by the handler.
- Construct messages as readable pipelines of initialization, entry, and customization operations.
- Send the resulting message recipes to the Instrument, Incremental, Snapshot, or MBO Snapshot feed.
- Observe the handler through the same listeners and repositories used in production.
The following example assumes that a handler is already running with matching incremental-feed settings. The call to get makes an asynchronous secondary-send failure visible to the test.
void sendBookUpdate(const ONIXS_CMEMDH_NAMESPACE::FeedSettings& feedSettings)
{
MulticastFeed incrementalFeed(NetFeedType::Incremental, feedSettings);
const auto update =
initialize<IncrementalRefreshBook>(EventFlags::EndOfRealQuotes | EventFlags::EndOfEvent, Timestamp{1'000'000})
incrementalFeed.send(1, update).get();
}
For a complete instrument, snapshot, and incremental recovery workflow, see the end-to-end three-feed test.
The following pages describe each part of this workflow:
- Building Message Pipelines explains direct pipelines, reusable recipes, entry operations, customizations, supported message types, and lifetime rules.
- Sending Test Market Data explains feed configuration, packet delivery, completion handling, and the common sending API.
- Testing Scenarios with Pipelines presents pipeline fragments for pre-open processing, market recovery, snapshots, event boundaries, and order-ID data.
- Advanced Packet Delivery describes runtime-selected encoded messages, raw datagrams, and custom delivery policies.
- Attention
- Use dedicated multicast groups, ports, and network interfaces for tests. Do not direct synthetic messages to a live production feed.