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/08/18 02:51:57 UTC

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

Author: djd
Date: Thu Aug 17 17:51:57 2006
New Revision: 432453

URL: http://svn.apache.org/viewvc?rev=432453&view=rev
Log:
Change ProcedureTest to use the utility methods provided by BaseJDBCTestCase instead of using getXConnection.

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java?rev=432453&r1=432452&r2=432453&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java Thu Aug 17 17:51:57 2006
@@ -55,7 +55,7 @@
      * @exception SQLException if a database error occurs
      */
     public void testExecuteQueryWithNoDynamicResultSets() throws SQLException {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = createStatement();
         try {
             stmt.executeQuery("CALL RETRIEVE_DYNAMIC_RESULTS(0)");
             fail("executeQuery() didn't fail.");
@@ -71,7 +71,7 @@
      * @exception SQLException if a database error occurs
      */
     public void testExecuteQueryWithOneDynamicResultSet() throws SQLException {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = createStatement();
         ResultSet rs = stmt.executeQuery("CALL RETRIEVE_DYNAMIC_RESULTS(1)");
         assertNotNull("executeQuery() returned null.", rs);
         assertTrue("Result set has no data.", rs.next());
@@ -87,7 +87,7 @@
     public void testExecuteQueryWithMoreThanOneDynamicResultSet()
         throws SQLException
     {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = createStatement();
         try {
             stmt.executeQuery("CALL RETRIEVE_DYNAMIC_RESULTS(2)");
             fail("executeQuery() didn't fail.");
@@ -120,7 +120,7 @@
      * @exception SQLException if a database error occurs
      */
     public void testExecuteUpdateWithOneDynamicResultSet() throws SQLException {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = createStatement();
         try {
             stmt.executeUpdate("CALL RETRIEVE_DYNAMIC_RESULTS(1)");
             fail("executeUpdate() didn't fail.");
@@ -337,11 +337,11 @@
      * @exception SQLException if a database error occurs
      */
     public void testRollbackStoredProcWithExecuteQuery() throws SQLException {
-        Connection conn = getXConnection();
-        Statement stmt = conn.createStatement();
+
+        Statement stmt = createStatement();
         ResultSet rs = stmt.executeQuery("CALL PROC_WITH_SIDE_EFFECTS(1)");
         rs.close();
-        conn.rollback();
+        stmt.getConnection().rollback();
         ResultSet tableRs = stmt.executeQuery("SELECT * FROM SIMPLE_TABLE");
         // table should be empty after rollback
         assertFalse("Side effects from stored procedure not rolled back.",
@@ -357,10 +357,9 @@
      * @exception SQLException if a database error occurs
      */
     public void testRollbackStoredProcWithExecuteUpdate() throws SQLException {
-        Connection conn = getXConnection();
-        Statement stmt = conn.createStatement();
+        Statement stmt = createStatement();
         stmt.executeUpdate("CALL PROC_WITH_SIDE_EFFECTS(0)");
-        conn.rollback();
+        stmt.getConnection().rollback();
         ResultSet rs = stmt.executeQuery("SELECT * FROM SIMPLE_TABLE");
         // table should be empty after rollback
         assertFalse("Side effects from stored procedure not rolled back.",
@@ -560,8 +559,7 @@
     public void testClosedDynamicResultSetsFromExecuteQuery()
         throws SQLException
     {
-        Connection conn = getXConnection();
-        Statement stmt = conn.createStatement();
+        Statement stmt = createStatement();
         try {
             ResultSet rs = stmt.executeQuery("CALL RETRIEVE_CLOSED_RESULT()");
             fail("executeQuery() didn't fail.");
@@ -579,7 +577,7 @@
     public void testClosedDynamicResultSetsFromExecuteUpdate()
         throws SQLException
     {
-        Statement stmt = getXConnection().createStatement();
+        Statement stmt = createStatement();
         stmt.executeUpdate("CALL RETRIEVE_CLOSED_RESULT()");
         stmt.close();
     }