activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Adds a test for anonymous Producers
Date Thu, 06 Mar 2014 17:39:38 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 52a273353 -> f555d90e9


Adds a test for anonymous Producers

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f555d90e
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f555d90e
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f555d90e

Branch: refs/heads/trunk
Commit: f555d90e9246c34aad3d26d72c22b143eeea5314
Parents: 52a2733
Author: Timothy Bish <tabish121@gmai.com>
Authored: Thu Mar 6 12:39:30 2014 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Thu Mar 6 12:39:30 2014 -0500

----------------------------------------------------------------------
 .../activemq/transport/amqp/JMSClientTest.java  | 35 +++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f555d90e/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
index 1c6bc79..6239904 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTest.java
@@ -49,7 +49,6 @@ import org.apache.activemq.util.Wait;
 import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TestName;
@@ -108,6 +107,40 @@ public class JMSClientTest extends AmqpTestSupport {
         connection.close();
     }
 
+    @Test(timeout=30000)
+    public void testAnonymousProducerConsume() throws Exception {
+        ActiveMQAdmin.enableJMSFrameTracing();
+
+        Connection connection = createConnection();
+        {
+            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            Queue queue1 = session.createQueue(name.toString() + "1");
+            Queue queue2 = session.createQueue(name.toString() + "2");
+            MessageProducer p = session.createProducer(null);
+
+            TextMessage message = session.createTextMessage();
+            message.setText("hello");
+            p.send(queue1, message);
+            p.send(queue2, message);
+
+            {
+                MessageConsumer consumer = session.createConsumer(queue1);
+                Message msg = consumer.receive(TestConfig.TIMEOUT);
+                assertNotNull(msg);
+                assertTrue(msg instanceof TextMessage);
+                consumer.close();
+            }
+            {
+                MessageConsumer consumer = session.createConsumer(queue2);
+                Message msg = consumer.receive(TestConfig.TIMEOUT);
+                assertNotNull(msg);
+                assertTrue(msg instanceof TextMessage);
+                consumer.close();
+            }
+        }
+        connection.close();
+    }
+
     @Test
     public void testTransactedConsumer() throws Exception {
         ActiveMQAdmin.enableJMSFrameTracing();


Mime
View raw message