JAL-1767 patch buggy PCA view association test
authorJim Procter <jprocter@issues.jalview.org>
Tue, 15 Jan 2019 11:19:39 +0000 (11:19 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 15 Jan 2019 11:19:39 +0000 (11:19 +0000)
test/jalview/project/Jalview2xmlTests.java

index a0f1f6d..fb2d3e9 100644 (file)
@@ -1151,7 +1151,14 @@ public class Jalview2xmlTests extends Jalview2xmlBase
             "PCA and the tabbed alignment view should be the only two windows on the desktop");
     PCAPanel pcaPanel = (PCAPanel) frames[frames[0] == af ? 1 : 0];
 
-    AlignmentViewPanel restoredNewView = af.getAlignPanels().get(1);
+    AlignmentViewPanel restoredNewView = null;
+    for (AlignmentViewPanel alignpanel : Desktop.getAlignmentPanels(null))
+    {
+      if (alignpanel.getAlignViewport() == pcaPanel.getAlignViewport())
+      {
+        restoredNewView = alignpanel;
+      }
+    }
     assertEquals(restoredNewView.getViewName(), PCAVIEWNAME);
     assertTrue(
             restoredNewView.getAlignViewport() == pcaPanel