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 TestBasicDataSource.java
Date Mon, 25 Aug 2003 16:18:51 GMT
dirkv       2003/08/25 09:18:51

  Modified:    dbcp/src/test/org/apache/commons/dbcp
                        TestBasicDataSource.java
  Log:
  Bugzilla Bug 18550: Add defaultTransactionIsolation to BasicDataSource
  
  - junit test
  
  Revision  Changes    Path
  1.6       +24 -4     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestBasicDataSource.java	22 Aug 2003 16:08:32 -0000	1.5
  +++ TestBasicDataSource.java	25 Aug 2003 16:18:51 -0000	1.6
  @@ -93,6 +93,7 @@
           ds.setMaxWait(getMaxWait());
           ds.setDefaultAutoCommit(true);
           ds.setDefaultReadOnly(false);
  +        ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
           ds.setUsername("username");
           ds.setPassword("password");
           ds.setValidationQuery("SELECT DUMMY FROM DUAL");
  @@ -101,4 +102,23 @@
       public void tearDown() throws Exception {
           ds = null;
       }
  +    
  +    public void testTransactionIsolationBehavior() throws Exception {
  +        Connection conn = getConnection();
  +        assertTrue(conn != null);
  +        assertEquals(Connection.TRANSACTION_READ_COMMITTED, conn.getTransactionIsolation());
  +        conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
  +        conn.close();
  +        
  +        Connection conn2 = getConnection();
  +        assertEquals(Connection.TRANSACTION_READ_COMMITTED, conn2.getTransactionIsolation());
  +        
  +        Connection conn3 = getConnection();
  +        assertEquals(Connection.TRANSACTION_READ_COMMITTED, conn3.getTransactionIsolation());
  +
  +        conn2.close();
  +        
  +        conn3.close();
  +    }
  +
   }
  
  
  

Mime
View raw message