X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignViewportTest.java;h=3ba93bc4f7ac37c463488fb70117f50e71f98ca8;hb=447c5c1b22bd12a78730640321264fb38c39ec7b;hp=959abb086155807e590011b6265180df5a9a7e90;hpb=0356abc2cb7040672bc8fde68cafb77a2d623b5d;p=jalview.git diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index 959abb0..3ba93bc 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -79,9 +79,7 @@ public class AlignViewportTest /* * remove any sequence mappings left lying around by other tests */ - StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); - ssm.resetAll(); + Desktop.getStructureSelectionManager().resetAll(); } @BeforeMethod(alwaysRun = true) @@ -127,9 +125,8 @@ public class AlignViewportTest * Verify that creating the alignment for the new View has registered the * mappings */ - StructureSelectionManager ssm = StructureSelectionManager - .getStructureSelectionManager(Desktop.instance); - List sequenceMappings = ssm.getSequenceMappings(); + List sequenceMappings = Desktop.getInstance() + .getStructureSelectionManager().getSequenceMappings(); assertEquals(2, sequenceMappings.size()); assertTrue(sequenceMappings.contains(acf1)); assertTrue(sequenceMappings.contains(acf2)); @@ -150,10 +147,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); + StructureSelectionManager ssm = Desktop.getInstance() + .getStructureSelectionManager(); ssm.resetAll(); AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( @@ -213,10 +210,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); + StructureSelectionManager ssm = Desktop.getInstance() + .getStructureSelectionManager(); ssm.resetAll(); AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( @@ -277,18 +274,18 @@ 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" }, timeOut=2000) + @Test(groups = { "Functional" }, timeOut = 2000) // BH removed 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(Preferences.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); @@ -299,16 +296,29 @@ public class AlignViewportTest AlignViewport viewport = af.getViewport(); synchronized (this) { + System.out.println("AVT consv: " + + viewport.getAlignmentConservationAnnotation()); + try + { + wait(250); // BH increased from 50 -- was getting Quality in column 1 + // is null + } catch (InterruptedException e) + { + } + System.out.println("AVT consv: " + + viewport.getAlignmentConservationAnnotation()); while (viewport.getAlignmentConservationAnnotation() != null) { try { - wait(50); + wait(250); // BH increased from 50 -- was getting Quality in column 1 + // is null } catch (InterruptedException e) { } } } + af.paintImmediately(af.getBounds()); AlignmentAnnotation[] anns = viewport.getAlignment() .getAlignmentAnnotation(); assertNotNull("No annotations found", anns); @@ -327,8 +337,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); @@ -448,7 +458,6 @@ public class AlignViewportTest { c++; } - ; Assert.assertEquals(c, 1, "Expected to find one occupancy row."); } @@ -465,8 +474,21 @@ public class AlignViewportTest String fasta = ">s1\nA-C\n>s2\nA-C\n>s3\nA-D\n>s4\n--D\n"; AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(fasta, DataSourceType.PASTE); + synchronized (this) + { + try + { + wait(50); + } catch (InterruptedException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + // af.paintImmediately(af.getBounds()); AlignViewport testme = af.getViewport(); SequenceI cons = testme.getConsensusSeq(); + System.out.println("AVT " + cons.getSequenceAsString()); assertEquals("A-C", cons.getSequenceAsString()); }