JAL-1152 menu tweaks plus new option to put Autocalc at top or below.
[jalview.git] / test / jalview / analysis / AnnotationSorterTest.java
index 97dabbc..55dcf6d 100644 (file)
@@ -2,7 +2,7 @@ package jalview.analysis;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import jalview.analysis.AnnotationSorter.SortOrder;
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Sequence;
@@ -97,8 +97,8 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(3); anns[6].label = "IRP";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al);
-    testee.sort(anns, SortOrder.SEQUENCE_AND_TYPE);
+    AnnotationSorter testee = new AnnotationSorter(al, false);
+    testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     assertEquals("label5", anns[0].label); // for sequence 0
     assertEquals("label0", anns[1].label); // for sequence 1
     assertEquals("iron", anns[2].label); // sequence 3 /iron
@@ -133,8 +133,8 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al);
-    testee.sort(anns, SortOrder.TYPE_AND_SEQUENCE);
+    AnnotationSorter testee = new AnnotationSorter(al, false);
+    testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     assertEquals("IRON", anns[0].label); // IRON / sequence 0
     assertEquals("iron", anns[1].label); // iron / sequence 3
     assertEquals("label0", anns[2].label); // label0 / sequence 1
@@ -165,8 +165,8 @@ public class AnnotationSorterTest
       anns[i].label = "label" + i;
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(al);
-    testee.sort(anns, SortOrder.TYPE_AND_SEQUENCE);
+    AnnotationSorter testee = new AnnotationSorter(al, false);
+    testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     long endTime = System.currentTimeMillis();
     final long elapsed = endTime - startTime;
     System.out.println("Timing test for presorted " + numSeqs
@@ -199,8 +199,8 @@ public class AnnotationSorterTest
       anns[i].label = "label" + i;
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(al);
-    testee.sort(anns, SortOrder.SEQUENCE_AND_TYPE);
+    AnnotationSorter testee = new AnnotationSorter(al, false);
+    testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     long endTime = System.currentTimeMillis();
     final long elapsed = endTime - startTime;
     System.out.println("Timing test for unsorted " + numSeqs
@@ -234,8 +234,8 @@ public class AnnotationSorterTest
       anns[i].label = labels[r.nextInt(labels.length)];
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(al);
-    testee.sort(anns, SortOrder.TYPE_AND_SEQUENCE);
+    AnnotationSorter testee = new AnnotationSorter(al, false);
+    testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     long endTime = System.currentTimeMillis();
     long elapsed = endTime - startTime;
     System.out.println("Sort by type for semisorted " + numSeqs
@@ -244,7 +244,7 @@ public class AnnotationSorterTest
 
     // now resort by sequence
     startTime = System.currentTimeMillis();
-    testee.sort(anns, SortOrder.SEQUENCE_AND_TYPE);
+    testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     endTime = System.currentTimeMillis();
     elapsed = endTime - startTime;
     System.out.println("Resort by sequence for semisorted " + numSeqs
@@ -253,7 +253,7 @@ public class AnnotationSorterTest
 
     // now resort by type
     startTime = System.currentTimeMillis();
-    testee.sort(anns, SortOrder.TYPE_AND_SEQUENCE);
+    testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     endTime = System.currentTimeMillis();
     elapsed = endTime - startTime;
     System.out.println("Resort by type for semisorted " + numSeqs