commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1097483 - in /commons/proper/pool/trunk/src: java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
Date Thu, 28 Apr 2011 14:36:23 GMT
Author: simonetripodi
Date: Thu Apr 28 14:36:23 2011
New Revision: 1097483

URL: http://svn.apache.org/viewvc?rev=1097483&view=rev
Log:
fix for POOL-187: TestGenericKeyedObjectPool.testMaxTotalLRU method falls in an infinite loops
parametrization was right, problem is that I accidentally merged obsolete code :(

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1097483&r1=1097482&r2=1097483&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Thu Apr 28 14:36:23 2011
@@ -1430,13 +1430,8 @@ public class GenericKeyedObjectPool<K,V>
                     listForKey.add(pairTimeStamp);
                     toDestroy.put(key, listForKey);
                 }
-                // if that was the last object for that key, drop that pool
-                if (list.isEmpty()) {
-                    _poolMap.remove(key);
-                    _poolList.remove(key);
-                }
+                objectQueue.incrementInternalProcessingCount();
                 _totalIdle--;
-                _totalInternalProcessing++;
                 itemsToRemove--;
             }
 

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java?rev=1097483&r1=1097482&r2=1097483&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java
Thu Apr 28 14:36:23 2011
@@ -39,7 +39,6 @@ import org.apache.commons.pool2.Waiter;
 import org.apache.commons.pool2.WaiterFactory;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -295,11 +294,7 @@ public class TestGenericKeyedObjectPool 
         }
     }
 
-    /*
-     * FIXME this test is stuck!!!
-     */
     @Test
-    @Ignore
     public void testMaxTotalLRU() throws Exception {
         pool.setMaxActive(2);
         pool.setMaxTotal(3);



Mime
View raw message