activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: ARTEMIS-252 fixing tests
Date Mon, 12 Oct 2015 21:23:33 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 2a81a5f14 -> a5fab2754


ARTEMIS-252 fixing tests


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

Branch: refs/heads/master
Commit: a5fab2754dad1eeaa3ffcfe4017ca86038eae7d1
Parents: 2a81a5f
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Mon Oct 12 17:21:36 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Oct 12 17:21:36 2015 -0400

----------------------------------------------------------------------
 .../core/management/impl/QueueControlImpl.java  |  4 +---
 .../management/QueueControlTest.java            | 21 ++++++++++----------
 2 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a5fab275/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
index cb362ec..9f6488e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
@@ -570,13 +570,11 @@ public class QueueControlImpl extends AbstractControl implements QueueControl
{
             }
          };
 
-         queue.retryMessages(singleMessageFilter);
+         return queue.retryMessages(singleMessageFilter) > 0;
       }
       finally {
          blockOnIO();
       }
-
-      return false;
    }
 
    public int retryMessages() throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a5fab275/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
index b968a03..135a60f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java
@@ -16,6 +16,12 @@
  */
 package org.apache.activemq.artemis.tests.integration.management;
 
+import javax.management.Notification;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
@@ -42,16 +48,11 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.tests.integration.jms.server.management.JMSUtil;
 import org.apache.activemq.artemis.tests.util.RandomUtil;
 import org.apache.activemq.artemis.utils.json.JSONArray;
+import org.apache.activemq.artemis.utils.json.JSONObject;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.management.Notification;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 public class QueueControlTest extends ManagementTestBase {
 
    private ActiveMQServer server;
@@ -796,7 +797,7 @@ public class QueueControlTest extends ManagementTestBase {
       clientMessage.acknowledge();
       Assert.assertNotNull(clientMessage);
 
-      Assert.assertEquals(clientMessage.getBodyBuffer().readString(), "Put me on DLQ!");
+      Assert.assertEquals(sampleText, clientMessage.getBodyBuffer().readString());
 
       clientConsumer.close();
    }
@@ -2044,8 +2045,8 @@ public class QueueControlTest extends ManagementTestBase {
    }
 
    protected long getFirstMessageId(final QueueControl queueControl) throws Exception {
-      Map<String, Object>[] messages = queueControl.listMessages(null);
-      long messageID = (Long) messages[0].get("messageID");
-      return messageID;
+      JSONArray array = new JSONArray(queueControl.getFirstMessageAsJSON());
+      JSONObject object = (JSONObject)array.get(0);
+      return object.getLong("messageID");
    }
 }


Mime
View raw message