1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
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.assertSame; |
27 |
|
import static org.testng.AssertJUnit.assertTrue; |
28 |
|
|
29 |
|
import jalview.bin.Cache; |
30 |
|
import jalview.bin.Jalview; |
31 |
|
import jalview.datamodel.AlignedCodonFrame; |
32 |
|
import jalview.datamodel.Alignment; |
33 |
|
import jalview.datamodel.AlignmentAnnotation; |
34 |
|
import jalview.datamodel.AlignmentI; |
35 |
|
import jalview.datamodel.Annotation; |
36 |
|
import jalview.datamodel.PDBEntry; |
37 |
|
import jalview.datamodel.PDBEntry.Type; |
38 |
|
import jalview.datamodel.SearchResults; |
39 |
|
import jalview.datamodel.SearchResultsI; |
40 |
|
import jalview.datamodel.Sequence; |
41 |
|
import jalview.datamodel.SequenceGroup; |
42 |
|
import jalview.datamodel.SequenceI; |
43 |
|
import jalview.io.DataSourceType; |
44 |
|
import jalview.io.FileLoader; |
45 |
|
import jalview.schemes.ColourSchemeI; |
46 |
|
import jalview.schemes.PIDColourScheme; |
47 |
|
import jalview.structure.StructureSelectionManager; |
48 |
|
import jalview.util.MapList; |
49 |
|
import jalview.viewmodel.ViewportRanges; |
50 |
|
|
51 |
|
import java.util.ArrayList; |
52 |
|
import java.util.List; |
53 |
|
|
54 |
|
import org.testng.Assert; |
55 |
|
import org.testng.annotations.BeforeClass; |
56 |
|
import org.testng.annotations.BeforeMethod; |
57 |
|
import org.testng.annotations.Test; |
58 |
|
|
|
|
| 99.5% |
Uncovered Elements: 1 (202) |
Complexity: 13 |
Complexity Density: 0.07 |
|
59 |
|
public class AlignViewportTest |
60 |
|
{ |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
62 |
1 |
@BeforeClass(alwaysRun = true)... |
63 |
|
public void setUpJvOptionPane() |
64 |
|
{ |
65 |
1 |
JvOptionPane.setInteractiveMode(false); |
66 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
67 |
|
} |
68 |
|
|
69 |
|
AlignmentI al; |
70 |
|
|
71 |
|
AlignViewport testee; |
72 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
73 |
1 |
@BeforeClass(alwaysRun = true)... |
74 |
|
public static void setUpBeforeClass() throws Exception |
75 |
|
{ |
76 |
1 |
Jalview.main(new String[] { "-nonews", "-props", |
77 |
|
"test/jalview/testProps.jvprops" }); |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
1 |
StructureSelectionManager ssm = StructureSelectionManager |
83 |
|
.getStructureSelectionManager(Desktop.instance); |
84 |
1 |
ssm.resetAll(); |
85 |
|
} |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
87 |
10 |
@BeforeMethod(alwaysRun = true)... |
88 |
|
public void setUp() |
89 |
|
{ |
90 |
10 |
SequenceI seq1 = new Sequence("Seq1", "ABC"); |
91 |
10 |
SequenceI seq2 = new Sequence("Seq2", "ABC"); |
92 |
10 |
SequenceI seq3 = new Sequence("Seq3", "ABC"); |
93 |
10 |
SequenceI[] seqs = new SequenceI[] { seq1, seq2, seq3 }; |
94 |
10 |
al = new Alignment(seqs); |
95 |
10 |
al.setDataset(null); |
96 |
10 |
testee = new AlignViewport(al); |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
103 |
1 |
@Test(groups = { "Functional" })... |
104 |
|
public void testDeregisterMapping_onCloseView() |
105 |
|
{ |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
1 |
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( |
110 |
|
">Seq1\nCAGT\n", DataSourceType.PASTE); |
111 |
|
|
112 |
1 |
SequenceI s1 = af1.getViewport().getAlignment().getSequenceAt(0); |
113 |
1 |
AlignedCodonFrame acf1 = new AlignedCodonFrame(); |
114 |
1 |
acf1.addMap(s1, s1, new MapList(new int[] { 1, 4 }, new int[] { 1, 4 }, |
115 |
|
1, 1)); |
116 |
1 |
AlignedCodonFrame acf2 = new AlignedCodonFrame(); |
117 |
1 |
acf2.addMap(s1, s1, new MapList(new int[] { 1, 4 }, new int[] { 4, 1 }, |
118 |
|
1, 1)); |
119 |
|
|
120 |
1 |
List<AlignedCodonFrame> mappings = new ArrayList<>(); |
121 |
1 |
mappings.add(acf1); |
122 |
1 |
mappings.add(acf2); |
123 |
1 |
af1.getViewport().getAlignment().setCodonFrames(mappings); |
124 |
1 |
af1.newView_actionPerformed(null); |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
1 |
StructureSelectionManager ssm = StructureSelectionManager |
131 |
|
.getStructureSelectionManager(Desktop.instance); |
132 |
1 |
List<AlignedCodonFrame> sequenceMappings = ssm.getSequenceMappings(); |
133 |
1 |
assertEquals(2, sequenceMappings.size()); |
134 |
1 |
assertTrue(sequenceMappings.contains(acf1)); |
135 |
1 |
assertTrue(sequenceMappings.contains(acf2)); |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
1 |
af1.closeMenuItem_actionPerformed(false); |
142 |
1 |
assertEquals(2, sequenceMappings.size()); |
143 |
1 |
assertTrue(sequenceMappings.contains(acf1)); |
144 |
1 |
assertTrue(sequenceMappings.contains(acf2)); |
145 |
|
} |
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
150 |
1 |
@Test(groups = { "Functional" })... |
151 |
|
public void testDeregisterMapping_withNoReference() |
152 |
|
{ |
153 |
1 |
Desktop d = Desktop.instance; |
154 |
1 |
assertNotNull(d); |
155 |
1 |
StructureSelectionManager ssm = StructureSelectionManager |
156 |
|
.getStructureSelectionManager(Desktop.instance); |
157 |
1 |
ssm.resetAll(); |
158 |
|
|
159 |
1 |
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( |
160 |
|
">Seq1\nRSVQ\n", DataSourceType.PASTE); |
161 |
1 |
AlignFrame af2 = new FileLoader().LoadFileWaitTillLoaded( |
162 |
|
">Seq2\nDGEL\n", DataSourceType.PASTE); |
163 |
1 |
SequenceI cs1 = new Sequence("cseq1", "CCCGGGTTTAAA"); |
164 |
1 |
SequenceI cs2 = new Sequence("cseq2", "CTTGAGTCTAGA"); |
165 |
1 |
SequenceI s1 = af1.getViewport().getAlignment().getSequenceAt(0); |
166 |
1 |
SequenceI s2 = af2.getViewport().getAlignment().getSequenceAt(0); |
167 |
|
|
168 |
1 |
AlignedCodonFrame acf1 = new AlignedCodonFrame(); |
169 |
1 |
acf1.addMap(cs1, s1, new MapList(new int[] { 1, 4 }, |
170 |
|
new int[] { 1, 12 }, 1, 3)); |
171 |
1 |
AlignedCodonFrame acf2 = new AlignedCodonFrame(); |
172 |
1 |
acf2.addMap(cs2, s2, new MapList(new int[] { 1, 4 }, |
173 |
|
new int[] { 1, 12 }, 1, 3)); |
174 |
1 |
AlignedCodonFrame acf3 = new AlignedCodonFrame(); |
175 |
1 |
acf3.addMap(cs2, cs2, new MapList(new int[] { 1, 12 }, new int[] { 1, |
176 |
|
12 }, 1, 1)); |
177 |
|
|
178 |
1 |
List<AlignedCodonFrame> mappings1 = new ArrayList<>(); |
179 |
1 |
mappings1.add(acf1); |
180 |
1 |
af1.getViewport().getAlignment().setCodonFrames(mappings1); |
181 |
|
|
182 |
1 |
List<AlignedCodonFrame> mappings2 = new ArrayList<>(); |
183 |
1 |
mappings2.add(acf2); |
184 |
1 |
mappings2.add(acf3); |
185 |
1 |
af2.getViewport().getAlignment().setCodonFrames(mappings2); |
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
|
191 |
1 |
List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings(); |
192 |
1 |
assertEquals(0, ssmMappings.size()); |
193 |
1 |
ssm.registerMapping(acf1); |
194 |
1 |
assertEquals(1, ssmMappings.size()); |
195 |
1 |
ssm.registerMapping(acf2); |
196 |
1 |
assertEquals(2, ssmMappings.size()); |
197 |
1 |
ssm.registerMapping(acf3); |
198 |
1 |
assertEquals(3, ssmMappings.size()); |
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
1 |
af2.closeMenuItem_actionPerformed(true); |
205 |
1 |
assertEquals(1, ssmMappings.size()); |
206 |
1 |
assertTrue(ssmMappings.contains(acf1)); |
207 |
|
} |
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
213 |
1 |
@Test(groups = { "Functional" })... |
214 |
|
public void testDeregisterMapping_withReference() |
215 |
|
{ |
216 |
1 |
Desktop d = Desktop.instance; |
217 |
1 |
assertNotNull(d); |
218 |
1 |
StructureSelectionManager ssm = StructureSelectionManager |
219 |
|
.getStructureSelectionManager(Desktop.instance); |
220 |
1 |
ssm.resetAll(); |
221 |
|
|
222 |
1 |
AlignFrame af1 = new FileLoader().LoadFileWaitTillLoaded( |
223 |
|
">Seq1\nRSVQ\n", DataSourceType.PASTE); |
224 |
1 |
AlignFrame af2 = new FileLoader().LoadFileWaitTillLoaded( |
225 |
|
">Seq2\nDGEL\n", DataSourceType.PASTE); |
226 |
1 |
SequenceI cs1 = new Sequence("cseq1", "CCCGGGTTTAAA"); |
227 |
1 |
SequenceI cs2 = new Sequence("cseq2", "CTTGAGTCTAGA"); |
228 |
1 |
SequenceI s1 = af1.getViewport().getAlignment().getSequenceAt(0); |
229 |
1 |
SequenceI s2 = af2.getViewport().getAlignment().getSequenceAt(0); |
230 |
|
|
231 |
1 |
AlignedCodonFrame acf1 = new AlignedCodonFrame(); |
232 |
1 |
acf1.addMap(cs1, s1, new MapList(new int[] { 1, 4 }, |
233 |
|
new int[] { 1, 12 }, 1, 3)); |
234 |
1 |
AlignedCodonFrame acf2 = new AlignedCodonFrame(); |
235 |
1 |
acf2.addMap(cs2, s2, new MapList(new int[] { 1, 4 }, |
236 |
|
new int[] { 1, 12 }, 1, 3)); |
237 |
1 |
AlignedCodonFrame acf3 = new AlignedCodonFrame(); |
238 |
1 |
acf3.addMap(cs2, cs2, new MapList(new int[] { 1, 12 }, new int[] { 1, |
239 |
|
12 }, 1, 1)); |
240 |
|
|
241 |
1 |
List<AlignedCodonFrame> mappings1 = new ArrayList<>(); |
242 |
1 |
mappings1.add(acf1); |
243 |
1 |
mappings1.add(acf2); |
244 |
1 |
af1.getViewport().getAlignment().setCodonFrames(mappings1); |
245 |
|
|
246 |
1 |
List<AlignedCodonFrame> mappings2 = new ArrayList<>(); |
247 |
1 |
mappings2.add(acf2); |
248 |
1 |
mappings2.add(acf3); |
249 |
1 |
af2.getViewport().getAlignment().setCodonFrames(mappings2); |
250 |
|
|
251 |
|
|
252 |
|
|
253 |
|
|
254 |
|
|
255 |
1 |
List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings(); |
256 |
1 |
assertEquals(0, ssmMappings.size()); |
257 |
1 |
ssm.registerMapping(acf1); |
258 |
1 |
assertEquals(1, ssmMappings.size()); |
259 |
1 |
ssm.registerMapping(acf2); |
260 |
1 |
assertEquals(2, ssmMappings.size()); |
261 |
1 |
ssm.registerMapping(acf3); |
262 |
1 |
assertEquals(3, ssmMappings.size()); |
263 |
|
|
264 |
|
|
265 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 |
1 |
af2.closeMenuItem_actionPerformed(true); |
270 |
1 |
assertEquals(2, ssmMappings.size()); |
271 |
1 |
assertTrue(ssmMappings.contains(acf1)); |
272 |
1 |
assertTrue(ssmMappings.contains(acf2)); |
273 |
1 |
assertFalse(ssmMappings.contains(acf3)); |
274 |
|
} |
275 |
|
|
276 |
|
|
277 |
|
|
278 |
|
|
279 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
280 |
1 |
@Test(groups = { "Functional" })... |
281 |
|
public void testUpdateConservation_qualityOnly() |
282 |
|
{ |
283 |
1 |
Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", |
284 |
|
Boolean.TRUE.toString()); |
285 |
1 |
Cache.applicationProperties.setProperty("SHOW_QUALITY", |
286 |
|
Boolean.TRUE.toString()); |
287 |
1 |
Cache.applicationProperties.setProperty("SHOW_CONSERVATION", |
288 |
|
Boolean.FALSE.toString()); |
289 |
1 |
Cache.applicationProperties.setProperty("SHOW_OCCUPANCY", |
290 |
|
Boolean.FALSE.toString()); |
291 |
1 |
Cache.applicationProperties.setProperty("SHOW_IDENTITY", |
292 |
|
Boolean.FALSE.toString()); |
293 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( |
294 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
295 |
1 |
AlignmentAnnotation[] anns = af.viewport.getAlignment() |
296 |
|
.getAlignmentAnnotation(); |
297 |
1 |
assertNotNull("No annotations found", anns); |
298 |
1 |
assertEquals("More than one annotation found", 1, anns.length); |
299 |
1 |
assertTrue("Annotation is not Quality", |
300 |
|
anns[0].description.startsWith("Alignment Quality")); |
301 |
1 |
Annotation[] annotations = anns[0].annotations; |
302 |
1 |
assertNotNull("Quality annotations are null", annotations); |
303 |
1 |
assertNotNull("Quality in column 1 is null", annotations[0]); |
304 |
1 |
assertTrue("No quality value in column 1", annotations[0].value > 10f); |
305 |
|
} |
306 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
307 |
1 |
@Test(groups = { "Functional" })... |
308 |
|
public void testSetGlobalColourScheme() |
309 |
|
{ |
310 |
|
|
311 |
|
|
312 |
|
|
313 |
1 |
Cache.applicationProperties.setProperty("DEFAULT_COLOUR_PROT", "None"); |
314 |
1 |
Cache.applicationProperties.setProperty("SHOW_CONSERVATION", |
315 |
|
Boolean.TRUE.toString()); |
316 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( |
317 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
318 |
1 |
ColourSchemeI cs = new PIDColourScheme(); |
319 |
1 |
af.getViewport().setGlobalColourScheme(cs); |
320 |
1 |
assertFalse(af.getViewport().getResidueShading() |
321 |
|
.conservationApplied()); |
322 |
|
} |
323 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
324 |
1 |
@Test(groups = { "Functional" })... |
325 |
|
public void testSetGetHasSearchResults() |
326 |
|
{ |
327 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( |
328 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
329 |
1 |
SearchResultsI sr = new SearchResults(); |
330 |
1 |
SequenceI s1 = af.getViewport().getAlignment().getSequenceAt(0); |
331 |
|
|
332 |
|
|
333 |
1 |
sr.addResult(s1, s1.getStart() + 10, s1.getStart() + 15); |
334 |
|
|
335 |
|
|
336 |
1 |
af.getViewport().setSearchResults(sr); |
337 |
|
|
338 |
1 |
assertTrue(af.getViewport().hasSearchResults()); |
339 |
|
|
340 |
1 |
assertEquals(sr, af.getViewport().getSearchResults()); |
341 |
|
|
342 |
|
|
343 |
|
|
344 |
1 |
af.getViewport().setSearchResults(null); |
345 |
1 |
assertFalse(af.getViewport().hasSearchResults()); |
346 |
|
} |
347 |
|
|
348 |
|
|
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
353 |
1 |
@Test(groups = { "Functional" })... |
354 |
|
public void testSetSelectionGroup() |
355 |
|
{ |
356 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( |
357 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
358 |
1 |
AlignViewport av = af.getViewport(); |
359 |
1 |
SequenceGroup sg1 = new SequenceGroup(); |
360 |
1 |
SequenceGroup sg2 = new SequenceGroup(); |
361 |
1 |
SequenceGroup sg3 = new SequenceGroup(); |
362 |
|
|
363 |
1 |
av.setSelectionGroup(sg1); |
364 |
1 |
assertSame(sg1.getContext(), av.getAlignment()); |
365 |
1 |
assertFalse(sg1.isDefined()); |
366 |
|
|
367 |
1 |
sg2.setContext(sg1, false); |
368 |
1 |
av.setSelectionGroup(sg2); |
369 |
1 |
assertFalse(sg2.isDefined()); |
370 |
1 |
assertSame(sg2.getContext(), sg1); |
371 |
|
|
372 |
|
|
373 |
1 |
sg3.setContext(av.getAlignment(), true); |
374 |
1 |
av.setSelectionGroup(sg3); |
375 |
1 |
assertTrue(sg3.isDefined()); |
376 |
|
} |
377 |
|
|
378 |
|
|
379 |
|
|
|
|
| 94.1% |
Uncovered Elements: 1 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
380 |
1 |
@Test(groups = { "Functional" })... |
381 |
|
public void testShowOrDontShowOccupancy() |
382 |
|
{ |
383 |
|
|
384 |
1 |
jalview.bin.Cache.setProperty("SHOW_OCCUPANCY", Boolean.FALSE.toString()); |
385 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( |
386 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
387 |
1 |
AlignViewport av = af.getViewport(); |
388 |
1 |
Assert.assertNull(av.getAlignmentGapAnnotation(), "Preference did not disable occupancy row."); |
389 |
1 |
int c = 0; |
390 |
1 |
for (AlignmentAnnotation aa : av.getAlignment().findAnnotations(null, |
391 |
|
null, "Occupancy")) |
392 |
|
{ |
393 |
0 |
c++; |
394 |
|
} |
395 |
1 |
Assert.assertEquals(c, 0, "Expected zero occupancy rows."); |
396 |
|
|
397 |
|
|
398 |
1 |
jalview.bin.Cache.setProperty("SHOW_OCCUPANCY", Boolean.TRUE.toString()); |
399 |
1 |
af = new FileLoader().LoadFileWaitTillLoaded( |
400 |
|
"examples/uniref50.fa", DataSourceType.FILE); |
401 |
1 |
av = af.getViewport(); |
402 |
1 |
Assert.assertNotNull(av.getAlignmentGapAnnotation(), "Preference did not enable occupancy row."); |
403 |
1 |
c = 0; |
404 |
1 |
for (AlignmentAnnotation aa : av.getAlignment().findAnnotations(null, |
405 |
|
null, av.getAlignmentGapAnnotation().label)) |
406 |
|
{ |
407 |
1 |
c++; |
408 |
|
} |
409 |
1 |
; |
410 |
1 |
Assert.assertEquals(c, 1, "Expected to find one occupancy row."); |
411 |
|
} |
412 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
413 |
1 |
@Test(groups = { "Functional" })... |
414 |
|
public void testGetConsensusSeq() |
415 |
|
{ |
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
1 |
String fasta = ">s1\nA-C\n>s2\nA-C\n>s3\nA-D\n>s4\n--D\n"; |
424 |
1 |
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(fasta, |
425 |
|
DataSourceType.PASTE); |
426 |
1 |
AlignViewport testme = af.getViewport(); |
427 |
1 |
SequenceI cons = testme.getConsensusSeq(); |
428 |
1 |
assertEquals("A-C", cons.getSequenceAsString()); |
429 |
|
} |
430 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
431 |
1 |
@Test(groups = { "Functional" })... |
432 |
|
public void testHideRevealSequences() |
433 |
|
{ |
434 |
1 |
ViewportRanges ranges = testee.getRanges(); |
435 |
1 |
assertEquals(3, al.getHeight()); |
436 |
1 |
assertEquals(0, ranges.getStartSeq()); |
437 |
1 |
assertEquals(2, ranges.getEndSeq()); |
438 |
|
|
439 |
|
|
440 |
|
|
441 |
|
|
442 |
1 |
testee.hideSequence(new SequenceI[] { al.getSequenceAt(0) }); |
443 |
1 |
assertEquals(2, al.getHeight()); |
444 |
1 |
assertEquals(0, ranges.getStartSeq()); |
445 |
1 |
assertEquals(1, ranges.getEndSeq()); |
446 |
|
|
447 |
|
|
448 |
|
|
449 |
|
|
450 |
1 |
testee.showSequence(0); |
451 |
1 |
assertEquals(3, al.getHeight()); |
452 |
1 |
assertEquals(0, ranges.getStartSeq()); |
453 |
1 |
assertEquals(2, ranges.getEndSeq()); |
454 |
|
|
455 |
|
|
456 |
|
|
457 |
|
|
458 |
1 |
testee.hideSequence(new SequenceI[] { al.getSequenceAt(0), |
459 |
|
al.getSequenceAt(2) }); |
460 |
1 |
assertEquals(1, al.getHeight()); |
461 |
1 |
assertEquals(0, ranges.getStartSeq()); |
462 |
1 |
assertEquals(0, ranges.getEndSeq()); |
463 |
|
|
464 |
|
|
465 |
|
|
466 |
|
|
467 |
1 |
testee.showAllHiddenSeqs(); |
468 |
1 |
assertEquals(3, al.getHeight()); |
469 |
1 |
assertEquals(0, ranges.getStartSeq()); |
470 |
1 |
assertEquals(2, ranges.getEndSeq()); |
471 |
|
} |
472 |
|
} |