commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r558393 - /jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
Date Sat, 21 Jul 2007 23:43:05 GMT
Author: psteitz
Date: Sat Jul 21 16:43:04 2007
New Revision: 558393

URL: http://svn.apache.org/viewvc?view=rev&rev=558393
Log:
Added test to verify that maxWait = 0 means immediate failure for PerUserPoolDataSource, per
javadoc (different from BasicDataSource).

Modified:
    jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java

Modified: jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java?view=diff&rev=558393&r1=558392&r2=558393
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
(original)
+++ jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
Sat Jul 21 16:43:04 2007
@@ -305,6 +305,23 @@
         }
     }
     
+    /**
+     * Verify that defaultMaxWait = 0 means immediate failure when
+     * pool is exhausted.
+     */
+    public void testMaxWaitZero() throws Exception {
+        PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
+        tds.setDefaultMaxWait(0);
+        tds.setPerUserMaxActive("u1", new Integer(1));
+        Connection conn = tds.getConnection("u1", "p1");
+        try {
+            Connection conn2 = tds.getConnection("u1", "p1");
+            fail("Expecting Pool Exhausted exception");
+        } catch (SQLException ex) {
+            // expected
+        }
+    }
+    
     public void testPerUserMethods() throws Exception {
         PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
         



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message