activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r385467 - /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
Date Mon, 13 Mar 2006 08:42:43 GMT
Author: jstrachan
Date: Mon Mar 13 00:42:42 2006
New Revision: 385467

URL: http://svn.apache.org/viewcvs?rev=385467&view=rev
Log:
updated timers to ensure that the test runs even on slow machines

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java?rev=385467&r1=385466&r2=385467&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
Mon Mar 13 00:42:42 2006
@@ -47,6 +47,10 @@
 
     private AtomicBoolean stopThreads = new AtomicBoolean(false);
 
+    protected Exception writerException;
+
+    protected Exception readerException;
+
     public void testStreamlets() throws Exception {
         final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(
                 BROKER_URL);
@@ -77,6 +81,7 @@
                                 inputStream.close();
                             }
                         } catch (Exception e) {
+                            readerException  = e;
                             e.printStackTrace();
                         } finally {
                             System.err
@@ -105,6 +110,7 @@
                                 outputStream.close();
                             }
                         } catch (Exception e) {
+                            writerException = e;
                             e.printStackTrace();
                         } finally {
                             System.err.println(totalWritten
@@ -116,11 +122,14 @@
                 readerThread.start();
                 writerThread.start();
 
-                readerThread.join(30*1000);
-                writerThread.join(10);
+                writerThread.join(60 * 1000);
+                readerThread.join(60 * 1000);
                 
                 stopThreads.set(true);
-                                
+
+                assertTrue("Should not have received a reader exception", readerException
== null);
+                assertTrue("Should not have received a writer exception", writerException
== null);
+                
                 Assert.assertEquals("Not all messages accounted for", 
                         totalWritten, totalRead);
                 



Mime
View raw message