1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
23 |
|
import static org.testng.AssertJUnit.assertEquals; |
24 |
|
import static org.testng.AssertJUnit.assertFalse; |
25 |
|
import static org.testng.AssertJUnit.assertTrue; |
26 |
|
|
27 |
|
import jalview.gui.JvOptionPane; |
28 |
|
|
29 |
|
import org.testng.annotations.BeforeClass; |
30 |
|
import org.testng.annotations.Test; |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (35) |
Complexity: 3 |
Complexity Density: 0.09 |
|
32 |
|
public class MatchTest |
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 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
42 |
1 |
@Test(groups = { "Functional" })... |
43 |
|
public void testToString() |
44 |
|
{ |
45 |
1 |
SequenceI seq = new Sequence("Seq1", "abcdefghijklm"); |
46 |
1 |
SearchResultMatchI m = new SearchResults().new Match(seq, 3, 5); |
47 |
1 |
assertEquals("Seq1/3-5", m.toString()); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (27) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
50 |
1 |
@Test(groups = { "Functional" })... |
51 |
|
public void testEquals() |
52 |
|
{ |
53 |
1 |
SequenceI seq1 = new Sequence("", "abcdefghijklm"); |
54 |
1 |
SequenceI seq2 = new Sequence("", "abcdefghijklm"); |
55 |
1 |
SearchResultsI sr1 = new SearchResults(); |
56 |
1 |
SearchResultsI sr2 = new SearchResults(); |
57 |
|
|
58 |
1 |
assertFalse(sr1.equals(null)); |
59 |
1 |
assertFalse(sr1.equals(seq1)); |
60 |
1 |
assertTrue(sr1.equals(sr1)); |
61 |
1 |
assertTrue(sr1.equals(sr2)); |
62 |
1 |
assertTrue(sr2.equals(sr1)); |
63 |
|
|
64 |
1 |
sr1.addResult(seq1, 1, 1); |
65 |
1 |
assertFalse(sr1.equals(sr2)); |
66 |
1 |
assertFalse(sr2.equals(sr1)); |
67 |
|
|
68 |
1 |
sr2.addResult(seq1, 1, 1); |
69 |
1 |
assertTrue(sr1.equals(sr2)); |
70 |
1 |
assertTrue(sr2.equals(sr1)); |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
1 |
SearchResultsI sr3 = new SearchResults(); |
76 |
1 |
sr3.addResult(seq2, 1, 1); |
77 |
1 |
assertFalse(sr1.equals(sr3)); |
78 |
1 |
assertFalse(sr3.equals(sr1)); |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
1 |
sr1.addResult(seq1, 3, 4); |
84 |
1 |
sr2.addResult(seq1, 3, 5); |
85 |
1 |
assertFalse(sr1.equals(sr2)); |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
1 |
sr1 = new SearchResults(); |
91 |
1 |
sr2 = new SearchResults(); |
92 |
1 |
sr1.addResult(seq1, 3, 4); |
93 |
1 |
sr2.addResult(seq1, 2, 4); |
94 |
1 |
assertFalse(sr1.equals(sr2)); |
95 |
|
} |
96 |
|
} |