[hornetq-commits] JBoss hornetq SVN: r8627 - trunk/tests/src/org/hornetq/tests/integration/cluster/reattach.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Dec 8 18:09:30 EST 2009


Author: clebert.suconic at jboss.com
Date: 2009-12-08 18:09:30 -0500 (Tue, 08 Dec 2009)
New Revision: 8627

Modified:
   trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
Log:
Clean up on test

Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java	2009-12-08 22:48:43 UTC (rev 8626)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java	2009-12-08 23:09:30 UTC (rev 8627)
@@ -57,6 +57,8 @@
 
    // Constants -----------------------------------------------------
 
+   final SimpleString ADDRESS = new SimpleString("address");
+
    // Attributes ----------------------------------------------------
    private final Logger log = Logger.getLogger(this.getClass());
 
@@ -97,6 +99,9 @@
 
       final CountDownLatch ready = new CountDownLatch(1);
 
+      
+      // this test will use a queue. Whenever the test wants a failure.. it can just send TRUE to failureQueue
+      // This Thread will be reading the queue
       Thread failer = new Thread()
       {
          @Override
@@ -147,60 +152,7 @@
 
       try
       {
-         int numberOfProducers = 1;
-
-         final CountDownLatch align = new CountDownLatch(numberOfProducers);
-         final CountDownLatch flagStart = new CountDownLatch(1);
-
-         final ClientSessionFactory sessionFactory = sf;
-
-         class ThreadProd extends Thread
-         {
-            Throwable throwable;
-
-            int count;
-
-            public ThreadProd(final int count)
-            {
-               this.count = count;
-            }
-
-            @Override
-            public void run()
-            {
-               try
-               {
-                  align.countDown();
-                  flagStart.await();
-                  doSend2(count, sessionFactory, failureQueue);
-               }
-               catch (Throwable e)
-               {
-                  e.printStackTrace();
-                  throwable = e;
-               }
-            }
-         }
-
-         ThreadProd prod[] = new ThreadProd[numberOfProducers];
-         for (int i = 0; i < prod.length; i++)
-         {
-            prod[i] = new ThreadProd(i);
-            prod[i].start();
-         }
-
-         align.await();
-         flagStart.countDown();
-
-         for (ThreadProd prodT : prod)
-         {
-            prodT.join();
-            if (prodT.throwable != null)
-            {
-               throw prodT.throwable;
-            }
-         }
-
+         doSend2(1, sf, failureQueue);
       }
       finally
       {
@@ -229,8 +181,6 @@
 
    }
 
-   final SimpleString ADDRESS = new SimpleString("address");
-
    public void doSend2(final int order, final ClientSessionFactory sf, final LinkedBlockingDeque<Boolean> failureQueue) throws Exception
    {
       long start = System.currentTimeMillis();
@@ -315,7 +265,6 @@
             if (count % 100 == 0)
             {
                failureQueue.push(true);
-               System.out.println("Received " + count);
             }
 
             if (count == numMessages)



More information about the hornetq-commits mailing list