Skip to content

Commit 6e36db5

Browse files
committed
Structural sites: database write / read roundtrip test
1 parent ea36c43 commit 6e36db5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

vcell-server/src/test/java/cbit/vcell/modeldb/SpeciesContextSpecTableTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ public void test_springsalad_application() throws IOException, XmlParseException
119119
assertTrue(structuralSiteAttributesMap.size() == scs.getStructuralSiteAttributesMap().size() ? true : false, "structuralSiteAttributesMap size different after roundtrip");
120120
StructuralSite ssThis = structuralSiteAttributesMap.keySet().iterator().next();
121121
SiteAttributesSpec ssasThis = structuralSiteAttributesMap.get(ssThis);
122-
SiteAttributesSpec ssasThat = scs.getStructuralSiteAttributesMap().get(ssThis);
122+
SiteAttributesSpec ssasThat = null; // we can't use ssThis as key to get the value from scs because
123+
// the instances are different after round tripping, so we have to loop through the keys and compare by name
124+
for (StructuralSite ss : scs.getStructuralSiteAttributesMap().keySet()) {
125+
if (ss.getName().equals(ssThis.getName())) {
126+
ssasThat = scs.getStructuralSiteAttributesMap().get(ss);
127+
}
128+
}
123129
assertTrue(ssasThis.compareEqual(ssasThat) ? true : false, "SiteAttributesSpec element not found in structuralSiteAttributesMap after roundtrip");
124130
}
125131

0 commit comments

Comments
 (0)