X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=test%2Fjalview%2Fgui%2FAlignmentPanelTest.java;h=58f732448156dcb9c4ba1fc62b01e6057cb51cf6;hb=be135cc167b7374baa0ab0b18f31a3185389f59a;hp=2819dbfc405358908abbffd38dae360cd1fedd37;hpb=e6bdfc097a52ca0440f025dcdb9c787085a96477;p=jalview.git diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 2819dbf..58f7324 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -31,6 +31,10 @@ import jalview.io.DataSourceType; import jalview.io.FileLoader; import jalview.viewmodel.ViewportRanges; +import java.lang.reflect.InvocationTargetException; + +import javax.swing.SwingUtilities; + import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -131,7 +135,7 @@ public class AlignmentPanelTest AlignFrame af; @BeforeMethod(alwaysRun = true) - public void setUp() + public void setUp() throws InvocationTargetException, InterruptedException { Jalview.main(new String[] { "-nonews", "-props", "test/jalview/testProps.jvprops" }); @@ -140,6 +144,15 @@ public class AlignmentPanelTest Boolean.TRUE.toString()); af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", DataSourceType.FILE); + + /* + * ensure the panel has been repainted and so ViewportRanges set + */ + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + af.repaint(); + }}); /* * wait for Consensus thread to complete @@ -222,7 +235,7 @@ public class AlignmentPanelTest /** * Test that update layout reverts to original (unwrapped) values for endRes - * and endSeq when switching from wrapped to unwrapped mode (JAL-2739) + * when switching from wrapped back to unwrapped mode (JAL-2739) */ @Test(groups = "Functional") public void TestUpdateLayout_endRes() @@ -235,14 +248,14 @@ public class AlignmentPanelTest af.alignPanel.getAlignViewport().setWrapAlignment(true); af.alignPanel.updateLayout(); - // endRes changes + // endRes has changed assertNotEquals(ranges.getEndRes(), endres); // unwrap af.alignPanel.getAlignViewport().setWrapAlignment(false); af.alignPanel.updateLayout(); - // endRes and endSeq back to original values + // endRes back to original value assertEquals(ranges.getEndRes(), endres); }