commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1102236 - in /commons/proper/pool/trunk/src: changes/ java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/ test/org/apache/commons/pool2/impl/
Date Thu, 12 May 2011 10:32:12 GMT
Author: markt
Date: Thu May 12 10:32:12 2011
New Revision: 1102236

URL: http://svn.apache.org/viewvc?rev=1102236&view=rev
Log:
Port clean-up from POOL_FUTURE
http://svn.apache.org/viewvc?view=revision&revision=1053585
Remove stack-based pool/factory, since 'lifo' flag in G(K)OP(F) can get the same behaviour

Removed:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPool.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackKeyedObjectPoolFactory.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPool.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackKeyedObjectPoolFactory.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPool.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestStackObjectPoolFactory.java
Modified:
    commons/proper/pool/trunk/src/changes/changes.xml
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestKeyedObjectPool.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestObjectPool.java

Modified: commons/proper/pool/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/changes/changes.xml?rev=1102236&r1=1102235&r2=1102236&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/changes/changes.xml (original)
+++ commons/proper/pool/trunk/src/changes/changes.xml Thu May 12 10:32:12 2011
@@ -37,8 +37,8 @@
       the appropriate getters. 
     </action>
     <action dev="markt" type="update">
-      Code clean-up. Add missing @Override annotations, remove unused code and
-      remove deprecated code.
+      Code clean-up. Add missing @Override annotations, remove unused code,
+      remove deprecated code and unnecessary code.
     </action>
     <action dev="markt" type="update">
       Introduce an Enum (WhenExhaustedAction) to control pool behaviour when no

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestKeyedObjectPool.java?rev=1102236&r1=1102235&r2=1102236&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestKeyedObjectPool.java Thu
May 12 10:32:12 2011
@@ -26,7 +26,6 @@ import java.util.NoSuchElementException;
 import junit.framework.TestCase;
 
 import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
-import org.apache.commons.pool2.impl.StackKeyedObjectPool;
 import org.junit.Test;
 
 /**
@@ -111,10 +110,6 @@ public abstract class TestKeyedObjectPoo
         // addObject should make a new object, pasivate it and put it in the pool
         pool.addObject(KEY);
         expectedMethods.add(new MethodCall("makeObject", KEY).returned(ZERO));
-        if (pool instanceof StackKeyedObjectPool) {
-            expectedMethods.add(new MethodCall(
-                    "validateObject", KEY, ZERO).returned(Boolean.TRUE)); 
-        }
         expectedMethods.add(new MethodCall("passivateObject", KEY, ZERO));
         assertEquals(expectedMethods, factory.getMethodCalls());
 
@@ -144,10 +139,6 @@ public abstract class TestKeyedObjectPoo
             // expected
         }
         expectedMethods.add(new MethodCall("makeObject", KEY).returned(ONE));
-        if (pool instanceof StackKeyedObjectPool) {
-            expectedMethods.add(new MethodCall(
-                    "validateObject", KEY, ONE).returned(Boolean.TRUE)); 
-        }
         expectedMethods.add(new MethodCall("passivateObject", KEY, ONE));
         assertEquals(expectedMethods, factory.getMethodCalls());
     }
@@ -257,10 +248,6 @@ public abstract class TestKeyedObjectPoo
 
         // returned object should be passivated
         pool.returnObject(KEY, obj);
-        if (pool instanceof StackKeyedObjectPool) {
-            expectedMethods.add(new MethodCall(
-                    "validateObject", KEY, obj).returned(Boolean.TRUE)); 
-        }
         expectedMethods.add(new MethodCall("passivateObject", KEY, obj));
         assertEquals(expectedMethods, factory.getMethodCalls());
 
@@ -279,10 +266,6 @@ public abstract class TestKeyedObjectPoo
         clear(factory, expectedMethods);
         factory.setPassivateObjectFail(true);
         pool.returnObject(KEY, obj);
-        if (pool instanceof StackKeyedObjectPool) {
-            expectedMethods.add(new MethodCall(
-                    "validateObject", KEY, obj).returned(Boolean.TRUE)); 
-        }
         expectedMethods.add(new MethodCall("passivateObject", KEY, obj));
         TestObjectPool.removeDestroyObjectCall(factory.getMethodCalls()); // The exact timing
of destroyObject is flexible here.
         assertEquals(expectedMethods, factory.getMethodCalls());

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestObjectPool.java?rev=1102236&r1=1102235&r2=1102236&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestObjectPool.java (original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/TestObjectPool.java Thu May
12 10:32:12 2011
@@ -24,7 +24,6 @@ import org.apache.commons.pool2.ObjectPo
 import org.apache.commons.pool2.PoolableObjectFactory;
 import org.apache.commons.pool2.impl.GenericObjectPool;
 import org.apache.commons.pool2.impl.SoftReferenceObjectPool;
-import org.apache.commons.pool2.impl.StackObjectPool;
 import org.apache.commons.pool2.PoolUtils;
 import org.junit.Test;
 
@@ -124,8 +123,7 @@ public abstract class TestObjectPool {
         assertEquals(1, pool.getNumIdle());
         expectedMethods.add(new MethodCall("makeObject").returned(ZERO));
         // StackObjectPool, SoftReferenceObjectPool also validate on add
-        if (pool instanceof StackObjectPool || 
-                pool instanceof SoftReferenceObjectPool) {
+        if (pool instanceof SoftReferenceObjectPool) {
             expectedMethods.add(new MethodCall(
                     "validateObject", ZERO).returned(Boolean.TRUE));
         }
@@ -159,8 +157,7 @@ public abstract class TestObjectPool {
         }
         expectedMethods.add(new MethodCall("makeObject").returned(ONE));
         // StackObjectPool, SofReferenceObjectPool also validate on add
-        if (pool instanceof StackObjectPool || 
-                pool instanceof SoftReferenceObjectPool) {
+        if (pool instanceof SoftReferenceObjectPool) {
             expectedMethods.add(new MethodCall(
                     "validateObject", ONE).returned(Boolean.TRUE));
         }
@@ -270,8 +267,7 @@ public abstract class TestObjectPool {
         // returned object should be passivated
         pool.returnObject(obj);
         // StackObjectPool, SoftReferenceObjectPool also validate on return
-        if (pool instanceof StackObjectPool || 
-                pool instanceof SoftReferenceObjectPool) {
+        if (pool instanceof SoftReferenceObjectPool) {
             expectedMethods.add(new MethodCall(
                     "validateObject", obj).returned(Boolean.TRUE));
         }
@@ -293,8 +289,7 @@ public abstract class TestObjectPool {
         factory.setPassivateObjectFail(true);
         pool.returnObject(obj);
         // StackObjectPool, SoftReferenceObjectPool also validate on return
-        if (pool instanceof StackObjectPool || 
-                pool instanceof SoftReferenceObjectPool) {
+        if (pool instanceof SoftReferenceObjectPool) {
             expectedMethods.add(new MethodCall(
                     "validateObject", obj).returned(Boolean.TRUE));
         }



Mime
View raw message