You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2010/03/03 13:15:58 UTC

svn commit: r918437 - /activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java

Author: gtully
Date: Wed Mar  3 12:15:57 2010
New Revision: 918437

URL: http://svn.apache.org/viewvc?rev=918437&view=rev
Log:
merge -c 917628 https://svn.apache.org/repos/asf/activemq/trunk - test improvement

Modified:
    activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java

Modified: activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java?rev=918437&r1=918436&r2=918437&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java (original)
+++ activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java Wed Mar  3 12:15:57 2010
@@ -203,6 +203,8 @@
             @Override
             public void commitTransaction(ConnectionContext context,
                     TransactionId xid, boolean onePhase) throws Exception {
+                // from the consumer perspective whether the commit completed on the broker or
+                // not is irrelevant, the transaction is still in doubt in the absence of a reply
                 if (doActualBrokerCommit) {
                     LOG.info("doing actual broker commit...");
                     super.commitTransaction(context, xid, onePhase);
@@ -233,6 +235,10 @@
         final Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         final Queue destination = producerSession.createQueue(QUEUE_NAME
                 + "?consumer.prefetchSize=" + prefetch);
+        
+        final Queue signalDestination = producerSession.createQueue(QUEUE_NAME + ".signal"
+                + "?consumer.prefetchSize=" + prefetch);
+
 
         final Session consumerSession = connection.createSession(true, Session.SESSION_TRANSACTED);
 
@@ -248,7 +254,7 @@
                 assertNotNull("got message", message);
                 receivedMessages.add((TextMessage) message);
                 try {
-                    produceMessage(consumerSession, destination, 1);
+                    produceMessage(consumerSession, signalDestination, 1);
                     consumerSession.commit();
                 } catch (JMSException e) {
                     LOG.info("commit exception", e);
@@ -288,6 +294,7 @@
         assertTrue("another message was received", messagesReceived.await(20, TimeUnit.SECONDS));
         assertEquals("get message 1 eventually", MESSAGE_TEXT + "1", receivedMessages.get(2).getText());
 
+        
         connection.close();
     }