1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util; |
22 |
|
|
23 |
|
import static org.testng.AssertJUnit.assertEquals; |
24 |
|
import static org.testng.AssertJUnit.assertNull; |
25 |
|
|
26 |
|
import jalview.gui.JvOptionPane; |
27 |
|
|
28 |
|
import java.util.Arrays; |
29 |
|
import java.util.List; |
30 |
|
|
31 |
|
import org.testng.annotations.BeforeClass; |
32 |
|
import org.testng.annotations.Test; |
33 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
|
34 |
|
public class ShiftListTest |
35 |
|
{ |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
37 |
1 |
@BeforeClass(alwaysRun = true)... |
38 |
|
public void setUpJvOptionPane() |
39 |
|
{ |
40 |
1 |
JvOptionPane.setInteractiveMode(false); |
41 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
42 |
|
} |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
44 |
1 |
@Test(groups = { "Functional" })... |
45 |
|
public void testParseMap() |
46 |
|
{ |
47 |
1 |
assertNull(ShiftList.parseMap(null)); |
48 |
1 |
assertNull(ShiftList.parseMap(new int[] {})); |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
1 |
int[] gm = new int[] { 2, 3, 6, 8, 9, 10, 12 }; |
54 |
1 |
List<int[]> shifts = ShiftList.parseMap(gm).getShifts(); |
55 |
1 |
assertEquals(4, shifts.size()); |
56 |
|
|
57 |
|
|
58 |
1 |
assertEquals("[0, 2]", Arrays.toString(shifts.get(0))); |
59 |
1 |
assertEquals("[4, 2]", Arrays.toString(shifts.get(1))); |
60 |
1 |
assertEquals("[7, 1]", Arrays.toString(shifts.get(2))); |
61 |
1 |
assertEquals("[11, 1]", Arrays.toString(shifts.get(3))); |
62 |
|
} |
63 |
|
} |