1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util.matcher; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
import static org.testng.Assert.assertNull; |
25 |
|
|
26 |
|
import java.util.Locale; |
27 |
|
|
28 |
|
import org.testng.annotations.Test; |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 46 (46) |
Complexity: 3 |
Complexity Density: 0.07 |
|
30 |
|
public class ConditionTest |
31 |
|
{ |
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
4-
|
|
32 |
0 |
@Test(groups = "Functional")... |
33 |
|
public void testToString() |
34 |
|
{ |
35 |
0 |
Locale.setDefault(Locale.UK); |
36 |
0 |
assertEquals(Condition.Contains.toString(), "Contains"); |
37 |
0 |
assertEquals(Condition.NotContains.toString(), "Does not contain"); |
38 |
0 |
assertEquals(Condition.Matches.toString(), "Matches"); |
39 |
0 |
assertEquals(Condition.NotMatches.toString(), "Does not match"); |
40 |
0 |
assertEquals(Condition.Present.toString(), "Is present"); |
41 |
0 |
assertEquals(Condition.NotPresent.toString(), "Is not present"); |
42 |
0 |
assertEquals(Condition.LT.toString(), "<"); |
43 |
0 |
assertEquals(Condition.LE.toString(), "<="); |
44 |
0 |
assertEquals(Condition.GT.toString(), ">"); |
45 |
0 |
assertEquals(Condition.GE.toString(), ">="); |
46 |
0 |
assertEquals(Condition.EQ.toString(), "="); |
47 |
0 |
assertEquals(Condition.NE.toString(), "not ="); |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
0 |
assertEquals(Condition.NE.toString(), "not ="); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
4-
|
|
55 |
0 |
@Test(groups = "Functional")... |
56 |
|
public void testGetStableName() |
57 |
|
{ |
58 |
0 |
assertEquals(Condition.Contains.getStableName(), "Contains"); |
59 |
0 |
assertEquals(Condition.NotContains.getStableName(), "NotContains"); |
60 |
0 |
assertEquals(Condition.Matches.getStableName(), "Matches"); |
61 |
0 |
assertEquals(Condition.NotMatches.getStableName(), "NotMatches"); |
62 |
0 |
assertEquals(Condition.Present.getStableName(), "Present"); |
63 |
0 |
assertEquals(Condition.NotPresent.getStableName(), "NotPresent"); |
64 |
0 |
assertEquals(Condition.LT.getStableName(), "LT"); |
65 |
0 |
assertEquals(Condition.LE.getStableName(), "LE"); |
66 |
0 |
assertEquals(Condition.GT.getStableName(), "GT"); |
67 |
0 |
assertEquals(Condition.GE.getStableName(), "GE"); |
68 |
0 |
assertEquals(Condition.EQ.getStableName(), "EQ"); |
69 |
0 |
assertEquals(Condition.NE.getStableName(), "NE"); |
70 |
|
} |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
4-
|
|
72 |
0 |
@Test(groups = "Functional")... |
73 |
|
public void testFromString() |
74 |
|
{ |
75 |
0 |
assertEquals(Condition.fromString("Contains"), Condition.Contains); |
76 |
|
|
77 |
0 |
assertEquals(Condition.fromString("contains"), Condition.Contains); |
78 |
0 |
assertEquals(Condition.fromString("CONTAINS"), Condition.Contains); |
79 |
0 |
assertEquals(Condition.fromString("NotContains"), |
80 |
|
Condition.NotContains); |
81 |
0 |
assertEquals(Condition.fromString("Matches"), Condition.Matches); |
82 |
0 |
assertEquals(Condition.fromString("NotMatches"), Condition.NotMatches); |
83 |
0 |
assertEquals(Condition.fromString("Present"), Condition.Present); |
84 |
0 |
assertEquals(Condition.fromString("NotPresent"), Condition.NotPresent); |
85 |
0 |
assertEquals(Condition.fromString("LT"), Condition.LT); |
86 |
0 |
assertEquals(Condition.fromString("LE"), Condition.LE); |
87 |
0 |
assertEquals(Condition.fromString("GT"), Condition.GT); |
88 |
0 |
assertEquals(Condition.fromString("GE"), Condition.GE); |
89 |
0 |
assertEquals(Condition.fromString("EQ"), Condition.EQ); |
90 |
0 |
assertEquals(Condition.fromString("NE"), Condition.NE); |
91 |
|
|
92 |
0 |
assertNull(Condition.fromString("Equals")); |
93 |
0 |
assertNull(Condition.fromString("")); |
94 |
0 |
assertNull(Condition.fromString(null)); |
95 |
|
} |
96 |
|
} |