JAL-1369 fix the test
authorJim Procter <jprocter@issues.jalview.org>
Tue, 21 Jun 2016 09:19:17 +0000 (10:19 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 21 Jun 2016 09:19:17 +0000 (10:19 +0100)
test/jalview/io/Jalview2xmlTests.java

index 21bf846..8ef6ef4 100644 (file)
@@ -464,15 +464,20 @@ public class Jalview2xmlTests
     {
       AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
             tfile.getAbsolutePath(), FormatAdapter.FILE);
+      afid = af.getViewport().getSequenceSetId();
     }
-    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(Desktop
-            .getAlignFrames()[0].getViewport().getSequenceSetId()))
+    for (AlignmentViewPanel ap : Desktop.getAlignmentPanels(afid))
     {
       // check representative
       SequenceI rep = ap.getAlignment().getSeqrep();
       Assert.assertNotNull(rep,
               "Couldn't restore sequence representative from project");
-      Assert.assertEquals(refs.get(ap.getViewName()), rep,
+      // can't use a strong equals here, because by definition, the sequence IDs
+      // will be different.
+      // could set vamsas session save/restore flag to preserve IDs across
+      // load/saves.
+      Assert.assertEquals(refs.get(ap.getViewName()).toString(),
+              rep.toString(),
               "Representative wasn't the same when recovered.");
       Assert.assertTrue(ap.getAlignViewport().isDisplayReferenceSeq(),
               "Display reference sequence view setting not set.");