JAL-1645 source formatting and organise imports
[jalview.git] / test / jalview / util / ShiftListTest.java
1 package jalview.util;
2
3 import static org.testng.AssertJUnit.assertEquals;
4 import static org.testng.AssertJUnit.assertNull;
5
6 import java.util.Arrays;
7 import java.util.List;
8
9 import org.testng.annotations.Test;
10
11 public class ShiftListTest
12 {
13
14   @Test(groups = { "Functional" })
15   public void testParseMap()
16   {
17     assertNull(ShiftList.parseMap(null));
18     assertNull(ShiftList.parseMap(new int[] {}));
19
20     /*
21      * Gap map showing residues in aligned positions 2,3,6,8,9,10,12
22      */
23     int[] gm = new int[] { 2, 3, 6, 8, 9, 10, 12 };
24     List<int[]> shifts = ShiftList.parseMap(gm).getShifts();
25     assertEquals(4, shifts.size());
26
27     // TODO are these results (which pass) correct??
28     assertEquals("[0, 2]", Arrays.toString(shifts.get(0)));
29     assertEquals("[4, 2]", Arrays.toString(shifts.get(1)));
30     assertEquals("[7, 1]", Arrays.toString(shifts.get(2)));
31     assertEquals("[11, 1]", Arrays.toString(shifts.get(3)));
32   }
33 }