greeter.greetMeOneWay("three");
greeter.greetMeOneWay("four");
awaitMessages(7, 5, 10000);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages());
// Expected outbound:
// CreateSequence
// + 4 greetMe messages
// + at least 2 resends (message may be resent multiple times depending
// on the timing of the ACKs)
String[] expectedActions = new String[7];
expectedActions[0] = RMConstants.getCreateSequenceAction();
for (int i = 1; i < expectedActions.length; i++) {
expectedActions[i] = GREETMEONEWAY_ACTION;
}
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] {null, "1", "2", "3", "4", "2", "4"}, true, false);
mf.verifyLastMessage(new boolean[7], true);
mf.verifyAcknowledgements(new boolean[7], true);
// Expected inbound:
// createSequenceResponse
// + 2 partial responses to successfully transmitted messages
// + 2 partial responses to resent messages
mf.verifyMessages(5, false);
expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
RMConstants.getSequenceAcknowledgmentAction(),
RMConstants.getSequenceAcknowledgmentAction(),
RMConstants.getSequenceAcknowledgmentAction(),
RMConstants.getSequenceAcknowledgmentAction()};
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] {null, null, null, null, null}, false);
mf.verifyAcknowledgements(new boolean[] {false, true, true, true, true}, false);
}