You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2014/02/10 19:25:59 UTC

[1/2] git commit: Add a timeout in case of hang.

Updated Branches:
  refs/heads/trunk 519d8f7db -> cdfb56245


Add a timeout in case of hang.

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

Branch: refs/heads/trunk
Commit: cdfb56245510682b97f71a336c054bb39dcffbfd
Parents: 1e7dc12
Author: Timothy Bish <ta...@gmai.com>
Authored: Mon Feb 10 13:25:19 2014 -0500
Committer: Timothy Bish <ta...@gmai.com>
Committed: Mon Feb 10 13:25:47 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/activemq/transport/amqp/JMSClientTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/cdfb5624/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 20d1f22..e9c07ad 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
@@ -694,7 +694,7 @@ public class JMSClientTest extends AmqpTestSupport {
         assertTrue("No exception listener event fired.", called.await(15, TimeUnit.SECONDS));
     }
 
-    @Test
+    @Test(timeout=40000)
     public void testSessionTransactedCommit() throws JMSException, InterruptedException {
 
         Connection connection = createConnection();


[2/2] git commit: Add test case for session with local transactions.

Posted by ta...@apache.org.
Add test case for session with local transactions. 

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

Branch: refs/heads/trunk
Commit: 1e7dc12c3098061a421ba709b00aaf07d3e63b69
Parents: 519d8f7
Author: Timothy Bish <ta...@gmai.com>
Authored: Mon Feb 10 12:20:44 2014 -0500
Committer: Timothy Bish <ta...@gmai.com>
Committed: Mon Feb 10 13:25:47 2014 -0500

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/1e7dc12c/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 af4f6f8..20d1f22 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
@@ -694,6 +694,40 @@ public class JMSClientTest extends AmqpTestSupport {
         assertTrue("No exception listener event fired.", called.await(15, TimeUnit.SECONDS));
     }
 
+    @Test
+    public void testSessionTransactedCommit() throws JMSException, InterruptedException {
+
+        Connection connection = createConnection();
+        Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
+        Queue queue = session.createQueue(name.toString());
+
+        connection.start();
+
+        // transacted producer
+        MessageProducer pr = session.createProducer(queue);
+        for (int i = 0; i < 10; i++) {
+            Message m = session.createTextMessage("TestMessage" + i);
+            pr.send(m);
+        }
+
+        // No commit in place, so no message should be dispatched.
+        MessageConsumer consumer = session.createConsumer(queue);
+        TextMessage m = (TextMessage) consumer.receive(5000);
+
+        assertNull(m);
+
+        session.commit();
+
+        // Messages should be available now.
+        for (int i = 0; i < 10; i++) {
+            Message msg = consumer.receive(5000);
+            assertNotNull(msg);
+        }
+
+        session.close();
+        connection.close();
+    }
+
     private Connection createConnection() throws JMSException {
         return createConnection(name.toString(), false);
     }