JAL-1772 JAL-2164 make expanded view save/restore test pass when run in isolation...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 29 Jul 2016 16:37:32 +0000 (17:37 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 29 Jul 2016 16:38:03 +0000 (17:38 +0100)
test/jalview/io/Jalview2xmlTests.java

index 38153df..26fba58 100644 (file)
@@ -364,9 +364,7 @@ public class Jalview2xmlTests
   }
 
   /**
-   * test store and recovery of expanded views - currently this is disabled
-   * since the Desktop.explodeViews method doesn't seem to result in the views
-   * being expanded to distinct align frames when executed programmatically.
+   * test store and recovery of expanded views
    * 
    * @throws Exception
    */
@@ -377,24 +375,9 @@ public class Jalview2xmlTests
             "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
     String afid = af.getViewport().getSequenceSetId();
-    {
-      final AlignFrame xaf = af;
-      af = null;
-      new Thread(new Runnable()
-      {
-        @Override
-        public void run()
-        {
-          Desktop.instance.explodeViews(xaf);
-        }
-      }).start();
-      Thread.sleep(1000);
-    }
-    // int times = 0;
-    // while (++times < 5 && Desktop.getAlignFrames().length < )
-    // {
-    // Thread.sleep(300);
-    // }
+
+    Desktop.explodeViews(Desktop.getAlignFrameFor(af.getViewport()));
+
     int oldviews = Desktop.getAlignFrames().length;
     Assert.assertEquals(Desktop.getAlignFrames().length,
             Desktop.getAlignmentPanels(afid).length);