minor change
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 28 Jan 2007 21:34:21 +0000 (21:34 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 28 Jan 2007 21:34:21 +0000 (21:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@500890 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java

index e112a0c..e099ded 100644 (file)
@@ -55,7 +55,9 @@ public class TestDataIntegrity extends TestCase {
             threads[x] = new Thread() {
                 public void run() {
                     try {
+                        long start = System.currentTimeMillis();
                         for (int i = 0; i < msgCount; i++) channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(),0);
+                        System.out.println("Thread["+this.getName()+"] sent "+msgCount+" messages in "+(System.currentTimeMillis()-start)+" ms.");
                     }catch ( Exception x ) {
                         x.printStackTrace();
                         return;
@@ -69,8 +71,8 @@ public class TestDataIntegrity extends TestCase {
         for (int x=0; x<threads.length; x++ ) { threads[x].join();}
         //sleep for 50 sec, let the other messages in
         long start = System.currentTimeMillis();
-        while ( (System.currentTimeMillis()-start)<120000 && msgCount*threadCount!=listener1.count) Thread.sleep(500);
-        System.err.println("Finished NO_ACK");
+        while ( (System.currentTimeMillis()-start)<15000 && msgCount*threadCount!=listener1.count) Thread.sleep(500);
+        System.err.println("Finished NO_ACK ["+listener1.count+"]");
         assertEquals("Checking success messages.",msgCount*threadCount,listener1.count);
     }
     
@@ -81,7 +83,9 @@ public class TestDataIntegrity extends TestCase {
                 threads[x] = new Thread() {
                     public void run() {
                         try {
+                            long start = System.currentTimeMillis();
                             for (int i = 0; i < msgCount; i++) channel1.send(new Member[] {channel2.getLocalMember(false)}, Data.createRandomData(),GroupChannel.SEND_OPTIONS_ASYNCHRONOUS);
+                            System.out.println("Thread["+this.getName()+"] sent "+msgCount+" messages in "+(System.currentTimeMillis()-start)+" ms.");
                         }catch ( Exception x ) {
                             x.printStackTrace();
                             return;
@@ -96,7 +100,7 @@ public class TestDataIntegrity extends TestCase {
             //sleep for 50 sec, let the other messages in
             long start = System.currentTimeMillis();
             while ( (System.currentTimeMillis()-start)<15000 && msgCount*threadCount!=listener1.count) Thread.sleep(500);
-            System.err.println("Finished ASYNC MULTI THREAD");
+            System.err.println("Finished ASYNC MULTI THREAD ["+listener1.count+"]");
             assertEquals("Checking success messages.",msgCount*threadCount,listener1.count);
     }
     public void testDataSendASYNC() throws Exception {