提交 14cd5ad9 authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Fix test cases, documentation

上级 72d728e3
...@@ -96,7 +96,7 @@ EXPLAIN SELECT MIN(VALUE), MAX(VALUE) FROM TEST; ...@@ -96,7 +96,7 @@ EXPLAIN SELECT MIN(VALUE), MAX(VALUE) FROM TEST;
--> MIN(VALUE), --> MIN(VALUE),
--> MAX(VALUE) --> MAX(VALUE)
--> FROM PUBLIC.TEST --> FROM PUBLIC.TEST
--> /* PUBLIC.TEST.tableScan */ --> /* PUBLIC.IDX_TEST_VALUE */
--> /* direct lookup */ --> /* direct lookup */
; ;
......
...@@ -113,7 +113,7 @@ public class TestLob extends TestBase { ...@@ -113,7 +113,7 @@ public class TestLob extends TestBase {
} }
private void testRemoveAfterDeleteAndClose() throws Exception { private void testRemoveAfterDeleteAndClose() throws Exception {
if (config.memory) { if (config.memory || config.cipher != null) {
return; return;
} }
deleteDb("lob"); deleteDb("lob");
......
...@@ -12,6 +12,7 @@ import java.sql.ResultSet; ...@@ -12,6 +12,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.Map; import java.util.Map;
import java.util.Random;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.mvstore.MVStore; import org.h2.mvstore.MVStore;
...@@ -45,19 +46,20 @@ public class TestOutOfMemory extends TestBase { ...@@ -45,19 +46,20 @@ public class TestOutOfMemory extends TestBase {
private void testMVStoreUsingInMemoryFileSystem() { private void testMVStoreUsingInMemoryFileSystem() {
FilePath.register(new FilePathMem()); FilePath.register(new FilePathMem());
String fileName = "memLZF:" + getTestName(); String fileName = "memFS:" + getTestName();
MVStore store = MVStore.open(fileName); MVStore store = MVStore.open(fileName);
Map<Integer, byte[]> map = store.openMap("test"); Map<Integer, byte[]> map = store.openMap("test");
byte[] data = new byte[10 * 1024 * 1024]; Random r = new Random(1);
try { try {
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
byte[] data = new byte[10 * 1024 * 1024];
r.nextBytes(data);
map.put(i, data); map.put(i, data);
} }
fail(); fail();
} catch (OutOfMemoryError e) { } catch (OutOfMemoryError e) {
// expected // expected
} }
data = null;
try { try {
store.close(); store.close();
fail(); fail();
...@@ -72,7 +74,7 @@ public class TestOutOfMemory extends TestBase { ...@@ -72,7 +74,7 @@ public class TestOutOfMemory extends TestBase {
} }
private void testDatabaseUsingInMemoryFileSystem() throws SQLException { private void testDatabaseUsingInMemoryFileSystem() throws SQLException {
String url = "jdbc:h2:memLZF:" + getTestName(); String url = "jdbc:h2:memFS:" + getTestName();
Connection conn = DriverManager.getConnection(url); Connection conn = DriverManager.getConnection(url);
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
try { try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论