From e0df263b6c1235bc087d391fc8838de755f11635 Mon Sep 17 00:00:00 2001 From: Dominic Burger Date: Tue, 5 Nov 2024 16:29:08 +0100 Subject: [PATCH] Test reading from multiple baskets --- .../ValidMultipleBaskets.xtf | 100 ++++++++++++++++++ .../lk2dxf/LKMapXtfReaderTest.java | 12 +++ 2 files changed, 112 insertions(+) create mode 100644 src/test/data/LKMapXtfReaderTest/ValidMultipleBaskets.xtf diff --git a/src/test/data/LKMapXtfReaderTest/ValidMultipleBaskets.xtf b/src/test/data/LKMapXtfReaderTest/ValidMultipleBaskets.xtf new file mode 100644 index 0000000..eaac0e2 --- /dev/null +++ b/src/test/data/LKMapXtfReaderTest/ValidMultipleBaskets.xtf @@ -0,0 +1,100 @@ + + + + + + + + + + test data + + + + + basket1object001 + + + Test + Test + 20241030 + + + Test + unbekannt + in_Betrieb + + + + + + 2669992.781 + 1208904.666 + + + 2669971.614 + 1206904.416 + + + 2672924.364 + 1206936.166 + + + 2672818.531 + 1208915.250 + + + 2669992.781 + 1208904.666 + + + + + + Wasser.unbekannt + + + basket1object002 + + + Test + Test + 20241030 + + + Test + unbekannt + in_Betrieb + + + 2669992.781 + 1208904.666 + + + Wasser.Absperrorgan + + + + + basket2object001 + + + Test + Test + 20241030 + + + Test + ungenau + in_Betrieb + + + 2669992.781 + 1208904.666 + + + Fernwaerme.unbekannt + + + + \ No newline at end of file diff --git a/src/test/java/ch/geowerkstatt/lk2dxf/LKMapXtfReaderTest.java b/src/test/java/ch/geowerkstatt/lk2dxf/LKMapXtfReaderTest.java index e699fdf..7df1b93 100644 --- a/src/test/java/ch/geowerkstatt/lk2dxf/LKMapXtfReaderTest.java +++ b/src/test/java/ch/geowerkstatt/lk2dxf/LKMapXtfReaderTest.java @@ -24,6 +24,18 @@ public void readValidXtf() throws Exception { } } + @Test + public void readValidXtfMultipleBaskets() throws Exception { + try (LKMapXtfReader reader = new LKMapXtfReader(new File(TEST_DIR + "ValidMultipleBaskets.xtf"))) { + String[] objectIds = reader + .readObjects() + .map(IomObject::getobjectoid) + .toArray(String[]::new); + + assertArrayEquals(new String[] {"basket1object001", "basket1object002", "basket2object001"}, objectIds); + } + } + @Test public void readXtfForWrongModel() throws Exception { try (LKMapXtfReader reader = new LKMapXtfReader(new File(TEST_DIR + "WrongModel.xtf"))) {