You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/11/17 17:30:46 UTC

svn commit: r476199 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java

Author: djd
Date: Fri Nov 17 08:30:45 2006
New Revision: 476199

URL: http://svn.apache.org/viewvc?view=rev&rev=476199
Log:
Clean up some asserts and close a PreparedStatement in SURBaseTest

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java?view=diff&rev=476199&r1=476198&r2=476199
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java Fri Nov 17 08:30:45 2006
@@ -68,8 +68,7 @@
         int sum = a + id + 17;
         println("Reading tuple:(" + id + "," + a  + "," + b + ",'" + 
                 rs.getString(4) + "')");
-        assertEquals("Expecting b==id+a+17, got: id=" + id + 
-                     ",a=" + a + ",b=" + b + ",c=" +rs.getString(4), b, sum);
+        assertEquals("Expecting b==id+a+17", b, sum);
     }
     
     /**
@@ -77,8 +76,6 @@
      * updateRow()
      */
     protected void updateTuple(ResultSet rs) throws SQLException {
-        assertFalse("Cannot use updateRow() in autocommit mode", 
-                   rs.getStatement().getConnection().getAutoCommit());
         int id = rs.getInt(1);
         int a = rs.getInt(2);
         int b = rs.getInt(3);        
@@ -105,6 +102,7 @@
         ps.setInt(1, newA);
         ps.setInt(2, newB);
         assertEquals("Expected one tuple to be updated", 1, ps.executeUpdate());
+        ps.close();
     }
     
     /**
@@ -121,8 +119,7 @@
             verifyTuple(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+            assertEquals("Record Count", recordCount, nRecords);
         }
     }
     
@@ -141,8 +138,7 @@
             verifyTuple(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+        	assertEquals("Record Count", recordCount, nRecords);
         }
     }
     
@@ -161,8 +157,7 @@
             updateTuple(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+            assertEquals("Record Count", recordCount, nRecords);
         }
         assertNotNull("rs.getCursorName()", rs.getCursorName());
     }
@@ -182,8 +177,7 @@
             updateTuplePositioned(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+        	assertEquals("Record Count", recordCount, nRecords);
         }
         assertNotNull("rs.getCursorName()", rs.getCursorName());
     }
@@ -202,8 +196,7 @@
             updateTuple(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+        	assertEquals("Record Count", recordCount, nRecords);
         }
         assertNotNull("rs.getCursorName()", rs.getCursorName());
     }
@@ -223,8 +216,7 @@
             updateTuplePositioned(rs);
         }
         if (!ignoreCount) {
-            assertEquals("Expected  " + recordCount + " records", nRecords, 
-                         recordCount);
+        	assertEquals("Record Count", recordCount, nRecords);
         }
         assertNotNull("rs.getCursorName()", rs.getCursorName());
     }