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

--no commit message

--no commit message
上级 1452e9ba
......@@ -318,6 +318,12 @@ public abstract class TestBase {
error("a: " + a + " is not smaller than b: " + b);
}
}
protected void checkContains(String result, String contains) throws Exception {
if(result.indexOf(contains) < 0) {
error(result + " does not contain: " + contains);
}
}
protected void check(double a, double b) throws Exception {
if (a != b) {
......
......@@ -27,12 +27,12 @@ public class TestWeb extends TestBase {
client.get(url, "adminSave.do");
result = client.get(url, "index.do?language=de");
result = client.get(url, "login.jsp");
check(result.indexOf("Einstellung") >= 0);
checkContains(result, "Einstellung");
result = client.get(url, "index.do?language=en");
result = client.get(url, "login.jsp");
check(result.indexOf("Einstellung") < 0);
result = client.get(url, "test.do?driver=abc&url=jdbc:abc:mem:web&user=sa&password=sa&name=_test_");
check(result.indexOf("Exception") >= 0);
checkContains(result, "Exception");
result = client.get(url, "test.do?driver=org.h2.Driver&url=jdbc:h2:mem:web&user=sa&password=sa&name=_test_");
check(result.indexOf("Exception") < 0);
result = client.get(url, "login.do?driver=org.h2.Driver&url=jdbc:h2:mem:web&user=sa&password=sa&name=_test_");
......@@ -43,34 +43,34 @@ public class TestWeb extends TestBase {
result = client.get(url, "query.do?sql=drop table test if exists");
result = client.get(url, "query.do?sql=create table test(id int primary key, name varchar);insert into test values(1, 'Hello')");
result = client.get(url, "query.do?sql=select * from test");
check(result.indexOf("Hello") >= 0);
checkContains(result, "Hello");
result = client.get(url, "query.do?sql=@META select * from test");
check(result.indexOf("typeName") >= 0);
checkContains(result, "typeName");
result = client.get(url, "query.do?sql=delete from test");
result = client.get(url, "query.do?sql=@LOOP 1000 insert into test values(?, 'Hello ' || ?/*RND*/)");
check(result.indexOf("1000 * (Prepared)") >= 0);
checkContains(result, "1000 * (Prepared)");
result = client.get(url, "query.do?sql=select * from test");
result = client.get(url, "query.do?sql=@HISTORY");
result = client.get(url, "getHistory.do?id=4");
check(result.indexOf("select * from test") >= 0);
checkContains(result, "select * from test");
result = client.get(url, "autoCompleteList.do?query=se");
check(result.indexOf("select") >= 0);
check(result.indexOf("set") >= 0);
checkContains(result, "select");
checkContains(result, "set");
result = client.get(url, "tables.do");
check(result.indexOf("TEST") >= 0);
checkContains(result, "TEST");
result = client.get(url, "autoCompleteList.do?query=select * from ");
check(result.indexOf("test") >= 0);
checkContains(result, "test");
result = client.get(url, "autoCompleteList.do?query=from test t select t.");
check(result.indexOf("id") >= 0);
checkContains(result, "id");
result = client.get(url, "autoCompleteList.do?query=select id x from test te where t");
check(result.indexOf("te") >= 0);
checkContains(result, "te");
result = client.get(url, "query.do?sql=delete from test");
result = client.get(url, "query.do?sql=@LOOP 10 @STATEMENT insert into test values(?, 'Hello')");
result = client.get(url, "query.do?sql=select * from test");
check(result.indexOf("8") >= 0);
checkContains(result, "8");
result = client.get(url, "query.do?sql=@EDIT select * from test");
check(result.indexOf("editRow") >= 0);
checkContains(result, "editRow");
result = client.get(url, "query.do?sql=@AUTOCOMMIT TRUE");
result = client.get(url, "query.do?sql=@AUTOCOMMIT FALSE");
......@@ -79,24 +79,23 @@ public class TestWeb extends TestBase {
result = client.get(url, "query.do?sql=select * from test order by id");
result = client.get(url, "query.do?sql=@SET MAXROWS 1000");
result = client.get(url, "query.do?sql=@TABLES");
check(result.indexOf("TEST") >= 0);
checkContains(result, "TEST");
result = client.get(url, "query.do?sql=@COLUMNS null null TEST");
check(result.indexOf("ID") >= 0);
checkContains(result, "ID");
result = client.get(url, "query.do?sql=@INDEX_INFO null null TEST");
check(result.indexOf("PRIMARY") >= 0);
checkContains(result, "PRIMARY");
result = client.get(url, "query.do?sql=@CATALOG");
check(result.indexOf("PUBLIC") >= 0);
checkContains(result, "PUBLIC");
result = client.get(url, "query.do?sql=@MEMORY");
check(result.indexOf("Used") >= 0);
checkContains(result, "Used");
result = client.get(url, "query.do?sql=@UDTS");
result = client.get(url, "query.do?sql=@INFO");
check(result.indexOf("getCatalog") >= 0);
checkContains(result, "getCatalog");
result = client.get(url, "logout.do");
result = client.get(url, "settingRemove.do?name=_test_");
server.stop();
}
}
......@@ -40,7 +40,7 @@ public class TestKillRestart extends TestBase {
OutputCatcher catcher = new OutputCatcher(in);
catcher.start();
while (true) {
String s = catcher.readLine(5000);
String s = catcher.readLine(10000);
// System.out.println("> " + s);
if (s == null) {
error("No reply from process");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论