commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/jdbc2pool TestJdbc2PoolDataSource.java
Date Fri, 08 Nov 2002 19:37:26 GMT
rwaldhoff    2002/11/08 11:37:26

  Modified:    dbcp/src/test/org/apache/commons/dbcp
                        TestConnectionPool.java
               dbcp/src/test/org/apache/commons/dbcp/jdbc2pool
                        TestJdbc2PoolDataSource.java
  Log:
  additional tests (attempting unsuccessfully to recreate bug # 13235)
  
  Revision  Changes    Path
  1.3       +19 -4     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestConnectionPool.java
  
  Index: TestConnectionPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestConnectionPool.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestConnectionPool.java	8 Nov 2002 19:17:24 -0000	1.2
  +++ TestConnectionPool.java	8 Nov 2002 19:37:26 -0000	1.3
  @@ -169,6 +169,21 @@
           conn.close();
       }
   
  +    public void testRepeatedBorrowAndReturn() throws Exception {
  +        for(int i=0;i<100;i++) {
  +            Connection conn = getConnection();
  +            assertTrue(null != conn);
  +            PreparedStatement stmt = conn.prepareStatement("select * from dual");
  +            assertTrue(null != stmt);
  +            ResultSet rset = stmt.executeQuery();
  +            assertTrue(null != rset);
  +            assertTrue(rset.next());
  +            rset.close();
  +            stmt.close();
  +            conn.close();
  +        }
  +    }
  +
       public void testSimple2() throws Exception {
           Connection conn = getConnection();
           assertTrue(null != conn);
  
  
  
  1.3       +9 -7      jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/jdbc2pool/TestJdbc2PoolDataSource.java
  
  Index: TestJdbc2PoolDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/jdbc2pool/TestJdbc2PoolDataSource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestJdbc2PoolDataSource.java	8 Nov 2002 18:51:07 -0000	1.2
  +++ TestJdbc2PoolDataSource.java	8 Nov 2002 19:37:26 -0000	1.3
  @@ -87,7 +87,7 @@
       }
   
       protected Connection getConnection() throws Exception {
  -        return ds.getConnection();
  +        return ds.getConnection("foo","bar");
       }
   
       private DataSource ds;
  @@ -97,12 +97,14 @@
           pcds.setDriver("org.apache.commons.dbcp.TesterDriver");
           pcds.setUrl("jdbc:apache:commons:testdriver");
           pcds.setUser("foo");
  -        pcds.setPassword(null);
  +        pcds.setPassword("bar");
   
           Jdbc2PoolDataSource tds = new Jdbc2PoolDataSource();
           tds.setConnectionPoolDataSource(pcds);
           tds.setDefaultMaxActive(getMaxActive());
  -        tds.setDefaultMaxWait((int) (getMaxWait()));
  +        tds.setDefaultMaxWait((int)(getMaxWait()));
  +        tds.setPerUserMaxActive("foo",new Integer(getMaxActive()));
  +        tds.setPerUserMaxWait("foo",new Integer((int)(getMaxWait())));
   
           ds = tds;
       }
  
  
  

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


Mime
View raw message