import jalview.io.FileLoader;
import jalview.viewmodel.ViewportRanges;
+import java.lang.reflect.InvocationTargetException;
+
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
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
{
try
{
- wait(50);
+ wait(250); // BH was 50
} catch (InterruptedException e)
{
}
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 +
scrollpos = 130;
af.getViewport().showAllHiddenColumns();
af.alignPanel.setScrollValues(scrollpos, 5);
+ af.paintImmediately(af.getBounds());
assertEquals(ranges.getEndRes(), af.getViewport()
.getAlignment().getWidth() - 1);
// 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
/**
* 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()
// wrap
af.alignPanel.getAlignViewport().setWrapAlignment(true);
af.alignPanel.updateLayout();
+ af.paintImmediately(af.getBounds());
- // 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
+ af.paintImmediately(af.getBounds());
+ // endRes back to original value
assertEquals(ranges.getEndRes(), endres);
}