JAL-1767 test that changing view association for PCA panel can be restored features/pca_jaxb_datasetrefs_JAL-3171_JAL-3063_JAL-1767
authorJim Procter <jprocter@issues.jalview.org>
Tue, 15 Jan 2019 13:12:10 +0000 (13:12 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 15 Jan 2019 13:12:10 +0000 (13:12 +0000)
test/jalview/project/Jalview2xmlTests.java

index fb2d3e9..3f4ed71 100644 (file)
@@ -1120,15 +1120,18 @@ public class Jalview2xmlTests extends Jalview2xmlBase
       AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile,
               DataSourceType.FILE);
       assertNotNull(af, "Didn't read in the example file correctly.");
+      AlignmentPanel origView = (AlignmentPanel) af.getAlignPanels().get(0);
       AlignmentPanel newview = af.newView(PCAVIEWNAME, true);
       // create another for good measure
       af.newView("Not the PCA View", true);
-      PCAPanel pcaPanel = new PCAPanel(newview, "BLOSUM62",
+      PCAPanel pcaPanel = new PCAPanel(origView, "BLOSUM62",
               new SimilarityParams(true, true, true, false));
-
       // we're in the test exec thread, so we can just run synchronously here
       pcaPanel.run();
 
+      // now switch the linked view
+      pcaPanel.selectAssociatedView(newview);
+
       assertTrue(pcaPanel.getAlignViewport() == newview.getAlignViewport(),
               "PCA should be associated with 'With PCA' view: test is broken");