commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/test/org/apache/commons/dbcp TestAbandonedBasicDataSource.java TestBasicDataSource.java TestPStmtPoolingBasicDataSource.java
Date Mon, 22 Dec 2003 14:41:18 GMT
dirkv       2003/12/22 06:41:18

  Modified:    dbcp/src/test/org/apache/commons/dbcp
                        TestAbandonedBasicDataSource.java
                        TestBasicDataSource.java
                        TestPStmtPoolingBasicDataSource.java
  Log:
  do the BasicDataSource tests for the derived Abandoned and PStmtPool DataSources as well
  
  Revision  Changes    Path
  1.7       +6 -27     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestAbandonedBasicDataSource.java
  
  Index: TestAbandonedBasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestAbandonedBasicDataSource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestAbandonedBasicDataSource.java	2 Nov 2003 17:53:55 -0000	1.6
  +++ TestAbandonedBasicDataSource.java	22 Dec 2003 14:41:17 -0000	1.7
  @@ -72,7 +72,7 @@
    * @author Dirk Verbeeck
    * @version $Revision$ $Date$
    */
  -public class TestAbandonedBasicDataSource extends TestConnectionPool {
  +public class TestAbandonedBasicDataSource extends TestBasicDataSource {
       public TestAbandonedBasicDataSource(String testName) {
           super(testName);
       }
  @@ -81,24 +81,8 @@
           return new TestSuite(TestAbandonedBasicDataSource.class);
       }
   
  -    protected Connection getConnection() throws Exception {
  -        return ds.getConnection();
  -    }
  -
  -    private BasicDataSource ds = null;
  -    
       public void setUp() throws Exception {
           super.setUp();
  -        ds = new BasicDataSource();
  -        ds.setDriverClassName("org.apache.commons.dbcp.TesterDriver");
  -        ds.setUrl("jdbc:apache:commons:testdriver");
  -        ds.setMaxActive(getMaxActive());
  -        ds.setMaxWait(getMaxWait());
  -        ds.setDefaultAutoCommit(true);
  -        ds.setDefaultReadOnly(false);
  -        ds.setUsername("username");
  -        ds.setPassword("password");
  -        ds.setValidationQuery("SELECT DUMMY FROM DUAL");
   
           // abandoned enabled but should not affect the basic tests
           // (very high timeout)
  @@ -108,13 +92,8 @@
       }
   
       public void tearDown() throws Exception {
  -        ds = null;
  -    }
  -
  -    public void testPooling() throws Exception {
  -        // this also needs access to the undelying connection
  -        ds.setAccessToUnderlyingConnectionAllowed(true);
  -        super.testPooling();
  +        super.tearDown();
  +        // nothing to do here
       }
   
       // ---------- Abandoned Test -----------
  
  
  
  1.15      +6 -5      jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestBasicDataSource.java
  
  Index: TestBasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestBasicDataSource.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestBasicDataSource.java	2 Nov 2003 17:53:55 -0000	1.14
  +++ TestBasicDataSource.java	22 Dec 2003 14:41:17 -0000	1.15
  @@ -86,9 +86,9 @@
           return ds.getConnection();
       }
   
  -    private BasicDataSource ds = null;
  +    protected BasicDataSource ds = null;
       private static String CATALOG = "test catalog";
  -    
  +
       public void setUp() throws Exception {
           super.setUp();
           ds = new BasicDataSource();
  @@ -106,6 +106,7 @@
       }
   
       public void tearDown() throws Exception {
  +        super.tearDown();
           ds = null;
       }
       
  
  
  
  1.2       +7 -22     jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestPStmtPoolingBasicDataSource.java
  
  Index: TestPStmtPoolingBasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/test/org/apache/commons/dbcp/TestPStmtPoolingBasicDataSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestPStmtPoolingBasicDataSource.java	2 Nov 2003 17:53:55 -0000	1.1
  +++ TestPStmtPoolingBasicDataSource.java	22 Dec 2003 14:41:17 -0000	1.2
  @@ -74,7 +74,7 @@
    * @author Dirk Verbeeck
    * @version $Revision$ $Date$
    */
  -public class TestPStmtPoolingBasicDataSource extends TestConnectionPool {
  +public class TestPStmtPoolingBasicDataSource extends TestBasicDataSource {
       public TestPStmtPoolingBasicDataSource(String testName) {
           super(testName);
       }
  @@ -83,24 +83,8 @@
           return new TestSuite(TestPStmtPoolingBasicDataSource.class);
       }
   
  -    protected Connection getConnection() throws Exception {
  -        return ds.getConnection();
  -    }
  -
  -    private BasicDataSource ds = null;
  -    
       public void setUp() throws Exception {
           super.setUp();
  -        ds = new BasicDataSource();
  -        ds.setDriverClassName("org.apache.commons.dbcp.TesterDriver");
  -        ds.setUrl("jdbc:apache:commons:testdriver");
  -        ds.setMaxActive(getMaxActive());
  -        ds.setMaxWait(getMaxWait());
  -        ds.setDefaultAutoCommit(true);
  -        ds.setDefaultReadOnly(false);
  -        ds.setUsername("username");
  -        ds.setPassword("password");
  -        ds.setValidationQuery("SELECT DUMMY FROM DUAL");
   
           // PoolPreparedStatements enabled, should not affect the basic tests
           ds.setPoolPreparedStatements(true);
  @@ -108,7 +92,8 @@
       }
   
       public void tearDown() throws Exception {
  -        ds = null;
  +        super.tearDown();
  +        // nothing to do here
       }
   
       public void testPreparedStatementPooling() throws Exception {
  
  
  

---------------------------------------------------------------------
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