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
0b280dc5
Commit
0b280dc5
authored
Nov 15, 2024
by
Riegel
Browse files
Add getTopLevelCityObject method to CityObjects
parent
3dba0e5e
Changes
29
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Tunnel.java
View file @
0b280dc5
...
@@ -34,6 +34,11 @@ public class Tunnel extends AbstractTunnel {
...
@@ -34,6 +34,11 @@ public class Tunnel extends AbstractTunnel {
}
}
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
this
;
}
@Override
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
c
)
{
super
.
accept
(
c
);
super
.
accept
(
c
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/TunnelConstructiveElement.java
View file @
0b280dc5
...
@@ -31,12 +31,20 @@ public class TunnelConstructiveElement extends CityObject {
...
@@ -31,12 +31,20 @@ public class TunnelConstructiveElement extends CityObject {
private
final
org
.
citygml4j
.
core
.
model
.
tunnel
.
TunnelConstructiveElement
gmlTunnelElement
;
private
final
org
.
citygml4j
.
core
.
model
.
tunnel
.
TunnelConstructiveElement
gmlTunnelElement
;
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
AbstractTunnel
parent
;
public
TunnelConstructiveElement
(
org
.
citygml4j
.
core
.
model
.
tunnel
.
TunnelConstructiveElement
gmlObject
)
{
public
TunnelConstructiveElement
(
org
.
citygml4j
.
core
.
model
.
tunnel
.
TunnelConstructiveElement
gmlObject
)
{
this
.
gmlTunnelElement
=
gmlObject
;
this
.
gmlTunnelElement
=
gmlObject
;
}
}
public
void
setParent
(
AbstractTunnel
parent
)
{
this
.
parent
=
parent
;
}
public
AbstractTunnel
getParent
()
{
return
parent
;
}
@Override
@Override
public
Copyable
createCopyInstance
()
{
public
Copyable
createCopyInstance
()
{
return
new
TunnelConstructiveElement
(
gmlTunnelElement
);
return
new
TunnelConstructiveElement
(
gmlTunnelElement
);
...
@@ -186,6 +194,11 @@ public class TunnelConstructiveElement extends CityObject {
...
@@ -186,6 +194,11 @@ public class TunnelConstructiveElement extends CityObject {
}
}
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
getParent
().
getTopLevelCityObject
();
}
@Override
@Override
public
FeatureType
getFeatureType
()
{
public
FeatureType
getFeatureType
()
{
return
FeatureType
.
TUNNEL_CONSTRUCTION_ELEMENT
;
return
FeatureType
.
TUNNEL_CONSTRUCTION_ELEMENT
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/TunnelHollow.java
View file @
0b280dc5
...
@@ -43,6 +43,11 @@ public class TunnelHollow extends AbstractRoom {
...
@@ -43,6 +43,11 @@ public class TunnelHollow extends AbstractRoom {
parent
=
handler
.
getCopyInstance
(
oHollow
.
getParent
());
parent
=
handler
.
getCopyInstance
(
oHollow
.
getParent
());
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
getParent
().
getTopLevelCityObject
();
}
@Override
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/TunnelPart.java
View file @
0b280dc5
...
@@ -22,6 +22,11 @@ public class TunnelPart extends AbstractTunnel {
...
@@ -22,6 +22,11 @@ public class TunnelPart extends AbstractTunnel {
return
parent
;
return
parent
;
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
getParent
().
getTopLevelCityObject
();
}
@Override
@Override
public
FeatureType
getFeatureType
()
{
public
FeatureType
getFeatureType
()
{
return
FeatureType
.
TUNNEL_PART
;
return
FeatureType
.
TUNNEL_PART
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Vegetation.java
View file @
0b280dc5
...
@@ -198,6 +198,11 @@ public class Vegetation extends CityObject {
...
@@ -198,6 +198,11 @@ public class Vegetation extends CityObject {
}
}
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
this
;
}
public
void
setGmlObject
(
AbstractVegetationObject
avo
)
{
public
void
setGmlObject
(
AbstractVegetationObject
avo
)
{
citygmlVegetation
=
avo
;
citygmlVegetation
=
avo
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/WaterObject.java
View file @
0b280dc5
...
@@ -106,6 +106,11 @@ public class WaterObject extends CityObject {
...
@@ -106,6 +106,11 @@ public class WaterObject extends CityObject {
gmlWater
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
gmlWater
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
}
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
this
;
}
public
void
setGmlObject
(
WaterBody
waterBody
)
{
public
void
setGmlObject
(
WaterBody
waterBody
)
{
gmlWater
=
waterBody
;
gmlWater
=
waterBody
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
View file @
0b280dc5
...
@@ -252,7 +252,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -252,7 +252,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
@Override
@Override
public
void
visit
(
Bridge
bridge
)
{
public
void
visit
(
Bridge
bridge
)
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
bridge
);
BridgeObject
bo
=
new
BridgeObject
(
bridge
);
// parse deprecated geometries
// parse deprecated geometries
...
@@ -266,7 +266,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -266,7 +266,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue
;
continue
;
}
}
BridgePart
gmlBridgePart
=
bPartProperty
.
getObject
();
BridgePart
gmlBridgePart
=
bPartProperty
.
getObject
();
BridgeObject
bPart
=
new
BridgeObject
(
BridgeType
.
BRIDGE_PART
,
gmlBridgePart
);
BridgeObject
bPart
=
new
BridgeObject
(
gmlBridgePart
,
bo
);
mapAbstractBridge
(
gmlBridgePart
,
bPart
);
mapAbstractBridge
(
gmlBridgePart
,
bPart
);
bo
.
addBridgePart
(
bPart
);
bo
.
addBridgePart
(
bPart
);
}
}
...
...
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuildingTest.java
View file @
0b280dc5
...
@@ -348,6 +348,11 @@ public class AbstractBuildingTest {
...
@@ -348,6 +348,11 @@ public class AbstractBuildingTest {
return
null
;
return
null
;
}
}
@Override
public
CityObject
getTopLevelCityObject
(){
return
null
;
}
};
};
return
ab
;
return
ab
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeObjectTest.java
View file @
0b280dc5
...
@@ -47,7 +47,7 @@ public class BridgeObjectTest {
...
@@ -47,7 +47,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testAccept
()
{
public
void
testAccept
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
bo
.
addBoundarySurface
(
new
BoundarySurface
(
null
));
bo
.
addBoundarySurface
(
new
BoundarySurface
(
null
));
AtomicInteger
boCounter
=
new
AtomicInteger
(
0
);
AtomicInteger
boCounter
=
new
AtomicInteger
(
0
);
AtomicInteger
bsCounter
=
new
AtomicInteger
(
0
);
AtomicInteger
bsCounter
=
new
AtomicInteger
(
0
);
...
@@ -75,7 +75,7 @@ public class BridgeObjectTest {
...
@@ -75,7 +75,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testPrepareForChecking
()
{
public
void
testPrepareForChecking
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
prepareForChecking
();
bo
.
prepareForChecking
();
...
@@ -84,7 +84,7 @@ public class BridgeObjectTest {
...
@@ -84,7 +84,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testClearMetaInformation
()
{
public
void
testClearMetaInformation
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
clearMetaInformation
();
bo
.
clearMetaInformation
();
...
@@ -93,7 +93,7 @@ public class BridgeObjectTest {
...
@@ -93,7 +93,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testContainsError
()
{
public
void
testContainsError
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
assertFalse
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
assertFalse
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
bo
.
addCheckResult
(
new
CheckResult
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
,
ResultStatus
.
ERROR
,
mock
(
CheckError
.
class
)));
bo
.
addCheckResult
(
new
CheckResult
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
,
ResultStatus
.
ERROR
,
mock
(
CheckError
.
class
)));
assertTrue
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
assertTrue
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
...
@@ -101,7 +101,7 @@ public class BridgeObjectTest {
...
@@ -101,7 +101,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testContainsError2
()
{
public
void
testContainsError2
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
assertFalse
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
assertFalse
(
bo
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
...
@@ -111,7 +111,7 @@ public class BridgeObjectTest {
...
@@ -111,7 +111,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testClearAllContainedCheckResults
()
{
public
void
testClearAllContainedCheckResults
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
clearAllContainedCheckResults
();
bo
.
clearAllContainedCheckResults
();
...
@@ -120,7 +120,7 @@ public class BridgeObjectTest {
...
@@ -120,7 +120,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testContainsAnyError
()
{
public
void
testContainsAnyError
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
containsAnyError
();
bo
.
containsAnyError
();
...
@@ -129,14 +129,14 @@ public class BridgeObjectTest {
...
@@ -129,14 +129,14 @@ public class BridgeObjectTest {
when
(
bsMock
.
containsAnyError
()).
thenReturn
(
true
);
when
(
bsMock
.
containsAnyError
()).
thenReturn
(
true
);
assertTrue
(
bo
.
containsAnyError
());
assertTrue
(
bo
.
containsAnyError
());
BridgeObject
bo2
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo2
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
bo2
.
addCheckResult
(
new
CheckResult
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
,
ResultStatus
.
ERROR
,
mock
(
CheckError
.
class
)));
bo2
.
addCheckResult
(
new
CheckResult
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
,
ResultStatus
.
ERROR
,
mock
(
CheckError
.
class
)));
assertTrue
(
bo2
.
containsAnyError
());
assertTrue
(
bo2
.
containsAnyError
());
}
}
@Test
@Test
public
void
testCollectContainedErrors
()
{
public
void
testCollectContainedErrors
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
ArrayList
<
CheckError
>
errors
=
new
ArrayList
<>();
ArrayList
<
CheckError
>
errors
=
new
ArrayList
<>();
...
@@ -146,7 +146,7 @@ public class BridgeObjectTest {
...
@@ -146,7 +146,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometries
()
{
public
void
testReCreateGeometries
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
GeometryFactory
factoryMock
=
mock
(
GeometryFactory
.
class
);
GeometryFactory
factoryMock
=
mock
(
GeometryFactory
.
class
);
...
@@ -157,7 +157,7 @@ public class BridgeObjectTest {
...
@@ -157,7 +157,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesMultiSurfaceLod1
()
{
public
void
testReCreateGeometriesMultiSurfaceLod1
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD1
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD1
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -172,7 +172,7 @@ public class BridgeObjectTest {
...
@@ -172,7 +172,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesMultiSurfaceLod2
()
{
public
void
testReCreateGeometriesMultiSurfaceLod2
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD2
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD2
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -186,7 +186,7 @@ public class BridgeObjectTest {
...
@@ -186,7 +186,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesMultiSurfaceLod3
()
{
public
void
testReCreateGeometriesMultiSurfaceLod3
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD3
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD3
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -200,7 +200,7 @@ public class BridgeObjectTest {
...
@@ -200,7 +200,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesMultiSurfaceLod4
()
{
public
void
testReCreateGeometriesMultiSurfaceLod4
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD4
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
MULTI_SURFACE
,
Lod
.
LOD4
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -214,7 +214,7 @@ public class BridgeObjectTest {
...
@@ -214,7 +214,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesSolidLod1
()
{
public
void
testReCreateGeometriesSolidLod1
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD1
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD1
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -228,7 +228,7 @@ public class BridgeObjectTest {
...
@@ -228,7 +228,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesSolidLod2
()
{
public
void
testReCreateGeometriesSolidLod2
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD2
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD2
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -242,7 +242,7 @@ public class BridgeObjectTest {
...
@@ -242,7 +242,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesSolidLod3
()
{
public
void
testReCreateGeometriesSolidLod3
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD3
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD3
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -256,7 +256,7 @@ public class BridgeObjectTest {
...
@@ -256,7 +256,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testReCreateGeometriesSolidLod4
()
{
public
void
testReCreateGeometriesSolidLod4
()
{
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
mock
(
AbstractBridge
.
class
));
BridgeObject
bo
=
new
BridgeObject
(
mock
(
AbstractBridge
.
class
));
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD4
);
Geometry
geom
=
GeometryTestUtils
.
createDummyGeometry
(
GeometryType
.
SOLID
,
Lod
.
LOD4
);
AbstractBridge
ab
=
new
Bridge
();
AbstractBridge
ab
=
new
Bridge
();
bo
.
setGmlObject
(
ab
);
bo
.
setGmlObject
(
ab
);
...
@@ -273,7 +273,7 @@ public class BridgeObjectTest {
...
@@ -273,7 +273,7 @@ public class BridgeObjectTest {
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
DeprecatedPropertiesOfAbstractBridge
propsMock
=
mock
(
DeprecatedPropertiesOfAbstractBridge
.
class
);
DeprecatedPropertiesOfAbstractBridge
propsMock
=
mock
(
DeprecatedPropertiesOfAbstractBridge
.
class
);
when
(
abMock
.
getDeprecatedProperties
()).
thenReturn
(
propsMock
);
when
(
abMock
.
getDeprecatedProperties
()).
thenReturn
(
propsMock
);
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
abMock
);
BridgeObject
bo
=
new
BridgeObject
(
abMock
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
bo
.
addBoundarySurface
(
bsMock
);
bo
.
addBoundarySurface
(
bsMock
);
...
@@ -293,14 +293,14 @@ public class BridgeObjectTest {
...
@@ -293,14 +293,14 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testGetFeatureType
()
{
public
void
testGetFeatureType
()
{
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
abMock
);
BridgeObject
bo
=
new
BridgeObject
(
abMock
);
assertEquals
(
FeatureType
.
BRIDGE
,
bo
.
getFeatureType
());
assertEquals
(
FeatureType
.
BRIDGE
,
bo
.
getFeatureType
());
}
}
@Test
@Test
public
void
testGetType
()
{
public
void
testGetType
()
{
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
abMock
);
BridgeObject
bo
=
new
BridgeObject
(
abMock
);
assertEquals
(
BridgeType
.
BRIDGE
,
bo
.
getType
());
assertEquals
(
BridgeType
.
BRIDGE
,
bo
.
getType
());
bo
.
setType
(
BridgeType
.
BRIDGE_PART
);
bo
.
setType
(
BridgeType
.
BRIDGE_PART
);
assertEquals
(
BridgeType
.
BRIDGE_PART
,
bo
.
getType
());
assertEquals
(
BridgeType
.
BRIDGE_PART
,
bo
.
getType
());
...
@@ -309,7 +309,7 @@ public class BridgeObjectTest {
...
@@ -309,7 +309,7 @@ public class BridgeObjectTest {
@Test
@Test
public
void
testGetGmlObject
()
{
public
void
testGetGmlObject
()
{
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
AbstractBridge
abMock
=
mock
(
AbstractBridge
.
class
);
BridgeObject
bo
=
new
BridgeObject
(
BridgeType
.
BRIDGE
,
abMock
);
BridgeObject
bo
=
new
BridgeObject
(
abMock
);
assertEquals
(
abMock
,
bo
.
getGmlObject
());
assertEquals
(
abMock
,
bo
.
getGmlObject
());
AbstractBridge
abMock2
=
mock
(
AbstractBridge
.
class
);
AbstractBridge
abMock2
=
mock
(
AbstractBridge
.
class
);
bo
.
setGmlObject
(
abMock2
);
bo
.
setGmlObject
(
abMock2
);
...
...
Prev
1
2
Next
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