import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
-import jalview.util.MessageManager;
import java.awt.BorderLayout;
import java.awt.Checkbox;
import org.junit.Before;
import org.junit.Test;
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
+import jalview.util.MessageManager;
+
/**
* Unit tests for AnnotationChooser
*
@Before
public void setUp() throws IOException
{
+ // pin down annotation sort order for test
+ Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
+ SequenceAnnotationOrder.NONE.name());
+ final String True = Boolean.TRUE.toString();
+ Cache.applicationProperties.setProperty(
+ Preferences.SHOW_AUTOCALC_ABOVE, True);
+ Cache.applicationProperties.setProperty("SHOW_QUALITY", True);
+ Cache.applicationProperties.setProperty("SHOW_CONSERVATION", True);
+ Cache.applicationProperties.setProperty("SHOW_IDENTITY", True);
+
AlignmentI al = new jalview.io.FormatAdapter().readFile(TEST_DATA,
AppletFormatAdapter.PASTE, "FASTA");
af = new AlignFrame(al, 700, 500);
@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);
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...
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