JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / gui / AnnotationLabelsTest.java
index 31839a9..a4fc1a1 100644 (file)
@@ -62,7 +62,7 @@ public class AnnotationLabelsTest
     ann.description = null;
     assertEquals(AnnotationLabels.getTooltip(ann),
             "<html> Score: 2.34</html>");
-    
+
     /*
      * sequenceref, simple description
      */
@@ -102,4 +102,52 @@ public class AnnotationLabelsTest
     ann.sequenceRef = null;
     assertNull(AnnotationLabels.getTooltip(ann));
   }
+
+  @Test(groups = "Functional")
+  public void testGetStatusMessage()
+  {
+    assertNull(AnnotationLabels.getStatusMessage(null, null));
+
+    /*
+     * simple label
+     */
+    AlignmentAnnotation aa = new AlignmentAnnotation("IUPredWS Short",
+            "Protein disorder", null);
+    assertEquals(AnnotationLabels.getStatusMessage(aa, null),
+            "IUPredWS Short");
+
+    /*
+     * with sequence ref
+     */
+    aa.setSequenceRef(new Sequence("FER_CAPAA", "MIGRKQL"));
+    assertEquals(AnnotationLabels.getStatusMessage(aa, null),
+            "FER_CAPAA : IUPredWS Short");
+
+    /*
+     * with graph group (degenerate, one annotation only)
+     */
+    aa.graphGroup = 1;
+    AlignmentAnnotation aa2 = new AlignmentAnnotation("IUPredWS Long",
+            "Protein disorder", null);
+    assertEquals(
+            AnnotationLabels.getStatusMessage(aa, new AlignmentAnnotation[]
+            { aa, aa2 }), "FER_CAPAA : IUPredWS Short");
+
+    /*
+     * graph group with two members; note labels are appended in
+     * reverse order (matching rendering order on screen)
+     */
+    aa2.graphGroup = 1;
+    assertEquals(
+            AnnotationLabels.getStatusMessage(aa, new AlignmentAnnotation[]
+            { aa, aa2 }), "FER_CAPAA : IUPredWS Long, IUPredWS Short");
+
+    /*
+     * graph group with no sequence ref
+     */
+    aa.sequenceRef = null;
+    assertEquals(
+            AnnotationLabels.getStatusMessage(aa, new AlignmentAnnotation[]
+            { aa, aa2 }), "IUPredWS Long, IUPredWS Short");
+  }
 }