X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignViewportTest.java;fp=test%2Fjalview%2Fgui%2FAlignViewportTest.java;h=9c1a4126911f3c6cd3e2e31dd63760709e195932;hb=586ade46bdcd05ff028a1cff82c3c527326d28ec;hp=d6c875bba5aba6fa74e8e197e3afd481ead875c4;hpb=adcef27f5747b4e70e89a56c3735bc3afb8ce9bf;p=jalview.git diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index d6c875b..9c1a412 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -57,6 +57,7 @@ import jalview.structure.StructureSelectionManager; import jalview.util.MapList; import jalview.viewmodel.AlignmentViewport; import jalview.viewmodel.ViewportRanges; +import jalview.workers.AlignCalcManager; public class AlignViewportTest { @@ -75,14 +76,16 @@ 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" }); /* * remove any sequence mappings left lying around by other tests */ StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); + .getStructureSelectionManager(Desktop.getInstance()); ssm.resetAll(); } @@ -130,7 +133,7 @@ public class AlignViewportTest * mappings */ StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); + .getStructureSelectionManager(Desktop.getInstance()); List sequenceMappings = ssm.getSequenceMappings(); assertEquals(2, sequenceMappings.size()); assertTrue(sequenceMappings.contains(acf1)); @@ -152,10 +155,10 @@ public class AlignViewportTest @Test(groups = { "Functional" }) public void testDeregisterMapping_withNoReference() { - Desktop d = Desktop.instance; + Desktop d = Desktop.getInstance(); assertNotNull(d); StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); + .getStructureSelectionManager(Desktop.getInstance()); ssm.resetAll(); AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( @@ -215,10 +218,10 @@ public class AlignViewportTest @Test(groups = { "Functional" }) public void testDeregisterMapping_withReference() { - Desktop d = Desktop.instance; + Desktop d = Desktop.getInstance(); assertNotNull(d); StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); + .getStructureSelectionManager(Desktop.getInstance()); ssm.resetAll(); AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( @@ -282,15 +285,15 @@ public class AlignViewportTest @Test(groups = { "Functional" }, timeOut=2000) public void testUpdateConservation_qualityOnly() { - Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", + Cache.setPropertyNoSave("SHOW_ANNOTATIONS", Boolean.TRUE.toString()); - Cache.applicationProperties.setProperty("SHOW_QUALITY", + Cache.setPropertyNoSave("SHOW_QUALITY", Boolean.TRUE.toString()); - Cache.applicationProperties.setProperty("SHOW_CONSERVATION", + Cache.setPropertyNoSave("SHOW_CONSERVATION", Boolean.FALSE.toString()); - Cache.applicationProperties.setProperty("SHOW_OCCUPANCY", + Cache.setPropertyNoSave("SHOW_OCCUPANCY", Boolean.FALSE.toString()); - Cache.applicationProperties.setProperty("SHOW_IDENTITY", + Cache.setPropertyNoSave("SHOW_IDENTITY", Boolean.FALSE.toString()); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); @@ -321,15 +324,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"); } } @@ -339,8 +346,8 @@ public class AlignViewportTest /* * test for JAL-2283: don't inadvertently turn on colour by conservation */ - Cache.applicationProperties.setProperty("DEFAULT_COLOUR_PROT", "None"); - Cache.applicationProperties.setProperty("SHOW_CONSERVATION", + Cache.setPropertyNoSave("DEFAULT_COLOUR_PROT", "None"); + Cache.setPropertyNoSave("SHOW_CONSERVATION", Boolean.TRUE.toString()); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); @@ -482,7 +489,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" })