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

--no commit message

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