commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1131510 - in /commons/proper/pool/trunk/src: java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/impl/
Date Sun, 05 Jun 2011 00:59:47 GMT
Author: psteitz
Date: Sun Jun  5 00:59:46 2011
New Revision: 1131510

URL: http://svn.apache.org/viewvc?rev=1131510&view=rev
Log:
Renamed GKOP maxIdle, minIdle to *perKey; removed maxTotal, maxIdle, minIdle from BaseObjectPoolConfig.

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

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java?rev=1131510&r1=1131509&r2=1131510&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
Sun Jun  5 00:59:46 2011
@@ -23,11 +23,6 @@ package org.apache.commons.pool2.impl;
 public abstract class BaseObjectPoolConfig {
 
     /**
-     * The default cap on the total number of active instances from the pool.
-     */
-    public static final int DEFAULT_MAX_TOTAL = 8;
-
-    /**
      * The default LIFO status. True means that borrowObject returns the most
      * recently used ("last in") idle object in the pool (if there are idle
      * instances available). False means that the pool behaves as a FIFO queue -
@@ -44,10 +39,6 @@ public abstract class BaseObjectPoolConf
      */
     public static final long DEFAULT_MAX_WAIT = -1L;
 
-    /**
-     * The default cap on the number of "sleeping" instances in the pool.
-     */
-    public static final int DEFAULT_MAX_IDLE = 8;
 
     /**
      * The default value for {@link #getMinEvictableIdleTimeMillis}.
@@ -56,12 +47,6 @@ public abstract class BaseObjectPoolConf
             1000L * 60L * 30L;
 
     /**
-     * The default minimum number of "sleeping" instances in the pool before
-     * before the evictor thread (if active) spawns new objects.
-     */
-    public static final int DEFAULT_MIN_IDLE = 0;
-
-    /**
      * The default number of objects to examine per run in the idle object
      * evictor.
      */
@@ -93,20 +78,13 @@ public abstract class BaseObjectPoolConf
     public static final WhenExhaustedAction DEFAULT_WHEN_EXHAUSTED_ACTION =
         WhenExhaustedAction.BLOCK;
     
-
-    private int maxTotal = DEFAULT_MAX_TOTAL;
-
     private boolean lifo = DEFAULT_LIFO;
 
-    private int maxIdle = DEFAULT_MAX_IDLE;
-
     private long maxWait = DEFAULT_MAX_WAIT;
 
     private long minEvictableIdleTimeMillis =
         DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
 
-    private int minIdle = DEFAULT_MIN_IDLE;
-
     private int numTestsPerEvictionRun =
         DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
 
@@ -122,15 +100,6 @@ public abstract class BaseObjectPoolConf
     private WhenExhaustedAction whenExhaustedAction =
         DEFAULT_WHEN_EXHAUSTED_ACTION;
 
-
-    public int getMaxTotal() {
-        return maxTotal;
-    }
-
-    public void setMaxTotal(int maxTotal) {
-        this.maxTotal = maxTotal;
-    }
-
     public boolean getLifo() {
         return lifo;
     }
@@ -139,14 +108,6 @@ public abstract class BaseObjectPoolConf
         this.lifo = lifo;
     }
 
-    public int getMaxIdle() {
-        return maxIdle;
-    }
-
-    public void setMaxIdle(int maxIdle) {
-        this.maxIdle = maxIdle;
-    }
-
     public long getMaxWait() {
         return maxWait;
     }
@@ -163,14 +124,6 @@ public abstract class BaseObjectPoolConf
         this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
     }
 
-    public int getMinIdle() {
-        return minIdle;
-    }
-
-    public void setMinIdle(int minIdle) {
-        this.minIdle = minIdle;
-    }
-
     public int getNumTestsPerEvictionRun() {
         return numTestsPerEvictionRun;
     }

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=1131510&r1=1131509&r2=1131510&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
Sun Jun  5 00:59:46 2011
@@ -72,7 +72,7 @@ import org.apache.commons.pool2.PoolUtil
  *    pools. The default setting for this parameter is -1 (no limit).
  *  </li>
  *  <li>
- *    {@link #setMaxIdle maxIdle} controls the maximum number of objects that can
+ *    {@link #setMaxIdlePerKey maxIdlePerKey} controls the maximum number of objects that
can
  *    sit idle in the pool (per key) at any time.  When negative, there
  *    is no limit to the number of objects that may be idle per key. The
  *    default setting for this parameter is 8.
@@ -155,7 +155,7 @@ import org.apache.commons.pool2.PoolUtil
  *   for this parameter is <code>false.</code>
  *  </li>
  *  <li>
- *    {@link #setMinIdle minIdle} sets a target value for the minimum number of
+ *    {@link #setMinIdlePerKey minIdlePerKey} sets a target value for the minimum number
of
  *    idle objects (per key) that should always be available. If this parameter
  *    is set to a positive number and
  *    <code>timeBetweenEvictionRunsMillis > 0,</code> each time the idle object
@@ -226,13 +226,13 @@ public class GenericKeyedObjectPool<K,T>
         // Copy the settings from the config
         this._factory = config.getFactory();
         this._lifo = config.getLifo();
-        this._maxIdle = config.getMaxIdle();
+        this.maxIdlePerKey = config.getMaxIdlePerKey();
         this._maxTotal = config.getMaxTotal();
         this._maxTotalPerKey = config.getMaxTotalPerKey();
         this._maxWait = config.getMaxWait();
         this._minEvictableIdleTimeMillis =
             config.getMinEvictableIdleTimeMillis();
-        this._minIdle = config.getMinIdle();
+        this.minIdlePerKey = config.getMinIdlePerKey();
         this._numTestsPerEvictionRun = config.getNumTestsPerEvictionRun();
         this._testOnBorrow = config.getTestOnBorrow();
         this._testOnReturn = config.getTestOnReturn();
@@ -362,10 +362,10 @@ public class GenericKeyedObjectPool<K,T>
      * Returns the cap on the number of "idle" instances per key.
      * @return the maximum number of "idle" instances that can be held
      * in a given keyed pool.
-     * @see #setMaxIdle
+     * @see #setMaxIdlePerKey
      */
-    public int getMaxIdle() {
-        return _maxIdle;
+    public int getMaxIdlePerKey() {
+        return maxIdlePerKey;
     }
 
     /**
@@ -379,11 +379,10 @@ public class GenericKeyedObjectPool<K,T>
      * point.
      * @param maxIdle the maximum number of "idle" instances that can be held
      * in a given keyed pool. Use a negative value for no limit.
-     * @see #getMaxIdle
-     * @see BaseObjectPoolConfig#DEFAULT_MAX_IDLE
+     * @see #getMaxIdlePerKey
      */
-    public void setMaxIdle(int maxIdle) {
-        _maxIdle = maxIdle;
+    public void setMaxIdlePerKey(int maxIdle) {
+        maxIdlePerKey = maxIdle;
     }
 
     /**
@@ -394,11 +393,11 @@ public class GenericKeyedObjectPool<K,T>
      * made during idle object eviction runs.
      * @param poolSize - The minimum size of the each keyed pool
      * @since Pool 1.3
-     * @see #getMinIdle
+     * @see #getMinIdlePerKey
      * @see #setTimeBetweenEvictionRunsMillis
      */
-    public void setMinIdle(int poolSize) {
-        _minIdle = poolSize;
+    public void setMinIdlePerKey(int poolSize) {
+        minIdlePerKey = poolSize;
     }
 
     /**
@@ -411,8 +410,8 @@ public class GenericKeyedObjectPool<K,T>
      * @since Pool 1.3
      * @see #setTimeBetweenEvictionRunsMillis
      */
-    public int getMinIdle() {
-        return _minIdle;
+    public int getMinIdlePerKey() {
+        return minIdlePerKey;
     }
 
     /**
@@ -592,10 +591,10 @@ public class GenericKeyedObjectPool<K,T>
      * @see GenericKeyedObjectPoolConfig
      */
     public void setConfig(GenericKeyedObjectPoolConfig<K,T> conf) {
-        setMaxIdle(conf.getMaxIdle());
+        setMaxIdlePerKey(conf.getMaxIdlePerKey());
         setMaxTotalPerKey(conf.getMaxTotalPerKey());
         setMaxTotal(conf.getMaxTotal());
-        setMinIdle(conf.getMinIdle());
+        setMinIdlePerKey(conf.getMinIdlePerKey());
         setMaxWait(conf.getMaxWait());
         setWhenExhaustedAction(conf.getWhenExhaustedAction());
         setTestOnBorrow(conf.getTestOnBorrow());
@@ -781,7 +780,7 @@ public class GenericKeyedObjectPool<K,T>
       * the same object/key pair (with no <code>borrowObject</code> calls in
between) will result in multiple
       * references to the object in the idle instance pool.</p>
       * 
-      * <p>If {@link #getMaxIdle() maxIdle} is set to a positive value and the number
of idle instances under the given
+      * <p>If {@link #getMaxIdlePerKey() maxIdle} is set to a positive value and the
number of idle instances under the given
       * key has reached this value, the returning instance is destroyed.</p>
       * 
       * <p>If {@link #getTestOnReturn() testOnReturn} == true, the returning instance
is validated before being returned
@@ -829,7 +828,7 @@ public class GenericKeyedObjectPool<K,T>
              // TODO - Should not happen;
          }
 
-         int maxIdle = getMaxIdle();
+         int maxIdle = getMaxIdlePerKey();
          LinkedBlockingDeque<PooledObject<T>> idleObjects =
              objectDeque.getIdleObjects();
 
@@ -1331,7 +1330,7 @@ public class GenericKeyedObjectPool<K,T>
      * @throws Exception If there was an error whilst creating the pooled objects.
      */
     private void ensureMinIdle() throws Exception {
-        int minIdle = getMinIdle();
+        int minIdle = getMinIdlePerKey();
         if (minIdle < 1) {
             return;
         }
@@ -1354,7 +1353,7 @@ public class GenericKeyedObjectPool<K,T>
      * @throws Exception If there was an error whilst creating the pooled objects
      */
     private void ensureMinIdle(K key) throws Exception {
-        int minIdle = getMinIdle();
+        int minIdle = getMinIdlePerKey();
         if (minIdle < 1) {
             return;
         }
@@ -1428,7 +1427,7 @@ public class GenericKeyedObjectPool<K,T>
     }
 
     /**
-     * Registers a key for pool control and ensures that {@link #getMinIdle()}
+     * Registers a key for pool control and ensures that {@link #getMinIdlePerKey()}
      * idle instances are created.
      *
      * @param key - The key to register for pool control.
@@ -1504,13 +1503,13 @@ public class GenericKeyedObjectPool<K,T>
     private synchronized int calculateDeficit(ObjectDeque<T> objectDeque) {
         
         if (objectDeque == null) {
-            return getMinIdle();
+            return getMinIdlePerKey();
         }
         int objectDefecit = 0;
         
         // Calculate no of objects needed to be created, in order to have
         // the number of pooled objects < maxTotalPerKey();
-        objectDefecit = getMinIdle() - objectDeque.getIdleObjects().size();
+        objectDefecit = getMinIdlePerKey() - objectDeque.getIdleObjects().size();
         if (getMaxTotalPerKey() > 0) {
             int growLimit = Math.max(0,
                     getMaxTotalPerKey() - objectDeque.getIdleObjects().size());
@@ -1596,15 +1595,15 @@ public class GenericKeyedObjectPool<K,T>
      * @see #setMaxIdle
      * @see #getMaxIdle
      */
-    private int _maxIdle = GenericKeyedObjectPoolConfig.DEFAULT_MAX_IDLE;
+    private int maxIdlePerKey = GenericKeyedObjectPoolConfig.DEFAULT_MAX_IDLE_PER_KEY;
 
     /**
      * The minimum no of idle objects per key.
      * @see #setMinIdle
      * @see #getMinIdle
      */
-    private volatile int _minIdle =
-        GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE;
+    private volatile int minIdlePerKey =
+        GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE_PER_KEY;
 
     /**
      * The cap on the number of active instances from the pool.

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java?rev=1131510&r1=1131509&r2=1131510&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java
Sun Jun  5 00:59:46 2011
@@ -29,20 +29,37 @@ public class GenericKeyedObjectPoolConfi
 
     public static final int DEFAULT_MAX_TOTAL_PER_KEY = 8;
 
+    /**
+     * The default maximum number of instances under management
+     * (idle or checked out) across all keyed pools.
+     */
     public static final int DEFAULT_MAX_TOTAL = -1;
-
+    
+    /**
+     * The default minimum number of idle instances that the maintenance
+     * thread (if enabled) will try to maintain per key.
+     */
+    public static final int DEFAULT_MIN_IDLE_PER_KEY = 0;
+    
+    /**
+     * The default maximum number of idle instances per key.
+     */
+    public static final int DEFAULT_MAX_IDLE_PER_KEY = 8;
+    
+    
+    private int minIdlePerKey = DEFAULT_MIN_IDLE_PER_KEY;
+    
+    private int maxIdlePerKey = DEFAULT_MAX_IDLE_PER_KEY;
     
     private int maxTotalPerKey = DEFAULT_MAX_TOTAL_PER_KEY;
     
+    private int maxTotal = DEFAULT_MAX_TOTAL;
+    
     private KeyedPoolableObjectFactory<K,T> factory = null;
-
     
     public GenericKeyedObjectPoolConfig() {
-        // Uses a different default for maxTotal
-        setMaxTotal(DEFAULT_MAX_TOTAL);
     }
 
-
     public KeyedPoolableObjectFactory<K,T> getFactory() {
         return factory;
     }
@@ -51,6 +68,14 @@ public class GenericKeyedObjectPoolConfi
         this.factory = factory;
     }
 
+    public int getMaxTotal() {
+        return maxTotal;
+    }
+
+    public void setMaxTotal(int maxTotal) {
+        this.maxTotal = maxTotal;
+    }
+
     public int getMaxTotalPerKey() {
         return maxTotalPerKey;
     }
@@ -59,6 +84,22 @@ public class GenericKeyedObjectPoolConfi
         this.maxTotalPerKey = maxTotalPerKey;
     }
     
+    public int getMinIdlePerKey() {
+        return minIdlePerKey;
+    }
+
+    public void setMinIdlePerKey(int minIdlePerKey) {
+        this.minIdlePerKey = minIdlePerKey;
+    }
+
+    public int getMaxIdlePerKey() {
+        return maxIdlePerKey;
+    }
+
+    public void setMaxIdlePerKey(int maxIdlePerKey) {
+        this.maxIdlePerKey = maxIdlePerKey;
+    }
+
     @SuppressWarnings("unchecked")
     @Override
     public GenericKeyedObjectPoolConfig<K, T> clone() {

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=1131510&r1=1131509&r2=1131510&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
Sun Jun  5 00:59:46 2011
@@ -73,7 +73,7 @@ public class TestGenericKeyedObjectPool 
             new GenericKeyedObjectPool<Object,Object>();
         pool.setFactory(factory);
         pool.setMaxTotalPerKey(mincapacity);
-        pool.setMaxIdle(mincapacity);
+        pool.setMaxIdlePerKey(mincapacity);
         return pool;
     }
 
@@ -177,7 +177,7 @@ public class TestGenericKeyedObjectPool 
     @Test
     public void testMaxIdle() throws Exception {
         pool.setMaxTotalPerKey(100);
-        pool.setMaxIdle(8);
+        pool.setMaxIdlePerKey(8);
         String[] active = new String[100];
         for(int i=0;i<100;i++) {
             active[i] = pool.borrowObject("");
@@ -353,8 +353,8 @@ public class TestGenericKeyedObjectPool 
             assertEquals(123,pool.getMaxTotalPerKey());
         }
         {
-            pool.setMaxIdle(12);
-            assertEquals(12,pool.getMaxIdle());
+            pool.setMaxIdlePerKey(12);
+            assertEquals(12,pool.getMaxIdlePerKey());
         }
         {
             pool.setMaxWait(1234L);
@@ -400,7 +400,7 @@ public class TestGenericKeyedObjectPool 
 
     @Test
     public void testEviction() throws Exception {
-        pool.setMaxIdle(500);
+        pool.setMaxIdlePerKey(500);
         pool.setMaxTotalPerKey(500);
         pool.setNumTestsPerEvictionRun(100);
         pool.setMinEvictableIdleTimeMillis(250L);
@@ -450,7 +450,7 @@ public class TestGenericKeyedObjectPool 
 
     @Test
     public void testEviction2() throws Exception {
-        pool.setMaxIdle(500);
+        pool.setMaxIdlePerKey(500);
         pool.setMaxTotalPerKey(500);
         pool.setNumTestsPerEvictionRun(100);
         pool.setMinEvictableIdleTimeMillis(500L);
@@ -522,7 +522,7 @@ public class TestGenericKeyedObjectPool 
     @Test
     public void testThreaded1() throws Exception {
         pool.setMaxTotalPerKey(15);
-        pool.setMaxIdle(15);
+        pool.setMaxIdlePerKey(15);
         pool.setMaxWait(1000L);
         runTestThreads(20, 100, 50, pool);
     }
@@ -543,7 +543,7 @@ public class TestGenericKeyedObjectPool 
         pool = new GenericKeyedObjectPool<String,String>();
         pool.setFactory(factory);
         pool.setMaxTotal(maxTotal);
-        pool.setMaxIdle(-1);
+        pool.setMaxIdlePerKey(-1);
         pool.setTestOnReturn(true);
         pool.setMaxWait(10000L);
         runTestThreads(5, 10, 50, pool);
@@ -551,8 +551,8 @@ public class TestGenericKeyedObjectPool 
 
     @Test
     public void testMinIdle() throws Exception {
-        pool.setMaxIdle(500);
-        pool.setMinIdle(5);
+        pool.setMaxIdlePerKey(500);
+        pool.setMinIdlePerKey(5);
         pool.setMaxTotalPerKey(10);
         pool.setNumTestsPerEvictionRun(0);
         pool.setMinEvictableIdleTimeMillis(50L);
@@ -591,8 +591,8 @@ public class TestGenericKeyedObjectPool 
 
     @Test
     public void testMinIdleMaxTotalPerKey() throws Exception {
-        pool.setMaxIdle(500);
-        pool.setMinIdle(5);
+        pool.setMaxIdlePerKey(500);
+        pool.setMinIdlePerKey(5);
         pool.setMaxTotalPerKey(10);
         pool.setNumTestsPerEvictionRun(0);
         pool.setMinEvictableIdleTimeMillis(50L);
@@ -644,8 +644,8 @@ public class TestGenericKeyedObjectPool 
 
     @Test
     public void testMinIdleNoPreparePool() throws Exception {
-        pool.setMaxIdle(500);
-        pool.setMinIdle(5);
+        pool.setMaxIdlePerKey(500);
+        pool.setMinIdlePerKey(5);
         pool.setMaxTotalPerKey(10);
         pool.setNumTestsPerEvictionRun(0);
         pool.setMinEvictableIdleTimeMillis(50L);
@@ -927,7 +927,7 @@ public class TestGenericKeyedObjectPool 
                 factory = new VisitTrackerFactory<Integer>();
                 pool = new GenericKeyedObjectPool<Integer,VisitTracker<Integer>>();
                 pool.setFactory(factory);
-                pool.setMaxIdle(-1);
+                pool.setMaxIdlePerKey(-1);
                 pool.setMaxTotalPerKey(-1);
                 pool.setNumTestsPerEvictionRun(smallPrimes[i]);
                 pool.setMinEvictableIdleTimeMillis(-1);
@@ -1023,9 +1023,9 @@ public class TestGenericKeyedObjectPool 
         
         GenericKeyedObjectPool<Object,Object> pool = new GenericKeyedObjectPool<Object,Object>();
         assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL_PER_KEY, pool.getMaxTotalPerKey());
-        assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MAX_IDLE, pool.getMaxIdle());
+        assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MAX_IDLE_PER_KEY, pool.getMaxIdlePerKey());
         assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MAX_WAIT, pool.getMaxWait());
-        assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE, pool.getMinIdle());
+        assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE_PER_KEY, pool.getMinIdlePerKey());
         assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL, pool.getMaxTotal());
         assertEquals(GenericKeyedObjectPoolConfig.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS,
                 pool.getMinEvictableIdleTimeMillis());
@@ -1047,8 +1047,8 @@ public class TestGenericKeyedObjectPool 
             new GenericKeyedObjectPoolConfig<Object,Object>();
         config.setLifo(lifo);
         config.setMaxTotalPerKey(maxTotalPerKey);
-        config.setMaxIdle(maxIdle);
-        config.setMinIdle(minIdle);
+        config.setMaxIdlePerKey(maxIdle);
+        config.setMinIdlePerKey(minIdle);
         config.setMaxTotal(maxTotal);
         config.setMaxWait(maxWait);
         config.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
@@ -1060,9 +1060,9 @@ public class TestGenericKeyedObjectPool 
         config.setWhenExhaustedAction(whenExhaustedAction);
         pool = new GenericKeyedObjectPool<Object,Object>(config);
         assertEquals(maxTotalPerKey, pool.getMaxTotalPerKey());
-        assertEquals(maxIdle, pool.getMaxIdle());
+        assertEquals(maxIdle, pool.getMaxIdlePerKey());
         assertEquals(maxWait, pool.getMaxWait());
-        assertEquals(minIdle, pool.getMinIdle());
+        assertEquals(minIdle, pool.getMinIdlePerKey());
         assertEquals(maxTotal, pool.getMaxTotal());
         assertEquals(minEvictableIdleTimeMillis,
                 pool.getMinEvictableIdleTimeMillis());
@@ -1278,7 +1278,7 @@ public class TestGenericKeyedObjectPool 
         pool.setMaxTotalPerKey(5);
         pool.setMaxTotal(8);
         pool.setTestOnBorrow(true);
-        pool.setMaxIdle(5);
+        pool.setMaxIdlePerKey(5);
         pool.setMaxWait(-1);
         runTestThreads(20, 300, 250, pool);
     }

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPoolFactory.java?rev=1131510&r1=1131509&r2=1131510&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericKeyedObjectPoolFactory.java
Sun Jun  5 00:59:46 2011
@@ -46,9 +46,9 @@ public class TestGenericKeyedObjectPoolF
         final GenericKeyedObjectPoolConfig<Object,Object> config =
             new GenericKeyedObjectPoolConfig<Object,Object>();
         config.setMaxTotalPerKey(1);
-        config.setMaxIdle(2);
+        config.setMaxIdlePerKey(2);
         config.setMaxWait(3);
-        config.setMinIdle(4);
+        config.setMinIdlePerKey(4);
         config.setMinEvictableIdleTimeMillis(5);
         config.setNumTestsPerEvictionRun(6);
         config.setTestOnBorrow(true);
@@ -63,9 +63,9 @@ public class TestGenericKeyedObjectPoolF
         GenericKeyedObjectPool<Object,Object> pool =
             (GenericKeyedObjectPool<Object,Object>)factory.createPool();
         assertEquals(1, pool.getMaxTotalPerKey());
-        assertEquals(2, pool.getMaxIdle());
+        assertEquals(2, pool.getMaxIdlePerKey());
         assertEquals(3, pool.getMaxWait());
-        assertEquals(4, pool.getMinIdle());
+        assertEquals(4, pool.getMinIdlePerKey());
         assertEquals(5, pool.getMinEvictableIdleTimeMillis());
         assertEquals(6, pool.getNumTestsPerEvictionRun());
         assertEquals(true, pool.getTestOnBorrow());



Mime
View raw message