X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignViewportTest.java;h=780125016791750cb8ab79830377d517c86f1c37;hb=43699f9bc6ba2f390d3652f69b6db8975ff727c0;hp=5ed0cacca927f8c850da8f3c8ac609ae7992af24;hpb=e87f3076c7826c6bb2bc54583406f7e719df77ed;p=jalview.git diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index 5ed0cac..7801250 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -277,7 +277,7 @@ public class AlignViewportTest * Test for JAL-1306 - conservation thread should run even when only Quality * (and not Conservation) is enabled in Preferences */ - @Test(groups = { "Functional" }) + @Test(groups = { "Functional" }, timeOut=2000) public void testUpdateConservation_qualityOnly() { Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", @@ -292,7 +292,24 @@ public class AlignViewportTest Boolean.FALSE.toString()); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); - AlignmentAnnotation[] anns = af.viewport.getAlignment() + + /* + * wait for Conservation thread to complete + */ + AlignViewport viewport = af.getViewport(); + synchronized (this) + { + while (viewport.getAlignmentConservationAnnotation() != null) + { + try + { + wait(50); + } catch (InterruptedException e) + { + } + } + } + AlignmentAnnotation[] anns = viewport.getAlignment() .getAlignmentAnnotation(); assertNotNull("No annotations found", anns); assertEquals("More than one annotation found", 1, anns.length);