Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4fe88699
提交
4fe88699
authored
3月 19, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use assertNull(value) instead of assertTrue(value == null)
上级
b20f3175
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
26 行增加
和
26 行删除
+26
-26
TestBatchUpdates.java
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
+2
-2
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+4
-4
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+4
-4
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+10
-10
TestStatement.java
h2/src/test/org/h2/test/jdbc/TestStatement.java
+2
-2
TestClassLoaderLeak.java
h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java
+1
-1
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+3
-3
没有找到文件。
h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java
浏览文件 @
4fe88699
...
@@ -85,7 +85,7 @@ public class TestBatchUpdates extends TestBase {
...
@@ -85,7 +85,7 @@ public class TestBatchUpdates extends TestBase {
assertTrue
(
e
!=
null
);
assertTrue
(
e
!=
null
);
assertContains
(
e
.
toString
(),
"TEST_X"
);
assertContains
(
e
.
toString
(),
"TEST_X"
);
e
=
e
.
getNextException
();
e
=
e
.
getNextException
();
assert
True
(
e
==
null
);
assert
Null
(
e
);
}
}
stat
.
execute
(
"create table test(id int)"
);
stat
.
execute
(
"create table test(id int)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test values(?)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test values(?)"
);
...
@@ -104,7 +104,7 @@ public class TestBatchUpdates extends TestBase {
...
@@ -104,7 +104,7 @@ public class TestBatchUpdates extends TestBase {
assertTrue
(
e
!=
null
);
assertTrue
(
e
!=
null
);
assertContains
(
e
.
toString
(),
"TEST_X"
);
assertContains
(
e
.
toString
(),
"TEST_X"
);
e
=
e
.
getNextException
();
e
=
e
.
getNextException
();
assert
True
(
e
==
null
);
assert
Null
(
e
);
}
}
stat
.
execute
(
"drop table test"
);
stat
.
execute
(
"drop table test"
);
conn
.
close
();
conn
.
close
();
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
4fe88699
...
@@ -367,7 +367,7 @@ public class TestMetaData extends TestBase {
...
@@ -367,7 +367,7 @@ public class TestMetaData extends TestBase {
assertTrue
(
dr
.
jdbcCompliant
());
assertTrue
(
dr
.
jdbcCompliant
());
assertEquals
(
0
,
dr
.
getPropertyInfo
(
null
,
null
).
length
);
assertEquals
(
0
,
dr
.
getPropertyInfo
(
null
,
null
).
length
);
assert
True
(
dr
.
connect
(
"jdbc:test:false"
,
null
)
==
null
);
assert
Null
(
dr
.
connect
(
"jdbc:test:false"
,
null
)
);
assertTrue
(
meta
.
getNumericFunctions
().
length
()
>
0
);
assertTrue
(
meta
.
getNumericFunctions
().
length
()
>
0
);
assertTrue
(
meta
.
getStringFunctions
().
length
()
>
0
);
assertTrue
(
meta
.
getStringFunctions
().
length
()
>
0
);
...
@@ -994,9 +994,9 @@ public class TestMetaData extends TestBase {
...
@@ -994,9 +994,9 @@ public class TestMetaData extends TestBase {
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
},
null
,
null
);
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
},
null
,
null
);
assert
True
(
conn
.
getWarnings
()
==
null
);
assert
Null
(
conn
.
getWarnings
()
);
conn
.
clearWarnings
();
conn
.
clearWarnings
();
assert
True
(
conn
.
getWarnings
()
==
null
);
assert
Null
(
conn
.
getWarnings
()
);
conn
.
close
();
conn
.
close
();
}
}
...
@@ -1050,7 +1050,7 @@ public class TestMetaData extends TestBase {
...
@@ -1050,7 +1050,7 @@ public class TestMetaData extends TestBase {
rs
=
meta
.
getTables
(
null
,
Constants
.
SCHEMA_MAIN
,
rs
=
meta
.
getTables
(
null
,
Constants
.
SCHEMA_MAIN
,
null
,
new
String
[]
{
"TABLE"
});
null
,
new
String
[]
{
"TABLE"
});
assert
True
(
rs
.
getStatement
()
==
null
);
assert
Null
(
rs
.
getStatement
()
);
rs
.
next
();
rs
.
next
();
assertEquals
(
"TEST"
,
rs
.
getString
(
"TABLE_NAME"
));
assertEquals
(
"TEST"
,
rs
.
getString
(
"TABLE_NAME"
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
4fe88699
...
@@ -618,7 +618,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -618,7 +618,7 @@ public class TestPreparedStatement extends TestBase {
rs
.
next
();
rs
.
next
();
Object
o
=
rs
.
getObject
(
2
);
Object
o
=
rs
.
getObject
(
2
);
assertTrue
(
o
instanceof
byte
[]);
assertTrue
(
o
instanceof
byte
[]);
assert
True
(
rs
.
getObject
(
3
)
==
null
);
assert
Null
(
rs
.
getObject
(
3
)
);
rs
.
next
();
rs
.
next
();
o
=
rs
.
getObject
(
2
);
o
=
rs
.
getObject
(
2
);
assertTrue
(
o
instanceof
byte
[]);
assertTrue
(
o
instanceof
byte
[]);
...
@@ -1446,9 +1446,9 @@ public class TestPreparedStatement extends TestBase {
...
@@ -1446,9 +1446,9 @@ public class TestPreparedStatement extends TestBase {
assertEquals
(
ascii2
,
rs
.
getString
(
3
));
assertEquals
(
ascii2
,
rs
.
getString
(
3
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
assert
True
(
prep
.
getWarnings
()
==
null
);
assert
Null
(
prep
.
getWarnings
()
);
prep
.
clearWarnings
();
prep
.
clearWarnings
();
assert
True
(
prep
.
getWarnings
()
==
null
);
assert
Null
(
prep
.
getWarnings
()
);
assertTrue
(
conn
==
prep
.
getConnection
());
assertTrue
(
conn
==
prep
.
getConnection
());
}
}
...
@@ -1534,7 +1534,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -1534,7 +1534,7 @@ public class TestPreparedStatement extends TestBase {
java
.
math
.
BigDecimal
x
=
rs
.
getBigDecimal
(
1
);
java
.
math
.
BigDecimal
x
=
rs
.
getBigDecimal
(
1
);
trace
(
"v="
+
v
+
" x="
+
x
);
trace
(
"v="
+
v
+
" x="
+
x
);
if
(
v
==
null
)
{
if
(
v
==
null
)
{
assert
True
(
x
==
null
);
assert
Null
(
x
);
}
else
{
}
else
{
assertTrue
(
x
.
compareTo
(
new
java
.
math
.
BigDecimal
(
v
))
==
0
);
assertTrue
(
x
.
compareTo
(
new
java
.
math
.
BigDecimal
(
v
))
==
0
);
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
4fe88699
...
@@ -739,10 +739,10 @@ public class TestResultSet extends TestBase {
...
@@ -739,10 +739,10 @@ public class TestResultSet extends TestBase {
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
);
o
=
rs
.
getObject
(
2
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
,
Integer
.
class
);
o
=
rs
.
getObject
(
2
,
Integer
.
class
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
assertEquals
(
0
,
rs
.
getRow
());
assertEquals
(
0
,
rs
.
getRow
());
...
@@ -863,10 +863,10 @@ public class TestResultSet extends TestBase {
...
@@ -863,10 +863,10 @@ public class TestResultSet extends TestBase {
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
);
o
=
rs
.
getObject
(
2
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
,
Short
.
class
);
o
=
rs
.
getObject
(
2
,
Short
.
class
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
assertEquals
(
0
,
rs
.
getRow
());
assertEquals
(
0
,
rs
.
getRow
());
...
@@ -994,10 +994,10 @@ public class TestResultSet extends TestBase {
...
@@ -994,10 +994,10 @@ public class TestResultSet extends TestBase {
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
1
).
equals
(
"6"
)
&&
!
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
assertTrue
(
rs
.
getString
(
2
)
==
null
&&
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
);
o
=
rs
.
getObject
(
2
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
o
=
rs
.
getObject
(
2
,
Long
.
class
);
o
=
rs
.
getObject
(
2
,
Long
.
class
);
assert
True
(
o
==
null
);
assert
Null
(
o
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
assertEquals
(
0
,
rs
.
getRow
());
assertEquals
(
0
,
rs
.
getRow
());
...
@@ -1724,17 +1724,17 @@ public class TestResultSet extends TestBase {
...
@@ -1724,17 +1724,17 @@ public class TestResultSet extends TestBase {
}
}
rs
.
next
();
rs
.
next
();
assert
True
(
rs
.
getCharacterStream
(
2
)
==
null
);
assert
Null
(
rs
.
getCharacterStream
(
2
)
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
rs
.
next
();
rs
.
next
();
assert
True
(
rs
.
getAsciiStream
(
"Value"
)
==
null
);
assert
Null
(
rs
.
getAsciiStream
(
"Value"
)
);
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
wasNull
());
assertTrue
(
rs
.
getStatement
()
==
stat
);
assertTrue
(
rs
.
getStatement
()
==
stat
);
assert
True
(
rs
.
getWarnings
()
==
null
);
assert
Null
(
rs
.
getWarnings
()
);
rs
.
clearWarnings
();
rs
.
clearWarnings
();
assert
True
(
rs
.
getWarnings
()
==
null
);
assert
Null
(
rs
.
getWarnings
()
);
assertEquals
(
ResultSet
.
FETCH_FORWARD
,
rs
.
getFetchDirection
());
assertEquals
(
ResultSet
.
FETCH_FORWARD
,
rs
.
getFetchDirection
());
assertEquals
(
ResultSet
.
CONCUR_UPDATABLE
,
rs
.
getConcurrency
());
assertEquals
(
ResultSet
.
CONCUR_UPDATABLE
,
rs
.
getConcurrency
());
rs
.
next
();
rs
.
next
();
...
...
h2/src/test/org/h2/test/jdbc/TestStatement.java
浏览文件 @
4fe88699
...
@@ -324,9 +324,9 @@ public class TestStatement extends TestBase {
...
@@ -324,9 +324,9 @@ public class TestStatement extends TestBase {
stat
.
execute
(
"DROP TABLE TEST"
);
stat
.
execute
(
"DROP TABLE TEST"
);
stat
.
executeUpdate
(
"DROP TABLE IF EXISTS TEST"
);
stat
.
executeUpdate
(
"DROP TABLE IF EXISTS TEST"
);
assert
True
(
stat
.
getWarnings
()
==
null
);
assert
Null
(
stat
.
getWarnings
()
);
stat
.
clearWarnings
();
stat
.
clearWarnings
();
assert
True
(
stat
.
getWarnings
()
==
null
);
assert
Null
(
stat
.
getWarnings
()
);
assertTrue
(
conn
==
stat
.
getConnection
());
assertTrue
(
conn
==
stat
.
getConnection
());
assertEquals
(
"SOME_ID"
,
statBC
.
enquoteIdentifier
(
"SOME_ID"
,
false
));
assertEquals
(
"SOME_ID"
,
statBC
.
enquoteIdentifier
(
"SOME_ID"
,
false
));
...
...
h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java
浏览文件 @
4fe88699
...
@@ -50,7 +50,7 @@ public class TestClassLoaderLeak extends TestBase {
...
@@ -50,7 +50,7 @@ public class TestClassLoaderLeak extends TestBase {
Thread
.
sleep
(
10
);
Thread
.
sleep
(
10
);
}
}
ClassLoader
cl
=
ref
.
get
();
ClassLoader
cl
=
ref
.
get
();
assert
True
(
cl
==
nul
l
);
assert
Null
(
c
l
);
// fill the memory, so a heap dump is created
// fill the memory, so a heap dump is created
// using -XX:+HeapDumpOnOutOfMemoryError
// using -XX:+HeapDumpOnOutOfMemoryError
// which can be analyzed using EclipseMAT
// which can be analyzed using EclipseMAT
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
4fe88699
...
@@ -476,7 +476,7 @@ public class TestTools extends TestBase {
...
@@ -476,7 +476,7 @@ public class TestTools extends TestBase {
assertEquals
(
ResultSet
.
FETCH_FORWARD
,
rs
.
getFetchDirection
());
assertEquals
(
ResultSet
.
FETCH_FORWARD
,
rs
.
getFetchDirection
());
assertEquals
(
0
,
rs
.
getFetchSize
());
assertEquals
(
0
,
rs
.
getFetchSize
());
assertEquals
(
ResultSet
.
TYPE_SCROLL_INSENSITIVE
,
rs
.
getType
());
assertEquals
(
ResultSet
.
TYPE_SCROLL_INSENSITIVE
,
rs
.
getType
());
assert
True
(
rs
.
getStatement
()
==
null
);
assert
Null
(
rs
.
getStatement
()
);
assertFalse
(
rs
.
isClosed
());
assertFalse
(
rs
.
isClosed
());
rs
.
beforeFirst
();
rs
.
beforeFirst
();
...
@@ -902,8 +902,8 @@ public class TestTools extends TestBase {
...
@@ -902,8 +902,8 @@ public class TestTools extends TestBase {
"SELECT * FROM TEST ORDER BY ID"
);
"SELECT * FROM TEST ORDER BY ID"
);
rs
.
next
();
rs
.
next
();
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
1
,
rs
.
getInt
(
1
));
assert
True
(
rs
.
getString
(
2
)
==
null
);
assert
Null
(
rs
.
getString
(
2
)
);
assert
True
(
rs
.
getString
(
3
)
==
null
);
assert
Null
(
rs
.
getString
(
3
)
);
rs
.
next
();
rs
.
next
();
assertEquals
(
2
,
rs
.
getInt
(
1
));
assertEquals
(
2
,
rs
.
getInt
(
1
));
assertEquals
(
"face"
,
rs
.
getString
(
2
));
assertEquals
(
"face"
,
rs
.
getString
(
2
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论