Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9BB411F7F for ; Tue, 19 Aug 2014 18:38:01 +0000 (UTC) Received: (qmail 51538 invoked by uid 500); 19 Aug 2014 18:38:01 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 51497 invoked by uid 500); 19 Aug 2014 18:38:01 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 51488 invoked by uid 99); 19 Aug 2014 18:38:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Aug 2014 18:38:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 3D59B8BFDE2; Tue, 19 Aug 2014 18:38:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: <59c479b055be436f8815a6f97037347e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Fix test, remote broker only dequeues the message if it is ack'd otherwise it remains in-flight. Date: Tue, 19 Aug 2014 18:38:01 +0000 (UTC) Repository: activemq Updated Branches: refs/heads/trunk 6ae576caf -> 4fa10356f Fix test, remote broker only dequeues the message if it is ack'd otherwise it remains in-flight. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/4fa10356 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/4fa10356 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/4fa10356 Branch: refs/heads/trunk Commit: 4fa10356f09908d8cfb9fd4448983ac6d7e80ee7 Parents: 6ae576c Author: Timothy Bish Authored: Tue Aug 19 14:37:30 2014 -0400 Committer: Timothy Bish Committed: Tue Aug 19 14:37:30 2014 -0400 ---------------------------------------------------------------------- .../activemq/network/DemandForwardingBridgeTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/4fa10356/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java index 020a511..02b207c 100755 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java @@ -26,6 +26,7 @@ import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ConnectionInfo; import org.apache.activemq.command.ConsumerInfo; import org.apache.activemq.command.Message; +import org.apache.activemq.command.MessageAck; import org.apache.activemq.command.ProducerInfo; import org.apache.activemq.command.SessionInfo; import org.apache.activemq.util.Wait; @@ -80,14 +81,20 @@ public class DemandForwardingBridgeTest extends NetworkTestSupport { // Now create remote consumer that should cause message to move to this // remote consumer. - ConsumerInfo consumerInfo2 = createConsumerInfo(sessionInfo2, destination); + final ConsumerInfo consumerInfo2 = createConsumerInfo(sessionInfo2, destination); connection2.request(consumerInfo2); // Make sure the message was delivered via the remote. assertTrue("message was received", Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { - return receiveMessage(connection2) != null; + Message msg = receiveMessage(connection2); + if (msg != null) { + connection2.request(createAck(consumerInfo2, msg, 1, MessageAck.STANDARD_ACK_TYPE)); + return true; + } + + return false; } })); @@ -97,6 +104,7 @@ public class DemandForwardingBridgeTest extends NetworkTestSupport { return 1 == destinationStatistics.getForwards().getCount(); } })); + assertEquals("broker dest stat dequeues", 1, destinationStatistics.getDequeues().getCount()); assertEquals("remote broker dest stat dequeues", 1, remoteBroker.getDestination(destination).getDestinationStatistics().getDequeues().getCount()); }