commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1024410 - in /commons/proper/pool/trunk/src: java/org/apache/commons/pool2/impl/ test/org/apache/commons/pool2/impl/
Date Tue, 19 Oct 2010 20:58:03 GMT
Author: simonetripodi
Date: Tue Oct 19 20:58:02 2010
New Revision: 1024410

URL: http://svn.apache.org/viewvc?rev=1024410&view=rev
Log:
GenericObjectPool.Config class converted to a POJO, no more direct access to fields
TODO add missing getters/setters javadoc comments

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java
    commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPoolFactory.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java?rev=1024410&r1=1024409&r2=1024410&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPool.java
Tue Oct 19 20:58:02 2010
@@ -1652,60 +1652,162 @@ public class GenericObjectPool<T> extend
      * @see GenericObjectPool#setConfig
      */
     public static class Config {
-        //CHECKSTYLE: stop VisibilityModifier
         /**
          * @see GenericObjectPool#setMaxIdle
          */
-        public int maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
+        private int maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
         /**
          * @see GenericObjectPool#setMinIdle
          */
-        public int minIdle = GenericObjectPool.DEFAULT_MIN_IDLE;
+        private int minIdle = GenericObjectPool.DEFAULT_MIN_IDLE;
         /**
          * @see GenericObjectPool#setMaxActive
          */
-        public int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
+        private int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
         /**
          * @see GenericObjectPool#setMaxWait
          */
-        public long maxWait = GenericObjectPool.DEFAULT_MAX_WAIT;
+        private long maxWait = GenericObjectPool.DEFAULT_MAX_WAIT;
         /**
          * @see GenericObjectPool#setWhenExhaustedAction
          */
-        public WhenExhaustedAction whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
+        private WhenExhaustedAction whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
         /**
          * @see GenericObjectPool#setTestOnBorrow
          */
-        public boolean testOnBorrow = GenericObjectPool.DEFAULT_TEST_ON_BORROW;
+        private boolean testOnBorrow = GenericObjectPool.DEFAULT_TEST_ON_BORROW;
         /**
          * @see GenericObjectPool#setTestOnReturn
          */
-        public boolean testOnReturn = GenericObjectPool.DEFAULT_TEST_ON_RETURN;
+        private boolean testOnReturn = GenericObjectPool.DEFAULT_TEST_ON_RETURN;
         /**
          * @see GenericObjectPool#setTestWhileIdle
          */
-        public boolean testWhileIdle = GenericObjectPool.DEFAULT_TEST_WHILE_IDLE;
+        private boolean testWhileIdle = GenericObjectPool.DEFAULT_TEST_WHILE_IDLE;
         /**
          * @see GenericObjectPool#setTimeBetweenEvictionRunsMillis
          */
-        public long timeBetweenEvictionRunsMillis = GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
+        private long timeBetweenEvictionRunsMillis = GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
         /**
          * @see GenericObjectPool#setNumTestsPerEvictionRun
          */
-        public int numTestsPerEvictionRun =  GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
+        private int numTestsPerEvictionRun =  GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
         /**
          * @see GenericObjectPool#setMinEvictableIdleTimeMillis
          */
-        public long minEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
+        private long minEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
         /**
          * @see GenericObjectPool#setSoftMinEvictableIdleTimeMillis
          */
-        public long softMinEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
+        private long softMinEvictableIdleTimeMillis = GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
         /**
          * @see GenericObjectPool#setLifo
          */
-        public boolean lifo = GenericObjectPool.DEFAULT_LIFO;
-        //CHECKSTYLE: resume VisibilityModifier
+        private boolean lifo = GenericObjectPool.DEFAULT_LIFO;
+
+        public int getMaxIdle() {
+            return maxIdle;
+        }
+
+        public void setMaxIdle(int maxIdle) {
+            this.maxIdle = maxIdle;
+        }
+
+        public int getMinIdle() {
+            return minIdle;
+        }
+
+        public void setMinIdle(int minIdle) {
+            this.minIdle = minIdle;
+        }
+
+        public int getMaxActive() {
+            return maxActive;
+        }
+
+        public void setMaxActive(int maxActive) {
+            this.maxActive = maxActive;
+        }
+
+        public long getMaxWait() {
+            return maxWait;
+        }
+
+        public void setMaxWait(long maxWait) {
+            this.maxWait = maxWait;
+        }
+
+        public WhenExhaustedAction getWhenExhaustedAction() {
+            return whenExhaustedAction;
+        }
+
+        public void setWhenExhaustedAction(WhenExhaustedAction whenExhaustedAction) {
+            this.whenExhaustedAction = whenExhaustedAction;
+        }
+
+        public boolean getTestOnBorrow() {
+            return testOnBorrow;
+        }
+
+        public void setTestOnBorrow(boolean testOnBorrow) {
+            this.testOnBorrow = testOnBorrow;
+        }
+
+        public boolean getTestOnReturn() {
+            return testOnReturn;
+        }
+
+        public void setTestOnReturn(boolean testOnReturn) {
+            this.testOnReturn = testOnReturn;
+        }
+
+        public boolean getTestWhileIdle() {
+            return testWhileIdle;
+        }
+
+        public void setTestWhileIdle(boolean testWhileIdle) {
+            this.testWhileIdle = testWhileIdle;
+        }
+
+        public long getTimeBetweenEvictionRunsMillis() {
+            return timeBetweenEvictionRunsMillis;
+        }
+
+        public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
{
+            this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
+        }
+
+        public int getNumTestsPerEvictionRun() {
+            return numTestsPerEvictionRun;
+        }
+
+        public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) {
+            this.numTestsPerEvictionRun = numTestsPerEvictionRun;
+        }
+
+        public long getMinEvictableIdleTimeMillis() {
+            return minEvictableIdleTimeMillis;
+        }
+
+        public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
+            this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
+        }
+
+        public long getSoftMinEvictableIdleTimeMillis() {
+            return softMinEvictableIdleTimeMillis;
+        }
+
+        public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
{
+            this.softMinEvictableIdleTimeMillis = softMinEvictableIdleTimeMillis;
+        }
+
+        public boolean getLifo() {
+            return lifo;
+        }
+
+        public void setLifo(boolean lifo) {
+            this.lifo = lifo;
+        }
     }
 
     /**

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java?rev=1024410&r1=1024409&r2=1024410&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericObjectPoolFactory.java
Tue Oct 19 20:58:02 2010
@@ -51,7 +51,7 @@ public class GenericObjectPoolFactory<T>
      * @see GenericObjectPool#GenericObjectPool(PoolableObjectFactory, GenericObjectPool.Config)
      */
     public GenericObjectPoolFactory(PoolableObjectFactory<T> factory, GenericObjectPool.Config
config) throws NullPointerException {
-        this(factory,config.maxActive,config.whenExhaustedAction,config.maxWait,config.maxIdle,config.minIdle,config.testOnBorrow,config.testOnReturn,config.timeBetweenEvictionRunsMillis,config.numTestsPerEvictionRun,config.minEvictableIdleTimeMillis,config.testWhileIdle,config.softMinEvictableIdleTimeMillis,
config.lifo);
+        this(factory,config.getMaxActive(),config.getWhenExhaustedAction(),config.getMaxWait(),config.getMaxIdle(),config.getMinIdle(),config.getTestOnBorrow(),config.getTestOnReturn(),config.getTimeBetweenEvictionRunsMillis(),config.getNumTestsPerEvictionRun(),config.getMinEvictableIdleTimeMillis(),config.getTestWhileIdle(),config.getSoftMinEvictableIdleTimeMillis(),
config.getLifo());
     }
 
     /**

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java?rev=1024410&r1=1024409&r2=1024410&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPool.java
Tue Oct 19 20:58:02 2010
@@ -712,92 +712,92 @@ public class TestGenericObjectPool exten
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxIdle = 3;
-            expected.maxWait = 5L;
-            expected.minEvictableIdleTimeMillis = 7L;
-            expected.numTestsPerEvictionRun = 9;
-            expected.testOnBorrow = true;
-            expected.testOnReturn = true;
-            expected.testWhileIdle = true;
-            expected.timeBetweenEvictionRunsMillis = 11L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
+            expected.setMaxActive(2);
+            expected.setMaxIdle(3);
+            expected.setMaxWait(5L);
+            expected.setMinEvictableIdleTimeMillis(7L);
+            expected.setNumTestsPerEvictionRun(9);
+            expected.setTestOnBorrow(true);
+            expected.setTestOnReturn(true);
+            expected.setTestWhileIdle(true);
+            expected.setTimeBetweenEvictionRunsMillis(11L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
             GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected);
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive);
+            expected.setMaxActive(2);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxWait = 5L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive,expected.whenExhaustedAction,expected.maxWait);
+            expected.setMaxActive(2);
+            expected.setMaxWait(5L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(),expected.getWhenExhaustedAction(),expected.getMaxWait());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxWait = 5L;
-            expected.testOnBorrow = true;
-            expected.testOnReturn = true;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive,expected.whenExhaustedAction,expected.maxWait,expected.testOnBorrow,expected.testOnReturn);
+            expected.setMaxActive(2);
+            expected.setMaxWait(5L);
+            expected.setTestOnBorrow(true);
+            expected.setTestOnReturn(true);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(),expected.getWhenExhaustedAction(),expected.getMaxWait(),expected.getTestOnBorrow(),expected.getTestOnReturn());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxIdle = 3;
-            expected.maxWait = 5L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive,expected.whenExhaustedAction,expected.maxWait,expected.maxIdle);
+            expected.setMaxActive(2);
+            expected.setMaxIdle(3);
+            expected.setMaxWait(5L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(),expected.getWhenExhaustedAction(),expected.getMaxWait(),expected.getMaxIdle());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxIdle = 3;
-            expected.maxWait = 5L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            expected.testOnBorrow = true;
-            expected.testOnReturn = true;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive,expected.whenExhaustedAction,expected.maxWait,expected.maxIdle,expected.testOnBorrow,expected.testOnReturn);
+            expected.setMaxActive(2);
+            expected.setMaxIdle(3);
+            expected.setMaxWait(5L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            expected.setTestOnBorrow(true);
+            expected.setTestOnReturn(true);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(),expected.getWhenExhaustedAction(),expected.getMaxWait(),expected.getMaxIdle(),expected.getTestOnBorrow(),expected.getTestOnReturn());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxIdle = 3;
-            expected.maxWait = 5L;
-            expected.minEvictableIdleTimeMillis = 7L;
-            expected.numTestsPerEvictionRun = 9;
-            expected.testOnBorrow = true;
-            expected.testOnReturn = true;
-            expected.testWhileIdle = true;
-            expected.timeBetweenEvictionRunsMillis = 11L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive, expected.whenExhaustedAction, expected.maxWait, expected.maxIdle,
expected.testOnBorrow, expected.testOnReturn, expected.timeBetweenEvictionRunsMillis, expected.numTestsPerEvictionRun,
expected.minEvictableIdleTimeMillis, expected.testWhileIdle);
+            expected.setMaxActive(2);
+            expected.setMaxIdle(3);
+            expected.setMaxWait(5L);
+            expected.setMinEvictableIdleTimeMillis(7L);
+            expected.setNumTestsPerEvictionRun(9);
+            expected.setTestOnBorrow(true);
+            expected.setTestOnReturn(true);
+            expected.setTestWhileIdle(true);
+            expected.setTimeBetweenEvictionRunsMillis(11L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(), expected.getWhenExhaustedAction(), expected.getMaxWait(),
expected.getMaxIdle(), expected.getTestOnBorrow(), expected.getTestOnReturn(), expected.getTimeBetweenEvictionRunsMillis(),
expected.getNumTestsPerEvictionRun(), expected.getMinEvictableIdleTimeMillis(), expected.getTestWhileIdle());
             assertConfiguration(expected,pool);
         }
         {
             GenericObjectPool.Config expected = new GenericObjectPool.Config();
-            expected.maxActive = 2;
-            expected.maxIdle = 3;
-            expected.minIdle = 1;
-            expected.maxWait = 5L;
-            expected.minEvictableIdleTimeMillis = 7L;
-            expected.numTestsPerEvictionRun = 9;
-            expected.testOnBorrow = true;
-            expected.testOnReturn = true;
-            expected.testWhileIdle = true;
-            expected.timeBetweenEvictionRunsMillis = 11L;
-            expected.whenExhaustedAction = WhenExhaustedAction.GROW;
-            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.maxActive, expected.whenExhaustedAction, expected.maxWait, expected.maxIdle,
expected.minIdle, expected.testOnBorrow, expected.testOnReturn, expected.timeBetweenEvictionRunsMillis,
expected.numTestsPerEvictionRun, expected.minEvictableIdleTimeMillis, expected.testWhileIdle);
+            expected.setMaxActive(2);
+            expected.setMaxIdle(3);
+            expected.setMinIdle(1);
+            expected.setMaxWait(5L);
+            expected.setMinEvictableIdleTimeMillis(7L);
+            expected.setNumTestsPerEvictionRun(9);
+            expected.setTestOnBorrow(true);
+            expected.setTestOnReturn(true);
+            expected.setTestWhileIdle(true);
+            expected.setTimeBetweenEvictionRunsMillis(11L);
+            expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
+            GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new
SimpleFactory(),expected.getMaxActive(), expected.getWhenExhaustedAction(), expected.getMaxWait(),
expected.getMaxIdle(), expected.getMinIdle(), expected.getTestOnBorrow(), expected.getTestOnReturn(),
expected.getTimeBetweenEvictionRunsMillis(), expected.getNumTestsPerEvictionRun(), expected.getMinEvictableIdleTimeMillis(),
expected.getTestWhileIdle());
             assertConfiguration(expected,pool);
         }
     }
@@ -807,16 +807,16 @@ public class TestGenericObjectPool exten
         GenericObjectPool.Config expected = new GenericObjectPool.Config();
         GenericObjectPool<Object> pool = new GenericObjectPool<Object>(new SimpleFactory());
         assertConfiguration(expected,pool);
-        expected.maxActive = 2;
-        expected.maxIdle = 3;
-        expected.maxWait = 5L;
-        expected.minEvictableIdleTimeMillis = 7L;
-        expected.numTestsPerEvictionRun = 9;
-        expected.testOnBorrow = true;
-        expected.testOnReturn = true;
-        expected.testWhileIdle = true;
-        expected.timeBetweenEvictionRunsMillis = 11L;
-        expected.whenExhaustedAction = WhenExhaustedAction.GROW;
+        expected.setMaxActive(2);
+        expected.setMaxIdle(3);
+        expected.setMaxWait(5L);
+        expected.setMinEvictableIdleTimeMillis(7L);
+        expected.setNumTestsPerEvictionRun(9);
+        expected.setTestOnBorrow(true);
+        expected.setTestOnReturn(true);
+        expected.setTestWhileIdle(true);
+        expected.setTimeBetweenEvictionRunsMillis(11L);
+        expected.setWhenExhaustedAction(WhenExhaustedAction.GROW);
         pool.setConfig(expected);
         assertConfiguration(expected,pool);
     }
@@ -1270,16 +1270,16 @@ public class TestGenericObjectPool exten
     protected GenericObjectPool<Object> pool = null;
 
     private void assertConfiguration(GenericObjectPool.Config expected, GenericObjectPool<Object>
actual) throws Exception {
-        assertEquals("testOnBorrow",expected.testOnBorrow,actual.getTestOnBorrow());
-        assertEquals("testOnReturn",expected.testOnReturn,actual.getTestOnReturn());
-        assertEquals("testWhileIdle",expected.testWhileIdle,actual.getTestWhileIdle());
-        assertEquals("whenExhaustedAction",expected.whenExhaustedAction,actual.getWhenExhaustedAction());
-        assertEquals("maxActive",expected.maxActive,actual.getMaxActive());
-        assertEquals("maxIdle",expected.maxIdle,actual.getMaxIdle());
-        assertEquals("maxWait",expected.maxWait,actual.getMaxWait());
-        assertEquals("minEvictableIdleTimeMillis",expected.minEvictableIdleTimeMillis,actual.getMinEvictableIdleTimeMillis());
-        assertEquals("numTestsPerEvictionRun",expected.numTestsPerEvictionRun,actual.getNumTestsPerEvictionRun());
-        assertEquals("timeBetweenEvictionRunsMillis",expected.timeBetweenEvictionRunsMillis,actual.getTimeBetweenEvictionRunsMillis());
+        assertEquals("testOnBorrow",expected.getTestOnBorrow(),actual.getTestOnBorrow());
+        assertEquals("testOnReturn",expected.getTestOnReturn(),actual.getTestOnReturn());
+        assertEquals("testWhileIdle",expected.getTestWhileIdle(),actual.getTestWhileIdle());
+        assertEquals("whenExhaustedAction",expected.getWhenExhaustedAction(),actual.getWhenExhaustedAction());
+        assertEquals("maxActive",expected.getMaxActive(),actual.getMaxActive());
+        assertEquals("maxIdle",expected.getMaxIdle(),actual.getMaxIdle());
+        assertEquals("maxWait",expected.getMaxWait(),actual.getMaxWait());
+        assertEquals("minEvictableIdleTimeMillis",expected.getMinEvictableIdleTimeMillis(),actual.getMinEvictableIdleTimeMillis());
+        assertEquals("numTestsPerEvictionRun",expected.getNumTestsPerEvictionRun(),actual.getNumTestsPerEvictionRun());
+        assertEquals("timeBetweenEvictionRunsMillis",expected.getTimeBetweenEvictionRunsMillis(),actual.getTimeBetweenEvictionRunsMillis());
     }
 
     public class SimpleFactory implements PoolableObjectFactory<Object> {

Modified: commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPoolFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPoolFactory.java?rev=1024410&r1=1024409&r2=1024410&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPoolFactory.java
(original)
+++ commons/proper/pool/trunk/src/test/org/apache/commons/pool2/impl/TestGenericObjectPoolFactory.java
Tue Oct 19 20:58:02 2010
@@ -51,19 +51,19 @@ public class TestGenericObjectPoolFactor
         factory.createPool().close();
 
         final GenericObjectPool.Config config = new GenericObjectPool.Config();
-        config.maxActive = 1;
-        config.maxIdle = 2;
-        config.maxWait = 3;
-        config.minIdle = 4;
-        config.minEvictableIdleTimeMillis = 5;
-        config.numTestsPerEvictionRun = 6;
-        config.softMinEvictableIdleTimeMillis = 7;
-        config.testOnBorrow = true;
-        config.testOnReturn = false;
-        config.testWhileIdle = true;
-        config.lifo = false;
-        config.timeBetweenEvictionRunsMillis = 8;
-        config.whenExhaustedAction = WhenExhaustedAction.GROW;
+        config.setMaxActive(1);
+        config.setMaxIdle(2);
+        config.setMaxWait(3);
+        config.setMinIdle(4);
+        config.setMinEvictableIdleTimeMillis(5);
+        config.setNumTestsPerEvictionRun(6);
+        config.setSoftMinEvictableIdleTimeMillis(7);
+        config.setTestOnBorrow(true);
+        config.setTestOnReturn(false);
+        config.setTestWhileIdle(true);
+        config.setLifo(false);
+        config.setTimeBetweenEvictionRunsMillis(8);
+        config.setWhenExhaustedAction(WhenExhaustedAction.GROW);
         factory = new GenericObjectPoolFactory<Object>(new MethodCallPoolableObjectFactory(),
config);
         pool = (GenericObjectPool<Object>)factory.createPool();
         assertEquals(1, pool.getMaxActive());



Mime
View raw message