activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6027
Date Wed, 25 Nov 2015 19:22:59 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 29d943429 -> 95f58fa7c


https://issues.apache.org/jira/browse/AMQ-6027

Adding back in test case now that AMQ-5898 is resolved


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

Branch: refs/heads/master
Commit: 95f58fa7c4e26b5b2d73a80bd8e1cb2bee8ebf47
Parents: 29d9434
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Wed Nov 25 19:13:24 2015 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Wed Nov 25 19:13:24 2015 +0000

----------------------------------------------------------------------
 .../network/VirtualConsumerDemandTest.java      | 50 ++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/95f58fa7/activemq-unit-tests/src/test/java/org/apache/activemq/network/VirtualConsumerDemandTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/VirtualConsumerDemandTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/network/VirtualConsumerDemandTest.java
index ad22b07..bff069b 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/VirtualConsumerDemandTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/VirtualConsumerDemandTest.java
@@ -275,6 +275,56 @@ public class VirtualConsumerDemandTest extends DynamicNetworkTestSupport
{
 
     /**
      * Test that dynamic flow works for virtual destinations when a second composite
+     * topic is included that forwards to the same queue, but is excluded from
+     * being forwarded from the remote broker
+     *
+     * @throws Exception
+     */
+    @Test(timeout = 60 * 1000)
+    public void testSecondNonIncludedCompositeTopicForwardSameQueue() throws Exception {
+        Assume.assumeTrue(isUseVirtualDestSubsOnCreation);
+
+        doSetUp(true, null);
+
+        MessageConsumer advisoryConsumer = getVirtualDestinationAdvisoryConsumer(testTopicName);
+
+        //configure a composite topic that isn't included
+        CompositeTopic compositeTopic = createCompositeTopic("include.test.bar2",
+                new ActiveMQQueue("include.test.bar.bridge"));
+
+        runtimeBroker.setVirtualDestinations(new VirtualDestination[] {compositeTopic}, true);
+
+        Thread.sleep(2000);
+
+        //add one that is included
+        CompositeTopic compositeTopic2 = createCompositeTopic(testTopicName,
+                new ActiveMQQueue("include.test.bar.bridge"));
+
+        runtimeBroker.setVirtualDestinations(new VirtualDestination[] {compositeTopic, compositeTopic2},
true);
+
+        Thread.sleep(2000);
+        MessageProducer includedProducer = localSession.createProducer(included);
+        Message test = localSession.createTextMessage("test");
+
+        final DestinationStatistics destinationStatistics = localBroker.getDestination(included).getDestinationStatistics();
+        final DestinationStatistics remoteDestStatistics = remoteBroker.getDestination(
+                new ActiveMQQueue("include.test.bar.bridge")).getDestinationStatistics();
+
+        waitForConsumerCount(destinationStatistics, 1);
+
+        includedProducer.send(test);
+
+        waitForDispatchFromLocalBroker(destinationStatistics, 1);
+        assertLocalBrokerStatistics(destinationStatistics, 1);
+        assertEquals("remote dest messages", 1, remoteDestStatistics.getMessages().getCount());
+
+        assertRemoteAdvisoryCount(advisoryConsumer, 1);
+        assertAdvisoryBrokerCounts(2,2,2);
+
+    }
+
+    /**
+     * Test that dynamic flow works for virtual destinations when a second composite
      * topic is included, but is excluded from
      * being forwarded from the remote broker
      *


Mime
View raw message