Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
4a460949
Commit
4a460949
authored
Oct 11, 2022
by
Eric Duminil
Browse files
Tests for citygml stdout. Not working yet.
parent
04a18c6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
4a460949
...
...
@@ -272,3 +272,4 @@ $RECYCLE.BIN/
*.lnk
# End of https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij
/-
src/test/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterfaceTest.java
View file @
4a460949
...
...
@@ -113,6 +113,21 @@ void testExtractRegionWithStandardInput() throws IOException {
assertEquals
(
2
,
countBuildings
(
outGML
));
}
@Test
void
testExtractRegionWithStandardInputAndStandardOutput
()
throws
IOException
{
String
wktPolygon
=
"POLYGON((-73.9959209576448 40.73286384885367, -73.996317924579 40.732359794090684, -73.9947515145143 40.7315061442504, -73.99422580154739 40.73214841515045, -73.9959209576448 40.73286384885367))"
;
Path
citygml
=
TEST_REPOSITORY
.
resolve
(
"NewYork.proj/ManhattanSmall.gml"
);
InputStream
stdin
=
new
ByteArrayInputStream
(
wktPolygon
.
getBytes
(
StandardCharsets
.
UTF_8
));
System
.
setIn
(
stdin
);
new
CommandLine
(
new
RegionChooserCommandLineInterface
()).
execute
(
"--input="
+
citygml
,
"--output=-"
,
"--wkt=-"
);
String
expectedLog
=
"EPSG:32118"
;
assertTrue
(
err
.
toString
().
contains
(
expectedLog
),
err
.
toString
()
+
" should contain "
+
expectedLog
);
originalOut
.
println
(
err
.
toString
());
originalOut
.
println
(
"--------------------"
);
originalOut
.
println
(
out
.
toString
());
assertFalse
(
Files
.
exists
(
Paths
.
get
(
"-"
)));
}
@Test
void
testExtractRegionWithMissingInput
()
throws
IOException
{
String
wktPolygon
=
"POLYGON((-73.9959209576448 40.73286384885367, -73.996317924579 40.732359794090684, -73.9947515145143 40.7315061442504, -73.99422580154739 40.73214841515045, -73.9959209576448 40.73286384885367))"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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