directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r440239 - /directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java
Date Tue, 05 Sep 2006 03:33:34 GMT
Author: trustin
Date: Mon Sep  4 20:33:33 2006
New Revision: 440239

URL: http://svn.apache.org/viewvc?view=rev&rev=440239
Log:
Added additional check to find an additional thread pool problem.

Modified:
    directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java

Modified: directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java?view=diff&rev=440239&r1=440238&r2=440239
==============================================================================
--- directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java
(original)
+++ directory/trunks/mina/core/src/test/java/org/apache/mina/filter/thread/ThreadPoolFilterRegressionTest.java
Mon Sep  4 20:33:33 2006
@@ -73,7 +73,7 @@
     public void testEventOrder() throws Throwable
     {
         final EventOrderChecker nextFilter = new EventOrderChecker();
-        final IoSession[] sessions = new IoSession[]
+        final EventOrderCounter[] sessions = new EventOrderCounter[]
         {
             new EventOrderCounter(),
             new EventOrderCounter(),
@@ -86,11 +86,12 @@
             new EventOrderCounter(),
             new EventOrderCounter(),
         };
+        final int loop = 1000000;
         final int end = sessions.length - 1;
         final ThreadPoolFilter filter = this.filter;
         filter.getThreadPool().setKeepAliveTime( 3000 );
         
-        for( int i = 0; i < 1000000 ; i++ )
+        for( int i = 0; i < loop ; i++ )
         {
             Integer objI = new Integer( i );
 
@@ -108,6 +109,10 @@
         Thread.sleep( 3500 );
         
         Assert.assertEquals( 1, filter.getThreadPool().getPoolSize() );
+        for( int i = end; i >= 0; i-- )
+        {
+            Assert.assertEquals( loop - 1, sessions[ i ].lastCount.intValue() );
+        }
     }
     
     public void testShutdown() throws Exception



Mime
View raw message