Incoming Message Definition
Incoming message starts with message name, followed by whitespace, < character, and an endpoint name. Example below uses endpoint named “Ping” to receive message “Reply”. Data present in children nodes will be matched against received message. For example, expectation below is that any received message will have Status Success and RoundTripTime of 7ms.
Reply <Ping {
Status Success
RoundtripTime 0.007
}
We can also use numeric comparison for reply. Below is an example how to check if value is 7ms or less.
Reply <Ping {
Status Success
RoundtripTime 0.007 /op=le
}
Supported arithmetic operations (/op) are:
eq: values are equalne: values are not equallt: received value is less than the value providedle: received value is equal to or less than the value providedgt: received value is greater than the value providedge: received value is equal to or greater than the value provided
For textual data, we can compare value against the regular expression.
Reply <Ping {
Status S[.*] /op=regex
RoundtripTime 0.007
}
AASeq usually matches outgoing and incoming message automatically. However, in cases of interleaving, this might not work exactly. For such cases, we can define match parameter manually. Note that the exact value is not important - only that the outgoing message matches the incoming one.
Send >Ping /match=A
Send >Ping /match=B
Reply <Ping /match=B {
Status TimedOut
}
Reply <Ping /match=A {
Status Success
}
If we want to just check for the existence of message, without checking any data, we can omit children nodes.
Reply <Ping
We can also add “Me” endpoint as a destination.
Reply Me<Ping
For more natural writing, we can also define the same operation using reverse direction (“Me” is mandatory in that case).
Reply Ping>Me
To receive message without matching it to the request, you can use two << characters.
Reply <<Ping
For more details about configuration, you can check details for each supported endpoint plugin: