activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1401261 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java
Date Tue, 23 Oct 2012 12:16:47 GMT
Author: dejanb
Date: Tue Oct 23 12:16:47 2012
New Revision: 1401261

URL: http://svn.apache.org/viewvc?rev=1401261&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3485 - make sure prefetch size of zero is a workaround

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java?rev=1401261&r1=1401260&r2=1401261&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java
Tue Oct 23 12:16:47 2012
@@ -19,6 +19,7 @@ package org.apache.activemq;
 import java.util.ArrayList;
 import java.util.Enumeration;
 
+import javax.jms.Destination;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
@@ -202,4 +203,30 @@ public class JmsQueueTransactionTest ext
         commitTx();
     }
 
+    public void testCloseConsumer() throws Exception {
+        Destination dest = session.createQueue(getSubject() + "?consumer.prefetchSize=0");
+        producer = session.createProducer(dest);
+        beginTx();
+        producer.send(session.createTextMessage("message 1"));
+        producer.send(session.createTextMessage("message 2"));
+        commitTx();
+
+        beginTx();
+        consumer = session.createConsumer(dest);
+        Message message1 = consumer.receive(1000);
+        String text1 = ((TextMessage)message1).getText();
+        assertNotNull(message1);
+        assertEquals("message 1", text1);
+
+        consumer.close();
+
+        consumer = session.createConsumer(dest);
+
+        Message message2 = consumer.receive(1000);
+        String text2 = ((TextMessage)message2).getText();
+        assertNotNull(message2);
+        assertEquals("message 2", text2);
+        commitTx();
+    }
+
 }



Mime
View raw message