You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/12/28 09:11:14 UTC

svn commit: r607186 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java

Author: rajdavies
Date: Fri Dec 28 00:11:14 2007
New Revision: 607186

URL: http://svn.apache.org/viewvc?rev=607186&view=rev
Log:
This test could get stuck - now only wait 2 seconds for a message 
and use Memory Message Store

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java?rev=607186&r1=607185&r2=607186&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java Fri Dec 28 00:11:14 2007
@@ -17,7 +17,9 @@
 package org.apache.activemq.usecases;
 
 import java.util.Date;
+import java.util.Map;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -56,7 +58,7 @@
 
     public void testTransaction() throws Exception {
 
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost");
+        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
         connection = factory.createConnection();
         queue = new ActiveMQQueue(getClass().getName() + "." + getName());
 
@@ -104,8 +106,20 @@
         }
 
         LOG.info("Waiting for latch");
-        latch.await();
-
+        latch.await(2,TimeUnit.SECONDS);
+        if (receivedText==null) {
+            /*
+            Map<Thread,StackTraceElement[]> map = Thread.getAllStackTraces();
+            for (Map.Entry<Thread,StackTraceElement[]> entry: map.entrySet()) {
+                System.out.println(entry.getKey());
+                for (StackTraceElement element :entry.getValue()) {
+                    System.out.println(element);
+                }
+            }
+            */
+            fail("No message received");
+        }
+        assertNotNull(receivedText);
         LOG.info("test completed, destination=" + receivedText);
     }