X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FJalview2xmlTests.java;h=ddc615f5e7231a590a79a85af25a8437d99bcd36;hb=4eb9955fd442f5fa51c1771d00b6c352ff227a4c;hp=38153df44959f69daef08227e56ea89e800cda2f;hpb=8f5031f8cc3b6da5ce8d639a5b6e0365c1904623;p=jalview.git diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 38153df..ddc615f 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -44,7 +44,9 @@ import jalview.schemes.ColourSchemeI; import jalview.viewmodel.AlignmentViewport; import java.io.File; +import java.time.Instant; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -67,6 +69,9 @@ public class Jalview2xmlTests { jalview.bin.Jalview.main(new String[] { "-props", "test/jalview/io/testProps.jvprops" }); + jalview.bin.Cache.setProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", + Cache.date_format.format(Date.from(Instant.now().plusSeconds( + 3600)))); } /** @@ -364,37 +369,29 @@ 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 */ @Test(groups = { "Functional" }, enabled = true) public void testStoreAndRecoverExpandedviews() throws Exception { + Desktop.instance.closeAll_actionPerformed(null); + AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded( "examples/exampleFile_2_7.jar", FormatAdapter.FILE); assertTrue("Didn't read in the example file correctly.", af != null); + Assert.assertEquals(Desktop.getAlignFrames().length, 1); 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); - // } + + // check FileLoader returned a reference to the one alignFrame that is + // actually on the Desktop + assertTrue( + "Jalview2XML.loadAlignFrame() didn't return correct AlignFrame reference for multiple view window", + af == Desktop.getAlignFrameFor(af.getViewport())); + + Desktop.explodeViews(af); + int oldviews = Desktop.getAlignFrames().length; Assert.assertEquals(Desktop.getAlignFrames().length, Desktop.getAlignmentPanels(afid).length);