Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a204eabd
提交
a204eabd
authored
7月 12, 2012
作者:
Sergi.Vladykin@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Not serialized java object value test enabled.
上级
3570ae00
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
13 行删除
+19
-13
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-1
TestJavaObject.java
h2/src/test/org/h2/test/jdbc/TestJavaObject.java
+17
-11
没有找到文件。
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
a204eabd
...
@@ -395,7 +395,7 @@ public class SysProperties {
...
@@ -395,7 +395,7 @@ public class SysProperties {
* defensive copy himself before storing, or ensure that the value object is
* defensive copy himself before storing, or ensure that the value object is
* immutable.
* immutable.
*/
*/
public
static
final
boolean
SERIALIZE_JAVA_OBJECT
=
Utils
.
getProperty
(
"h2.serializeJavaObject"
,
true
);
public
static
boolean
SERIALIZE_JAVA_OBJECT
=
Utils
.
getProperty
(
"h2.serializeJavaObject"
,
true
);
private
static
final
String
H2_BASE_DIR
=
"h2.baseDir"
;
private
static
final
String
H2_BASE_DIR
=
"h2.baseDir"
;
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
a204eabd
...
@@ -612,7 +612,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
...
@@ -612,7 +612,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new
TestCancel
().
runTest
(
this
);
new
TestCancel
().
runTest
(
this
);
new
TestDatabaseEventListener
().
runTest
(
this
);
new
TestDatabaseEventListener
().
runTest
(
this
);
new
TestDriver
().
runTest
(
this
);
new
TestDriver
().
runTest
(
this
);
//
new TestJavaObject().runTest(this);
new
TestJavaObject
().
runTest
(
this
);
new
TestLimitUpdates
().
runTest
(
this
);
new
TestLimitUpdates
().
runTest
(
this
);
new
TestLobApi
().
runTest
(
this
);
new
TestLobApi
().
runTest
(
this
);
new
TestManyJdbcObjects
().
runTest
(
this
);
new
TestManyJdbcObjects
().
runTest
(
this
);
...
...
h2/src/test/org/h2/test/jdbc/TestJavaObject.java
浏览文件 @
a204eabd
...
@@ -17,6 +17,7 @@ import java.sql.Timestamp;
...
@@ -17,6 +17,7 @@ import java.sql.Timestamp;
import
java.sql.Types
;
import
java.sql.Types
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.UUID
;
import
java.util.UUID
;
import
org.h2.constant.SysProperties
;
import
org.h2.test.TestAll
;
import
org.h2.test.TestAll
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
...
@@ -34,7 +35,7 @@ public class TestJavaObject extends TestBase {
...
@@ -34,7 +35,7 @@ public class TestJavaObject extends TestBase {
* @param a ignored
* @param a ignored
*/
*/
public
static
void
main
(
String
...
a
)
throws
Exception
{
public
static
void
main
(
String
...
a
)
throws
Exception
{
System
.
setProperty
(
"h2.serializeJavaObject"
,
"false"
);
//
System.setProperty("h2.serializeJavaObject", "false");
TestAll
conf
=
new
TestAll
();
TestAll
conf
=
new
TestAll
();
conf
.
traceTest
=
true
;
conf
.
traceTest
=
true
;
...
@@ -45,16 +46,21 @@ public class TestJavaObject extends TestBase {
...
@@ -45,16 +46,21 @@ public class TestJavaObject extends TestBase {
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
trace
(
"Test Java Object"
);
SysProperties
.
SERIALIZE_JAVA_OBJECT
=
false
;
startServerIfRequired
();
try
{
doTest
(
Arrays
.
asList
(
UUID
.
randomUUID
(),
null
),
Arrays
.
asList
(
UUID
.
randomUUID
(),
UUID
.
randomUUID
()),
true
);
trace
(
"Test Java Object"
);
doTest
(
new
Timestamp
(
System
.
currentTimeMillis
()),
new
Timestamp
(
System
.
currentTimeMillis
()
+
10000
),
false
);
startServerIfRequired
();
doTest
(
200
,
100
,
false
);
doTest
(
Arrays
.
asList
(
UUID
.
randomUUID
(),
null
),
Arrays
.
asList
(
UUID
.
randomUUID
(),
UUID
.
randomUUID
()),
true
);
doTest
(
200
,
100L
,
true
);
doTest
(
new
Timestamp
(
System
.
currentTimeMillis
()),
new
Timestamp
(
System
.
currentTimeMillis
()
+
10000
),
false
);
doTest
(
new
Date
(
System
.
currentTimeMillis
()
+
1000
),
new
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
200
,
100
,
false
);
doTest
(
new
java
.
util
.
Date
(
System
.
currentTimeMillis
()
+
1000
),
new
java
.
util
.
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
200
,
100L
,
true
);
doTest
(
new
Time
(
System
.
currentTimeMillis
()
+
1000
),
new
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
new
Date
(
System
.
currentTimeMillis
()
+
1000
),
new
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
new
Time
(
System
.
currentTimeMillis
()
+
1000
),
new
Timestamp
(
System
.
currentTimeMillis
()),
false
);
doTest
(
new
java
.
util
.
Date
(
System
.
currentTimeMillis
()
+
1000
),
new
java
.
util
.
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
new
Time
(
System
.
currentTimeMillis
()
+
1000
),
new
Date
(
System
.
currentTimeMillis
()),
false
);
doTest
(
new
Time
(
System
.
currentTimeMillis
()
+
1000
),
new
Timestamp
(
System
.
currentTimeMillis
()),
false
);
}
finally
{
SysProperties
.
SERIALIZE_JAVA_OBJECT
=
true
;
}
}
}
private
void
doTest
(
Object
o1
,
Object
o2
,
boolean
hash
)
throws
SQLException
{
private
void
doTest
(
Object
o1
,
Object
o2
,
boolean
hash
)
throws
SQLException
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论