commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r907359 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp: cpdsadapter/TestDriverAdapterCPDS.java datasources/TestPerUserPoolDataSource.java datasources/TestSharedPoolDataSource.java
Date Sun, 07 Feb 2010 01:07:29 GMT
Author: sebb
Date: Sun Feb  7 01:07:29 2010
New Revision: 907359

URL: http://svn.apache.org/viewvc?rev=907359&view=rev
Log:
We are testing that getConnection() fails, so don't also close it

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/cpdsadapter/TestDriverAdapterCPDS.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestSharedPoolDataSource.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/cpdsadapter/TestDriverAdapterCPDS.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/cpdsadapter/TestDriverAdapterCPDS.java?rev=907359&r1=907358&r2=907359&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/cpdsadapter/TestDriverAdapterCPDS.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/cpdsadapter/TestDriverAdapterCPDS.java
Sun Feb  7 01:07:29 2010
@@ -61,7 +61,7 @@
         pcds.getPooledConnection("u2", "p2").close();
         try {
             // Use bad password
-            pcds.getPooledConnection("u1", "zlsafjk").close();
+            pcds.getPooledConnection("u1", "zlsafjk");
             fail("Able to retrieve connection with incorrect password");
         } catch (SQLException e1) {
             // should fail
@@ -71,7 +71,7 @@
         // Use good password
         pcds.getPooledConnection("u1", "p1").close();
         try {
-            pcds.getPooledConnection("u1", "x").close();
+            pcds.getPooledConnection("u1", "x");
             fail("Able to retrieve connection with incorrect password");
         }
         catch (SQLException e) {

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java?rev=907359&r1=907358&r2=907359&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
Sun Feb  7 01:07:29 2010
@@ -89,7 +89,7 @@
     {
         try {
             // Use bad password
-            ds.getConnection("u1", "zlsafjk").close();
+            ds.getConnection("u1", "zlsafjk");
             fail("Able to retrieve connection with incorrect password");
         } catch (SQLException e1) {
             // should fail
@@ -100,7 +100,7 @@
         ds.getConnection("u1", "p1").close();
         try 
         {
-            ds.getConnection("u1", "x").close();
+            ds.getConnection("u1", "x");
             fail("Able to retrieve connection with incorrect password");
         }
         catch (SQLException e)
@@ -118,12 +118,12 @@
         // Try related users and passwords
         ds.getConnection("foo", "bar").close();
         try {
-            ds.getConnection("foob", "ar").close();
+            ds.getConnection("foob", "ar");
             fail("Should have caused an SQLException");
         } catch (SQLException expected) {
         }
         try {
-            ds.getConnection("foo", "baz").close();
+            ds.getConnection("foo", "baz");
             fail("Should have generated SQLException");
         } catch (SQLException expected) {
         }
@@ -514,7 +514,7 @@
     // See DBCP-8
     public void testChangePassword() throws Exception {
         try {
-            ds.getConnection("foo", "bay").close();
+            ds.getConnection("foo", "bay");
             fail("Should have generated SQLException");
         } catch (SQLException expected) {
         }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestSharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestSharedPoolDataSource.java?rev=907359&r1=907358&r2=907359&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestSharedPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestSharedPoolDataSource.java
Sun Feb  7 01:07:29 2010
@@ -91,7 +91,7 @@
         ds.getConnection("u2", "p2").close();
         try {
             // Use bad password
-            ds.getConnection("u1", "zlsafjk").close();
+            ds.getConnection("u1", "zlsafjk");
             fail("Able to retrieve connection with incorrect password");
         } catch (SQLException e1) {
             // should fail
@@ -102,7 +102,7 @@
         ds.getConnection("u1", "p1").close();
         try 
         {
-            ds.getConnection("u1", "x").close();
+            ds.getConnection("u1", "x");
             fail("Able to retrieve connection with incorrect password");
         }
         catch (SQLException e)
@@ -120,12 +120,12 @@
         // Try related users and passwords
         ds.getConnection("foo", "bar").close();
         try {
-            ds.getConnection("foob", "ar").close();
+            ds.getConnection("foob", "ar");
             fail("Should have caused an SQLException");
         } catch (SQLException expected) {
         }
         try {
-            ds.getConnection("foo", "baz").close();
+            ds.getConnection("foo", "baz");
             fail("Should have generated SQLException");
         } catch (SQLException expected) {
         }
@@ -574,7 +574,7 @@
             assertEquals("Should be one idle connection in the pool", 
                     1, ((SharedPoolDataSource) ds).getNumIdle());
             try {
-                ds.getConnection("foo", "bar").close(); // old password
+                ds.getConnection("foo", "bar"); // old password
                 fail("Should have generated SQLException"); 
             } catch (SQLException expected) {
             }



Mime
View raw message