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 mi...@apache.org on 2006/08/25 20:57:58 UTC

svn commit: r436904 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/SetQueryTimeoutTest.out tests/jdbcapi/SetQueryTimeoutTest.java

Author: mikem
Date: Fri Aug 25 11:57:57 2006
New Revision: 436904

URL: http://svn.apache.org/viewvc?rev=436904&view=rev
Log:
DERBY-1698, contributed by Deepa Remesh

adds an additional test to jdbcapi/SetQueryTimeoutTest.java. This patch adds a test for executeUpdate method call.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SetQueryTimeoutTest.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SetQueryTimeoutTest.out?rev=436904&r1=436903&r2=436904&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SetQueryTimeoutTest.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SetQueryTimeoutTest.out Fri Aug 25 11:57:57 2006
@@ -15,5 +15,6 @@
 Testing that Statement remembers timeout.
 Testing that PreparedStatement remembers timeout.
 Testing that CallableStatement remembers timeout.
+Testing timeout with executeUpdate call.
 Test SetQueryTimeoutTest PASSED
 Closed connections

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java?rev=436904&r1=436903&r2=436904&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java Fri Aug 25 11:57:57 2006
@@ -645,6 +645,20 @@
         }
     }
 
+    /** This tests timeout with executeUpdate call. */
+    private static void testTimeoutWithExecuteUpdate(Connection conn)
+        throws TestFailedException
+    {
+    	System.out.println("Testing timeout with executeUpdate call.");
+        try{
+            Statement stmt = conn.createStatement();
+            stmt.setQueryTimeout(TIMEOUT);
+            stmt.executeUpdate(getExecQuery("t"));    
+        } catch (SQLException sqle) {
+        	expectException("XCL52", sqle, "Should have timed out.");
+        }
+    }
+    
     /** Test for DERBY-1692. */
     private static void testRememberTimeoutValue(Connection conn)
         throws TestFailedException
@@ -744,6 +758,7 @@
             testTimeoutWithExec(connections);
             testInvalidTimeoutValue(connections[0]);
             testRememberTimeoutValue(connections[0]);
+            testTimeoutWithExecuteUpdate(connections[0]);
   
             System.out.println("Test SetQueryTimeoutTest PASSED");
         } catch (Throwable e) {