Source:
public void performQueueSubscriptionsBreakAndReceiveTestCase() { Integer sendCount = 1000; Integer runTime = 40; int numberOfSubscriptionBreaks = 5; Integer expectedCount = sendCount / numberOfSubscriptionBreaks; AndesClient receivingClient = new AndesClient("receive", "127.0.0.1:5672", "queue:breakSubscriberQueue", "100", "false", runTime.toString(), expectedCount.toString(), "1", "listener=true,ackMode=1,delayBetweenMsg=0,stopAfter=" + expectedCount, ""); receivingClient.startWorking(); AndesClient sendingClient = new AndesClient("send", "127.0.0.1:5672", "queue:breakSubscriberQueue", "100", "false", runTime.toString(), sendCount.toString(), "1", "ackMode=1,delayBetweenMsg=0,stopAfter=" + sendCount, ""); sendingClient.startWorking(); boolean success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); int totalMsgCountReceived = receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived += receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived += receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived += receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived += receivingClient.getReceivedqueueMessagecount(); Assert.assertEquals(totalMsgCountReceived, sendCount.intValue(), "Expected message count was not received."); log.info(totalMsgCountReceived); }

Target:
public void performQueueSubscriptionsBreakAndReceiveTestCase() { Integer sendCount = 1000; Integer runTime = 40; int numberOfSubscriptionBreaks = 5; Integer expectedCount = sendCount / numberOfSubscriptionBreaks; AndesClient receivingClient = new AndesClient("receive", "127.0.0.1:5672", "queue:breakSubscriberQueue", "100", "false", runTime.toString(), expectedCount.toString(), "1", "listener=true,ackMode=1,delayBetweenMsg=0,stopAfter=" + expectedCount, ""); receivingClient.startWorking(); AndesClient sendingClient = new AndesClient("send", "127.0.0.1:5672", "queue:breakSubscriberQueue", "100", "false", runTime.toString(), sendCount.toString(), "1", "ackMode=1,delayBetweenMsg=0,stopAfter=" + sendCount, ""); sendingClient.startWorking(); boolean success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); int totalMsgCountReceived = receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived = totalMsgCountReceived + receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived = totalMsgCountReceived + receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived = totalMsgCountReceived + receivingClient.getReceivedqueueMessagecount(); success = AndesClientUtils.waitUntilMessagesAreReceived(receivingClient, expectedCount, runTime); Assert.assertTrue(success, "Message receiving failed."); totalMsgCountReceived = totalMsgCountReceived + receivingClient.getReceivedqueueMessagecount(); Assert.assertEquals(totalMsgCountReceived, sendCount.intValue(), "Expected message count was not received."); log.info(totalMsgCountReceived); }