From: BobHanson Date: Wed, 10 Jun 2020 05:03:22 +0000 (-0500) Subject: JAL-3446 AlignViewportTest X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=47d3ff9c908b646ea2ee659b8328976d20c3dd11;p=jalview.git JAL-3446 AlignViewportTest - optionally stops jabaws checking interference; Allows a bit more time, for calculation to start, I think. - passing 8 times in a row --- diff --git a/src/jalview/workers/AlignCalcManager.java b/src/jalview/workers/AlignCalcManager.java index 08ef3a2..c596f05 100644 --- a/src/jalview/workers/AlignCalcManager.java +++ b/src/jalview/workers/AlignCalcManager.java @@ -207,6 +207,10 @@ public class AlignCalcManager implements AlignCalcManagerI } } + public int getQueueLength() { + return inProgress.size(); + } + @Override public void registerWorker(AlignCalcWorkerI worker) { diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index 8a5ef8c..c2983ec 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -35,6 +35,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import jalview.api.AlignCalcWorkerI; import jalview.bin.Cache; import jalview.bin.Jalview; import jalview.datamodel.AlignedCodonFrame; @@ -55,6 +56,7 @@ import jalview.schemes.PIDColourScheme; import jalview.structure.StructureSelectionManager; import jalview.util.MapList; import jalview.viewmodel.ViewportRanges; +import jalview.workers.AlignCalcManager; public class AlignViewportTest { @@ -73,7 +75,9 @@ public class AlignViewportTest @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { - Jalview.main(new String[] { "-nonews", "-props", + Jalview.main(new String[] { + //"-jabaws", "none", + "-nonews", "-props", "test/jalview/testProps.jvprops" }); /* @@ -319,15 +323,19 @@ public class AlignViewportTest { synchronized (this) { - while (viewport.getCalcManager().isWorking()) + System.out.print("waiting..."); + int n = 3; + while (--n >= 0 || viewport.getCalcManager().isWorking()) { try { + System.out.print(((AlignCalcManager) viewport.getCalcManager()).getQueueLength()); wait(50); } catch (InterruptedException e) { } } + System.out.println("...done"); } } @@ -478,7 +486,10 @@ public class AlignViewportTest AlignViewport testme = af.getViewport(); waitForCalculations(testme); SequenceI cons = testme.getConsensusSeq(); - assertEquals("A-C", cons.getSequenceAsString()); + String s = cons.getSequenceAsString(); + System.out.println("s is " + s); + + assertEquals("A-C", s); } @Test(groups = { "Functional" })