提交 34b8dc02 authored 作者: Thomas Mueller's avatar Thomas Mueller

Test

上级 71b1085f
...@@ -34,7 +34,11 @@ public class TestAutoServer extends TestBase { ...@@ -34,7 +34,11 @@ public class TestAutoServer extends TestBase {
public void test() throws Exception { public void test() throws Exception {
testUnsupportedCombinations(); testUnsupportedCombinations();
testAutoServer(); testAutoServer(false);
if (!config.big) {
int todo;
// testAutoServer(true);
}
testLinkedLocalTablesWithAutoServerReconnect(); testLinkedLocalTablesWithAutoServerReconnect();
} }
...@@ -56,15 +60,15 @@ public class TestAutoServer extends TestBase { ...@@ -56,15 +60,15 @@ public class TestAutoServer extends TestBase {
} }
} }
/** private void testAutoServer(boolean port) throws Exception {
* Tests basic AUTO_SERVER functionality
*/
private void testAutoServer() throws Exception {
if (config.memory || config.networked) { if (config.memory || config.networked) {
return; return;
} }
deleteDb("autoServer"); deleteDb("autoServer");
String url = getURL("autoServer;AUTO_SERVER=TRUE", true); String url = getURL("autoServer;AUTO_SERVER=TRUE", true);
if (port) {
url += ";AUTO_SERVER_PORT=11111";
}
String user = getUser(), password = getPassword(); String user = getUser(), password = getPassword();
Connection connServer = getConnection(url + ";OPEN_NEW=TRUE", user, password); Connection connServer = getConnection(url + ";OPEN_NEW=TRUE", user, password);
...@@ -79,6 +83,10 @@ public class TestAutoServer extends TestBase { ...@@ -79,6 +83,10 @@ public class TestAutoServer extends TestBase {
u2 = "jdbc:h2:tcp://" + server + "/" + key + u2; u2 = "jdbc:h2:tcp://" + server + "/" + key + u2;
Connection conn = DriverManager.getConnection(u2, user, password); Connection conn = DriverManager.getConnection(u2, user, password);
conn.close(); conn.close();
int gotPort = Integer.parseInt(server.substring(server.lastIndexOf(':') + 1));
if (port) {
assertEquals(11111, gotPort);
}
break; break;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论