Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
71ec2fd8
提交
71ec2fd8
authored
12月 29, 2006
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
c7400dc2
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
17 行删除
+21
-17
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+3
-2
TestCases.java
h2/src/test/org/h2/test/db/TestCases.java
+1
-1
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+17
-14
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
71ec2fd8
...
@@ -88,6 +88,8 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
...
@@ -88,6 +88,8 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll
test
=
new
TestAll
();
TestAll
test
=
new
TestAll
();
test
.
printSystem
();
test
.
printSystem
();
// int todoWriteTestThatCallsSystemHaltExtendTestLob;
// READ_CLOB, READ_BLOB
//create table test(id int, data array)
//create table test(id int, data array)
//document array_get, array_length
//document array_get, array_length
...
@@ -103,7 +105,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
...
@@ -103,7 +105,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test
// D:\data\h2test\openjpa\openjpa-persistence-jdbc>mvn test
// OSGi Bundle (see Forum)
// OSGi Bundle (see Forum)
// QueryObjectFactory
// test with PostgreSQL Version 8.2
// test with PostgreSQL Version 8.2
...
...
h2/src/test/org/h2/test/db/TestCases.java
浏览文件 @
71ec2fd8
...
@@ -164,7 +164,7 @@ public class TestCases extends TestBase {
...
@@ -164,7 +164,7 @@ public class TestCases extends TestBase {
Thread
.
sleep
(
500
);
Thread
.
sleep
(
500
);
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
conn
.
close
();
conn
.
close
();
Thread
.
sleep
(
5
00
);
t
.
join
(
50
00
);
if
(!
stopped
[
0
])
{
if
(!
stopped
[
0
])
{
error
(
"query still running"
);
error
(
"query still running"
);
}
}
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
71ec2fd8
...
@@ -33,7 +33,8 @@ public class TestLob extends TestBase {
...
@@ -33,7 +33,8 @@ public class TestLob extends TestBase {
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
;
}
}
testLobTransactions
();
testLobTransactions
(
10
);
testLobTransactions
(
10000
);
testLobRollbackStop
();
testLobRollbackStop
();
testLobCopy
();
testLobCopy
();
testLobHibernate
();
testLobHibernate
();
...
@@ -50,7 +51,7 @@ public class TestLob extends TestBase {
...
@@ -50,7 +51,7 @@ public class TestLob extends TestBase {
testJavaObject
();
testJavaObject
();
}
}
private
void
testLobTransactions
()
throws
Exception
{
private
void
testLobTransactions
(
int
spaceLen
)
throws
Exception
{
if
(
config
.
logMode
==
0
)
{
if
(
config
.
logMode
==
0
)
{
return
;
return
;
}
}
...
@@ -58,58 +59,60 @@ public class TestLob extends TestBase {
...
@@ -58,58 +59,60 @@ public class TestLob extends TestBase {
Connection
conn
=
reconnect
(
null
);
Connection
conn
=
reconnect
(
null
);
conn
.
createStatement
().
execute
(
"CREATE TABLE TEST(ID IDENTITY, DATA CLOB, DATA2 VARCHAR)"
);
conn
.
createStatement
().
execute
(
"CREATE TABLE TEST(ID IDENTITY, DATA CLOB, DATA2 VARCHAR)"
);
conn
.
setAutoCommit
(
false
);
conn
.
setAutoCommit
(
false
);
Random
random
=
new
Random
(
1
);
Random
random
=
new
Random
(
0
);
int
rows
=
0
;
int
rows
=
0
;
Savepoint
sp
=
null
;
Savepoint
sp
=
null
;
int
len
=
getSize
(
100
,
20
00
);
int
len
=
getSize
(
100
,
4
00
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
switch
(
random
.
nextInt
(
10
))
{
switch
(
random
.
nextInt
(
10
))
{
case
0
:
case
0
:
// System.out.println
("insert");
trace
(
"insert"
);
conn
.
createStatement
().
execute
(
"INSERT INTO TEST(DATA, DATA2) VALUES('"
+
i
+
"' || SPACE(
10000
), '"
+
i
+
"')"
);
conn
.
createStatement
().
execute
(
"INSERT INTO TEST(DATA, DATA2) VALUES('"
+
i
+
"' || SPACE(
"
+
spaceLen
+
"
), '"
+
i
+
"')"
);
rows
++;
rows
++;
break
;
break
;
case
1
:
case
1
:
if
(
rows
>
0
)
{
if
(
rows
>
0
)
{
// System.out.println
("delete");
trace
(
"delete"
);
conn
.
createStatement
().
execute
(
"DELETE FROM TEST WHERE ID="
+
random
.
nextInt
(
rows
));
conn
.
createStatement
().
execute
(
"DELETE FROM TEST WHERE ID="
+
random
.
nextInt
(
rows
));
}
}
break
;
break
;
case
2
:
case
2
:
if
(
rows
>
0
)
{
if
(
rows
>
0
)
{
// System.out.println
("update");
trace
(
"update"
);
conn
.
createStatement
().
execute
(
"UPDATE TEST SET DATA='x' || DATA, DATA2='x' || DATA2 WHERE ID="
+
random
.
nextInt
(
rows
));
conn
.
createStatement
().
execute
(
"UPDATE TEST SET DATA='x' || DATA, DATA2='x' || DATA2 WHERE ID="
+
random
.
nextInt
(
rows
));
}
}
break
;
break
;
case
3
:
case
3
:
if
(
rows
>
0
)
{
if
(
rows
>
0
)
{
// System.out.println
("commit");
trace
(
"commit"
);
conn
.
commit
();
conn
.
commit
();
sp
=
null
;
sp
=
null
;
}
}
break
;
break
;
case
4
:
case
4
:
if
(
rows
>
0
)
{
if
(
rows
>
0
)
{
// System.out.println
("rollback");
trace
(
"rollback"
);
conn
.
rollback
();
conn
.
rollback
();
sp
=
null
;
sp
=
null
;
}
}
break
;
break
;
case
5
:
case
5
:
// System.out.println
("savepoint");
trace
(
"savepoint"
);
sp
=
conn
.
setSavepoint
();
sp
=
conn
.
setSavepoint
();
break
;
break
;
case
6
:
case
6
:
if
(
sp
!=
null
)
{
if
(
sp
!=
null
)
{
// System.out.println
("rollback to savepoint");
trace
(
"rollback to savepoint"
);
conn
.
rollback
(
sp
);
conn
.
rollback
(
sp
);
}
}
break
;
break
;
case
7
:
case
7
:
if
(
rows
>
0
)
{
if
(
rows
>
0
)
{
// System.out.println("shutdown
");
trace
(
"checkpoint
"
);
conn
.
createStatement
().
execute
(
"CHECKPOINT"
);
conn
.
createStatement
().
execute
(
"CHECKPOINT"
);
trace
(
"shutdown immediately"
);
conn
.
createStatement
().
execute
(
"SHUTDOWN IMMEDIATELY"
);
conn
.
createStatement
().
execute
(
"SHUTDOWN IMMEDIATELY"
);
trace
(
"shutdown done"
);
conn
=
reconnect
(
null
);
conn
=
reconnect
(
null
);
conn
.
setAutoCommit
(
false
);
conn
.
setAutoCommit
(
false
);
sp
=
null
;
sp
=
null
;
...
@@ -337,7 +340,7 @@ public class TestLob extends TestBase {
...
@@ -337,7 +340,7 @@ public class TestLob extends TestBase {
}
}
}
}
time
=
System
.
currentTimeMillis
()
-
time
;
time
=
System
.
currentTimeMillis
()
-
time
;
// System.out.println
("time: " + time +" compress: " + compress);
trace
(
"time: "
+
time
+
" compress: "
+
compress
);
conn
.
close
();
conn
.
close
();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论