Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Compare Revisions
134141bbf243f6cd485032e8b0b9920ee0aefb30...4231c92b7e4d60257b96b96f0c611ae3e49422cd
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/checks/semantics/PolygonWithoutSurfaceCheckTest.java
0 → 100644
View file @
4231c92b
package
de.hft.stuttgart.citydoctor2.checks.semantics
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertSame
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckResult
;
import
de.hft.stuttgart.citydoctor2.check.ErrorId
;
import
de.hft.stuttgart.citydoctor2.check.ResultStatus
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWithoutSurfaceError
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface
;
import
de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon
;
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.datastructure.Polygon
;
public
class
PolygonWithoutSurfaceCheckTest
{
@Test
public
void
testPolygonWithoutSurface
()
{
Geometry
geom
=
new
Geometry
(
GeometryType
.
SOLID
,
Lod
.
LOD2
);
Polygon
poly
=
new
ConcretePolygon
();
geom
.
addPolygon
(
poly
);
PolygonWithoutSurfaceCheck
check
=
new
PolygonWithoutSurfaceCheck
();
poly
.
accept
(
check
);
CheckResult
checkResult
=
poly
.
getCheckResult
(
check
);
assertNotNull
(
checkResult
);
assertEquals
(
ResultStatus
.
ERROR
,
checkResult
.
getResultStatus
());
assertEquals
(
CheckId
.
C_SE_POLYGON_WITHOUT_SURFACE
,
checkResult
.
getCheckIdentifier
());
CheckError
error
=
checkResult
.
getError
();
assertNotNull
(
error
);
assertEquals
(
ErrorId
.
SE_POLYGON_WITHOUT_SURFACE
,
error
.
getErrorId
());
assertTrue
(
error
instanceof
PolygonWithoutSurfaceError
);
PolygonWithoutSurfaceError
errorCast
=
(
PolygonWithoutSurfaceError
)
error
;
assertSame
(
poly
,
errorCast
.
getPolygon
());
}
@Test
public
void
testPolygonWithSurface
()
{
Geometry
geom
=
new
Geometry
(
GeometryType
.
SOLID
,
Lod
.
LOD2
);
Polygon
poly
=
new
ConcretePolygon
();
BoundarySurface
bs
=
new
BoundarySurface
(
null
);
bs
.
addGeometry
(
geom
);
geom
.
addPolygon
(
poly
);
PolygonWithoutSurfaceCheck
check
=
new
PolygonWithoutSurfaceCheck
();
poly
.
accept
(
check
);
CheckResult
checkResult
=
poly
.
getCheckResult
(
check
);
assertNotNull
(
checkResult
);
assertEquals
(
ResultStatus
.
OK
,
checkResult
.
getResultStatus
());
assertEquals
(
CheckId
.
C_SE_POLYGON_WITHOUT_SURFACE
,
checkResult
.
getCheckIdentifier
());
CheckError
error
=
checkResult
.
getError
();
assertNull
(
error
);
}
@Test
public
void
testPolygonWithWrongLod
()
{
Geometry
geom
=
new
Geometry
(
GeometryType
.
SOLID
,
Lod
.
LOD1
);
Polygon
poly
=
new
ConcretePolygon
();
BoundarySurface
bs
=
new
BoundarySurface
(
null
);
bs
.
addGeometry
(
geom
);
geom
.
addPolygon
(
poly
);
PolygonWithoutSurfaceCheck
check
=
new
PolygonWithoutSurfaceCheck
();
poly
.
accept
(
check
);
CheckResult
checkResult
=
poly
.
getCheckResult
(
check
);
assertNull
(
checkResult
);
}
}
CityDoctorParent/pom.xml
View file @
4231c92b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
de.hft.stuttgart
</groupId>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.1
3.1
</version>
<version>
3.1
4.0
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<name>
CityDoctorParent
</name>
<name>
CityDoctorParent
</name>
<properties>
<properties>
...
@@ -103,12 +103,12 @@
...
@@ -103,12 +103,12 @@
<dependency>
<dependency>
<groupId>
org.citygml4j
</groupId>
<groupId>
org.citygml4j
</groupId>
<artifactId>
citygml4j-core
</artifactId>
<artifactId>
citygml4j-core
</artifactId>
<version>
3.
0
.0
</version>
<version>
3.
1
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.citygml4j
</groupId>
<groupId>
org.citygml4j
</groupId>
<artifactId>
citygml4j-xml
</artifactId>
<artifactId>
citygml4j-xml
</artifactId>
<version>
3.
0
.0
</version>
<version>
3.
1
.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
de.hft.stuttgart
</groupId>
<groupId>
de.hft.stuttgart
</groupId>
...
@@ -156,6 +156,11 @@
...
@@ -156,6 +156,11 @@
<artifactId>
log4j-core
</artifactId>
<artifactId>
log4j-core
</artifactId>
<version>
${log4j.version}
</version>
<version>
${log4j.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-jul
</artifactId>
<version>
${log4j.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.yaml
</groupId>
<groupId>
org.yaml
</groupId>
<artifactId>
snakeyaml
</artifactId>
<artifactId>
snakeyaml
</artifactId>
...
...
Prev
1
2
Next