directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r385241 - in /directory/trunks/mina/core/src: main/java/org/apache/mina/filter/ThreadPoolFilter.java test/java/org/apache/mina/common/ByteBufferTest.java test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
Date Sun, 12 Mar 2006 03:42:58 GMT
Author: trustin
Date: Sat Mar 11 19:42:56 2006
New Revision: 385241

URL: http://svn.apache.org/viewcvs?rev=385241&view=rev
Log:
* Fixed failing regression test cases
* Shortend ByteBufferTest duration


Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
    directory/trunks/mina/core/src/test/java/org/apache/mina/common/ByteBufferTest.java
    directory/trunks/mina/core/src/test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java?rev=385241&r1=385240&r2=385241&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
Sat Mar 11 19:42:56 2006
@@ -306,17 +306,14 @@
     private SessionBuffer getSessionBuffer( IoSession session )
     {
         final Map buffers = this.buffers;
-        SessionBuffer buf = ( SessionBuffer ) buffers.get( session );
-        if( buf == null )
+        SessionBuffer buf;
+        synchronized( buffers )
         {
-            synchronized( buffers )
+            buf = ( SessionBuffer ) buffers.get( session );
+            if( buf == null )
             {
-                buf = ( SessionBuffer ) buffers.get( session );
-                if( buf == null )
-                {
-                    buf = new SessionBuffer( session );
-                    buffers.put( session, buf );
-                }
+                buf = new SessionBuffer( session );
+                buffers.put( session, buf );
             }
         }
         return buf;

Modified: directory/trunks/mina/core/src/test/java/org/apache/mina/common/ByteBufferTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/test/java/org/apache/mina/common/ByteBufferTest.java?rev=385241&r1=385240&r2=385241&view=diff
==============================================================================
--- directory/trunks/mina/core/src/test/java/org/apache/mina/common/ByteBufferTest.java (original)
+++ directory/trunks/mina/core/src/test/java/org/apache/mina/common/ByteBufferTest.java Sat
Mar 11 19:42:56 2006
@@ -481,7 +481,14 @@
         t.setDaemon( true );
         t.start();
 
-        Thread.sleep( 5 * 1000 );
+        for( int i = 0; i < 50; i ++ )
+        {
+            Thread.sleep( 100 );
+            if( !t.isAlive() )
+            {
+                break;
+            }
+        }
 
         if( t.isAlive() )
         {

Modified: directory/trunks/mina/core/src/test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java?rev=385241&r1=385240&r2=385241&view=diff
==============================================================================
--- directory/trunks/mina/core/src/test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
(original)
+++ directory/trunks/mina/core/src/test/java/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
Sat Mar 11 19:42:56 2006
@@ -40,12 +40,12 @@
     public void setUp() throws Exception
     {
         filter = new ThreadPoolFilter();
-        filter.init();
+        filter.start();
     }
     
     public void tearDown() throws Exception
     {
-        filter.destroy();
+        filter.stop();
         Assert.assertEquals( 0, filter.getPoolSize() );
         filter = null;
     }



Mime
View raw message