1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.bin; |
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 |
|
|
30 |
|
import org.testng.annotations.BeforeClass; |
31 |
|
import org.testng.annotations.Test; |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 2 |
Complexity Density: 0.15 |
|
33 |
|
public class JalviewLiteTest |
34 |
|
{ |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
36 |
1 |
@BeforeClass(alwaysRun = true)... |
37 |
|
public void setUpJvOptionPane() |
38 |
|
{ |
39 |
1 |
JvOptionPane.setInteractiveMode(false); |
40 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
41 |
|
} |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
1PASS
|
|
43 |
1 |
@Test(groups = "Functional")... |
44 |
|
public void testSeparatorListToArray() |
45 |
|
{ |
46 |
1 |
assertNull(JalviewLite.separatorListToArray(null, "|")); |
47 |
1 |
assertNull(JalviewLite.separatorListToArray("", "|")); |
48 |
1 |
assertNull(JalviewLite.separatorListToArray("|", "|")); |
49 |
1 |
assertNull(JalviewLite.separatorListToArray("abc", "abc")); |
50 |
|
|
51 |
1 |
String[] array = JalviewLite.separatorListToArray("abc|def|ghi|", "|"); |
52 |
1 |
assertEquals(3, array.length); |
53 |
1 |
assertEquals("abc", array[0]); |
54 |
1 |
assertEquals("def", array[1]); |
55 |
1 |
assertEquals("ghi", array[2]); |
56 |
|
|
57 |
1 |
assertEquals("[abc]", |
58 |
|
Arrays.toString(JalviewLite.separatorListToArray("abc|", "|"))); |
59 |
1 |
assertEquals("[abc]", Arrays |
60 |
|
.toString(JalviewLite.separatorListToArray("abcxy", "xy"))); |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
} |
68 |
|
} |