db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r541041 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbcapi/SetTransactionIsolationTest.java functionTests/tests/jdbcapi/XATest.java junit/CleanDatabaseTestSetup.java junit/XATestUtil.java
Date Wed, 23 May 2007 19:30:40 GMT
Author: djd
Date: Wed May 23 12:30:39 2007
New Revision: 541041

URL: http://svn.apache.org/viewvc?view=rev&rev=541041
Log:
More JUnit test cleanup related to use of CleanDatabaseTestSetup.
Also fix typo in CleanDatabaseTestSetup where exception was ignored.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/XATestUtil.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java?view=diff&rev=541041&r1=541040&r2=541041
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
Wed May 23 12:30:39 2007
@@ -270,7 +270,6 @@
                 s.executeUpdate("create table t3 (i integer)");
                 
 
-                s.close();
                 CallableStatement cs = conn
                         .prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY (?, ?)");
                 cs.setString(1, "derby.locks.waitTimeout");

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java?view=diff&rev=541041&r1=541040&r2=541041
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.java
Wed May 23 12:30:39 2007
@@ -1002,8 +1002,7 @@
              * 
              */
             protected void decorateSQL(Statement s) throws SQLException {
-                Connection conn = getConnection();
-                XATestUtil.createXATransactionView(conn);
+                XATestUtil.createXATransactionView(s);
             }
 
         };

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java?view=diff&rev=541041&r1=541040&r2=541041
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java
Wed May 23 12:30:39 2007
@@ -175,7 +175,7 @@
                 try {
                     JDBC.dropSchema(dmd, schema);
                 } catch (SQLException e) {
-                    sqle = null;
+                    sqle = e;
                 }
             }
             // No errors means all the schemas we wanted to

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/XATestUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/XATestUtil.java?view=diff&rev=541041&r1=541040&r2=541041
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/XATestUtil.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/XATestUtil.java Wed May
23 12:30:39 2007
@@ -57,9 +57,8 @@
      * Create a view that allows useful inspection of the active
      * global transactions.
     */
-    public static void createXATransactionView(Connection conn) throws SQLException
+    public static void createXATransactionView(Statement s) throws SQLException
     {
-        Statement s = conn.createStatement();
         s.execute(
                 "create view XATESTUTIL.global_xactTable as " +
                 "select  cast(global_xid as char(2)) as gxid," +
@@ -67,7 +66,6 @@
                 " CAST (case when first_instant is NULL then 'NULL' else 'false' end AS VARCHAR(8))
as readOnly, " +
                 " cast (username as char(10)) as username, type " +
                 " from syscs_diag.transaction_table");
-        s.close();
     }
     
     /**



Mime
View raw message