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 ka...@apache.org on 2011/03/13 09:34:06 UTC
svn commit: r1081059 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java
Author: kahatlen
Date: Sun Mar 13 08:34:05 2011
New Revision: 1081059
URL: http://svn.apache.org/viewvc?rev=1081059&view=rev
Log:
DERBY-5113: Intermittent failure in BlobSetMethodsTest on Java 7: Unable to set stream: 'Reached EOF prematurely; expected 1,024, got 0.'
AccessTest should reset the database properties it modifies.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java?rev=1081059&r1=1081058&r2=1081059&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/AccessTest.java Sun Mar 13 08:34:05 2011
@@ -43,6 +43,17 @@ import org.apache.derbyTesting.junit.Tes
public final class AccessTest extends BaseJDBCTestCase {
/**
+ * Array with names of database properties that may be modified by
+ * the test cases in this class. The properties will be cleared in
+ * {@link #tearDown()}.
+ */
+ private static final String[] MODIFIED_DB_PROPS = {
+ "derby.storage.pageSize",
+ "derby.storage.minimumRecordSize",
+ "derby.storage.pageReservedSpace",
+ };
+
+ /**
* Public constructor required for running test as standalone JUnit.
*/
public AccessTest(String name)
@@ -73,7 +84,26 @@ public final class AccessTest extends Ba
}
};
}
-
+
+ /**
+ * Tear down the test environment.
+ */
+ protected void tearDown() throws Exception {
+ rollback();
+
+ // Clear the database properties set by this test so that they
+ // don't affect other tests.
+ PreparedStatement clearProp = prepareStatement(
+ "CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, NULL)");
+ for (int i = 0; i < MODIFIED_DB_PROPS.length; i++) {
+ clearProp.setString(1, MODIFIED_DB_PROPS[i]);
+ clearProp.executeUpdate();
+ }
+ commit();
+
+ super.tearDown();
+ }
+
//---------------------------------------------------------
// test qualifier skip code on fields with length
// having the 8th bit set in low order length byte.