Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
eebe787b
Commit
eebe787b
authored
Apr 11, 2025
by
Riegel
Browse files
Test: Fix Testcase
parent
7a2be924
Changes
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuildingTest.java
View file @
eebe787b
...
...
@@ -23,12 +23,16 @@ import static org.junit.Assert.assertFalse;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
doAnswer
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
de.hft.stuttgart.citydoctor2.utils.UnsetGeometriesVisitor
;
import
org.citygml4j.core.model.construction.WallSurface
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
...
...
@@ -305,12 +309,22 @@ public class AbstractBuildingTest {
@Test
public
void
testUnsetGmlGeometries
()
{
Installation
biMock
=
mock
(
Installation
.
class
);
doAnswer
(
invocation
->
{
biMock
.
unsetGmlGeometries
();
return
null
;
}).
when
(
biMock
).
accept
(
any
(
UnsetGeometriesVisitor
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
doAnswer
(
invocation
->
{
bsMock
.
unsetGmlGeometries
();
return
null
;
}).
when
(
bsMock
).
accept
(
any
(
UnsetGeometriesVisitor
.
class
));
AbstractBuilding
ab
=
createAbstractBuilding
();
ab
.
addBoundarySurface
(
bsMock
);
ab
.
addBuildingInstallation
(
biMock
);
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
gmlAb
=
new
org
.
citygml4j
.
core
.
model
.
building
.
Building
();
gmlAb
.
setLod1Solid
(
new
SolidProperty
());
gmlAb
.
setLod2Solid
(
new
SolidProperty
());
gmlAb
.
setLod3Solid
(
new
SolidProperty
());
...
...
@@ -320,9 +334,14 @@ public class AbstractBuildingTest {
gmlAb
.
setLod3MultiSurface
(
new
MultiSurfaceProperty
());
gmlAb
.
getDeprecatedProperties
().
setLod4MultiSurface
(
new
MultiSurfaceProperty
());
ab
.
setCityGmlBuilding
(
gmlAb
);
ab
.
unsetGmlGeometries
();
Mockito
.
verify
(
biMock
).
unsetGmlGeometries
();
Mockito
.
verify
(
bsMock
).
unsetGmlGeometries
();
ab
.
accept
(
new
UnsetGeometriesVisitor
());
verify
(
biMock
).
accept
(
any
(
UnsetGeometriesVisitor
.
class
));
verify
(
bsMock
).
accept
(
any
(
UnsetGeometriesVisitor
.
class
));
verify
(
biMock
).
unsetGmlGeometries
();
verify
(
bsMock
).
unsetGmlGeometries
();
assertNull
(
gmlAb
.
getLod1Solid
());
assertNull
(
gmlAb
.
getLod2Solid
());
assertNull
(
gmlAb
.
getLod3Solid
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment