X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignmentPanelTest.java;h=fd67ac4d068e4d62e2761a765a2070e0551b2a69;hb=1bbf9cd2904a084b5f4df2db064a477480e5c688;hp=e84b87ae7cef861cdd83f13f773fa7f1b8decdb7;hpb=4e77e758e10a6b83902b3cc21a669da8bcd0dc8f;p=jalview.git diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index e84b87a..fd67ac4 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -31,6 +31,8 @@ import jalview.io.DataSourceType; import jalview.io.FileLoader; import jalview.viewmodel.ViewportRanges; +import java.lang.reflect.InvocationTargetException; + import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -131,15 +133,17 @@ 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" }); - Cache.applicationProperties.setProperty("SHOW_IDENTITY", + Cache.setPropertyNoSave("SHOW_IDENTITY", Boolean.TRUE.toString()); af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", DataSourceType.FILE); + + af.paintImmediately(af.getBounds()); /* * wait for Consensus thread to complete @@ -150,7 +154,7 @@ public class AlignmentPanelTest { try { - wait(50); + wait(250); // BH was 50 } catch (InterruptedException e) { } @@ -189,6 +193,8 @@ public class AlignmentPanelTest int scrollpos = 60; af.getViewport().hideColumns(30, 50); af.alignPanel.setScrollValues(scrollpos, 5); + + af.paintImmediately(af.getBounds()); assertEquals(ranges.getEndRes(), oldres + scrollpos); // scroll to position within hidden columns, still sets endres to oldres + @@ -206,6 +212,7 @@ public class AlignmentPanelTest scrollpos = 130; af.getViewport().showAllHiddenColumns(); af.alignPanel.setScrollValues(scrollpos, 5); + af.paintImmediately(af.getBounds()); assertEquals(ranges.getEndRes(), af.getViewport() .getAlignment().getWidth() - 1); @@ -214,6 +221,7 @@ public class AlignmentPanelTest // endRes should be set to width of alignment - 1 - the number of hidden // columns af.getViewport().hideColumns(30, 50); + af.paintImmediately(af.getBounds()); af.alignPanel.setScrollValues(scrollpos, 5); assertEquals(ranges.getEndRes(), af.getViewport() .getAlignment().getWidth() - 1 - 21); // 21 is the number of hidden @@ -234,6 +242,7 @@ public class AlignmentPanelTest // wrap af.alignPanel.getAlignViewport().setWrapAlignment(true); af.alignPanel.updateLayout(); + af.paintImmediately(af.getBounds()); // endRes has changed assertNotEquals(ranges.getEndRes(), endres); @@ -241,7 +250,7 @@ public class AlignmentPanelTest // unwrap af.alignPanel.getAlignViewport().setWrapAlignment(false); af.alignPanel.updateLayout(); - + af.paintImmediately(af.getBounds()); // endRes back to original value assertEquals(ranges.getEndRes(), endres);