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