JAL-2349 store/restore mappable contact matrix in project and fix up interactive...
[jalview.git] / test / jalview / project / Jalview2xmlTests.java
index 81756e0..343df05 100644 (file)
@@ -100,6 +100,7 @@ import jalview.util.MapList;
 import jalview.util.matcher.Condition;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.seqfeatures.FeatureRendererModel;
+import jalview.ws.datamodel.MappableContactMatrixI;
 import jalview.ws.datamodel.alphafold.PAEContactMatrix;
 
 @Test(singleThreaded = true)
@@ -1590,13 +1591,22 @@ public class Jalview2xmlTests extends Jalview2xmlBase
     ContactMatrixI restoredMat = newSeq
             .getContactMatrixFor(newSeq.getAnnotation()[0]);
     Assert.assertNotNull(restoredMat);
+    MapList oldMap = ((MappableContactMatrixI) dummyMat).getMapFor(sq);
+    MapList newMap = ((MappableContactMatrixI) restoredMat).getMapFor(newSeq);
+    Assert.assertEquals(oldMap.getFromRanges(),newMap.getFromRanges());
+    Assert.assertEquals(oldMap.getToRanges(),newMap.getToRanges());
+    Assert.assertEquals(oldMap.getFromRatio(),newMap.getFromRatio());
+    Assert.assertEquals(oldMap.getToRatio(),newMap.getToRatio());
+    
     for (i = sq.getLength() - 1; i >= 0; i--)
     {
       ContactListI oldCM = dummyMat.getContactList(i),
               newCM = restoredMat.getContactList(i);
       for (int j = oldCM.getContactHeight(); j >= 0; j--)
       {
-        Assert.assertEquals(oldCM.getContactAt(j), newCM.getContactAt(j));
+        double old_j=oldCM.getContactAt(j);
+        double new_j=newCM.getContactAt(j);
+        Assert.assertEquals(old_j,new_j);
       }
     }
     Assert.assertEquals(restoredMat.hasGroups(), dummyMat.hasGroups());