Commit 491b8247 authored by Riegel's avatar Riegel
Browse files

Test: Move CityGml zip-file validation test

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 19 additions and 17 deletions
+19 -17
......@@ -89,20 +89,6 @@ 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(){
......
......@@ -18,12 +18,12 @@
*/
package de.hft.stuttgart.citydoctor2.check;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
......@@ -36,6 +36,10 @@ import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
*
* @author Matthias Betz
......@@ -114,4 +118,16 @@ public class CheckerTest {
f3.delete();
}
}
@Test
public void testZipEntryChecking() throws CityGmlParseException, IOException, InvalidGmlFileException, CityDoctorWriteException {
CityGmlZipArchive cgmlArch = CityGmlZipArchive.register("src/test/resources/zipArchive.zip");
assertNotNull(cgmlArch);
cgmlArch.mountArchive(new ParserConfiguration(8,false));
ValidationConfiguration config = ValidationConfiguration.loadStandardValidationConfig();
for (CityGmlZipEntry entry : cgmlArch.getEntries()){
Checker.streamCheck(entry, null, null, config, null );
}
}
}
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