Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
try {
//assertions for the out sequence.
SequenceReport outgoingSequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
//System.out.println("Checking Outbound Sequence: " + outgoingSequenceReport.getSequenceID());
assertTrue("Outbound message #1", outgoingSequenceReport.getCompletedMessages().contains(new Long(1)));
assertTrue("Outbound message #2", outgoingSequenceReport.getCompletedMessages().contains(new Long(2)));
assertTrue("Outbound message #3", outgoingSequenceReport.getCompletedMessages().contains(new Long(3)));
assertEquals("Outbound sequence status: TERMINATED", SequenceReport.SEQUENCE_STATUS_TERMINATED, outgoingSequenceReport.getSequenceStatus());
assertEquals("Outbound sequence direction: OUT", SequenceReport.SEQUENCE_DIRECTION_OUT, outgoingSequenceReport.getSequenceDirection());
//assertions for the inbound sequence. The one we care about is a new sequence,
//so it will not exist in the oldSequences list.
List incomingSequences = SandeshaClient.getIncomingSequenceReports(configContext);
SequenceReport incomingSequenceReport = getNewReport(incomingSequences, oldIncomingReports);
//System.out.println("Checking Inbound Sequence: " + incomingSequenceReport.getSequenceID());
String offer = (String) clientOptions.getProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID);
if(offer != null) assertEquals("Inbound seq id", offer, incomingSequenceReport.getSequenceID());
assertEquals ("Inbound message count", 3, incomingSequenceReport.getCompletedMessages().size());
assertTrue("Inbound message #1", incomingSequenceReport.getCompletedMessages().contains(new Long(1)));
assertTrue("Inbound message #2", incomingSequenceReport.getCompletedMessages().contains(new Long(2)));
assertTrue("Inbound message #3", incomingSequenceReport.getCompletedMessages().contains(new Long(3)));
if (checkInboundTermination)
assertEquals("Inbound sequence status: TERMINATED", SequenceReport.SEQUENCE_STATUS_TERMINATED, incomingSequenceReport.getSequenceStatus());
assertEquals("Inbound sequence direction: IN", SequenceReport.SEQUENCE_DIRECTION_IN, incomingSequenceReport.getSequenceDirection());
assertTrue("Callback #1", callback1.isComplete());
assertEquals("Callback #1 data", "echo1", callback1.getResult());
assertTrue("Callback #2", callback2.isComplete());