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 my...@apache.org on 2014/02/25 03:02:15 UTC
svn commit: r1571534 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java
Author: myrnavl
Date: Tue Feb 25 02:02:15 2014
New Revision: 1571534
URL: http://svn.apache.org/r1571534
Log:
DERBY-6280; test failure in SetQueryTimeoutTest ComparisonFailure: Output at line 16 expected:<Test[ing that PreparedStatement remembers timeout.]> but was:<Test[ SetQueryTimeoutTest FAILED]>
adding details to the failure messages for this case
Modified:
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/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=1571534&r1=1571533&r2=1571534&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 Tue Feb 25 02:02:15 2014
@@ -681,13 +681,20 @@ public class SetQueryTimeoutTest
{
System.out.println("Testing that Statement remembers timeout.");
stmt.setQueryTimeout(1);
+ long runTime=0;
for (int i = 0; i < 3; i++) {
try {
ResultSet rs = stmt.executeQuery(getFetchQuery("t"));
+ long startTime = System.currentTimeMillis();
while (rs.next());
- throw new TestFailedException("Should have timed out.");
+ long endTime = System.currentTimeMillis();
+ runTime = endTime - startTime;
+ throw new TestFailedException("Should have timed out, for " +
+ "statement, iteration: " +i+ ", took (millis): "+runTime);
} catch (SQLException sqle) {
- expectException("XCL52", sqle, "Should have timed out.");
+ expectException("XCL52", sqle, "Should have timed out, got " +
+ "unexpected exception, for statement, iteration: " + i +
+ ", time taken (millis): " + runTime);
}
}
stmt.close();
@@ -703,12 +710,20 @@ public class SetQueryTimeoutTest
System.out.println("Testing that " + name + " remembers timeout.");
ps.setQueryTimeout(1);
for (int i = 0; i < 3; i++) {
+ long runTime=0;
try {
ResultSet rs = ps.executeQuery();
+ long startTime = System.currentTimeMillis();
while (rs.next());
- throw new TestFailedException("Should have timed out.");
+ long endTime = System.currentTimeMillis();
+ runTime = endTime - startTime;
+ throw new TestFailedException(
+ "Should have timed out, for " + name + ", on iteration "
+ + i + ", runtime(millis): " + runTime);
} catch (SQLException sqle) {
- expectException("XCL52", sqle, "Should have timed out.");
+ expectException("XCL52", sqle, "Should have timed out, " +
+ "got unexpected exception, for " + name + ", on iteration "
+ + i + ", runtime(millis): " + runTime);
}
}
ps.close();