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
ee22bc29
Commit
ee22bc29
authored
Jul 29, 2025
by
Luna Riegel
Browse files
Test: Fix Copy.Copy failure for LinkedPolygons
parent
4b335e3e
Pipeline
#11769
passed with stage
in 1 minute and 43 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/database/DatabaseHandler.java
View file @
ee22bc29
package
de.hft.stuttgart.citydoctor2.database
;
package
de.hft.stuttgart.citydoctor2.database
;
import
de.hft.stuttgart.citydoctor2.check.CheckableUtilsVisitor
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundingBox
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundingBox
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Geometry
;
import
de.hft.stuttgart.citydoctor2.datastructure.GmlId
;
import
de.hft.stuttgart.citydoctor2.datastructure.GmlId
;
import
de.hft.stuttgart.citydoctor2.utils.Pair
;
import
org.apache.commons.lang3.SerializationUtils
;
import
org.apache.commons.lang3.SerializationUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -97,7 +98,15 @@ public class DatabaseHandler {
...
@@ -97,7 +98,15 @@ public class DatabaseHandler {
ResultSet
rs
=
ps
.
executeQuery
();
ResultSet
rs
=
ps
.
executeQuery
();
if
(
rs
.
next
())
{
if
(
rs
.
next
())
{
try
(
InputStream
is
=
rs
.
getBinaryStream
(
"data"
))
{
try
(
InputStream
is
=
rs
.
getBinaryStream
(
"data"
))
{
return
SerializationUtils
.
deserialize
(
is
);
CityObject
co
=
SerializationUtils
.
deserialize
(
is
);
// Rebuild the adjacency maps
co
.
accept
(
new
CheckableUtilsVisitor
()
{
@Override
public
void
check
(
Geometry
geom
)
{
geom
.
updateVertices
();
}
});
return
co
;
}
}
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Geometry.java
View file @
ee22bc29
...
@@ -351,7 +351,6 @@ public class Geometry extends GmlElement {
...
@@ -351,7 +351,6 @@ public class Geometry extends GmlElement {
in
.
defaultReadObject
();
in
.
defaultReadObject
();
edges
=
new
ArrayList
<>();
edges
=
new
ArrayList
<>();
edgeMap
=
new
HashMap
<>();
edgeMap
=
new
HashMap
<>();
updateVertices
();
}
}
public
void
clearMetaData
()
{
public
void
clearMetaData
()
{
...
...
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/datastructure/BuildingTest.java
View file @
ee22bc29
...
@@ -76,6 +76,7 @@ public class BuildingTest {
...
@@ -76,6 +76,7 @@ public class BuildingTest {
assertEquals
(
b
.
getGmlId
(),
copy
.
getGmlId
());
assertEquals
(
b
.
getGmlId
(),
copy
.
getGmlId
());
copy
.
prepareForChecking
();
Geometry
copyGeom
=
copy
.
getGeometries
().
get
(
0
);
Geometry
copyGeom
=
copy
.
getGeometries
().
get
(
0
);
assertNotSame
(
geom
,
copyGeom
);
assertNotSame
(
geom
,
copyGeom
);
...
...
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