Commit f9f4046f authored by Riegel's avatar Riegel
Browse files

Excluded the false-positive self-intersection tests with big meshes from Maven

parent 006bb2b0
Pipeline #10017 passed with stage
in 1 minute and 10 seconds
package de.hft.stuttgart.citydoctor2.checks.geometry;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.Checker;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.ValidationConfiguration;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
/**
* Additional Test-Cases for known False-Positives for self intersection.
* These tests use building models which have big meshes.
* Excluded from Maven test-phase due to the limited memory of the
* CI/CD-Runners.
*
* @author Riegel
*/
public class SolidSelfIntCheckFalsePositiveBigMeshTest {
private void testFalsePositiveExample(String gml_filepath) throws CityGmlParseException, InvalidGmlFileException {
ValidationConfiguration config = ValidationConfiguration.loadStandardValidationConfig();
config.setSchematronFilePathInGlobalParameters(null);
CityDoctorModel m = CityGmlParser.parseCityGmlFile(gml_filepath, config.getParserConfiguration());
Checker c = new Checker(config, m);
c.runChecks();
Building building = m.getBuildings().get(0);
System.out.println(building.containsAnyError());
/*
* The examples have no actual self-intersections, but can contain other actual model defects.
* If an error is detected, it is thus required to check if the
* False-Positive self-intersection triggered it.
*/
if (building.containsAnyError()) {
Geometry buildingGeom = building.getGeometry(GeometryType.SOLID, Lod.LOD2);
buildingGeom.clearCheckResults();
SolidSelfIntCheck check = new SolidSelfIntCheck();
check.check(buildingGeom);
CheckResult cr = buildingGeom.getCheckResult(check);
assertNotNull(cr);
//Ensure that the found error is not a self-intersection error
assertEquals("Known False-Positive self-intersection was detected as error", ResultStatus.OK, cr.getResultStatus());
}
}
@Test
public void testKnownFalsePositiveExample_BigMesh1() throws CityGmlParseException, InvalidGmlFileException {
testFalsePositiveExample("src/test/resources/SolidSelfIntTest-known_false_positive_Big_Mesh1.gml");
}
@Test
public void testKnownFalsePositiveExample_BigMesh2() throws CityGmlParseException, InvalidGmlFileException {
testFalsePositiveExample("src/test/resources/SolidSelfIntTest-known_false_positive_Big_Mesh2.gml");
}
}
......@@ -35,6 +35,9 @@
<version>2.22.0</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<excludes>
<exclude>**/SolidSelfIntCheckFalsePositiveBigMeshTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
......
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