JAL-1264 unit tests fixed (have to explicit set annotation sort order)
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Feb 2015 10:24:25 +0000 (10:24 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 10 Feb 2015 10:24:25 +0000 (10:24 +0000)
test/jalview/gui/AnnotationChooserTest.java

index 944ab9c..2b890d2 100644 (file)
@@ -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