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 fu...@apache.org on 2007/04/13 23:44:48 UTC
svn commit: r528677 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java
Author: fuzzylogic
Date: Fri Apr 13 14:44:47 2007
New Revision: 528677
URL: http://svn.apache.org/viewvc?view=rev&rev=528677
Log:
DERBY-2543: Wrapping the original SystemPropertyTestSetup in a DatabasePropertyTestSetup that shutdowns and restarts the engine allows the new setting for maxMemoryPerTable to be properly set for testVirtualMemoryHeap. Reenabling the test.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java?view=diff&rev=528677&r1=528676&r2=528677
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdateCursorTest.java Fri Apr 13 14:44:47 2007
@@ -33,6 +33,7 @@
import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
import org.apache.derbyTesting.junit.TestConfiguration;
@@ -76,7 +77,8 @@
Properties props = new Properties();
props.setProperty("derby.language.maxMemoryPerTable", "1");
- return TestConfiguration.singleUseDatabaseDecorator(new SystemPropertyTestSetup(new CleanDatabaseTestSetup(
+ return new DatabasePropertyTestSetup(
+ new SystemPropertyTestSetup(new CleanDatabaseTestSetup(
new TestSuite(UpdateCursorTest.class, "UpdateCursorTest")) {
/**
@@ -128,18 +130,14 @@
pstmt.close();
}
- }, props));
+ }, props), props, true);
}
- /*
- * DERBY-2543: Test fails in suite runs in the nightlies,
- * probably because the static property
- * maxMemoryPerTable has already been set
- *
+ /**
* Test the virtual memory heap.
*
* @throws SQLException
-
+ */
public void testVirtualMemoryHeap() throws SQLException {
PreparedStatement select = prepareStatement("select c1, c3 from t1 where c3 > 1 and c1 > 0 for update");
Statement update = createStatement();
@@ -150,7 +148,7 @@
cursor = select.executeQuery(); // cursor is now open
cursorName = cursor.getCursorName();
- /* scan the entire table except the last row.
+ /* scan the entire table except the last row. */
for (int i = 0; i < SIZE_OF_T1 - 1; i++) {
/* Notice the order in the rows we get: from 2 to 102 asc order on second column (c3)
@@ -161,7 +159,7 @@
* memory heap, whose in memory part is also 100 entries. So row 103 to 202 goes into
* the in-memory part and gets dumped out in reverse order. Finally Row 203 to 250"
* goes into file system. Here we mean row ids.
-
+ */
if (i < MAX_CAP_OF_HASH_TABLE + 1) {
expectedValue++;
} else if (i > MAX_CAP_OF_HASH_TABLE && i <= MAX_CAP_OF_HASH_TABLE * 2) {
@@ -190,7 +188,7 @@
cursor.close();
update.close();
- /* see what we have in the table
+ /* see what we have in the table */
select = prepareStatement("select c1, c3 from t1");
cursor = select.executeQuery(); // cursor is now open
for (int i = 0; i < SIZE_OF_T1; i++) {
@@ -205,7 +203,6 @@
rollback();
}
- */
/**
* Tests non covering index.