activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ACTIVEMQ6-110 getDeliveringMessages() broken
Date Mon, 18 May 2015 19:30:25 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master fe093fcce -> 3b7ac292c


ACTIVEMQ6-110 getDeliveringMessages() broken


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

Branch: refs/heads/master
Commit: 8561d60f54dfec1ea9efc34e90c175dfdaa08184
Parents: fe093fc
Author: jbertram <jbertram@apache.org>
Authored: Mon May 18 13:57:05 2015 -0500
Committer: jbertram <jbertram@apache.org>
Committed: Mon May 18 13:57:41 2015 -0500

----------------------------------------------------------------------
 .../core/server/impl/ServerConsumerImpl.java        |  2 +-
 .../integration/management/QueueControlTest.java    | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8561d60f/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
index 6b77c04..ead5396 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
@@ -918,7 +918,7 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener
 
    public String toManagementString()
    {
-      return "ServerConsumer [id=" + id + ", filter=" + filter + ", binding=" + binding.toManagementString()
+ "]";
+      return "ServerConsumer [id=" + getConnectionID() + ":" + getSessionID() + ":" + id
+ ", filter=" + filter + ", binding=" + binding.toManagementString() + "]";
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8561d60f/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 ac8012b..e6cb6a0 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
@@ -529,15 +529,25 @@ public class QueueControlTest extends ManagementTestBase
       assertEquals(msgRec.getIntProperty("key").intValue(), intValue);
 
 
-      assertEquals(1, srvqueue.getDeliveringCount());
+      ClientSessionFactory sf2 = createSessionFactory(locator);
+      ClientSession session2 = sf2.createSession(false, true, false);
+      ClientConsumer consumer2 = session2.createConsumer(queue);
+      session2.start();
+      ClientMessage msgRec2 = consumer2.receive(5000);
+      assertNotNull(msgRec2);
+
+
+      assertEquals(2, srvqueue.getDeliveringCount());
+      assertEquals(2, srvqueue.getConsumerCount());
+      assertEquals(2, server.getConnectionCount());
 
       System.out.println(queueControl.listDeliveringMessagesAsJSON());
 
       Map<String, Map<String, Object> []> deliveringMap = queueControl.listDeliveringMessages();
-      assertEquals(1, deliveringMap.size());
-      //Map<String, Object[]> msgs = deliveringMap.get(key)
+      assertEquals(2, deliveringMap.size());
 
       consumer.close();
+      consumer2.close();
 
       session.deleteQueue(queue);
    }


Mime
View raw message