[Jboss-cvs] JBossAS SVN: r57102 - trunk/testsuite/src/main/org/jboss/test/jca/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Sep 23 00:06:13 EDT 2006


Author: weston.price at jboss.com
Date: 2006-09-23 00:06:12 -0400 (Sat, 23 Sep 2006)
New Revision: 57102

Modified:
   trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java
Log:
[JBAS-2737] Do not destroy connections below minimum for timed out connections
if stictMin is in effect. 

Modified: trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java	2006-09-23 04:04:28 UTC (rev 57101)
+++ trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java	2006-09-23 04:06:12 UTC (rev 57102)
@@ -253,6 +253,40 @@
       
    }
    
+   public void testNonStrictMinPool() throws Exception
+   {
+      InternalManagedConnectionPool.PoolParams pp = new InternalManagedConnectionPool.PoolParams();
+      pp.minSize = 10;
+      pp.maxSize = 15;
+      pp.blockingTimeout = 10;
+      pp.idleTimeout = 1000;
+      pp.prefill = true;
+      
+      BaseConnectionManager2 cm = getCM(pp);
+      JBossManagedConnectionPool.OnePool pool = (JBossManagedConnectionPool.OnePool) cm.getPoolingStrategy();
+      Thread.sleep(5000);
+      assertTrue("Non StrictMin pool should allow destroyed connections below minimum connections", pool.getConnectionDestroyedCount() > 0);
+
+   }
+   
+   public void testStrictMinPool() throws Exception
+   {
+      InternalManagedConnectionPool.PoolParams pp = new InternalManagedConnectionPool.PoolParams();
+      pp.minSize = 10;
+      pp.maxSize = 15;
+      pp.blockingTimeout = 10;
+      pp.idleTimeout = 1000;
+      pp.prefill = true;
+      pp.stictMin = true;
+      
+      BaseConnectionManager2 cm = getCM(pp);
+      JBossManagedConnectionPool.OnePool pool = (JBossManagedConnectionPool.OnePool) cm.getPoolingStrategy();
+      //Let Idle remover run
+      Thread.sleep(3500);
+      assertTrue("StrictMin pool should not destroy below minimum connections", pool.getConnectionDestroyedCount() == 0);
+            
+   }
+   
    public void testMisConfiguredFillToMin() throws Exception
    {
       InternalManagedConnectionPool.PoolParams pp = new InternalManagedConnectionPool.PoolParams();




More information about the jboss-cvs-commits mailing list