commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1053585 - in /commons/proper/pool/trunk/src: java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/ test/org/apache/commons/pool2/impl/
Date Wed, 29 Dec 2010 09:45:08 GMT
Author: simonetripodi
Date: Wed Dec 29 09:45:08 2010
New Revision: 1053585

URL: http://svn.apache.org/viewvc?rev=1053585&view=rev
Log:
According to what discussed and agreed on ML, stack-based pool/factory can be removed, since
'lifo' flag in G(K)OP(F) can get the same behavior

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/StackKeyedObjectPoolMBean.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/StackObjectPoolConfig.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolFactory.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/StackObjectPoolMBean.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/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/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=1053585&r1=1053584&r2=1053585&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 Wed
Dec 29 09:45:08 2010
@@ -25,13 +25,7 @@ import java.util.NoSuchElementException;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.pool2.BaseKeyedPoolableObjectFactory;
-import org.apache.commons.pool2.KeyedObjectPool;
-import org.apache.commons.pool2.KeyedPoolableObjectFactory;
-import org.apache.commons.pool2.ObjectPool;
-import org.apache.commons.pool2.PoolUtils;
 import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
-import org.apache.commons.pool2.impl.StackKeyedObjectPool;
 import org.junit.Test;
 
 /**
@@ -115,10 +109,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());
 
@@ -148,10 +138,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());
     }
@@ -261,10 +247,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());
 
@@ -283,10 +265,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=1053585&r1=1053584&r2=1053585&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 Wed Dec
29 09:45:08 2010
@@ -27,12 +27,8 @@ import java.util.NoSuchElementException;
 
 import junit.framework.TestCase;
 
-import org.apache.commons.pool2.ObjectPool;
-import org.apache.commons.pool2.PoolUtils;
-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.junit.Test;
 
 /**
@@ -125,8 +121,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));
         }
@@ -160,8 +155,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));
         }
@@ -271,8 +265,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));
         }
@@ -294,8 +287,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