From 38fdd8b8d87931baf4761c1b9da9e5447717df42 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 10 Feb 2015 10:24:25 +0000 Subject: [PATCH] JAL-1264 unit tests fixed (have to explicit set annotation sort order) --- test/jalview/gui/AnnotationChooserTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/jalview/gui/AnnotationChooserTest.java b/test/jalview/gui/AnnotationChooserTest.java index 944ab9c..2b890d2 100644 --- a/test/jalview/gui/AnnotationChooserTest.java +++ b/test/jalview/gui/AnnotationChooserTest.java @@ -3,6 +3,8 @@ package jalview.gui; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; +import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; @@ -52,6 +54,12 @@ public class AnnotationChooserTest @Before public void setUp() throws IOException { + // pin down annotation sort order for test + Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS, + SequenceAnnotationOrder.NONE.name()); + Cache.applicationProperties.setProperty( + Preferences.SHOW_AUTOCALC_ABOVE, Boolean.TRUE.toString()); + AlignmentI al = new jalview.io.FormatAdapter().readFile(TEST_DATA, AppletFormatAdapter.PASTE, "FASTA"); af = new AlignFrame(al, 700, 500); @@ -490,6 +498,7 @@ public class AnnotationChooserTest @Test public void testSelectType_showForSelected() { + // sequences 1 and 2 have annotations IUPred and Jmol selectSequences(1, 2); testee = new AnnotationChooser(parentPanel); final Checkbox showCheckbox = (Checkbox) getComponent(testee, 1, 0, 0); @@ -505,6 +514,7 @@ public class AnnotationChooserTest setSelected(selectedSequencesCheckbox, true); setSelected(hideCheckbox, true); setSelected(getTypeCheckbox("JMol"), true); + assertTrue(anns[5].visible); // JMol for seq3 assertFalse(anns[7].visible); // JMol for seq1 // ...now show them... @@ -738,8 +748,8 @@ public class AnnotationChooserTest assertTrue(anns[0].visible); // Conservation assertTrue(anns[1].visible); // Quality assertTrue(anns[2].visible); // Consensus - assertFalse(anns[3].visible); // IUPRED - assertTrue(anns[4].visible); // Beauty (not seq-related) + assertTrue(anns[3].visible); // Beauty (not seq-related) + assertFalse(anns[4].visible); // IUPRED assertFalse(anns[5].visible); // JMol assertFalse(anns[6].visible); // IUPRED assertFalse(anns[7].visible); // JMol -- 1.7.10.2