activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r711617 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
Date Wed, 05 Nov 2008 17:01:05 GMT
Author: gtully
Date: Wed Nov  5 09:01:05 2008
New Revision: 711617

URL: http://svn.apache.org/viewvc?rev=711617&view=rev
Log:
resolve AMQ-1995

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java?rev=711617&r1=711616&r2=711617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempQueueMemoryTest.java
Wed Nov  5 09:01:05 2008
@@ -48,6 +48,11 @@
     protected int numProducers = 1;
     
 
+    public void testConcurrentProducerRequestReply() throws Exception {
+        numProducers = 10;
+        testLoadRequestReply();
+    }
+    
     public void testLoadRequestReply() throws Exception {
         for (int i=0; i< numConsumers; i++) {
             serverSession.createConsumer(serverDestination).setMessageListener(new MessageListener()
{
@@ -73,23 +78,24 @@
             public Producer(int numToSend) {
                 this.numToSend = numToSend;
             }
-            public void run() {
-                MessageProducer producer;
+            public void run() {     
                 try {
-                    producer = clientSession.createProducer(serverDestination);
+                    Session session = clientConnection.createSession(clientTransactional,

+                            clientTransactional ? Session.SESSION_TRANSACTED : Session.AUTO_ACKNOWLEDGE);
+                    MessageProducer producer = session.createProducer(serverDestination);
                
                     for (int i =0; i< numToSend; i++) {
-                        TemporaryQueue replyTo = clientSession.createTemporaryQueue();
-                        MessageConsumer consumer = clientSession.createConsumer(replyTo);
-                        Message msg = clientSession.createMessage();
+                        TemporaryQueue replyTo = session.createTemporaryQueue();
+                        MessageConsumer consumer = session.createConsumer(replyTo);
+                        Message msg = session.createMessage();
                         msg.setJMSReplyTo(replyTo);
                         producer.send(msg);
                         if (clientTransactional) {
-                            clientSession.commit();
+                            session.commit();
                         }
-                        Message reply = consumer.receive();
+                        consumer.receive();
                         if (clientTransactional) {
-                            clientSession.commit();
+                            session.commit();
                         }
                         consumer.close();
                         if (deleteTempQueue) {
@@ -98,7 +104,6 @@
                             // temp queue will be cleaned up on clientConnection.close
                         }
                     }
-                } catch (IllegalStateException IgnoredAsCanOcurrDuringShutdown) {
                 } catch (JMSException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();



Mime
View raw message