Commit 6a1fed35 authored by Riegel's avatar Riegel
Browse files

Test: Add testcase for CityDoctor validation of zip-files

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 20 additions and 3 deletions
+20 -3
......@@ -97,4 +97,8 @@ public class CityGmlZipArchive implements Serializable {
public List<CityGmlZipEntry> getEntries() {
return entries;
}
public void streamValidateCityGml() {
return;
}
}
......@@ -10,8 +10,6 @@ import org.junit.rules.ExpectedException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
......@@ -85,7 +83,7 @@ public class ZipTest {
}
@Test
public void testValidation(){
public void testXMLValidation(){
ParserConfiguration valConfig = new ParserConfiguration(8,true);
CityGmlZipArchive cgmlArch = CityGmlZipArchive.register("src/test/resources/zip/validate.zip");
assertNotNull(cgmlArch);
......@@ -95,6 +93,21 @@ public class ZipTest {
assertEquals(ZipEntryErrorType.INVALID_CITY_GML_FILE, cgmlArch.getEntry("valFaulty.gml").getErrorType());
}
@Test
public void testCityDoctorValidation(){
CityGmlZipArchive cgmlArch = CityGmlZipArchive.register("src/test/resources/zip/mock_archive.zip");
assertNotNull(cgmlArch);
cgmlArch.mountArchive(config);
cgmlArch.streamValidateCityGml();
for (CityGmlZipEntry entry: cgmlArch.getEntries()) {
assertNotNull(entry);
assertNotNull(entry.getModel());
assertTrue(entry.getModel().isValidated());
assertFalse(entry.getModel().getBuildings().get(0).containsAnyError());
}
}
@Test
public void testImplicitParsing(){
CityGmlZipArchive cgmlArch = CityGmlZipArchive.register("src/test/resources/zip/implicit.zip");
......
Supports Markdown
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