提交 ab51dbf6 authored 作者: Thomas Mueller's avatar Thomas Mueller

Allow all tests to use the split file system (but not enabled currently).

上级 d04b47e9
......@@ -22,7 +22,10 @@ import org.h2.util.New;
*/
public class FileSystemSplit extends FileSystem {
private static final String PREFIX = "split:";
/**
* The prefix to use for this file system.
*/
public static final String PREFIX = "split:";
private static final String PART_SUFFIX = ".part";
......
......@@ -245,6 +245,11 @@ java org.h2.test.TestAll timer
*/
public boolean record;
/**
* Test the split file system.
*/
public boolean splitFileSystem;
/**
* If the transaction log should be kept small (that is, the log should be
* switched early).
......@@ -448,11 +453,13 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
defrag = false;
traceLevelFile = throttle = 0;
cipher = null;
// splitFileSystem = true;
test();
testUnit();
networked = true;
memory = true;
splitFileSystem = false;
test();
memory = false;
......@@ -748,6 +755,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
appendIf(buff, traceTest, "traceTest");
appendIf(buff, stopOnError, "stopOnError");
appendIf(buff, defrag, "defrag");
appendIf(buff, splitFileSystem, "split");
return buff.toString();
}
......
......@@ -27,6 +27,7 @@ import org.h2.jdbc.JdbcConnection;
import org.h2.message.TraceSystem;
import org.h2.store.FileLock;
import org.h2.store.fs.FileSystem;
import org.h2.store.fs.FileSystemSplit;
import org.h2.test.utils.RecordingFileSystem;
import org.h2.tools.DeleteDbFiles;
......@@ -213,11 +214,17 @@ public abstract class TestBase {
* @return the directory, possibly including file system prefix
*/
protected String getBaseDir() {
if (config != null && config.record) {
return RecordingFileSystem.PREFIX + "memFS:" + baseDir;
String dir = baseDir;
if (config != null) {
if (config.record) {
dir = RecordingFileSystem.PREFIX + "memFS:" + dir;
}
if (config.splitFileSystem) {
dir = FileSystemSplit.PREFIX + "16:" + dir;
}
}
// return "split:nioMapped:" + baseDir;
return baseDir;
return dir;
}
/**
......
......@@ -44,9 +44,11 @@ public class TestFileSystem extends TestBase {
testDatabaseInJar();
// set default part size to 1 << 10
FileSystem.getInstance("split:10:" + getBaseDir() + "/fs");
testFileSystem("nioMapped:" + getBaseDir() + "/fs");
testFileSystem("split:nioMapped:" + getBaseDir() + "/fs");
testFileSystem("split:" + getBaseDir() + "/fs");
if (!config.splitFileSystem) {
testFileSystem("nioMapped:" + getBaseDir() + "/fs");
testFileSystem("split:nioMapped:" + getBaseDir() + "/fs");
testFileSystem("split:" + getBaseDir() + "/fs");
}
testFileSystem(getBaseDir() + "/fs");
testFileSystem(FileSystemMemory.PREFIX);
FileSystemDatabase fs = FileSystemDatabase.register("jdbc:h2:mem:fs");
......
......@@ -76,7 +76,9 @@ public class TestTools extends TestBase {
testConvertTraceFile();
testManagementDb();
testChangeFileEncryption(false);
testChangeFileEncryption(true);
if (!config.splitFileSystem) {
testChangeFileEncryption(true);
}
testServer();
testScriptRunscript();
testBackupRestore();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论