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;
...
@@ -21,6 +21,7 @@ import java.util.List;
import
java.util.Random
;
import
java.util.Random
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.Constants
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
...
@@ -932,6 +933,7 @@ public class TestCases extends TestBase {
...
@@ -932,6 +933,7 @@ public class TestCases extends TestBase {
ResultSet
rs
;
ResultSet
rs
;
// test the default (SIGNED)
// test the default (SIGNED)
if
(
Constants
.
VERSION_MINOR
<
4
)
{
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
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
=
stat
.
executeQuery
(
"select * from bin order by x;"
);
...
@@ -943,9 +945,10 @@ public class TestCases extends TestBase {
...
@@ -943,9 +945,10 @@ public class TestCases extends TestBase {
assertEquals
(
"09"
,
rs
.
getString
(
1
));
assertEquals
(
"09"
,
rs
.
getString
(
1
));
rs
.
next
();
rs
.
next
();
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
assertEquals
(
"0a"
,
rs
.
getString
(
1
));
stat
.
execute
(
"drop table bin"
);
}
// test UNSIGNED mode
// test UNSIGNED mode
stat
.
execute
(
"drop table bin"
);
stat
.
execute
(
"SET BINARY_COLLATION UNSIGNED"
);
stat
.
execute
(
"SET BINARY_COLLATION UNSIGNED"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"create table bin( x binary(1) );"
);
stat
.
execute
(
"insert into bin(x) values (x'09'),(x'0a'),(x'99'),(x'aa');"
);
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 {
...
@@ -155,6 +155,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
*
* @param values the value array
* @return a result set
* @return a result set
*/
*/
public
static
ResultSet
varArgsFunctionTable
(
int
...
values
)
throws
SQLException
{
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 {
...
@@ -1126,7 +1126,7 @@ public class TestMVStore extends TestBase {
map
.
put
(
1
,
"Hi"
);
map
.
put
(
1
,
"Hi"
);
map
.
remove
(
2
);
map
.
remove
(
2
);
// access the old data (before
incrementVersion
)
// access the old data (before
the commit
)
MVMap
<
Integer
,
String
>
oldMap
=
MVMap
<
Integer
,
String
>
oldMap
=
map
.
openVersion
(
oldVersion
);
map
.
openVersion
(
oldVersion
);
...
...
h2/src/test/org/h2/test/store/TestMVTableEngine.java
浏览文件 @
b9de50b7
...
@@ -713,7 +713,7 @@ public class TestMVTableEngine extends TestBase {
...
@@ -713,7 +713,7 @@ public class TestMVTableEngine extends TestBase {
private
void
testExclusiveLock
()
throws
Exception
{
private
void
testExclusiveLock
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
String
dbName
=
"mvstore;MV_STORE=TRUE"
;
String
dbName
=
"mvstore;MV_STORE=TRUE
;MVCC=FALSE
"
;
Connection
conn
,
conn2
;
Connection
conn
,
conn2
;
Statement
stat
,
stat2
;
Statement
stat
,
stat2
;
conn
=
getConnection
(
dbName
);
conn
=
getConnection
(
dbName
);
...
@@ -943,7 +943,7 @@ public class TestMVTableEngine extends TestBase {
...
@@ -943,7 +943,7 @@ public class TestMVTableEngine extends TestBase {
private
void
testLocking
()
throws
Exception
{
private
void
testLocking
()
throws
Exception
{
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
FileUtils
.
deleteRecursive
(
getBaseDir
(),
true
);
String
dbName
=
"mvstore;MV_STORE=TRUE"
;
String
dbName
=
"mvstore;MV_STORE=TRUE
;MVCC=FALSE
"
;
Connection
conn
=
getConnection
(
dbName
);
Connection
conn
=
getConnection
(
dbName
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"set lock_timeout 1000"
);
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 {
...
@@ -79,8 +79,13 @@ public class TestJmx extends TestBase {
getAttribute
(
name
,
"Mode"
).
toString
());
getAttribute
(
name
,
"Mode"
).
toString
());
assertEquals
(
"false"
,
mbeanServer
.
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"MultiThreaded"
).
toString
());
getAttribute
(
name
,
"MultiThreaded"
).
toString
());
if
(
config
.
mvStore
)
{
assertEquals
(
"true"
,
mbeanServer
.
getAttribute
(
name
,
"Mvcc"
).
toString
());
}
else
{
assertEquals
(
"false"
,
mbeanServer
.
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"Mvcc"
).
toString
());
getAttribute
(
name
,
"Mvcc"
).
toString
());
}
assertEquals
(
"false"
,
mbeanServer
.
assertEquals
(
"false"
,
mbeanServer
.
getAttribute
(
name
,
"ReadOnly"
).
toString
());
getAttribute
(
name
,
"ReadOnly"
).
toString
());
assertEquals
(
"1"
,
mbeanServer
.
assertEquals
(
"1"
,
mbeanServer
.
...
@@ -100,7 +105,11 @@ public class TestJmx extends TestBase {
...
@@ -100,7 +105,11 @@ public class TestJmx extends TestBase {
result
=
mbeanServer
.
invoke
(
name
,
"listSessions"
,
null
,
null
).
toString
();
result
=
mbeanServer
.
invoke
(
name
,
"listSessions"
,
null
,
null
).
toString
();
assertTrue
(
result
.
indexOf
(
"session id"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"session id"
)
>=
0
);
if
(
config
.
mvcc
)
{
assertTrue
(
result
.
indexOf
(
"read lock"
)
>=
0
);
}
else
{
assertTrue
(
result
.
indexOf
(
"write lock"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"write lock"
)
>=
0
);
}
assertEquals
(
2
,
info
.
getOperations
().
length
);
assertEquals
(
2
,
info
.
getOperations
().
length
);
assertTrue
(
info
.
getDescription
().
indexOf
(
"database"
)
>=
0
);
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 {
...
@@ -116,9 +116,6 @@ public class TestReopen extends TestBase implements Recorder {
p
.
setProperty
(
"password"
,
getPassword
());
p
.
setProperty
(
"password"
,
getPassword
());
String
url
=
"jdbc:h2:"
+
testDatabase
+
String
url
=
"jdbc:h2:"
+
testDatabase
+
";FILE_LOCK=NO;TRACE_LEVEL_FILE=0"
;
";FILE_LOCK=NO;TRACE_LEVEL_FILE=0"
;
if
(
config
.
mvStore
)
{
url
+=
";MV_STORE=TRUE"
;
}
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
Database
database
=
new
Database
(
ci
,
null
);
Database
database
=
new
Database
(
ci
,
null
);
// close the database
// close the database
...
@@ -170,9 +167,6 @@ public class TestReopen extends TestBase implements Recorder {
...
@@ -170,9 +167,6 @@ public class TestReopen extends TestBase implements Recorder {
// avoid using the Engine class to avoid deadlocks
// avoid using the Engine class to avoid deadlocks
Properties
p
=
new
Properties
();
Properties
p
=
new
Properties
();
String
url
=
"jdbc:h2:"
+
testDatabase
+
";FILE_LOCK=NO"
;
String
url
=
"jdbc:h2:"
+
testDatabase
+
";FILE_LOCK=NO"
;
if
(
config
.
mvStore
)
{
url
+=
";MV_STORE=TRUE"
;
}
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
p
);
Database
database
=
new
Database
(
ci
,
null
);
Database
database
=
new
Database
(
ci
,
null
);
// close the database
// close the database
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论