activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [08/47] activemq-artemis git commit: ARTEMIS-415 - [Artemis Testsuite] NettyPagingSendTest#testPagingDoesNotDuplicateBatchMessages
Date Mon, 22 Feb 2016 15:38:32 GMT
ARTEMIS-415 - [Artemis Testsuite] NettyPagingSendTest#testPagingDoesNotDuplicateBatchMessages


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a4c4f811
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a4c4f811
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a4c4f811

Branch: refs/heads/refactor-openwire
Commit: a4c4f811ebf5816ad1152c08c34e559ae08a842a
Parents: 51d033a
Author: Erich Duda <eduda@redhat.com>
Authored: Mon Feb 22 09:23:23 2016 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Feb 22 10:32:24 2016 -0500

----------------------------------------------------------------------
 .../tests/integration/paging/PagingSendTest.java     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a4c4f811/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java
index 5f736fc..f913dca 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java
@@ -233,6 +233,9 @@ public class PagingSendTest extends ActiveMQTestBase {
 
       Queue queue = server.locateQueue(queueAddr);
 
+      // Give time Queue.deliverAsync to deliver messages
+      Assert.assertTrue("Messages were not propagated to internal structures.", waitForMessages(queue,
batchSize, 3000));
+
       checkBatchMessagesAreNotPagedTwice(queue);
 
       for (int i = 0; i < 10; i++) {
@@ -324,6 +327,18 @@ public class PagingSendTest extends ActiveMQTestBase {
       assertTrue(duplicates == 0);
    }
 
+   public boolean waitForMessages(Queue queue, int count, long timeout) throws Exception
{
+      long timeToWait = System.currentTimeMillis() + timeout;
+
+      while (System.currentTimeMillis() < timeToWait) {
+         if (queue.getMessageCount() >= count) {
+            return true;
+         }
+         Thread.sleep(100);
+      }
+      return false;
+   }
+
    /**
     * checks that there are no message duplicates in the page.  Any IDs found in the ignoreIds
field will not be tested
     * this allows us to test only those messages that have been sent after the address has
started paging (ignoring any


Mime
View raw message