JAL-1645 source formatting and organise imports
[jalview.git] / test / jalview / datamodel / SequenceTest.java
index 4d08b15..f1b93e1 100644 (file)
@@ -15,12 +15,13 @@ public class SequenceTest
 {
   SequenceI seq;
 
- @BeforeMethod(alwaysRun = true)
+  @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
     seq = new Sequence("FER1", "AKPNGVL");
   }
-  @Test(groups ={ "Functional" })
+
+  @Test(groups = { "Functional" })
   public void testInsertGapsAndGapmaps()
   {
     SequenceI aseq = seq.deriveSequence();
@@ -35,7 +36,7 @@ public class SequenceTest
     assertEquals("Gap interval 2 end wrong", 8, gapInt.get(1)[1]);
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetAnnotation()
   {
     // initial state returns null not an empty array
@@ -51,12 +52,15 @@ public class SequenceTest
     assertNull(seq.getAnnotation());
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetAnnotation_forLabel()
   {
-    AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1", 1f);
-    AlignmentAnnotation ann2 = addAnnotation("label2", "desc2", "calcId2", 1f);
-    AlignmentAnnotation ann3 = addAnnotation("label1", "desc3", "calcId3", 1f);
+    AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1",
+            1f);
+    AlignmentAnnotation ann2 = addAnnotation("label2", "desc2", "calcId2",
+            1f);
+    AlignmentAnnotation ann3 = addAnnotation("label1", "desc3", "calcId3",
+            1f);
     AlignmentAnnotation[] anns = seq.getAnnotation("label1");
     assertEquals(2, anns.length);
     assertSame(ann1, anns[0]);
@@ -64,17 +68,16 @@ public class SequenceTest
   }
 
   private AlignmentAnnotation addAnnotation(String label,
-          String description, String calcId,
-          float value)
+          String description, String calcId, float value)
   {
-    final AlignmentAnnotation annotation = new AlignmentAnnotation(label, description,
-            value);
+    final AlignmentAnnotation annotation = new AlignmentAnnotation(label,
+            description, value);
     annotation.setCalcId(calcId);
     seq.addAlignmentAnnotation(annotation);
     return annotation;
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetAlignmentAnnotations_forCalcIdAndLabel()
   {
     AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1",
@@ -85,16 +88,14 @@ public class SequenceTest
             1f);
     AlignmentAnnotation ann4 = addAnnotation("label2", "desc3", "calcId2",
             1f);
-    AlignmentAnnotation ann5 = addAnnotation("label5", "desc3", null,
-            1f);
-    AlignmentAnnotation ann6 = addAnnotation(null, "desc3", "calcId3",
-            1f);
+    AlignmentAnnotation ann5 = addAnnotation("label5", "desc3", null, 1f);
+    AlignmentAnnotation ann6 = addAnnotation(null, "desc3", "calcId3", 1f);
     List<AlignmentAnnotation> anns = seq.getAlignmentAnnotations("calcId2",
             "label2");
     assertEquals(2, anns.size());
     assertSame(ann2, anns.get(0));
     assertSame(ann4, anns.get(1));
-    
+
     assertTrue(seq.getAlignmentAnnotations("calcId2", "label3").isEmpty());
     assertTrue(seq.getAlignmentAnnotations("calcId3", "label5").isEmpty());
     assertTrue(seq.getAlignmentAnnotations("calcId2", null).isEmpty());
@@ -107,7 +108,7 @@ public class SequenceTest
    * setting the sequenceRef on the annotation. Adding the same annotation twice
    * should be ignored.
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testAddAlignmentAnnotation()
   {
     assertNull(seq.getAnnotation());
@@ -137,7 +138,7 @@ public class SequenceTest
 
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetStartGetEnd()
   {
     SequenceI seq = new Sequence("test", "ABCDEF");
@@ -157,7 +158,7 @@ public class SequenceTest
    * Tests for the method that returns an alignment column position (base 1) for
    * a given sequence position (base 1).
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testFindIndex()
   {
     SequenceI seq = new Sequence("test", "ABCDEF");
@@ -185,7 +186,7 @@ public class SequenceTest
    * Tests for the method that returns a dataset sequence position (base 1) for
    * an aligned column position (base 0).
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testFindPosition()
   {
     SequenceI seq = new Sequence("test", "ABCDEF");
@@ -220,7 +221,7 @@ public class SequenceTest
     assertEquals(7, seq.findPosition(11));
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testDeleteChars()
   {
     SequenceI seq = new Sequence("test", "ABCDEF");
@@ -238,7 +239,7 @@ public class SequenceTest
     assertEquals(6, seq.getEnd());
   }
 
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testInsertCharAt()
   {
     // non-static methods:
@@ -255,7 +256,7 @@ public class SequenceTest
    * Test the method that returns an array of aligned sequence positions where
    * the array index is the data sequence position (both base 0).
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGapMap()
   {
     SequenceI seq = new Sequence("test", "-A--B-CD-E--F-");
@@ -267,7 +268,7 @@ public class SequenceTest
    * Test the method that gets sequence features, either from the sequence or
    * its dataset.
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetSequenceFeatures()
   {
     SequenceI seq = new Sequence("test", "GATCAT");
@@ -316,7 +317,7 @@ public class SequenceTest
    * entries are the residue positions at the sequence position (or to the right
    * if a gap)
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testFindPositionMap()
   {
     /*
@@ -327,14 +328,14 @@ public class SequenceTest
      */
     Sequence seq = new Sequence("TestSeq", "AB.C-D E.");
     int[] map = seq.findPositionMap();
-    assertEquals(Arrays.toString(new int[]
-    { 1, 2, 3, 3, 4, 4, 5, 5, 6 }), Arrays.toString(map));
+    assertEquals(Arrays.toString(new int[] { 1, 2, 3, 3, 4, 4, 5, 5, 6 }),
+            Arrays.toString(map));
   }
 
   /**
    * Test for getSubsequence
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testGetSubsequence()
   {
     SequenceI seq = new Sequence("TestSeq", "ABCDEFG");
@@ -354,7 +355,7 @@ public class SequenceTest
   /**
    * Test for deriveSequence applied to a sequence with a dataset
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testDeriveSequence_existingDataset()
   {
     SequenceI seq = new Sequence("Seq1", "CD");
@@ -369,7 +370,7 @@ public class SequenceTest
   /**
    * Test for deriveSequence applied to an ungapped sequence with no dataset
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testDeriveSequence_noDatasetUngapped()
   {
     SequenceI seq = new Sequence("Seq1", "ABCDEF");
@@ -384,7 +385,7 @@ public class SequenceTest
   /**
    * Test for deriveSequence applied to a gapped sequence with no dataset
    */
-  @Test(groups ={ "Functional" })
+  @Test(groups = { "Functional" })
   public void testDeriveSequence_noDatasetGapped()
   {
     SequenceI seq = new Sequence("Seq1", "AB-C.D EF");