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.assertNotNull; |
26 |
|
import static org.testng.AssertJUnit.assertNotSame; |
27 |
|
import static org.testng.AssertJUnit.assertNull; |
28 |
|
import static org.testng.AssertJUnit.assertSame; |
29 |
|
import static org.testng.AssertJUnit.assertTrue; |
30 |
|
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; |
31 |
|
|
32 |
|
import jalview.gui.AlignViewport; |
33 |
|
import jalview.gui.JvOptionPane; |
34 |
|
|
35 |
|
import java.util.List; |
36 |
|
|
37 |
|
import org.testng.annotations.BeforeClass; |
38 |
|
import org.testng.annotations.BeforeTest; |
39 |
|
import org.testng.annotations.Test; |
40 |
|
|
41 |
|
@Test(singleThreaded = true) |
|
|
| 100% |
Uncovered Elements: 0 (257) |
Complexity: 19 |
Complexity Density: 0.08 |
|
42 |
|
public class HiddenSequencesTest |
43 |
|
{ |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
45 |
1 |
@BeforeClass(alwaysRun = true)... |
46 |
|
public void setUpJvOptionPane() |
47 |
|
{ |
48 |
1 |
JvOptionPane.setInteractiveMode(false); |
49 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
50 |
|
} |
51 |
|
|
52 |
|
static int SEQ_COUNT = 25; |
53 |
|
|
54 |
|
SequenceI[] seqs; |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
59 |
1 |
@BeforeTest(alwaysRun = true)... |
60 |
|
public void setUp() |
61 |
|
{ |
62 |
1 |
seqs = new SequenceI[SEQ_COUNT]; |
63 |
26 |
for (int i = 0; i < SEQ_COUNT; i++) |
64 |
|
{ |
65 |
|
|
66 |
25 |
seqs[i] = new Sequence("Seq" + i, |
67 |
|
"abcdefghijklmnopqrstuvwxy".substring(0, i + 1)); |
68 |
|
} |
69 |
|
} |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 2 |
Complexity Density: 0.13 |
1PASS
|
|
75 |
1 |
@Test(groups = "Functional")... |
76 |
|
public void testAdjustForHiddenSeqs() |
77 |
|
{ |
78 |
1 |
AlignmentI al = new Alignment(seqs); |
79 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
80 |
26 |
for (int i = 0; i < SEQ_COUNT; i++) |
81 |
|
{ |
82 |
25 |
assertEquals(i, hs.adjustForHiddenSeqs(i)); |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
1 |
hs.hideSequence(seqs[1]); |
87 |
1 |
hs.hideSequence(seqs[5]); |
88 |
1 |
hs.hideSequence(seqs[6]); |
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
1 |
assertEquals(SEQ_COUNT - 3, al.getHeight()); |
94 |
1 |
assertEquals(0, hs.adjustForHiddenSeqs(0)); |
95 |
1 |
assertEquals(2, hs.adjustForHiddenSeqs(1)); |
96 |
1 |
assertEquals(3, hs.adjustForHiddenSeqs(2)); |
97 |
1 |
assertEquals(4, hs.adjustForHiddenSeqs(3)); |
98 |
1 |
assertEquals(7, hs.adjustForHiddenSeqs(4)); |
99 |
1 |
assertEquals(8, hs.adjustForHiddenSeqs(5)); |
100 |
1 |
assertEquals(9, hs.adjustForHiddenSeqs(6)); |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
107 |
1 |
@Test(groups = "Functional")... |
108 |
|
public void testAdjustHeightSequenceAdded() |
109 |
|
{ |
110 |
1 |
AlignmentI al = new Alignment(seqs); |
111 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
112 |
|
|
113 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
114 |
|
|
115 |
1 |
hs.adjustHeightSequenceAdded(); |
116 |
1 |
assertNull(hs.hiddenSequences); |
117 |
|
|
118 |
|
|
119 |
1 |
hs.hideSequence(seqs[3]); |
120 |
1 |
assertEquals(1, hs.getSize()); |
121 |
1 |
assertEquals(SEQ_COUNT - 1, al.getHeight()); |
122 |
1 |
assertEquals(SEQ_COUNT, hs.hiddenSequences.length); |
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
1 |
al.addSequence(new Sequence("a", "b")); |
131 |
1 |
assertEquals(1, hs.getSize()); |
132 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
133 |
1 |
assertEquals(SEQ_COUNT + 1, hs.hiddenSequences.length); |
134 |
|
} |
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
141 |
1 |
@Test(groups = "Functional")... |
142 |
|
public void testAdjustHeightSequenceDeleted() |
143 |
|
{ |
144 |
1 |
AlignmentI al = new Alignment(seqs); |
145 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
146 |
|
|
147 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
148 |
|
|
149 |
1 |
hs.adjustHeightSequenceAdded(); |
150 |
1 |
assertNull(hs.hiddenSequences); |
151 |
|
|
152 |
|
|
153 |
1 |
hs.hideSequence(seqs[3]); |
154 |
1 |
hs.hideSequence(seqs[5]); |
155 |
1 |
assertEquals(2, hs.getSize()); |
156 |
1 |
assertTrue(hs.isHidden(seqs[3])); |
157 |
1 |
assertTrue(hs.isHidden(seqs[5])); |
158 |
1 |
assertEquals(SEQ_COUNT - 2, al.getHeight()); |
159 |
1 |
assertEquals(SEQ_COUNT, hs.hiddenSequences.length); |
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
1 |
al.deleteSequence(seqs[2]); |
168 |
1 |
assertEquals(2, hs.getSize()); |
169 |
|
|
170 |
1 |
assertEquals(SEQ_COUNT - 3, al.getHeight()); |
171 |
|
|
172 |
1 |
assertEquals(SEQ_COUNT - 1, hs.hiddenSequences.length); |
173 |
|
} |
174 |
|
|
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (30) |
Complexity: 3 |
Complexity Density: 0.12 |
1PASS
|
|
179 |
1 |
@Test(groups = "Functional")... |
180 |
|
public void testFindIndexWithoutHiddenSeqs() |
181 |
|
{ |
182 |
1 |
AlignmentI al = new Alignment(seqs); |
183 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
184 |
1 |
int height = al.getHeight(); |
185 |
26 |
for (int i = 0; i < height; i++) |
186 |
|
{ |
187 |
25 |
assertEquals(i, hs.findIndexWithoutHiddenSeqs(i)); |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
1 |
hs.hideSequence(seqs[1]); |
192 |
1 |
hs.hideSequence(seqs[5]); |
193 |
1 |
hs.hideSequence(seqs[6]); |
194 |
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
1 |
assertEquals(height - 3, al.getHeight()); |
199 |
1 |
assertEquals(0, hs.findIndexWithoutHiddenSeqs(0)); |
200 |
1 |
assertEquals(0, hs.findIndexWithoutHiddenSeqs(1)); |
201 |
1 |
assertEquals(1, hs.findIndexWithoutHiddenSeqs(2)); |
202 |
1 |
assertEquals(2, hs.findIndexWithoutHiddenSeqs(3)); |
203 |
1 |
assertEquals(3, hs.findIndexWithoutHiddenSeqs(4)); |
204 |
1 |
assertEquals(3, hs.findIndexWithoutHiddenSeqs(5)); |
205 |
1 |
assertEquals(3, hs.findIndexWithoutHiddenSeqs(6)); |
206 |
1 |
assertEquals(4, hs.findIndexWithoutHiddenSeqs(7)); |
207 |
1 |
assertEquals(5, hs.findIndexWithoutHiddenSeqs(8)); |
208 |
1 |
assertEquals(6, hs.findIndexWithoutHiddenSeqs(9)); |
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
|
213 |
1 |
hs.showAll(null); |
214 |
1 |
hs.hideSequence(seqs[0]); |
215 |
1 |
hs.hideSequence(seqs[1]); |
216 |
1 |
assertEquals(-1, hs.findIndexWithoutHiddenSeqs(0)); |
217 |
1 |
assertEquals(-1, hs.findIndexWithoutHiddenSeqs(1)); |
218 |
24 |
for (int i = 2; i < height; i++) |
219 |
|
{ |
220 |
23 |
assertEquals(i - 2, hs.findIndexWithoutHiddenSeqs(i)); |
221 |
|
} |
222 |
|
} |
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
|
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (36) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
228 |
1 |
@Test(groups = { "Functional" })... |
229 |
|
public void testFindIndexNFromRow() |
230 |
|
{ |
231 |
1 |
AlignmentI al = new Alignment(seqs); |
232 |
1 |
HiddenSequences hs = new HiddenSequences(al); |
233 |
|
|
234 |
|
|
235 |
|
|
236 |
1 |
int pos = hs.subtractVisibleRows(3, 10); |
237 |
1 |
assertEquals(7, pos); |
238 |
|
|
239 |
|
|
240 |
1 |
pos = hs.subtractVisibleRows(0, 10); |
241 |
1 |
assertEquals(10, pos); |
242 |
|
|
243 |
|
|
244 |
1 |
pos = hs.subtractVisibleRows(3, 0); |
245 |
1 |
assertEquals(-3, pos); |
246 |
|
|
247 |
|
|
248 |
|
|
249 |
1 |
hs.hideSequence(seqs[1]); |
250 |
1 |
hs.hideSequence(seqs[2]); |
251 |
1 |
hs.hideSequence(seqs[3]); |
252 |
|
|
253 |
|
|
254 |
1 |
pos = hs.subtractVisibleRows(3, 10); |
255 |
1 |
assertEquals(7, pos); |
256 |
|
|
257 |
|
|
258 |
1 |
pos = hs.subtractVisibleRows(0, 10); |
259 |
1 |
assertEquals(10, pos); |
260 |
|
|
261 |
|
|
262 |
1 |
hs.hideSequence(seqs[12]); |
263 |
1 |
hs.hideSequence(seqs[13]); |
264 |
1 |
hs.hideSequence(seqs[14]); |
265 |
1 |
hs.hideSequence(seqs[15]); |
266 |
1 |
pos = hs.subtractVisibleRows(8, 17); |
267 |
1 |
assertEquals(5, pos); |
268 |
|
|
269 |
|
|
270 |
1 |
hs.hideSequence(seqs[20]); |
271 |
1 |
hs.hideSequence(seqs[21]); |
272 |
1 |
pos = hs.subtractVisibleRows(8, 23); |
273 |
1 |
assertEquals(9, pos); |
274 |
|
|
275 |
|
|
276 |
1 |
hs.showAll(null); |
277 |
|
|
278 |
|
|
279 |
1 |
hs.hideSequence(seqs[12]); |
280 |
1 |
hs.hideSequence(seqs[13]); |
281 |
1 |
hs.hideSequence(seqs[14]); |
282 |
1 |
hs.hideSequence(seqs[15]); |
283 |
1 |
pos = hs.subtractVisibleRows(8, 17); |
284 |
1 |
assertEquals(5, pos); |
285 |
|
|
286 |
|
|
287 |
1 |
hs.hideSequence(seqs[20]); |
288 |
1 |
hs.hideSequence(seqs[21]); |
289 |
1 |
pos = hs.subtractVisibleRows(8, 23); |
290 |
1 |
assertEquals(9, pos); |
291 |
|
|
292 |
|
} |
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
|
297 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
298 |
1 |
@Test(groups = "Functional")... |
299 |
|
public void testGetFullAlignment() |
300 |
|
{ |
301 |
1 |
AlignmentI al = new Alignment(seqs); |
302 |
1 |
assertArrayEquals(seqs, al.getSequencesArray()); |
303 |
1 |
al.setProperty("a", "b"); |
304 |
1 |
al.addAnnotation(new AlignmentAnnotation("ann", "label", 12f)); |
305 |
1 |
al.setSeqrep(seqs[4]); |
306 |
1 |
SequenceGroup sg = new SequenceGroup(); |
307 |
1 |
sg.addSequence(seqs[8], false); |
308 |
1 |
al.addGroup(sg); |
309 |
1 |
((Alignment) al).hasRNAStructure = true; |
310 |
|
|
311 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
312 |
1 |
AlignmentI al2 = hs.getFullAlignment(); |
313 |
|
|
314 |
1 |
assertNotSame(al, al2); |
315 |
1 |
assertArrayEquals(al.getSequencesArray(), al2.getSequencesArray()); |
316 |
|
|
317 |
1 |
hs.hideSequence(seqs[4]); |
318 |
1 |
hs.hideSequence(seqs[9]); |
319 |
1 |
al2 = hs.getFullAlignment(); |
320 |
1 |
assertNotSame(al, al2); |
321 |
1 |
assertArrayEquals(seqs, al2.getSequencesArray()); |
322 |
1 |
assertNotNull(al2.getProperties()); |
323 |
1 |
assertSame(al.getProperties(), al2.getProperties()); |
324 |
1 |
assertNotNull(al2.getAlignmentAnnotation()); |
325 |
1 |
assertSame(al.getAlignmentAnnotation(), al2.getAlignmentAnnotation()); |
326 |
1 |
assertSame(seqs[4], al2.getSeqrep()); |
327 |
1 |
assertNotNull(al2.getGroups()); |
328 |
1 |
assertSame(al.getGroups(), al2.getGroups()); |
329 |
1 |
assertTrue(al2.hasRNAStructure()); |
330 |
|
} |
331 |
|
|
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
|
@return |
337 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
338 |
1 |
@Test(groups = "Functional")... |
339 |
|
public void testGetHiddenSequence() |
340 |
|
{ |
341 |
1 |
AlignmentI al = new Alignment(seqs); |
342 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
343 |
1 |
assertNull(hs.getHiddenSequence(0)); |
344 |
1 |
hs.hideSequence(seqs[3]); |
345 |
1 |
assertSame(seqs[3], hs.getHiddenSequence(3)); |
346 |
1 |
assertNull(hs.getHiddenSequence(2)); |
347 |
1 |
assertNull(hs.getHiddenSequence(4)); |
348 |
|
} |
349 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
1PASS
|
|
350 |
1 |
@Test(groups = "Functional")... |
351 |
|
public void testGetSize() |
352 |
|
{ |
353 |
|
} |
354 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
355 |
1 |
@Test(groups = "Functional")... |
356 |
|
public void testGetWidth() |
357 |
|
{ |
358 |
1 |
AlignmentI al = new Alignment(seqs); |
359 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
360 |
1 |
assertEquals(0, hs.getWidth()); |
361 |
1 |
hs.hideSequence(seqs[6]); |
362 |
1 |
hs.hideSequence(seqs[8]); |
363 |
1 |
assertEquals(9, hs.getWidth()); |
364 |
|
} |
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
370 |
1 |
@Test(groups = "Functional")... |
371 |
|
public void testHideShowSequence() |
372 |
|
{ |
373 |
1 |
AlignmentI al = new Alignment(seqs); |
374 |
1 |
assertTrue(al.getSequences().contains(seqs[1])); |
375 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
376 |
1 |
assertEquals(0, hs.getSize()); |
377 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
378 |
|
|
379 |
|
|
380 |
|
|
381 |
|
|
382 |
1 |
hs.hideSequence(seqs[1]); |
383 |
1 |
assertFalse(hs.isHidden(seqs[0])); |
384 |
1 |
assertTrue(hs.isHidden(seqs[1])); |
385 |
1 |
assertFalse(al.getSequences().contains(seqs[1])); |
386 |
1 |
assertEquals(1, hs.getSize()); |
387 |
1 |
assertEquals(SEQ_COUNT - 1, al.getHeight()); |
388 |
1 |
assertSame(seqs[2], al.getSequenceAt(1)); |
389 |
|
|
390 |
|
|
391 |
|
|
392 |
|
|
393 |
1 |
hs.hideSequence(seqs[2]); |
394 |
1 |
assertFalse(hs.isHidden(seqs[0])); |
395 |
1 |
assertTrue(hs.isHidden(seqs[1])); |
396 |
1 |
assertTrue(hs.isHidden(seqs[2])); |
397 |
1 |
assertFalse(al.getSequences().contains(seqs[1])); |
398 |
1 |
assertFalse(al.getSequences().contains(seqs[2])); |
399 |
1 |
assertEquals(2, hs.getSize()); |
400 |
1 |
assertEquals(SEQ_COUNT - 2, al.getHeight()); |
401 |
|
|
402 |
|
|
403 |
|
|
404 |
|
|
405 |
|
|
406 |
1 |
List<SequenceI> revealed = hs.showSequence(1, null); |
407 |
1 |
assertEquals(2, revealed.size()); |
408 |
1 |
assertTrue(revealed.contains(seqs[1])); |
409 |
1 |
assertTrue(revealed.contains(seqs[2])); |
410 |
1 |
assertEquals(0, hs.getSize()); |
411 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
412 |
|
} |
413 |
|
|
414 |
|
|
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (25) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
419 |
1 |
@Test(groups = "Functional")... |
420 |
|
public void testHideShowLastSequences() |
421 |
|
{ |
422 |
1 |
AlignmentI al = new Alignment(seqs); |
423 |
1 |
assertTrue(al.getSequences().contains(seqs[1])); |
424 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
425 |
1 |
assertEquals(0, hs.getSize()); |
426 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
1 |
hs.hideSequence(seqs[SEQ_COUNT - 1]); |
432 |
1 |
assertFalse(hs.isHidden(seqs[SEQ_COUNT - 2])); |
433 |
1 |
assertTrue(hs.isHidden(seqs[SEQ_COUNT - 1])); |
434 |
1 |
assertFalse(al.getSequences().contains(seqs[SEQ_COUNT - 1])); |
435 |
1 |
assertEquals(1, hs.getSize()); |
436 |
1 |
assertEquals(SEQ_COUNT - 1, al.getHeight()); |
437 |
|
|
438 |
|
|
439 |
|
|
440 |
|
|
441 |
1 |
hs.hideSequence(seqs[SEQ_COUNT - 3]); |
442 |
1 |
assertFalse(hs.isHidden(seqs[SEQ_COUNT - 2])); |
443 |
1 |
assertTrue(hs.isHidden(seqs[SEQ_COUNT - 3])); |
444 |
1 |
assertFalse(al.getSequences().contains(seqs[SEQ_COUNT - 3])); |
445 |
1 |
assertEquals(2, hs.getSize()); |
446 |
1 |
assertEquals(SEQ_COUNT - 2, al.getHeight()); |
447 |
|
|
448 |
|
|
449 |
|
|
450 |
|
|
451 |
1 |
hs.showAll(null); |
452 |
1 |
assertFalse(hs.isHidden(seqs[SEQ_COUNT - 3])); |
453 |
1 |
assertFalse(hs.isHidden(seqs[SEQ_COUNT - 1])); |
454 |
1 |
assertEquals(seqs[SEQ_COUNT - 3], al.getSequences().get(SEQ_COUNT - 3)); |
455 |
1 |
assertEquals(seqs[SEQ_COUNT - 2], al.getSequences().get(SEQ_COUNT - 2)); |
456 |
1 |
assertEquals(seqs[SEQ_COUNT - 1], al.getSequences().get(SEQ_COUNT - 1)); |
457 |
1 |
assertEquals(0, hs.getSize()); |
458 |
1 |
assertEquals(SEQ_COUNT, al.getHeight()); |
459 |
|
} |
460 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
1PASS
|
|
461 |
1 |
@Test(groups = "Functional")... |
462 |
|
public void testIsHidden() |
463 |
|
{ |
464 |
1 |
AlignmentI al = new Alignment(seqs); |
465 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
466 |
1 |
hs.hideSequence(seqs[7]); |
467 |
1 |
hs.hideSequence(seqs[4]); |
468 |
1 |
assertTrue(hs.isHidden(seqs[4])); |
469 |
1 |
assertFalse(hs.isHidden(seqs[5])); |
470 |
1 |
assertFalse(hs.isHidden(seqs[6])); |
471 |
1 |
assertTrue(hs.isHidden(seqs[7])); |
472 |
1 |
assertFalse(hs.isHidden(null)); |
473 |
1 |
assertFalse(hs.isHidden(new Sequence("", ""))); |
474 |
|
} |
475 |
|
|
476 |
|
|
477 |
|
|
478 |
|
|
479 |
|
|
480 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
481 |
1 |
@Test(groups = "Functional")... |
482 |
|
public void testHideShowSequence_withHiddenRepSequence() |
483 |
|
{ |
484 |
1 |
AlignmentI al = new Alignment(seqs); |
485 |
|
|
486 |
|
|
487 |
|
|
488 |
|
|
489 |
|
|
490 |
1 |
AlignViewport av = new AlignViewport(al); |
491 |
1 |
SequenceGroup sg = new SequenceGroup(); |
492 |
1 |
sg.addSequence(seqs[1], false); |
493 |
1 |
sg.addSequence(seqs[2], false); |
494 |
1 |
sg.addSequence(seqs[3], false); |
495 |
1 |
av.setSelectionGroup(sg); |
496 |
|
|
497 |
|
|
498 |
|
|
499 |
|
|
500 |
1 |
av.hideSequences(seqs[2], true); |
501 |
1 |
HiddenSequences hs = al.getHiddenSequences(); |
502 |
1 |
assertEquals(2, hs.getSize()); |
503 |
1 |
assertTrue(hs.isHidden(seqs[1])); |
504 |
1 |
assertFalse(hs.isHidden(seqs[2])); |
505 |
1 |
assertTrue(hs.isHidden(seqs[3])); |
506 |
|
|
507 |
|
|
508 |
|
|
509 |
|
|
510 |
1 |
assertNull(av.getSelectionGroup()); |
511 |
|
|
512 |
|
|
513 |
|
|
514 |
|
|
515 |
|
|
516 |
|
|
517 |
|
|
518 |
|
|
519 |
|
|
520 |
|
|
521 |
1 |
av.showSequence(1); |
522 |
|
|
523 |
|
|
524 |
|
|
525 |
|
|
526 |
1 |
assertEquals(1, hs.getSize()); |
527 |
1 |
assertTrue(hs.isHidden(seqs[3])); |
528 |
1 |
assertEquals(SEQ_COUNT - 1, al.getHeight()); |
529 |
1 |
sg = av.getSelectionGroup(); |
530 |
|
|
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
|
535 |
1 |
assertEquals(2, sg.getSize()); |
536 |
1 |
assertTrue(sg.getSequences().contains(seqs[1])); |
537 |
1 |
assertTrue(sg.getSequences().contains(seqs[2])); |
538 |
1 |
assertFalse(sg.getSequences().contains(seqs[3])); |
539 |
|
} |
540 |
|
} |