Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
060f91da
提交
060f91da
authored
10月 09, 2013
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reorder, formatting, javadocs
上级
d1eda2f4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
6 行删除
+13
-6
TestSpatial.java
h2/src/test/org/h2/test/db/TestSpatial.java
+12
-5
TestBnf.java
h2/src/test/org/h2/test/unit/TestBnf.java
+1
-1
没有找到文件。
h2/src/test/org/h2/test/db/TestSpatial.java
浏览文件 @
060f91da
...
@@ -368,7 +368,6 @@ public class TestSpatial extends TestBase {
...
@@ -368,7 +368,6 @@ public class TestSpatial extends TestBase {
rs
.
next
();
rs
.
next
();
assertContains
(
rs
.
getString
(
1
),
"/* PUBLIC.IDX_TEST_POLYGON: POLYGON &&"
);
assertContains
(
rs
.
getString
(
1
),
"/* PUBLIC.IDX_TEST_POLYGON: POLYGON &&"
);
int
todo
;
// TODO equality should probably also use the spatial index
// TODO equality should probably also use the spatial index
// rs = stat.executeQuery("explain select * from test " +
// rs = stat.executeQuery("explain select * from test " +
// "where polygon = 'POLYGON ((1 1, 1 2, 2 2, 1 1))'");
// "where polygon = 'POLYGON ((1 1, 1 2, 2 2, 1 1))'");
...
@@ -517,7 +516,7 @@ public class TestSpatial extends TestBase {
...
@@ -517,7 +516,7 @@ public class TestSpatial extends TestBase {
}
}
/**
/**
* Test seriali
s
ation of Z and SRID values.
* Test seriali
z
ation of Z and SRID values.
*/
*/
private
void
testWKB
()
{
private
void
testWKB
()
{
ValueGeometry
geom3d
=
ValueGeometry
.
get
(
"POLYGON ((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"
);
ValueGeometry
geom3d
=
ValueGeometry
.
get
(
"POLYGON ((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"
);
...
@@ -538,15 +537,21 @@ public class TestSpatial extends TestBase {
...
@@ -538,15 +537,21 @@ public class TestSpatial extends TestBase {
deleteDb
(
"spatialIndex"
);
deleteDb
(
"spatialIndex"
);
Connection
conn
=
getConnection
(
"spatialIndex"
);
Connection
conn
=
getConnection
(
"spatialIndex"
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE ALIAS OBJSTRING FOR \""
+
stat
.
execute
(
"CREATE ALIAS OBJ
_
STRING FOR \""
+
TestSpatial
.
class
.
getName
()
+
".getObjectString\""
);
TestSpatial
.
class
.
getName
()
+
".getObjectString\""
);
ResultSet
rs
=
stat
.
executeQuery
(
"select OBJSTRING('POINT( 15 25 )'::geometry)"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select OBJ
_
STRING('POINT( 15 25 )'::geometry)"
);
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
"POINT (15 25)"
,
rs
.
getString
(
1
));
assertEquals
(
"POINT (15 25)"
,
rs
.
getString
(
1
));
conn
.
close
();
conn
.
close
();
deleteDb
(
"spatialIndex"
);
deleteDb
(
"spatialIndex"
);
}
}
/**
* Get the toString value of the object.
*
* @param object the object
* @return the string representation
*/
public
static
String
getObjectString
(
Object
object
)
{
public
static
String
getObjectString
(
Object
object
)
{
return
object
.
toString
();
return
object
.
toString
();
}
}
...
@@ -554,7 +559,7 @@ public class TestSpatial extends TestBase {
...
@@ -554,7 +559,7 @@ public class TestSpatial extends TestBase {
/**
/**
* Test equality method on ValueGeometry
* Test equality method on ValueGeometry
*/
*/
p
ublic
void
testEquals
()
{
p
rivate
void
testEquals
()
{
// 3d equality test
// 3d equality test
ValueGeometry
geom3d
=
ValueGeometry
.
get
(
"POLYGON ((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"
);
ValueGeometry
geom3d
=
ValueGeometry
.
get
(
"POLYGON ((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"
);
ValueGeometry
geom2d
=
ValueGeometry
.
get
(
"POLYGON ((67 13, 67 18, 59 18, 59 13, 67 13))"
);
ValueGeometry
geom2d
=
ValueGeometry
.
get
(
"POLYGON ((67 13, 67 18, 59 18, 59 13, 67 13))"
);
...
@@ -573,6 +578,8 @@ public class TestSpatial extends TestBase {
...
@@ -573,6 +578,8 @@ public class TestSpatial extends TestBase {
ValueGeometry
.
get
(
"POINT EMPTY"
);
ValueGeometry
.
get
(
"POINT EMPTY"
);
fail
(
"expected this to throw IllegalArgumentException"
);
fail
(
"expected this to throw IllegalArgumentException"
);
}
catch
(
IllegalArgumentException
ex
)
{
}
catch
(
IllegalArgumentException
ex
)
{
// expected
}
}
}
}
}
}
h2/src/test/org/h2/test/unit/TestBnf.java
浏览文件 @
060f91da
...
@@ -55,7 +55,7 @@ public class TestBnf extends TestBase {
...
@@ -55,7 +55,7 @@ public class TestBnf extends TestBase {
DbSchema
defaultSchema
=
dbContents
.
getDefaultSchema
();
DbSchema
defaultSchema
=
dbContents
.
getDefaultSchema
();
DbProcedure
[]
procedures
=
defaultSchema
.
getProcedures
();
DbProcedure
[]
procedures
=
defaultSchema
.
getProcedures
();
Set
<
String
>
procedureName
=
new
HashSet
<
String
>(
procedures
.
length
);
Set
<
String
>
procedureName
=
new
HashSet
<
String
>(
procedures
.
length
);
for
(
DbProcedure
procedure
:
procedures
)
{
for
(
DbProcedure
procedure
:
procedures
)
{
procedureName
.
add
(
procedure
.
getName
());
procedureName
.
add
(
procedure
.
getName
());
}
}
assertTrue
(
procedureName
.
contains
(
"CUSTOM_PRINT"
));
assertTrue
(
procedureName
.
contains
(
"CUSTOM_PRINT"
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论