greeter.greetMe("one");
greeter.greetMe("two");
greeter.greetMe("three");
awaitMessages(7, 13, 5000);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages());
mf.verifyMessages(7, true);
String[] expectedActions = new String[] {RMConstants.getCreateSequenceAction(),
GREETME_ACTION,
GREETME_ACTION,
RMConstants.getTerminateSequenceAction(),
RMConstants.getSequenceAckAction(),
RMConstants.getCreateSequenceAction(),
GREETME_ACTION};
mf.verifyActions(expectedActions, true);
mf.verifyMessageNumbers(new String[] {null, "1", "2", null, null, null, "1"}, true);
mf.verifyLastMessage(new boolean[] {false, false, true, false, false, false, false}, true);
mf.verifyAcknowledgements(new boolean[] {false, false, true, false, true, false, false}, true);
// 7 partial responses plus 2 full responses to CreateSequence requests
// plus 3 full responses to greetMe requests plus server originiated
// TerminateSequence request
mf.verifyMessages(13, false);
mf.verifyPartialResponses(7);
mf.purgePartialResponses();
expectedActions = new String[] {RMConstants.getCreateSequenceResponseAction(),
GREETME_RESPONSE_ACTION,
GREETME_RESPONSE_ACTION,
RMConstants.getTerminateSequenceAction(),
RMConstants.getCreateSequenceResponseAction(),
GREETME_RESPONSE_ACTION};
mf.verifyActions(expectedActions, false);
mf.verifyMessageNumbers(new String[] {null, "1", "2", null, null, "1"}, false);
boolean[] expected = new boolean[6];
expected[2] = true;
mf.verifyLastMessage(expected, false);
expected[1] = true;
expected[5] = true;
mf.verifyAcknowledgements(expected, false);
}