Repository: activemq
Updated Branches:
  refs/heads/master a3fa0da6e -> 1ae29382e


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

Fixing DynamicallyIncludedDestinationsDuplexNetworkTest


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

Branch: refs/heads/master
Commit: 1ae29382e12dd9704d78f12b7948b442005ce086
Parents: a3fa0da
Author: Christopher L. Shannon (cshannon) <christopher.l.shan...@gmail.com>
Authored: Mon Jan 18 15:27:11 2016 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shan...@gmail.com>
Committed: Mon Jan 18 15:27:11 2016 +0000

----------------------------------------------------------------------
 ...callyIncludedDestinationsDuplexNetworkTest.java | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/1ae29382/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
----------------------------------------------------------------------
diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
 
b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
index 3dd8be6..a647abe 100644
--- 
a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
+++ 
b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
@@ -19,6 +19,7 @@ package org.apache.activemq.network;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.lang.reflect.Field;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -30,6 +31,7 @@ import org.apache.activemq.advisory.AdvisorySupport;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnection;
 import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.util.Wait;
 import org.junit.Test;
 
 /**
@@ -114,4 +116,19 @@ public class 
DynamicallyIncludedDestinationsDuplexNetworkTest extends SimpleNetw
         TransportConnection duplexBridgeConnectionFromRemote = 
transportConnections.get(0);
         return duplexBridgeConnectionFromRemote;
     }
+
+    @Override
+    protected void assertNetworkBridgeStatistics(final long expectedLocalSent, 
final long expectedRemoteSent) throws Exception {
+
+        final NetworkBridge localBridge = 
localBroker.getNetworkConnectors().get(0).activeBridges().iterator().next();
+
+        assertTrue(Wait.waitFor(new Wait.Condition() {
+            @Override
+            public boolean isSatisified() throws Exception {
+                return expectedLocalSent == 
localBridge.getNetworkBridgeStatistics().getDequeues().getCount() &&
+                        expectedRemoteSent == 
localBridge.getNetworkBridgeStatistics().getReceivedCount().getCount();
+            }
+        }));
+
+    }
 }

Reply via email to