Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b9de50b7
提交
b9de50b7
authored
4月 04, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tests
上级
4825106c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
31 行增加
和
24 行删除
+31
-24
TestCases.java
h2/src/test/org/h2/test/db/TestCases.java
+15
-12
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+1
-0
TestMVStore.java
h2/src/test/org/h2/test/store/TestMVStore.java
+1
-1
TestMVTableEngine.java
h2/src/test/org/h2/test/store/TestMVTableEngine.java
+2
-2
TestJmx.java
h2/src/test/org/h2/test/unit/TestJmx.java
+12
-3
TestReopen.java
h2/src/test/org/h2/test/unit/TestReopen.java
+0
-6
没有找到文件。
h2/src/test/org/h2/test/db/TestCases.java
浏览文件 @
b9de50b7
...
...
@@ -21,6 +21,7 @@ import java.util.List;
import
java.util.Random
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.Constants
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
...
...
@@ -932,20 +933,22 @@ public class TestCases extends TestBase {
ResultSet
rs
;
// test the default (SIGNED)
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
rs
=
stat
.
executeQuery
(
"select * from bin order by x;"
);
rs
.
next
();
assertEquals
(
"99"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"aa"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"09"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
if
(
Constants
.
VERSION_MINOR
<
4
)
{
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
rs
=
stat
.
executeQuery
(
"select * from bin order by x;"
);
rs
.
next
();
assertEquals
(
"99"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"aa"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"09"
,
rs
.
getString
(
1
));
rs
.
next
();
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
stat
.
execute
(
"drop table bin"
);
}
// test UNSIGNED mode
stat
.
execute
(
"drop table bin"
);
stat
.
execute
(
"SET BINARY_COLLATION UNSIGNED"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
b9de50b7
...
...
@@ -155,6 +155,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
* This method is called via reflection from the database.
*
* @param values the value array
* @return a result set
*/
public
static
ResultSet
varArgsFunctionTable
(
int
...
values
)
throws
SQLException
{
...
...
h2/src/test/org/h2/test/store/TestMVStore.java
浏览文件 @
b9de50b7
...
...
@@ -1126,7 +1126,7 @@ public class TestMVStore extends TestBase {
map
.
put
(
1
,
"Hi"
);
map
.
remove
(
2
);
// access the old data (before
incrementVersion
)
// access the old data (before
the commit
)
MVMap
<
Integer
,
String
>
oldMap
=
map
.
openVersion
(
oldVersion
);
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
b9de50b7
...
...
@@ -713,7 +713,7 @@ public class TestMVTableEngine extends TestBase {
private
void
testExclusiveLock
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
String
dbName
=
"mvstore;MV_STORE=TRUE"
;
String
dbName
=
"mvstore;MV_STORE=TRUE
;MVCC=FALSE
"
;
Connection
conn
,
conn2
;
Statement
stat
,
stat2
;
conn
=
getConnection
(
dbName
);
...
...
@@ -943,7 +943,7 @@ public class TestMVTableEngine extends TestBase {
private
void
testLocking
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
String
dbName
=
"mvstore;MV_STORE=TRUE"
;
String
dbName
=
"mvstore;MV_STORE=TRUE
;MVCC=FALSE
"
;
Connection
conn
=
getConnection
(
dbName
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"set lock_timeout 1000"
);
...
...
h2/src/test/org/h2/test/unit/TestJmx.java
浏览文件 @
b9de50b7
...
...
@@ -79,8 +79,13 @@ public class TestJmx extends TestBase {
getAttribute
(
name
,
"Mode"
).
toString
());
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"MultiThreaded"
).
toString
());
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"Mvcc"
).
toString
());
if
(
config
.
mvStore
)
{
assertEquals
(
"true"
,
mbeanServer
.
getAttribute
(
name
,
"Mvcc"
).
toString
());
}
else
{
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"Mvcc"
).
toString
());
}
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"ReadOnly"
).
toString
());
assertEquals
(
"1"
,
mbeanServer
.
...
...
@@ -100,7 +105,11 @@ public class TestJmx extends TestBase {
result
=
mbeanServer
.
invoke
(
name
,
"listSessions"
,
null
,
null
).
toString
();
assertTrue
(
result
.
indexOf
(
"session id"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"write lock"
)
>=
0
);
if
(
config
.
mvcc
)
{
assertTrue
(
result
.
indexOf
(
"read lock"
)
>=
0
);
}
else
{
assertTrue
(
result
.
indexOf
(
"write lock"
)
>=
0
);
}
assertEquals
(
2
,
info
.
getOperations
().
length
);
assertTrue
(
info
.
getDescription
().
indexOf
(
"database"
)
>=
0
);
...
...
h2/src/test/org/h2/test/unit/TestReopen.java
浏览文件 @
b9de50b7
...
...
@@ -116,9 +116,6 @@ public class TestReopen extends TestBase implements Recorder {
p
.
setProperty
(
"password"
,
getPassword
());
String
url
=
"jdbc:h2:"
+
testDatabase
+
";FILE_LOCK=NO;TRACE_LEVEL_FILE=0"
;
if
(
config
.
mvStore
)
{
url
+=
";MV_STORE=TRUE"
;
}
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
Database
database
=
new
Database
(
ci
,
null
);
// close the database
...
...
@@ -170,9 +167,6 @@ public class TestReopen extends TestBase implements Recorder {
// avoid using the Engine class to avoid deadlocks
Properties
p
=
new
Properties
();
String
url
=
"jdbc:h2:"
+
testDatabase
+
";FILE_LOCK=NO"
;
if
(
config
.
mvStore
)
{
url
+=
";MV_STORE=TRUE"
;
}
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
Database
database
=
new
Database
(
ci
,
null
);
// close the database
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论