Commit 4a460949 authored by Eric Duminil's avatar Eric Duminil
Browse files

Tests for citygml stdout. Not working yet.

parent 04a18c6b
......@@ -272,3 +272,4 @@ $RECYCLE.BIN/
*.lnk
# End of https://www.gitignore.io/api/java,maven,macos,linux,eclipse,windows,netbeans,intellij
/-
......@@ -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))";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment