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 km...@apache.org on 2007/04/04 01:32:54 UTC
svn commit: r525332 [3/3] - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting:
functionTests/master/ functionTests/master/DerbyNet/
functionTests/master/DerbyNet/jdk16/ functionTests/master/DerbyNetClient/
functionTests/master/DerbyNetClient...
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangProcedureTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?view=diff&rev=525332&r1=525331&r2=525332
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java Tue Apr 3 16:32:53 2007
@@ -719,6 +719,26 @@
}
}
+
+ /**
+ * Executes the Callable statement that is expected to fail and verifies
+ * that it throws the expected SQL exception.
+ * @param conn The Connection handle
+ * @param sql The SQL to execute
+ * @param expectedSE The expected SQL exception
+ * @throws SQLException
+ */
+ public static void assertCallError(String expectedSE, Connection conn, String callSQL)
+ throws SQLException
+ {
+ try {
+ CallableStatement cs = conn.prepareCall(callSQL);
+ cs.execute();
+ fail("FAIL - SQL expected to throw exception");
+ } catch (SQLException se) {
+ assertSQLState(expectedSE, se.getSQLState(), se);
+ }
+ }
/**
* Perform a fetch on the ResultSet with an expected failure
*
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java?view=diff&rev=525332&r1=525331&r2=525332
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java Tue Apr 3 16:32:53 2007
@@ -427,6 +427,22 @@
assertDrainResults(rs, 0);
}
+ /**
+ *
+ * @param rs
+ */
+ public static void assertClosed(ResultSet rs)
+ {
+ try {
+ rs.next();
+ Assert.fail("ResultSet not closed");
+ }catch (SQLException sqle){
+ Assert.assertEquals("XCL16", sqle.getSQLState());
+ }
+
+
+ }
+
/**
* Drain a single ResultSet by reading all of its
* rows and columns. Each column is accessed using