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 be...@apache.org on 2006/02/15 13:47:42 UTC
svn commit: r377998 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests:
master/derbyStress.out suites/DerbyNetClient.exclude
tests/jdbcapi/derbyStress.java
Author: bernt
Date: Wed Feb 15 04:47:40 2006
New Revision: 377998
URL: http://svn.apache.org/viewcvs?rev=377998&view=rev
Log:
DERBY-557 Added a test case for DERBY-557. Submitted by Knut Anders Hatlen
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyStress.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyStress.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyStress.out?rev=377998&r1=377997&r2=377998&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyStress.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/derbyStress.out Wed Feb 15 04:47:40 2006
@@ -1,4 +1,5 @@
Test derbyStress starting
Testing with 2000 prepared statements
PASS -- Prepared statement test
+DERBY-557: reExecuteStatementTest() PASSED
Test derbyStress finished.
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude?rev=377998&r1=377997&r2=377998&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude Wed Feb 15 04:47:40 2006
@@ -7,7 +7,6 @@
# excluding jdbcapi/checkDataSource30.java - Client behaves differently. Need to look into this
# excluding jdbcapi/statementJdbc30.java - Client behaves differently. Need to look into this
# excluding jdbcapi/dataSourceReference.java - client side only tests, tests all data sources
-# excluding jdbcapi/derbyStress.java - till DERBY-210 is fixed
# regardless of framework
# excluding largedata/LobLimits.java to run with the network server because currently lobs are materialized and this test tests for 2G lobs.
# see DERBY-326 and DERBY-550 issues
@@ -20,5 +19,4 @@
jdbcapi/checkDataSource30.java
jdbcapi/statementJdbc30.java
jdbcapi/dataSourceReference.java
-jdbcapi/derbyStress.java
largedata/LobLimits.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java?rev=377998&r1=377997&r2=377998&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java Wed Feb 15 04:47:40 2006
@@ -53,6 +53,9 @@
System.out.println("PASS -- Prepared statement test");
conn.close();
}
+
+ reExecuteStatementTest();
+
System.out.println("Test derbyStress finished.");
} catch (SQLException se) {
TestUtil.dumpSQLExceptions(se);
@@ -85,6 +88,9 @@
// user (DERBY-210)
private static void prepStmtTest(Connection conn, int numRows, int numPreparedStmts) throws Exception
{
+ // Don't run under DerbyNetClient until DERBY-210 is fixed
+ if (TestUtil.isDerbyNetClientFramework()) return;
+
PreparedStatement ps = null;
ResultSet rs = null;
conn.setAutoCommit(false);
@@ -116,5 +122,20 @@
TestUtil.dumpSQLExceptions(e);
conn.rollback();
}
+ }
+
+ // Tests re-execution of a statement without closing the result
+ // set (DERBY-557).
+ private static void reExecuteStatementTest() throws Exception {
+ System.out.print("DERBY-557: reExecuteStatementTest() ");
+ Connection conn = ij.startJBMS();
+ Statement stmt = conn.createStatement();
+ for (int i = 0; i < 50000; i++) {
+ ResultSet rs = stmt.executeQuery("values(1)");
+ // How silly! I forgot to close the result set.
+ }
+ stmt.close();
+ conn.close();
+ System.out.println("PASSED");
}
}