JAL-3081 autocalculated annotation first/last leaves others unchanged
[jalview.git] / test / jalview / analysis / AnnotationSorterTest.java
index 1c5a7f9..7153f67 100644 (file)
@@ -76,7 +76,7 @@ public class AnnotationSorterTest
    */
   protected AlignmentAnnotation[] buildAnnotations(int numAnns)
   {
-    List<AlignmentAnnotation> annlist = new ArrayList<AlignmentAnnotation>();
+    List<AlignmentAnnotation> annlist = new ArrayList<>();
     for (int i = 0; i < numAnns; i++)
     {
       AlignmentAnnotation ann = new AlignmentAnnotation(SS + i, "", 0);
@@ -115,7 +115,7 @@ public class AnnotationSorterTest
    * </ul>
    */
   @Test(groups = { "Functional" })
-  public void testSortBySequenceAndType_autocalcLast()
+  public void testSortBySequenceAndLabel_autocalcLast()
   {
     // @formatter:off
     anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
@@ -127,7 +127,7 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(3); anns[6].label = "IRP";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al, false);
+    AnnotationSorter testee = new AnnotationSorter(al, false, false);
     testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     assertEquals("label5", anns[0].label); // for sequence 0
     assertEquals("label0", anns[1].label); // for sequence 1
@@ -142,7 +142,7 @@ public class AnnotationSorterTest
    * Variant with autocalculated annotations sorting to front
    */
   @Test(groups = { "Functional" })
-  public void testSortBySequenceAndType_autocalcFirst()
+  public void testSortBySequenceAndLabel_autocalcFirst()
   {
     // @formatter:off
     anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
@@ -154,7 +154,7 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(3); anns[6].label = "IRP";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al, true);
+    AnnotationSorter testee = new AnnotationSorter(al, true, false);
     testee.sort(anns, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     assertEquals("Quality", anns[0].label); // autocalc annotations
     assertEquals("Consensus", anns[1].label); // retain ordering
@@ -178,7 +178,7 @@ public class AnnotationSorterTest
    * </ul>
    */
   @Test(groups = { "Functional" })
-  public void testSortByTypeAndSequence_autocalcLast()
+  public void testSortByLabelAndSequence_autocalcLast()
   {
     // @formatter:off
     anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
@@ -190,7 +190,7 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al, false);
+    AnnotationSorter testee = new AnnotationSorter(al, false, false);
     testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     assertEquals("IRON", anns[0].label); // IRON / sequence 0
     assertEquals("iron", anns[1].label); // iron / sequence 3
@@ -205,7 +205,7 @@ public class AnnotationSorterTest
    * Variant of test with autocalculated annotations sorted to front
    */
   @Test(groups = { "Functional" })
-  public void testSortByTypeAndSequence_autocalcFirst()
+  public void testSortByLabelAndSequence_autocalcFirst()
   {
     // @formatter:off
     anns[0].sequenceRef = al.getSequenceAt(1); anns[0].label = "label0";
@@ -217,7 +217,7 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al, true);
+    AnnotationSorter testee = new AnnotationSorter(al, true, false);
     testee.sort(anns, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     assertEquals("Quality", anns[0].label); // autocalc annotations
     assertEquals("Consensus", anns[1].label); // retain ordering
@@ -245,7 +245,7 @@ public class AnnotationSorterTest
     anns[6].sequenceRef = al.getSequenceAt(2); anns[6].label = "Structure";
     // @formatter:on
 
-    AnnotationSorter testee = new AnnotationSorter(al, true);
+    AnnotationSorter testee = new AnnotationSorter(al, true, false);
     testee.sort(anns, SequenceAnnotationOrder.NONE);
     assertEquals("Quality", anns[0].label); // autocalc annotations
     assertEquals("Consensus", anns[1].label); // retain ordering
@@ -287,7 +287,7 @@ public class AnnotationSorterTest
       annotations[i].label = "label" + i;
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(alignment, false);
+    AnnotationSorter testee = new AnnotationSorter(alignment, false, false);
     testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     long endTime = System.currentTimeMillis();
     final long elapsed = endTime - startTime;
@@ -331,7 +331,7 @@ public class AnnotationSorterTest
       annotations[i].label = "label" + i;
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(alignment, false);
+    AnnotationSorter testee = new AnnotationSorter(alignment, false, false);
     testee.sort(annotations, SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     long endTime = System.currentTimeMillis();
     final long elapsed = endTime - startTime;
@@ -384,7 +384,7 @@ public class AnnotationSorterTest
       annotations[i].label = labels[r.nextInt(labels.length)];
     }
     long startTime = System.currentTimeMillis();
-    AnnotationSorter testee = new AnnotationSorter(alignment, false);
+    AnnotationSorter testee = new AnnotationSorter(alignment, false, false);
     testee.sort(annotations, SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     long endTime = System.currentTimeMillis();
     long elapsed = endTime - startTime;