Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e756cf88
提交
e756cf88
authored
1月 30, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
1452e9ba
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
27 行增加
和
22 行删除
+27
-22
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+6
-0
TestWeb.java
h2/src/test/org/h2/test/server/TestWeb.java
+20
-21
TestKillRestart.java
h2/src/test/org/h2/test/synth/TestKillRestart.java
+1
-1
没有找到文件。
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
e756cf88
...
...
@@ -319,6 +319,12 @@ public abstract class TestBase {
}
}
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
)
{
error
(
"double a: "
+
a
+
" b: "
+
b
);
...
...
h2/src/test/org/h2/test/server/TestWeb.java
浏览文件 @
e756cf88
...
...
@@ -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
);
check
Contains
(
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
);
check
Contains
(
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
);
check
Contains
(
result
,
"Hello"
);
result
=
client
.
get
(
url
,
"query.do?sql=@META select * from test"
);
check
(
result
.
indexOf
(
"typeName"
)
>=
0
);
check
Contains
(
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
);
check
Contains
(
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
);
check
Contains
(
result
,
"select * from test"
);
result
=
client
.
get
(
url
,
"autoCompleteList.do?query=se"
);
check
(
result
.
indexOf
(
"select"
)
>=
0
);
check
(
result
.
indexOf
(
"set"
)
>=
0
);
check
Contains
(
result
,
"select"
);
check
Contains
(
result
,
"set"
);
result
=
client
.
get
(
url
,
"tables.do"
);
check
(
result
.
indexOf
(
"TEST"
)
>=
0
);
check
Contains
(
result
,
"TEST"
);
result
=
client
.
get
(
url
,
"autoCompleteList.do?query=select * from "
);
check
(
result
.
indexOf
(
"test"
)
>=
0
);
check
Contains
(
result
,
"test"
);
result
=
client
.
get
(
url
,
"autoCompleteList.do?query=from test t select t."
);
check
(
result
.
indexOf
(
"id"
)
>=
0
);
check
Contains
(
result
,
"id"
);
result
=
client
.
get
(
url
,
"autoCompleteList.do?query=select id x from test te where t"
);
check
(
result
.
indexOf
(
"te"
)
>=
0
);
check
Contains
(
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
);
check
Contains
(
result
,
"8"
);
result
=
client
.
get
(
url
,
"query.do?sql=@EDIT select * from test"
);
check
(
result
.
indexOf
(
"editRow"
)
>=
0
);
check
Contains
(
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
);
check
Contains
(
result
,
"TEST"
);
result
=
client
.
get
(
url
,
"query.do?sql=@COLUMNS null null TEST"
);
check
(
result
.
indexOf
(
"ID"
)
>=
0
);
check
Contains
(
result
,
"ID"
);
result
=
client
.
get
(
url
,
"query.do?sql=@INDEX_INFO null null TEST"
);
check
(
result
.
indexOf
(
"PRIMARY"
)
>=
0
);
check
Contains
(
result
,
"PRIMARY"
);
result
=
client
.
get
(
url
,
"query.do?sql=@CATALOG"
);
check
(
result
.
indexOf
(
"PUBLIC"
)
>=
0
);
check
Contains
(
result
,
"PUBLIC"
);
result
=
client
.
get
(
url
,
"query.do?sql=@MEMORY"
);
check
(
result
.
indexOf
(
"Used"
)
>=
0
);
check
Contains
(
result
,
"Used"
);
result
=
client
.
get
(
url
,
"query.do?sql=@UDTS"
);
result
=
client
.
get
(
url
,
"query.do?sql=@INFO"
);
check
(
result
.
indexOf
(
"getCatalog"
)
>=
0
);
check
Contains
(
result
,
"getCatalog"
);
result
=
client
.
get
(
url
,
"logout.do"
);
result
=
client
.
get
(
url
,
"settingRemove.do?name=_test_"
);
server
.
stop
();
}
}
h2/src/test/org/h2/test/synth/TestKillRestart.java
浏览文件 @
e756cf88
...
...
@@ -40,7 +40,7 @@ public class TestKillRestart extends TestBase {
OutputCatcher
catcher
=
new
OutputCatcher
(
in
);
catcher
.
start
();
while
(
true
)
{
String
s
=
catcher
.
readLine
(
5
000
);
String
s
=
catcher
.
readLine
(
10
000
);
// System.out.println("> " + s);
if
(
s
==
null
)
{
error
(
"No reply from process"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论