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.Assert.assertEquals; |
24 |
|
|
25 |
|
import jalview.gui.JvOptionPane; |
26 |
|
|
27 |
|
import org.testng.annotations.BeforeClass; |
28 |
|
import org.testng.annotations.Test; |
29 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (61) |
Complexity: 2 |
Complexity Density: 0.03 |
|
30 |
|
public class CigarArrayTest |
31 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
32 |
1 |
@BeforeClass(alwaysRun = true)... |
33 |
|
public void setUpJvOptionPane() |
34 |
|
{ |
35 |
1 |
JvOptionPane.setInteractiveMode(false); |
36 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
37 |
|
} |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (57) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
39 |
1 |
@Test(groups = "Functional")... |
40 |
|
public void testConstructor() |
41 |
|
{ |
42 |
1 |
SequenceI seq1 = new Sequence("sq1", |
43 |
|
"ASFDDABACBACBACBACBACBACBABCABCBACBABCAB"); |
44 |
1 |
Sequence seq2 = new Sequence("sq2", |
45 |
|
"TTTTTTACBCBABCABCABCABCBACBACBABCABCABCBA"); |
46 |
|
|
47 |
|
|
48 |
1 |
AlignmentI al = new Alignment(new SequenceI[] { seq1, seq2 }); |
49 |
|
|
50 |
|
|
51 |
1 |
HiddenColumns hc = new HiddenColumns(); |
52 |
1 |
hc.hideColumns(3, 6); |
53 |
1 |
hc.hideColumns(16, 20); |
54 |
|
|
55 |
|
|
56 |
1 |
SequenceGroup sg1 = new SequenceGroup(); |
57 |
1 |
sg1.addSequence(seq1, false); |
58 |
1 |
sg1.setStartRes(2); |
59 |
1 |
sg1.setEndRes(23); |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
1 |
CigarArray cig = new CigarArray(al, null, sg1); |
73 |
1 |
String result = cig.getCigarstring(); |
74 |
1 |
assertEquals(result, "22M"); |
75 |
|
|
76 |
1 |
cig = new CigarArray(al, hc, sg1); |
77 |
1 |
result = cig.getCigarstring(); |
78 |
1 |
assertEquals(result, "1M4D9M5D3M"); |
79 |
|
|
80 |
|
|
81 |
1 |
sg1.setStartRes(3); |
82 |
1 |
cig = new CigarArray(al, hc, sg1); |
83 |
1 |
result = cig.getCigarstring(); |
84 |
1 |
assertEquals(result, "4D9M5D3M"); |
85 |
|
|
86 |
|
|
87 |
1 |
sg1.setStartRes(5); |
88 |
1 |
cig = new CigarArray(al, hc, sg1); |
89 |
1 |
result = cig.getCigarstring(); |
90 |
1 |
assertEquals(result, "2D9M5D3M"); |
91 |
|
|
92 |
|
|
93 |
1 |
sg1.setStartRes(6); |
94 |
1 |
cig = new CigarArray(al, hc, sg1); |
95 |
1 |
result = cig.getCigarstring(); |
96 |
1 |
assertEquals(result, "1D9M5D3M"); |
97 |
|
|
98 |
|
|
99 |
1 |
sg1.setStartRes(7); |
100 |
1 |
cig = new CigarArray(al, hc, sg1); |
101 |
1 |
result = cig.getCigarstring(); |
102 |
1 |
assertEquals(result, "9M5D3M"); |
103 |
|
|
104 |
|
|
105 |
1 |
sg1.setStartRes(5); |
106 |
1 |
sg1.setEndRes(15); |
107 |
1 |
cig = new CigarArray(al, hc, sg1); |
108 |
1 |
result = cig.getCigarstring(); |
109 |
1 |
assertEquals(result, "2D9M"); |
110 |
|
|
111 |
|
|
112 |
1 |
sg1.setEndRes(16); |
113 |
1 |
cig = new CigarArray(al, hc, sg1); |
114 |
1 |
result = cig.getCigarstring(); |
115 |
1 |
assertEquals(result, "2D9M1D"); |
116 |
|
|
117 |
|
|
118 |
1 |
sg1.setEndRes(17); |
119 |
1 |
cig = new CigarArray(al, hc, sg1); |
120 |
1 |
result = cig.getCigarstring(); |
121 |
1 |
assertEquals(result, "2D9M2D"); |
122 |
|
|
123 |
|
|
124 |
1 |
sg1.setEndRes(20); |
125 |
1 |
cig = new CigarArray(al, hc, sg1); |
126 |
1 |
result = cig.getCigarstring(); |
127 |
1 |
assertEquals(result, "2D9M5D"); |
128 |
|
|
129 |
|
|
130 |
1 |
sg1.setEndRes(21); |
131 |
1 |
cig = new CigarArray(al, hc, sg1); |
132 |
1 |
result = cig.getCigarstring(); |
133 |
1 |
assertEquals(result, "2D9M5D1M"); |
134 |
|
|
135 |
|
|
136 |
1 |
sg1.setEndRes(22); |
137 |
1 |
cig = new CigarArray(al, hc, sg1); |
138 |
1 |
result = cig.getCigarstring(); |
139 |
1 |
assertEquals(result, "2D9M5D2M"); |
140 |
|
} |
141 |
|
} |