Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c27872f3
提交
c27872f3
authored
1月 19, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not use deprecated constructors of wrapper types except for ClassUtils
上级
16b47879
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
28 行增加
和
33 行删除
+28
-33
FunctionMultiReturn.java
h2/src/test/org/h2/samples/FunctionMultiReturn.java
+1
-1
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+1
-1
SupportedTypes.java
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
+7
-7
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+13
-18
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+5
-5
TestCrashAPI.java
h2/src/test/org/h2/test/synth/TestCrashAPI.java
+1
-1
没有找到文件。
h2/src/test/org/h2/samples/FunctionMultiReturn.java
浏览文件 @
c27872f3
...
...
@@ -127,7 +127,7 @@ public class FunctionMultiReturn {
public
static
Object
[]
polar2CartesianArray
(
Double
r
,
Double
alpha
)
{
double
x
=
r
.
doubleValue
()
*
Math
.
cos
(
alpha
.
doubleValue
());
double
y
=
r
.
doubleValue
()
*
Math
.
sin
(
alpha
.
doubleValue
());
return
new
Object
[]{
new
Double
(
x
),
new
Double
(
y
)
};
return
new
Object
[]{
x
,
y
};
}
/**
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
c27872f3
...
...
@@ -876,7 +876,7 @@ public class TestOptimizations extends TestBase {
case
5
:
if
(
random
.
nextInt
(
1000
)
==
1
)
{
stat
.
execute
(
"insert into test values("
+
i
+
", null)"
);
map
.
put
(
new
Integer
(
i
)
,
null
);
map
.
put
(
i
,
null
);
}
else
{
int
value
=
random
.
nextInt
();
stat
.
execute
(
"insert into test values("
+
i
+
", "
+
value
+
")"
);
...
...
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
浏览文件 @
c27872f3
...
...
@@ -74,13 +74,13 @@ public class SupportedTypes {
static
SupportedTypes
randomValue
()
{
Random
rand
=
new
Random
();
SupportedTypes
s
=
new
SupportedTypes
();
s
.
myBool
=
Boolean
.
valueOf
(
rand
.
nextBoolean
()
);
s
.
myByte
=
new
Byte
((
byte
)
rand
.
nextInt
(
Byte
.
MAX_VALUE
)
);
s
.
myShort
=
new
Short
((
short
)
rand
.
nextInt
(
Short
.
MAX_VALUE
)
);
s
.
myInteger
=
new
Integer
(
rand
.
nextInt
()
);
s
.
myLong
=
new
Long
(
rand
.
nextLong
()
);
s
.
myFloat
=
new
Float
(
rand
.
nextFloat
()
);
s
.
myDouble
=
new
Double
(
rand
.
nextDouble
()
);
s
.
myBool
=
rand
.
nextBoolean
(
);
s
.
myByte
=
(
byte
)
rand
.
nextInt
(
Byte
.
MAX_VALUE
);
s
.
myShort
=
(
short
)
rand
.
nextInt
(
Short
.
MAX_VALUE
);
s
.
myInteger
=
rand
.
nextInt
(
);
s
.
myLong
=
rand
.
nextLong
(
);
s
.
myFloat
=
rand
.
nextFloat
(
);
s
.
myDouble
=
rand
.
nextDouble
(
);
s
.
myBigDecimal
=
new
BigDecimal
(
rand
.
nextDouble
());
s
.
myString
=
Long
.
toHexString
(
rand
.
nextLong
());
s
.
myUtilDate
=
new
java
.
util
.
Date
(
rand
.
nextLong
());
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
c27872f3
...
...
@@ -986,7 +986,7 @@ public class TestPreparedStatement extends TestBase {
prep
.
setString
(
2
,
"-1"
);
prep
.
executeUpdate
();
prep
.
setInt
(
1
,
7
);
prep
.
setObject
(
2
,
new
Integer
(
3
)
);
prep
.
setObject
(
2
,
3
);
prep
.
executeUpdate
();
prep
.
setObject
(
1
,
"8"
);
// should throw an exception
...
...
@@ -1132,12 +1132,12 @@ public class TestPreparedStatement extends TestBase {
prep
.
setObject
(
1
,
Boolean
.
TRUE
);
prep
.
setObject
(
2
,
"Abc"
);
prep
.
setObject
(
3
,
new
BigDecimal
(
"10.2"
));
prep
.
setObject
(
4
,
new
Byte
((
byte
)
0xff
)
);
prep
.
setObject
(
5
,
new
Short
(
Short
.
MAX_VALUE
)
);
prep
.
setObject
(
6
,
new
Integer
(
Integer
.
MIN_VALUE
)
);
prep
.
setObject
(
7
,
new
Long
(
Long
.
MAX_VALUE
)
);
prep
.
setObject
(
8
,
new
Float
(
Float
.
MAX_VALUE
)
);
prep
.
setObject
(
9
,
new
Double
(
Double
.
MAX_VALUE
)
);
prep
.
setObject
(
4
,
(
byte
)
0xff
);
prep
.
setObject
(
5
,
Short
.
MAX_VALUE
);
prep
.
setObject
(
6
,
Integer
.
MIN_VALUE
);
prep
.
setObject
(
7
,
Long
.
MAX_VALUE
);
prep
.
setObject
(
8
,
Float
.
MAX_VALUE
);
prep
.
setObject
(
9
,
Double
.
MAX_VALUE
);
prep
.
setObject
(
10
,
java
.
sql
.
Date
.
valueOf
(
"2001-02-03"
));
prep
.
setObject
(
11
,
java
.
sql
.
Time
.
valueOf
(
"04:05:06"
));
prep
.
setObject
(
12
,
java
.
sql
.
Timestamp
.
valueOf
(
...
...
@@ -1145,7 +1145,7 @@ public class TestPreparedStatement extends TestBase {
prep
.
setObject
(
13
,
new
java
.
util
.
Date
(
java
.
sql
.
Date
.
valueOf
(
"2001-02-03"
).
getTime
()));
prep
.
setObject
(
14
,
new
byte
[]
{
10
,
20
,
30
});
prep
.
setObject
(
15
,
new
Character
(
'a'
)
,
Types
.
OTHER
);
prep
.
setObject
(
15
,
'a'
,
Types
.
OTHER
);
prep
.
setObject
(
16
,
"2001-01-02"
,
Types
.
DATE
);
// converting to null seems strange...
prep
.
setObject
(
17
,
"2001-01-02"
,
Types
.
NULL
);
...
...
@@ -1163,14 +1163,10 @@ public class TestPreparedStatement extends TestBase {
(
Object
)
Byte
.
valueOf
((
byte
)
0xff
)
:
(
Object
)
Integer
.
valueOf
(-
1
)));
assertTrue
(
rs
.
getObject
(
5
).
equals
(
SysProperties
.
OLD_RESULT_SET_GET_OBJECT
?
(
Object
)
Short
.
valueOf
(
Short
.
MAX_VALUE
)
:
(
Object
)
Integer
.
valueOf
(
Short
.
MAX_VALUE
)));
assertTrue
(
rs
.
getObject
(
6
).
equals
(
new
Integer
(
Integer
.
MIN_VALUE
)));
assertTrue
(
rs
.
getObject
(
7
).
equals
(
new
Long
(
Long
.
MAX_VALUE
)));
assertTrue
(
rs
.
getObject
(
8
).
equals
(
new
Float
(
Float
.
MAX_VALUE
)));
assertTrue
(
rs
.
getObject
(
9
).
equals
(
new
Double
(
Double
.
MAX_VALUE
)));
assertTrue
(
rs
.
getObject
(
6
).
equals
(
Integer
.
MIN_VALUE
));
assertTrue
(
rs
.
getObject
(
7
).
equals
(
Long
.
MAX_VALUE
));
assertTrue
(
rs
.
getObject
(
8
).
equals
(
Float
.
MAX_VALUE
));
assertTrue
(
rs
.
getObject
(
9
).
equals
(
Double
.
MAX_VALUE
));
assertTrue
(
rs
.
getObject
(
10
).
equals
(
java
.
sql
.
Date
.
valueOf
(
"2001-02-03"
)));
assertEquals
(
"04:05:06"
,
rs
.
getObject
(
11
).
toString
());
...
...
@@ -1185,8 +1181,7 @@ public class TestPreparedStatement extends TestBase {
assertTrue
(
rs
.
getObject
(
16
).
equals
(
java
.
sql
.
Date
.
valueOf
(
"2001-01-02"
)));
assertTrue
(
rs
.
getObject
(
17
)
==
null
&&
rs
.
wasNull
());
assertTrue
(
rs
.
getObject
(
18
).
equals
(
new
Double
(
3.725
)));
assertTrue
(
rs
.
getObject
(
18
).
equals
(
3.725d
));
assertTrue
(
rs
.
getObject
(
19
).
equals
(
java
.
sql
.
Time
.
valueOf
(
"23:22:21"
)));
assertTrue
(
rs
.
getObject
(
20
).
equals
(
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
c27872f3
...
...
@@ -1205,19 +1205,19 @@ public class TestResultSet extends TestBase {
o
=
rs
.
getObject
(
2
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Double
);
assertTrue
(((
Double
)
o
).
compareTo
(
new
Double
(
"-1.00"
)
)
==
0
);
assertTrue
(((
Double
)
o
).
compareTo
(
-
1
d
)
==
0
);
o
=
rs
.
getObject
(
2
,
Double
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Double
);
assertTrue
(((
Double
)
o
).
compareTo
(
new
Double
(
"-1.00"
)
)
==
0
);
assertTrue
(((
Double
)
o
).
compareTo
(
-
1
d
)
==
0
);
o
=
rs
.
getObject
(
3
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Float
);
assertTrue
(((
Float
)
o
).
compareTo
(
new
Float
(
"-1.00"
)
)
==
0
);
assertTrue
(((
Float
)
o
).
compareTo
(
-
1
f
)
==
0
);
o
=
rs
.
getObject
(
3
,
Float
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Float
);
assertTrue
(((
Float
)
o
).
compareTo
(
new
Float
(
"-1.00"
)
)
==
0
);
assertTrue
(((
Float
)
o
).
compareTo
(
-
1
f
)
==
0
);
rs
.
next
();
assertTrue
(
rs
.
getInt
(
1
)
==
2
);
assertTrue
(!
rs
.
wasNull
());
...
...
@@ -1745,7 +1745,7 @@ public class TestResultSet extends TestBase {
stat
.
execute
(
"CREATE TABLE TEST(ID INT PRIMARY KEY, VALUE ARRAY)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES(?, ?)"
);
prep
.
setInt
(
1
,
1
);
prep
.
setObject
(
2
,
new
Object
[]
{
new
Integer
(
1
),
new
Integer
(
2
)
});
prep
.
setObject
(
2
,
new
Object
[]
{
1
,
2
});
prep
.
execute
();
prep
.
setInt
(
1
,
2
);
prep
.
setObject
(
2
,
new
Object
[]
{
11
,
12
});
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
c27872f3
...
...
@@ -440,7 +440,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
}
else
if
(
type
==
boolean
.
class
)
{
return
random
.
nextBoolean
();
}
else
if
(
type
==
double
.
class
)
{
return
new
Double
(
random
.
getRandomDouble
()
);
return
random
.
getRandomDouble
(
);
}
else
if
(
type
==
String
.
class
)
{
if
(
random
.
getInt
(
10
)
==
0
)
{
return
null
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论