X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignViewportTest.java;h=341a8143b1b15f98b08a650165c288bcd4204b44;hb=528c0f1815bc67b54618ad5b16c2162946974caf;hp=dc9113c4b81eeebe6df28b98f24c7405a682ed3b;hpb=d37cf2412f01d6cae5d62ae549ec534785e20ed4;p=jalview.git diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index dc9113c..341a814 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -26,9 +26,13 @@ import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.bin.Cache; +import jalview.bin.Jalview; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.PDBEntry.Type; import jalview.datamodel.Sequence; @@ -55,8 +59,7 @@ public class AlignViewportTest @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception { - jalview.bin.Jalview.main(new String[] { "-props", - "test/jalview/testProps.jvprops" }); + Jalview.main(new String[] { "-props", "test/jalview/testProps.jvprops" }); } @BeforeMethod(alwaysRun = true) @@ -74,15 +77,16 @@ public class AlignViewportTest @Test(groups = { "Functional" }) public void testCollateForPdb() { + // JBP: What behaviour is this supposed to test ? /* * Set up sequence pdb ids */ - PDBEntry pdb1 = new PDBEntry("1ABC", "A", Type.PDB, "1ABC.pdb"); - PDBEntry pdb2 = new PDBEntry("2ABC", "A", Type.PDB, "2ABC.pdb"); - PDBEntry pdb3 = new PDBEntry("3ABC", "A", Type.PDB, "3ABC.pdb"); + PDBEntry pdb1 = new PDBEntry("1ABC", "B", Type.PDB, "1ABC.pdb"); + PDBEntry pdb2 = new PDBEntry("2ABC", "C", Type.PDB, "2ABC.pdb"); + PDBEntry pdb3 = new PDBEntry("3ABC", "D", Type.PDB, "3ABC.pdb"); /* - * seq1 and seq3 refer to 1ABC, seq2 to 2ABC, none to 3ABC + * seq1 and seq3 refer to 1abcB, seq2 to 2abcC, none to 3abcD */ al.getSequenceAt(0).getDatasetSequence() .addPDBId(new PDBEntry("1ABC", "B", Type.PDB, "1ABC.pdb")); @@ -296,4 +300,33 @@ public class AlignViewportTest assertTrue(ssmMappings.contains(acf2)); assertFalse(ssmMappings.contains(acf3)); } + + /** + * Test for JAL-1306 - conservation thread should run even when only Quality + * (and not Conservation) is enabled in Preferences + */ + @Test(groups = { "Functional" }) + public void testUpdateConservation_qualityOnly() + { + Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", + Boolean.TRUE.toString()); + Cache.applicationProperties.setProperty("SHOW_QUALITY", + Boolean.TRUE.toString()); + Cache.applicationProperties.setProperty("SHOW_CONSERVATION", + Boolean.FALSE.toString()); + Cache.applicationProperties.setProperty("SHOW_IDENTITY", + Boolean.FALSE.toString()); + AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( + "examples/uniref50.fa", FormatAdapter.FILE); + AlignmentAnnotation[] anns = af.viewport.getAlignment() + .getAlignmentAnnotation(); + assertNotNull("No annotations found", anns); + assertEquals("More than one annotation found", 1, anns.length); + assertTrue("Annotation is not Quality", + anns[0].description.startsWith("Alignment Quality")); + Annotation[] annotations = anns[0].annotations; + assertNotNull("Quality annotations are null", annotations); + assertNotNull("Quality in column 1 is null", annotations[0]); + assertTrue("No quality value in column 1", annotations[0].value > 10f); + } }