activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r607186 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionTest.java
Date Fri, 28 Dec 2007 08:11:14 GMT
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);
     }
 



Mime
View raw message