JAL-2154 [test] verify reference integrity for alignment/dataset after each retrieval...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 16 Aug 2016 13:41:35 +0000 (14:41 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 16 Aug 2016 16:49:53 +0000 (17:49 +0100)
test/jalview/io/CrossRef2xmlTests.java

index 56ffa52..d8cf9eb 100644 (file)
@@ -26,6 +26,7 @@ import jalview.analysis.CrossRef;
 import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.AlignedCodonFrame;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentTest;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
 import jalview.gui.CrossRefAction;
@@ -96,6 +97,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase
           af = jalview.gui.SequenceFetcher.fetchAndShow(did[0], did[1])
                   .get(0);
           assertTrue("Didn't retrieve " + first, af != null);
+
+          // verify references for retrieved data
+          AlignmentTest.verifyAlignmentDatasetRefs(af.getViewport()
+                  .getAlignment(), true);
+
           // store project to recover on next pass
           stringify(dbtoviewBit, savedProjects, first, af.alignPanel);
         }
@@ -105,6 +111,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase
           // recover stored project
           af = new FileLoader(false).LoadFileWaitTillLoaded(savedProjects
                   .get(first).toString(), FormatAdapter.FILE);
+
+          // verify references for recovered data
+          AlignmentTest.verifyAlignmentDatasetRefs(af.getViewport()
+                  .getAlignment(), true);
+
         }
 
         boolean dna = af.getViewport().getAlignment().isNucleotide();
@@ -175,6 +186,9 @@ public class CrossRef2xmlTests extends Jalview2xmlBase
             }
             for (AlignmentViewPanel avp : cra_views)
             {
+              // verify references for this panel
+              AlignmentTest.verifyAlignmentDatasetRefs(avp.getAlignment(),
+                      true);
 
               SequenceI[] xrseqs = avp.getAlignment().getSequencesArray();
               nextxref = first + " -> " + db + "{" + p++ + "}";
@@ -247,6 +261,11 @@ public class CrossRef2xmlTests extends Jalview2xmlBase
                   {
                     nextnextxref = "{" + p + "}" + nextxref + " -> "
                             + xrefdb + "{" + q++ + "}";
+
+                    // verify references for this panel
+                    AlignmentTest.verifyAlignmentDatasetRefs(
+                            nextavp.getAlignment(), true);
+
                     viewsourcedb.put(nextavp, nextnextxref);
                     stringify(dbtoviewBit, savedProjects, nextnextxref,
                             nextavp);