You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2006/07/04 00:23:30 UTC

svn commit: r418865 - /tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java

Author: fhanik
Date: Mon Jul  3 15:23:27 2006
New Revision: 418865

URL: http://svn.apache.org/viewvc?rev=418865&view=rev
Log:
minor changes

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java?rev=418865&r1=418864&r2=418865&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java Mon Jul  3 15:23:27 2006
@@ -23,11 +23,12 @@
  * @version 1.0
  */
 public class TestDataIntegrity extends TestCase {
-    int msgCount = 10000;
+    int msgCount = 1000;
     int threadCount = 8;
     GroupChannel channel1;
     GroupChannel channel2;
     Listener listener1;
+    int threadCounter = 0;
     protected void setUp() throws Exception {
         super.setUp();
         channel1 = new GroupChannel();
@@ -53,17 +54,21 @@
             threads[x] = new Thread() {
                 public void run() {
                     try {
-                        for (int i = 0; i < msgCount; i++) channel1.send(channel1.getMembers(), Data.createRandomData(),GroupChannel.SEND_OPTIONS_ASYNCHRONOUS);
+                        for (int i = 0; i < msgCount; i++) channel1.send(channel1.getMembers(), Data.createRandomData(),0);
                     }catch ( Exception x ) {
                         x.printStackTrace();
                         return;
+                    } finally {
+                        threadCounter++;
                     }
                 }
             };
         }
         for (int x=0; x<threads.length; x++ ) { threads[x].start();}
         for (int x=0; x<threads.length; x++ ) { threads[x].join();}
-        Thread.sleep(25000);
+        //sleep for 50 sec, let the other messages in
+        long start = System.currentTimeMillis();
+        while ( (System.currentTimeMillis()-start)<50000 && msgCount*threadCount!=listener1.count) Thread.sleep(500);
         System.err.println("Finished NO_ACK");
         assertEquals("Checking success messages.",msgCount*threadCount,listener1.count);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org