Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
83d927c6
Commit
83d927c6
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
More test
parent
386b7a16
master
develop
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+0
-1
...tadt/regionchooser/RegionChooserCommandLineInterface.java
src/test/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterfaceTest.java
+25
-4
.../regionchooser/RegionChooserCommandLineInterfaceTest.java
with
25 additions
and
5 deletions
+25
-5
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+
0
-
1
View file @
83d927c6
...
...
@@ -46,7 +46,6 @@ class RegionChooserCommandLineInterface implements Callable<Integer>
@Override
public
Integer
call
()
throws
Exception
{
//TODO: Test
CoordinateReferenceSystem
localCRS
;
if
(
espgId
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterfaceTest.java
+
25
-
4
View file @
83d927c6
...
...
@@ -40,7 +40,7 @@ public void restoreStreams() {
@Test
void
testNoInput
()
{
new
CommandLine
(
new
RegionChooserCommandLineInterface
()).
execute
(
""
);
originalOut
.
println
(
err
.
toString
());
//
originalOut.println(err.toString());
String
expectedErr
=
"Missing required options: '--input=input.gml', '--output=output.gml', '--wkt=polygon.wkt'"
;
assertTrue
(
err
.
toString
().
contains
(
expectedErr
),
err
.
toString
()
+
" should contain "
+
expectedErr
);
}
...
...
@@ -57,10 +57,31 @@ void testExtractRegionFromTwoCitygmls() throws IOException {
}
new
CommandLine
(
new
RegionChooserCommandLineInterface
()).
execute
(
"--input="
+
citygml1
+
","
+
citygml2
,
"--output="
+
outGML
,
"--wkt="
+
inWKT
,
"--epsg=31463"
,
"--local"
);
String
expectedErr
=
"Buildings found in selected region 20"
;
assertTrue
(
err
.
toString
().
contains
(
expectedErr
),
err
.
toString
()
+
" should contain "
+
expectedErr
);
originalOut
.
println
(
Files
.
size
(
outGML
));
String
expectedLog
=
"Buildings found in selected region 20"
;
assertTrue
(
err
.
toString
().
contains
(
expectedLog
),
err
.
toString
()
+
" should contain "
+
expectedLog
);
assertTrue
(
Files
.
size
(
outGML
)
>
600_000
);
}
@Test
void
testExtractRegionFromTwoCitygmlsInWGS84
()
throws
IOException
{
String
wktPolygon
=
"POLYGON((9.18991539528286 48.79067456353269, 9.195580220722313 48.7873947720947, 9.172062612079735 48.78241812742368, 9.170946813129538 48.78569824412753, 9.18991539528286 48.79067456353269))"
;
Path
citygml1
=
TEST_REPOSITORY
.
resolve
(
"Stuttgart.proj/Stuttgart_LOD0_LOD1_small.gml"
);
Path
citygml2
=
TEST_REPOSITORY
.
resolve
(
"Stuttgart.proj/Stöckach_überarbeitete GML-NoBuildingPart.gml"
);
Path
outGML
=
Files
.
createTempFile
(
"output"
,
".gml"
);
Path
inWKT
=
Files
.
createTempFile
(
"polygon"
,
".wkt"
);
try
(
BufferedWriter
wkt
=
Files
.
newBufferedWriter
(
inWKT
))
{
wkt
.
write
(
wktPolygon
);
}
new
CommandLine
(
new
RegionChooserCommandLineInterface
()).
execute
(
"--input="
+
citygml1
+
","
+
citygml2
,
"--output="
+
outGML
,
"--wkt="
+
inWKT
);
originalOut
.
println
(
err
.
toString
());
String
expectedLog
=
"EPSG:31463"
;
assertTrue
(
err
.
toString
().
contains
(
expectedLog
),
err
.
toString
()
+
" should contain "
+
expectedLog
);
expectedLog
=
"Buildings found in selected region 22"
;
assertTrue
(
err
.
toString
().
contains
(
expectedLog
),
err
.
toString
()
+
" should contain "
+
expectedLog
);
assertTrue
(
Files
.
size
(
outGML
)
>
300_000
);
}
//TODO: Test with stdin
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets