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 |
|
|
25 |
|
import jalview.gui.JvOptionPane; |
26 |
|
|
27 |
|
import java.util.Arrays; |
28 |
|
|
29 |
|
import org.testng.annotations.BeforeClass; |
30 |
|
import org.testng.annotations.Test; |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 2 |
Complexity Density: 0.18 |
|
32 |
|
public class ArrayUtilsTest |
33 |
|
{ |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
35 |
1 |
@BeforeClass(alwaysRun = true)... |
36 |
|
public void setUpJvOptionPane() |
37 |
|
{ |
38 |
1 |
JvOptionPane.setInteractiveMode(false); |
39 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
40 |
|
} |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
42 |
1 |
@Test(groups = "Functional")... |
43 |
|
public void testReverseIntArray() |
44 |
|
{ |
45 |
|
|
46 |
|
|
47 |
1 |
ArrayUtils.reverseIntArray((int[]) null); |
48 |
|
|
49 |
|
|
50 |
1 |
int[] arr = new int[] {}; |
51 |
1 |
ArrayUtils.reverseIntArray(arr); |
52 |
|
|
53 |
|
|
54 |
1 |
arr = new int[] { 1, 2, 3, 4 }; |
55 |
1 |
ArrayUtils.reverseIntArray(arr); |
56 |
1 |
assertEquals("[4, 3, 2, 1]", Arrays.toString(arr)); |
57 |
|
|
58 |
|
|
59 |
1 |
arr = new int[] { 1, 2, 3, 4, 5 }; |
60 |
1 |
ArrayUtils.reverseIntArray(arr); |
61 |
1 |
assertEquals("[5, 4, 3, 2, 1]", Arrays.toString(arr)); |
62 |
|
} |
63 |
|
} |