You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2003/11/10 15:40:26 UTC

cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TestManual.java

dirkv       2003/11/10 06:40:26

  Modified:    dbcp/src/test/org/apache/commons/dbcp TestManual.java
  Log:
  Bugzilla Bug 24562: PoolingDriver needs a closePool method
  - testcase
  
  Revision  Changes    Path
  1.16      +20 -3     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestManual.java
  
  Index: TestManual.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestManual.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TestManual.java	9 Oct 2003 21:05:29 -0000	1.15
  +++ TestManual.java	10 Nov 2003 14:40:26 -0000	1.16
  @@ -63,6 +63,7 @@
   
   import java.sql.Connection;
   import java.sql.DriverManager;
  +import java.sql.SQLException;
   
   import junit.framework.Test;
   import junit.framework.TestSuite;
  @@ -146,4 +147,20 @@
           }
       }
       
  +    public void testClosePool() throws Exception {
  +        Connection conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:test");
  +        assertNotNull(conn);
  +        conn.close();
  +        
  +        PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");
  +        driver.closePool("test");
  +
  +        try {
  +            conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:test");
  +            fail("expected SQLException");
  +        }
  +        catch (SQLException e) {
  +            // OK
  +        }
  +    }
   }
  
  
  

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