From be1c11378848df8ec39856dca54584e1f3b03fa4 Mon Sep 17 00:00:00 2001 From: Riegel <alexander.riegel@hft-stuttgart.de> Date: Tue, 17 Dec 2024 13:02:10 +0100 Subject: [PATCH] Test: Add testcase for Zip validation via CLI --- .../citydoctor2/check/CheckerTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java b/CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java index 3efdefd..9852977 100644 --- a/CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java +++ b/CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java @@ -35,6 +35,7 @@ import org.junit.rules.TemporaryFolder; import java.io.File; import java.io.IOException; +import java.nio.file.Files; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -117,6 +118,26 @@ public class CheckerTest { } } + @Test + public void testCliZipChecking() throws IOException, CityDoctorWriteException, CityGmlParseException, InvalidGmlFileException { + File f = folder.newFile("out.zip"); + Files.probeContentType(f.toPath()); + try { + String[] args = new String[6]; + args[0] = "-in"; + args[1] = "src/test/resources/zipArchive.zip"; + args[2] = "-config"; + args[3] = "src/test/resources/testConfigWithStreaming.yml"; + args[4] = "-out"; + args[5] = f.getAbsolutePath(); + CityDoctorValidation.main(args); + assertTrue(f.exists()); + + } finally { + f.delete(); + } + } + @Test public void testZipEntryChecking() throws CityGmlParseException, IOException { CityGmlZipArchive cgmlArch = CityGmlZipArchive.register("src/test/resources/zipArchive.zip"); -- GitLab