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 864429691 for ; Wed, 15 Feb 2012 11:22:08 +0000 (UTC) Received: (qmail 40035 invoked by uid 500); 15 Feb 2012 11:22:08 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 39983 invoked by uid 500); 15 Feb 2012 11:22:07 -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 39974 invoked by uid 99); 15 Feb 2012 11:22:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Feb 2012 11:22:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Feb 2012 11:22:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3262823888E7 for ; Wed, 15 Feb 2012 11:21:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1244443 - in /activemq/trunk/activemq-core/src/test: java/org/apache/activemq/broker/XARecoveryBrokerTest.java resources/log4j.properties Date: Wed, 15 Feb 2012 11:21:44 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120215112144.3262823888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Wed Feb 15 11:21:43 2012 New Revision: 1244443 URL: http://svn.apache.org/viewvc?rev=1244443&view=rev Log: fix intermittent failure, consume messages from all destinations, sorts out the composite case so that there are no dangling messages Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java activemq/trunk/activemq-core/src/test/resources/log4j.properties Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java?rev=1244443&r1=1244442&r2=1244443&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/XARecoveryBrokerTest.java Wed Feb 15 11:21:43 2012 @@ -519,21 +519,25 @@ public class XARecoveryBrokerTest extend connection.send(message); } - // Setup the consumer and receive the message. - ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, destination); - connection.send(consumerInfo); - // Begin the transaction. XATransactionId txid = createXATransaction(sessionInfo); connection.send(createBeginTransaction(connectionInfo, txid)); - Message m = null; - for (int i = 0; i < 4; i++) { - m = receiveMessage(connection); - assertNotNull(m); + + Message message = null; + for (ActiveMQDestination dest : destinationList(destination)) { + // Setup the consumer and receive the message. + ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, dest); + connection.send(consumerInfo); + + for (int i = 0; i < 4; i++) { + message = receiveMessage(connection); + assertNotNull(message); + } + MessageAck ack = createAck(consumerInfo, message, 4, MessageAck.STANDARD_ACK_TYPE); + ack.setTransactionId(txid); + connection.send(ack); } - MessageAck ack = createAck(consumerInfo, m, 4, MessageAck.STANDARD_ACK_TYPE); - ack.setTransactionId(txid); - connection.send(ack); + // Don't commit // restart the broker. @@ -545,13 +549,16 @@ public class XARecoveryBrokerTest extend sessionInfo = createSessionInfo(connectionInfo); connection.send(connectionInfo); connection.send(sessionInfo); - consumerInfo = createConsumerInfo(sessionInfo, destination); - connection.send(consumerInfo); - // All messages should be re-delivered. - for (int i = 0; i < 4; i++) { - m = receiveMessage(connection); - assertNotNull(m); + for (ActiveMQDestination dest : destinationList(destination)) { + // Setup the consumer and receive the message. + ConsumerInfo consumerInfo = createConsumerInfo(sessionInfo, dest); + connection.send(consumerInfo); + + for (int i = 0; i < 4; i++) { + message = receiveMessage(connection); + assertNotNull(message); + } } assertNoMessagesLeft(connection); Modified: activemq/trunk/activemq-core/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/resources/log4j.properties?rev=1244443&r1=1244442&r2=1244443&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/resources/log4j.properties (original) +++ activemq/trunk/activemq-core/src/test/resources/log4j.properties Wed Feb 15 11:21:43 2012 @@ -22,7 +22,7 @@ log4j.rootLogger=INFO, out, stdout #log4j.logger.org.apache.activemq.broker.scheduler=DEBUG #log4j.logger.org.apache.activemq.network.DemandForwardingBridgeSupport=DEBUG -log4j.logger.org.apache.activemq.transport.failover=TRACE +#log4j.logger.org.apache.activemq.transport.failover=TRACE #log4j.logger.org.apache.activemq.store.jdbc=TRACE #log4j.logger.org.apache.activemq.broker.region.cursors.AbstractStoreCursor=DEBUG #log4j.logger.org.apache.activemq.store.jdbc.JDBCMessageStore=DEBUG