From: BobHanson Date: Sat, 4 Apr 2020 16:21:05 +0000 (-0500) Subject: JAL-3253 JAL-3032 upgrade to SwingJS-3.2.9.v1e complete 2/2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b2761facaf7c85bf37dc48b4485fd733a7d3e989;p=jalview.git JAL-3253 JAL-3032 upgrade to SwingJS-3.2.9.v1e complete 2/2 - random tests failing can be ignored (just thread timing issues) (AlignmentPanelTest and SeqCanvasTest). Problem is clearly from concurrent thread interference not likely to affect standard operation. - branch can be deleted after merging. --- diff --git a/test/jalview/gui/SeqCanvasTest.java b/test/jalview/gui/SeqCanvasTest.java index e73b805..f7c4615 100644 --- a/test/jalview/gui/SeqCanvasTest.java +++ b/test/jalview/gui/SeqCanvasTest.java @@ -27,7 +27,6 @@ import jalview.bin.Jalview; import jalview.datamodel.AlignmentI; import jalview.io.DataSourceType; import jalview.io.FileLoader; -import jalview.viewmodel.ViewportRanges; import java.awt.Font; import java.awt.FontMetrics; @@ -401,7 +400,7 @@ public class SeqCanvasTest // // }); // - ViewportRanges.sTest = ""; + Thread.currentThread().setName("SeqCanvasTest fromScrolled " + ++nTest); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); @@ -410,12 +409,8 @@ public class SeqCanvasTest AlignmentI al = av.getAlignment(); assertEquals(al.getWidth(), 157); assertEquals(al.getHeight(), 15); - String s = ""; - s += "flushing events"; flushEvents(); - s += "events flushed"; av.getRanges().setStartEndSeq(0, 3); - s += " SC1 " + av.getRanges() + " " + ViewportRanges.sTest; av.setShowAnnotation(false); av.setScaleAboveWrapped(true); SeqCanvas testee = af.alignPanel.getSeqPanel().seqCanvas; @@ -432,7 +427,8 @@ public class SeqCanvasTest testee.calculateWrappedGeometry(canvasWidth, canvasHeight); int repeatingHeight = (int) PA.getValue(testee, "wrappedRepeatHeightPx"); - assertEquals(av.getRanges().getEndSeq(), 3, "endSeq should be 3 " + s); // unchanged + assertEquals(av.getRanges().getEndSeq(), 3, + "endSeq should be 3 but may be 13 if scrollbar update thread interferes"); // unchanged assertEquals(repeatingHeight, charHeight * (2 + al.getHeight())); }