提交 184b84e6 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 8da94fcb
......@@ -38,10 +38,6 @@ public abstract class TestBase {
config.beforeTest();
}
protected void stopServerIfRequired() throws SQLException {
config.afterTest();
}
public TestBase init(TestAll conf) throws Exception {
this.config = conf;
return this;
......
......@@ -362,7 +362,7 @@ public class TestCrashAPI extends TestBase {
public TestBase init(TestAll conf) throws Exception {
super.init(conf);
if (config.mvcc) {
if (config.mvcc || config.networked) {
return this;
}
if (config.logMode == 0) {
......@@ -385,7 +385,7 @@ public class TestCrashAPI extends TestBase {
}
public void test() throws Exception {
if (config.mvcc) {
if (config.mvcc || config.networked) {
return;
}
int len = getSize(2, 6);
......
......@@ -17,14 +17,17 @@ import org.h2.test.TestBase;
public class TestKillRestart extends TestBase {
public void test() throws Exception {
if (config.networked) {
return;
}
deleteDb("corrupt");
String url = getURL("corrupt", true);
// String url = getURL("corrupt;CACHE_SIZE=2048;WRITE_DELAY=0;STORAGE=TEXT", true);
String user = getUser(), password = getPassword();
String[] procDef = new String[] { "java", "-cp", "bin", getClass().getName(), "-url", url, "-user", user,
"-password", password };
int len = getSize(1, 10);
for (int i = 0; i < len; i++) {
Process p = Runtime.getRuntime().exec(procDef);
......
......@@ -73,13 +73,13 @@ public class TestRandomSQL extends TestBase {
}
}
private void deleteDb() throws SQLException {
String name = getDatabaseName();
if (name.startsWith(FileSystem.MEMORY_PREFIX)) {
DeleteDbFiles.execute("memFS:/", name, true);
DeleteDbFiles.execute("memFS:/", name, true);
} else {
DeleteDbFiles.execute(baseDir, name, true);
DeleteDbFiles.execute(baseDir, name, true);
}
}
......@@ -170,6 +170,9 @@ public class TestRandomSQL extends TestBase {
}
public void test() throws Exception {
if (config.networked) {
return;
}
int len = getSize(2, 6);
exitOnError = false;
showSQL = false;
......
......@@ -16,7 +16,7 @@ import org.h2.test.TestBase;
public class TestExit extends TestBase implements DatabaseEventListener {
public void test() throws Exception {
if (config.codeCoverage) {
if (config.codeCoverage || config.networked) {
return;
}
String classPath = "bin" + File.pathSeparator + ".";
......@@ -110,8 +110,8 @@ public class TestExit extends TestBase implements DatabaseEventListener {
public void init(String url) {
}
public void opened() {
}
}
}
......@@ -30,8 +30,11 @@ public class TestFileSystem extends TestBase {
testFileSystem(FileSystem.MEMORY_PREFIX_LZF);
testUserHome();
}
private void testDatabaseInJar() throws Exception {
if (config.networked) {
return;
}
Class.forName("org.h2.Driver");
String url = "jdbc:h2:" + baseDir + "/fsJar";
Connection conn = DriverManager.getConnection(url, "sa", "sa");
......@@ -48,7 +51,7 @@ public class TestFileSystem extends TestBase {
stat = conn.createStatement();
stat.execute("backup to '" + baseDir + "/fsJar.zip'");
conn.close();
deleteDb(baseDir + "/fsJar");
FileSystem fs = FileSystem.getInstance("zip:" + baseDir + "/fsJar.zip");
String[] files = fs.listFiles("zip:" + baseDir + "/fsJar.zip");
......@@ -88,7 +91,7 @@ public class TestFileSystem extends TestBase {
testTempFile(fsBase);
testRandomAccess(fsBase);
}
private void testSimple(String fsBase) throws Exception {
FileSystem fs = FileSystem.getInstance(fsBase);
long time = System.currentTimeMillis();
......@@ -131,10 +134,10 @@ public class TestFileSystem extends TestBase {
in.close();
check(pos, 10000);
check(buffer2, buffer);
check(fs.tryDelete(fsBase + "/test2"));
fs.delete(fsBase + "/test");
if (!fsBase.startsWith(FileSystem.MEMORY_PREFIX) && !fsBase.startsWith(FileSystem.MEMORY_PREFIX_LZF)) {
fs.createDirs(fsBase + "/testDir/test");
check(fs.isDirectory(fsBase + "/testDir"));
......@@ -144,7 +147,7 @@ public class TestFileSystem extends TestBase {
}
}
}
private void testRandomAccess(String fsBase) throws Exception {
FileSystem fs = FileSystem.getInstance(fsBase);
String s = fs.createTempFile(fsBase + "/temp", ".tmp", false, false);
......@@ -245,6 +248,6 @@ public class TestFileSystem extends TestBase {
in.close();
out.close();
}
}
......@@ -33,6 +33,9 @@ public class TestTools extends TestBase {
private Server server;
public void test() throws Exception {
if (config.networked) {
return;
}
deleteDb("utils");
testServerMain();
testRemove();
......@@ -237,9 +240,6 @@ public class TestTools extends TestBase {
}
private void testManagementDb() throws Exception {
if (config.networked) {
return;
}
int count = getSize(2, 10);
for (int i = 0; i < count; i++) {
Server server = Server.createTcpServer(new String[] {}).start();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论