String st = Thread.currentThread().toString();
sTest += "ViewPortRanges.setEndseqTest " + val + " "
+ st + "\n";
- if (st.indexOf("Event") >= 0)
+ if (val == 13)
{
sTest += Arrays.toString(new NullPointerException().getStackTrace())
- .substring(0, 500)
+ .replace(',', '\n')
+ "\n";
}
endSeq = val;
* @param seq
* sequence position
*/
+ synchronized
public void setStartSeq(int seq)
{
int height = getViewportHeight();
import java.awt.Font;
import java.awt.FontMetrics;
+import java.awt.Toolkit;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
@Test(groups = "Functional")
public void testCalculateWrappedGeometry_fromScrolled()
{
+ flushEvents();
+ ViewportRanges.sTest = "";
Thread.currentThread().setName("SeqCanvasTest fromScrolled " + ++nTest);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignmentI al = av.getAlignment();
assertEquals(al.getWidth(), 157);
assertEquals(al.getHeight(), 15);
+ flushEvents();
av.getRanges().setStartEndSeq(0, 3);
String s = "";
s += " SC1 " + av.getRanges() + " " + ViewportRanges.sTest;
assertEquals(av.getRanges().getEndSeq(), 0, "endSeq should be 3 " + s); // unchanged
assertEquals(repeatingHeight, charHeight * (2 + al.getHeight()));
}
+
+ private static void flushEvents()
+ {
+ ((sun.awt.SunToolkit) Toolkit.getDefaultToolkit()).flushPendingEvents();
+ }
}