Author: ggregory
Date: Wed Aug 1 12:31:34 2012
New Revision: 1367957
URL: http://svn.apache.org/viewvc?rev=1367957&view=rev
Log:
[POOL-227] Unit test failures due to getMinIdle changes.
Modified:
commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java
Modified: commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml?rev=1367957&r1=1367956&r2=1367957&view=diff
==============================================================================
--- commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml (original)
+++ commons/proper/pool/branches/POOL_1_X/src/changes/changes.xml Wed Aug 1
12:31:34 2012
@@ -22,6 +22,9 @@
</properties>
<body>
<release version="1.6.1" date="?" description="">
+ <action dev="ggregory" type="fix" issue="POOL-227" due-to="liviutudor">
+ Unit test failures due to getMinIdle changes.
+ </action>
<action dev="ggregory" type="fix" issue="POOL-224" due-to="liviutudor">
FindBugs performance warnings on StackKeyedObjectPool.
</action>
Modified:
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java?rev=1367957&r1=1367956&r2=1367957&view=diff
==============================================================================
---
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
(original)
+++
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java
Wed Aug 1 12:31:34 2012
@@ -1026,6 +1026,8 @@ public class TestGenericKeyedObjectPool
byte whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;
boolean lifo = false;
+ assertTrue(minIdle > maxIdle);
+
GenericKeyedObjectPool<String, String> pool = new
GenericKeyedObjectPool<String, String>();
assertEquals(GenericKeyedObjectPool.DEFAULT_MAX_ACTIVE,
pool.getMaxActive());
assertEquals(GenericKeyedObjectPool.DEFAULT_MAX_IDLE,
pool.getMaxIdle());
@@ -1066,7 +1068,7 @@ public class TestGenericKeyedObjectPool
assertEquals(maxActive, pool.getMaxActive());
assertEquals(maxIdle, pool.getMaxIdle());
assertEquals(maxWait, pool.getMaxWait());
- assertEquals(minIdle, pool.getMinIdle());
+ assertEquals(maxIdle, pool.getMinIdle()); //maxIdle<minIdle so it gets
returned!
assertEquals(maxTotal, pool.getMaxTotal());
assertEquals(minEvictableIdleTimeMillis,
pool.getMinEvictableIdleTimeMillis());
@@ -1235,7 +1237,7 @@ public class TestGenericKeyedObjectPool
assertEquals(maxActive, pool.getMaxActive());
assertEquals(maxIdle, pool.getMaxIdle());
assertEquals(maxWait, pool.getMaxWait());
- assertEquals(minIdle, pool.getMinIdle());
+ assertEquals(maxIdle, pool.getMinIdle()); //maxIdle<minIdle so it gets
returned!
assertEquals(maxTotal, pool.getMaxTotal());
assertEquals(minEvictableIdleTimeMillis,
pool.getMinEvictableIdleTimeMillis());
@@ -1257,7 +1259,7 @@ public class TestGenericKeyedObjectPool
assertEquals(maxActive, pool.getMaxActive());
assertEquals(maxIdle, pool.getMaxIdle());
assertEquals(maxWait, pool.getMaxWait());
- assertEquals(minIdle, pool.getMinIdle());
+ assertEquals(maxIdle, pool.getMinIdle()); //maxIdle<minIdle so it gets
returned!
assertEquals(maxTotal, pool.getMaxTotal());
assertEquals(minEvictableIdleTimeMillis,
pool.getMinEvictableIdleTimeMillis());
Modified:
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java?rev=1367957&r1=1367956&r2=1367957&view=diff
==============================================================================
---
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java
(original)
+++
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPoolFactory.java
Wed Aug 1 12:31:34 2012
@@ -56,12 +56,13 @@ public class TestGenericKeyedObjectPoolF
config.timeBetweenEvictionRunsMillis = 8;
config.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;
config.lifo = false;
+ assertTrue(config.minIdle > config.maxIdle);
factory = new GenericKeyedObjectPoolFactory<Object,
Integer>(createObjectFactory(), config);
pool = (GenericKeyedObjectPool<Object, Integer>)factory.createPool();
assertEquals(1, pool.getMaxActive());
assertEquals(2, pool.getMaxIdle());
assertEquals(3, pool.getMaxWait());
- assertEquals(4, pool.getMinIdle());
+ assertEquals(config.maxIdle, pool.getMinIdle()); //maxIdle>minIdle
assertEquals(5, pool.getMinEvictableIdleTimeMillis());
assertEquals(6, pool.getNumTestsPerEvictionRun());
assertEquals(true, pool.getTestOnBorrow());
Modified:
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java?rev=1367957&r1=1367956&r2=1367957&view=diff
==============================================================================
---
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java
(original)
+++
commons/proper/pool/branches/POOL_1_X/src/test/org/apache/commons/pool/impl/TestGenericObjectPoolFactory.java
Wed Aug 1 12:31:34 2012
@@ -59,12 +59,13 @@ public class TestGenericObjectPoolFactor
config.lifo = false;
config.timeBetweenEvictionRunsMillis = 8;
config.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_GROW;
+ assertTrue(config.minIdle > config.maxIdle);
factory = new GenericObjectPoolFactory<Integer>(new
MethodCallPoolableObjectFactory(), config);
pool = (GenericObjectPool<Integer>)factory.createPool();
assertEquals(1, pool.getMaxActive());
assertEquals(2, pool.getMaxIdle());
assertEquals(3, pool.getMaxWait());
- assertEquals(4, pool.getMinIdle());
+ assertEquals(config.maxIdle, pool.getMinIdle()); //minIdle > maxIdle
assertEquals(5, pool.getMinEvictableIdleTimeMillis());
assertEquals(6, pool.getNumTestsPerEvictionRun());
assertEquals(7, pool.getSoftMinEvictableIdleTimeMillis());
@@ -157,7 +158,7 @@ public class TestGenericObjectPoolFactor
assertEquals(1, pool.getMaxActive());
assertEquals(2, pool.getMaxWait());
assertEquals(3, pool.getMaxIdle());
- assertEquals(4, pool.getMinIdle());
+ assertEquals(3, pool.getMinIdle()); //minIdle > maxIdle
assertEquals(5, pool.getTimeBetweenEvictionRunsMillis());
assertEquals(6, pool.getNumTestsPerEvictionRun());
assertEquals(7, pool.getMinEvictableIdleTimeMillis());
@@ -174,7 +175,7 @@ public class TestGenericObjectPoolFactor
assertEquals(1, pool.getMaxActive());
assertEquals(2, pool.getMaxWait());
assertEquals(3, pool.getMaxIdle());
- assertEquals(4, pool.getMinIdle());
+ assertEquals(3, pool.getMinIdle()); //minIdle > maxIdle
assertEquals(5, pool.getTimeBetweenEvictionRunsMillis());
assertEquals(6, pool.getNumTestsPerEvictionRun());
assertEquals(7, pool.getMinEvictableIdleTimeMillis());