1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.analysis; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
import static org.testng.Assert.assertSame; |
25 |
|
import static org.testng.Assert.assertTrue; |
26 |
|
|
27 |
|
import java.util.List; |
28 |
|
|
29 |
|
import org.testng.annotations.AfterMethod; |
30 |
|
import org.testng.annotations.BeforeClass; |
31 |
|
import org.testng.annotations.Test; |
32 |
|
|
33 |
|
import jalview.api.AlignViewportI; |
34 |
|
import jalview.api.FinderI; |
35 |
|
import jalview.bin.Cache; |
36 |
|
import jalview.datamodel.Alignment; |
37 |
|
import jalview.datamodel.AlignmentI; |
38 |
|
import jalview.datamodel.ColumnSelection; |
39 |
|
import jalview.datamodel.HiddenColumns; |
40 |
|
import jalview.datamodel.SearchResultMatchI; |
41 |
|
import jalview.datamodel.SearchResultsI; |
42 |
|
import jalview.datamodel.Sequence; |
43 |
|
import jalview.datamodel.SequenceFeature; |
44 |
|
import jalview.datamodel.SequenceGroup; |
45 |
|
import jalview.datamodel.SequenceI; |
46 |
|
import jalview.gui.AlignFrame; |
47 |
|
import jalview.gui.AlignViewport; |
48 |
|
import jalview.gui.JvOptionPane; |
49 |
|
import jalview.io.DataSourceType; |
50 |
|
import jalview.io.FileLoader; |
51 |
|
import junit.extensions.PA; |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (542) |
Complexity: 20 |
Complexity Density: 0.04 |
|
53 |
|
public class FinderTest |
54 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
55 |
1 |
@BeforeClass(alwaysRun = true)... |
56 |
|
public void setUpJvOptionPane() |
57 |
|
{ |
58 |
1 |
JvOptionPane.setInteractiveMode(false); |
59 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
60 |
|
} |
61 |
|
|
62 |
|
private AlignFrame af; |
63 |
|
|
64 |
|
private AlignmentI al; |
65 |
|
|
66 |
|
private AlignViewportI av; |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
|
68 |
1 |
@BeforeClass(groups = "Functional")... |
69 |
|
public void setUp() |
70 |
|
{ |
71 |
1 |
Cache.loadProperties("test/jalview/io/testProps.jvprops"); |
72 |
1 |
Cache.applicationProperties.setProperty("PAD_GAPS", |
73 |
|
Boolean.FALSE.toString()); |
74 |
|
|
75 |
|
|
76 |
1 |
String seqData = |
77 |
|
"seq1/8-18 ABCD--EF-GHIJI\n" + |
78 |
|
"seq2 A--BCDefHI\n" + |
79 |
|
"seq3 --bcdEFH\n" + |
80 |
|
"seq4 aa---aMMMMMaaa\n"; |
81 |
|
|
82 |
1 |
af = new FileLoader().LoadFileWaitTillLoaded(seqData, |
83 |
|
DataSourceType.PASTE); |
84 |
1 |
av = af.getViewport(); |
85 |
1 |
al = av.getAlignment(); |
86 |
1 |
al.getSequenceAt(0).addSequenceFeature( |
87 |
|
new SequenceFeature("BBBB", "FeatureB", 9, 11, "")); |
88 |
1 |
al.getSequenceAt(3).addSequenceFeature( |
89 |
|
new SequenceFeature("BBAB", "FeatureA", 1, 3, "")); |
90 |
1 |
al.getSequenceAt(3).addSequenceFeature( |
91 |
|
new SequenceFeature("AAAA", "FeatureA", 9, 11, "")); |
92 |
|
} |
93 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
17 |
@AfterMethod(alwaysRun = true)... |
95 |
|
public void tearDownAfterTest() |
96 |
|
{ |
97 |
17 |
av.setSelectionGroup(null); |
98 |
|
} |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (19) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
103 |
1 |
@Test(groups = "Functional")... |
104 |
|
public void testFind_regex() |
105 |
|
{ |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
1 |
Finder f = new Finder(av); |
110 |
1 |
f.findNext("E.H", false, false, false, false); |
111 |
|
|
112 |
1 |
SearchResultsI sr = f.getSearchResults(); |
113 |
1 |
assertEquals(sr.getCount(), 1); |
114 |
1 |
List<SearchResultMatchI> matches = sr.getResults(); |
115 |
1 |
assertSame(matches.get(0).getSequence(), al.getSequenceAt(1)); |
116 |
1 |
assertEquals(matches.get(0).getStart(), 5); |
117 |
1 |
assertEquals(matches.get(0).getEnd(), 7); |
118 |
|
|
119 |
1 |
f = new Finder(av); |
120 |
1 |
f.findAll("E.H", false, false, false, false); |
121 |
|
|
122 |
1 |
sr = f.getSearchResults(); |
123 |
1 |
assertEquals(sr.getCount(), 2); |
124 |
1 |
matches = sr.getResults(); |
125 |
1 |
assertSame(matches.get(0).getSequence(), al.getSequenceAt(1)); |
126 |
1 |
assertSame(matches.get(1).getSequence(), al.getSequenceAt(2)); |
127 |
1 |
assertEquals(matches.get(0).getStart(), 5); |
128 |
1 |
assertEquals(matches.get(0).getEnd(), 7); |
129 |
1 |
assertEquals(matches.get(1).getStart(), 4); |
130 |
1 |
assertEquals(matches.get(1).getEnd(), 6); |
131 |
|
} |
132 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
133 |
1 |
@Test(groups = "Functional")... |
134 |
|
public void testFind_findAll() |
135 |
|
{ |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
1 |
Finder f = new Finder(av); |
141 |
1 |
f.findAll("M", false, false, false, false); |
142 |
1 |
SearchResultsI sr = f.getSearchResults(); |
143 |
1 |
assertEquals(sr.getCount(), 5); |
144 |
|
|
145 |
|
} |
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (25) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
150 |
1 |
@Test(groups = "Functional")... |
151 |
|
public void testFind_residueNumber() |
152 |
|
{ |
153 |
1 |
Finder f = new Finder(av); |
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
1 |
f.findNext("9", false, false, false, false); |
159 |
1 |
SearchResultsI sr = f.getSearchResults(); |
160 |
1 |
assertEquals(sr.getCount(), 1); |
161 |
1 |
List<SearchResultMatchI> matches = sr.getResults(); |
162 |
1 |
assertSame(matches.get(0).getSequence(), al.getSequenceAt(0)); |
163 |
1 |
assertEquals(matches.get(0).getStart(), 9); |
164 |
1 |
assertEquals(matches.get(0).getEnd(), 9); |
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
170 |
1 |
f = new Finder(av); |
171 |
1 |
String name = al.getSequenceAt(0).getName(); |
172 |
1 |
al.getSequenceAt(0).setName("Q9XA0"); |
173 |
1 |
f.findAll("9", false, false, false, false); |
174 |
1 |
sr = f.getSearchResults(); |
175 |
1 |
assertEquals(sr.getCount(), 2); |
176 |
1 |
matches = sr.getResults(); |
177 |
1 |
assertSame(matches.get(0).getSequence(), al.getSequenceAt(0)); |
178 |
1 |
assertSame(matches.get(1).getSequence(), al.getSequenceAt(3)); |
179 |
1 |
assertEquals(matches.get(0).getStart(), 9); |
180 |
1 |
assertEquals(matches.get(0).getEnd(), 9); |
181 |
1 |
assertEquals(matches.get(1).getStart(), 9); |
182 |
1 |
assertEquals(matches.get(1).getEnd(), 9); |
183 |
1 |
al.getSequenceAt(0).setName(name); |
184 |
|
|
185 |
|
|
186 |
|
|
187 |
|
|
188 |
1 |
f = new Finder(av); |
189 |
1 |
f.findNext(" 9", false, false, false, false); |
190 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (27) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
196 |
1 |
@Test(groups = "Functional")... |
197 |
|
public void testFindNext() |
198 |
|
{ |
199 |
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
1 |
Finder f = new Finder(av); |
204 |
1 |
PA.setValue(f, "sequenceIndex", 1); |
205 |
1 |
PA.setValue(f, "residueIndex", -1); |
206 |
1 |
f.findNext("e", false, false, false, false); |
207 |
|
|
208 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
209 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
210 |
1 |
assertSame(f.getIdMatches().get(0), al.getSequenceAt(1)); |
211 |
|
|
212 |
|
|
213 |
|
|
214 |
1 |
assertEquals(PA.getValue(f, "residueIndex"), 0); |
215 |
1 |
f = new Finder(av); |
216 |
1 |
PA.setValue(f, "sequenceIndex", 1); |
217 |
1 |
PA.setValue(f, "residueIndex", 0); |
218 |
1 |
f.findNext("e", false, false, false, false); |
219 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
220 |
1 |
assertEquals(f.getSearchResults().getCount(), 1); |
221 |
1 |
List<SearchResultMatchI> matches = f.getSearchResults().getResults(); |
222 |
1 |
assertEquals(matches.get(0).getStart(), 5); |
223 |
1 |
assertEquals(matches.get(0).getEnd(), 5); |
224 |
1 |
assertSame(matches.get(0).getSequence(), al.getSequenceAt(1)); |
225 |
|
|
226 |
1 |
assertEquals(PA.getValue(f, "sequenceIndex"), 1); |
227 |
|
|
228 |
1 |
assertEquals(PA.getValue(f, "residueIndex"), 5); |
229 |
|
|
230 |
|
|
231 |
1 |
f = new Finder(av); |
232 |
1 |
PA.setValue(f, "sequenceIndex", 1); |
233 |
1 |
PA.setValue(f, "residueIndex", 7); |
234 |
1 |
f.findNext("e", false, false, false, false); |
235 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
236 |
1 |
assertSame(f.getIdMatches().get(0), al.getSequenceAt(2)); |
237 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
238 |
|
} |
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
243 |
1 |
@Test(groups = "Functional")... |
244 |
|
public void testFind_inDescription() |
245 |
|
{ |
246 |
1 |
AlignmentI al2 = new Alignment(al); |
247 |
1 |
al2.getSequenceAt(0).setDescription("BRAF"); |
248 |
1 |
al2.getSequenceAt(1).setDescription("braf"); |
249 |
|
|
250 |
1 |
AlignViewportI av2 = new AlignViewport(al2); |
251 |
|
|
252 |
|
|
253 |
|
|
254 |
|
|
255 |
1 |
Finder f = new Finder(av2); |
256 |
1 |
f.findNext("rAF", false, true, false, false); |
257 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
258 |
1 |
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(0)); |
259 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
260 |
|
|
261 |
|
|
262 |
|
|
263 |
|
|
264 |
1 |
f = new Finder(av2); |
265 |
1 |
f.findAll("rAF", false, true, false, false); |
266 |
1 |
assertEquals(f.getIdMatches().size(), 2); |
267 |
1 |
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(0)); |
268 |
1 |
assertSame(f.getIdMatches().get(1), al2.getSequenceAt(1)); |
269 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
270 |
|
|
271 |
|
|
272 |
|
|
273 |
|
|
274 |
1 |
f = new Finder(av2); |
275 |
1 |
f.findAll("RAF", true, true, false, false); |
276 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
277 |
1 |
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(0)); |
278 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
1 |
al2.getSequenceAt(0).setDescription("the efh sequence"); |
284 |
1 |
al2.getSequenceAt(0).setName("mouseEFHkinase"); |
285 |
1 |
al2.getSequenceAt(1).setName("humanEFHkinase"); |
286 |
1 |
f = new Finder(av2); |
287 |
|
|
288 |
|
|
289 |
|
|
290 |
|
|
291 |
1 |
f.findAll("EFH", false, true, false, false); |
292 |
1 |
assertEquals(f.getIdMatches().size(), 2); |
293 |
1 |
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(0)); |
294 |
1 |
assertSame(f.getIdMatches().get(1), al2.getSequenceAt(1)); |
295 |
|
|
296 |
1 |
assertEquals(f.getSearchResults().getCount(), 2); |
297 |
1 |
SearchResultMatchI match = f.getSearchResults().getResults().get(0); |
298 |
1 |
assertSame(match.getSequence(), al2.getSequenceAt(1)); |
299 |
1 |
assertEquals(match.getStart(), 5); |
300 |
1 |
assertEquals(match.getEnd(), 7); |
301 |
1 |
match = f.getSearchResults().getResults().get(1); |
302 |
1 |
assertSame(match.getSequence(), al2.getSequenceAt(2)); |
303 |
1 |
assertEquals(match.getStart(), 4); |
304 |
1 |
assertEquals(match.getEnd(), 6); |
305 |
|
} |
306 |
|
|
307 |
|
|
308 |
|
|
309 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (27) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
310 |
1 |
@Test(groups = "Functional")... |
311 |
|
public void testFindAll_sequenceIds() |
312 |
|
{ |
313 |
1 |
Finder f = new Finder(av); |
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
1 |
f.findAll("SEQ1", false, false, false, false); |
320 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
321 |
1 |
assertSame(f.getIdMatches().get(0), al.getSequenceAt(0)); |
322 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
323 |
1 |
assertTrue(searchResults.isEmpty()); |
324 |
|
|
325 |
|
|
326 |
|
|
327 |
|
|
328 |
1 |
f = new Finder(av); |
329 |
1 |
f.findAll("SEQ1", true, false, false, false); |
330 |
1 |
searchResults = f.getSearchResults(); |
331 |
1 |
assertTrue(searchResults.isEmpty()); |
332 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
336 |
1 |
AlignmentI al2 = new Alignment(al); |
337 |
1 |
AlignViewportI av2 = new AlignViewport(al2); |
338 |
1 |
al2.addSequence(new Sequence("aBz", "xyzabZpqrAbZ")); |
339 |
1 |
f = new Finder(av2); |
340 |
1 |
f.findAll("ABZ", false, false, false, false); |
341 |
1 |
assertEquals(f.getIdMatches().size(), 1); |
342 |
1 |
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(4)); |
343 |
1 |
searchResults = f.getSearchResults(); |
344 |
1 |
assertEquals(searchResults.getCount(), 2); |
345 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
346 |
1 |
assertSame(match.getSequence(), al2.getSequenceAt(4)); |
347 |
1 |
assertEquals(match.getStart(), 4); |
348 |
1 |
assertEquals(match.getEnd(), 6); |
349 |
1 |
match = searchResults.getResults().get(1); |
350 |
1 |
assertSame(match.getSequence(), al2.getSequenceAt(4)); |
351 |
1 |
assertEquals(match.getStart(), 10); |
352 |
1 |
assertEquals(match.getEnd(), 12); |
353 |
|
} |
354 |
|
|
355 |
|
|
356 |
|
|
357 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (39) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
358 |
1 |
@Test(groups = "Functional")... |
359 |
|
public void testFind_findNext() |
360 |
|
{ |
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
1 |
FinderI f = new Finder(av); |
369 |
1 |
f.findNext("EfH", false, false, false, false); |
370 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
371 |
1 |
assertEquals(searchResults.getCount(), 1); |
372 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
373 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
374 |
1 |
assertEquals(match.getStart(), 5); |
375 |
1 |
assertEquals(match.getEnd(), 7); |
376 |
|
|
377 |
|
|
378 |
|
|
379 |
|
|
380 |
1 |
f = new Finder(av); |
381 |
1 |
f.findNext("I", false, false, false, false); |
382 |
1 |
searchResults = f.getSearchResults(); |
383 |
1 |
assertEquals(searchResults.getCount(), 1); |
384 |
1 |
match = searchResults.getResults().get(0); |
385 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
386 |
1 |
assertEquals(match.getStart(), 16); |
387 |
1 |
assertEquals(match.getEnd(), 16); |
388 |
|
|
389 |
1 |
f.findNext("I", false, false, false, false); |
390 |
1 |
searchResults = f.getSearchResults(); |
391 |
1 |
assertEquals(searchResults.getCount(), 1); |
392 |
1 |
match = searchResults.getResults().get(0); |
393 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
394 |
1 |
assertEquals(match.getStart(), 18); |
395 |
1 |
assertEquals(match.getEnd(), 18); |
396 |
|
|
397 |
1 |
f.findNext("I", false, false, false, false); |
398 |
1 |
searchResults = f.getSearchResults(); |
399 |
1 |
assertEquals(searchResults.getCount(), 1); |
400 |
1 |
match = searchResults.getResults().get(0); |
401 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
402 |
1 |
assertEquals(match.getStart(), 8); |
403 |
1 |
assertEquals(match.getEnd(), 8); |
404 |
|
|
405 |
1 |
f.findNext("I", false, false, false, false); |
406 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
1 |
f.findNext("I", false, false, false, false); |
412 |
1 |
searchResults = f.getSearchResults(); |
413 |
1 |
assertEquals(searchResults.getCount(), 1); |
414 |
1 |
match = searchResults.getResults().get(0); |
415 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
416 |
1 |
assertEquals(match.getStart(), 16); |
417 |
1 |
assertEquals(match.getEnd(), 16); |
418 |
|
} |
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
424 |
1 |
@Test(groups = "Functional")... |
425 |
|
public void testFindAll_maximalResultOnly() |
426 |
|
{ |
427 |
1 |
Finder f = new Finder(av); |
428 |
1 |
f.findAll("M+", false, false, false, false); |
429 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
430 |
1 |
assertEquals(searchResults.getCount(), 1); |
431 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
432 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
433 |
1 |
assertEquals(match.getStart(), 4); |
434 |
1 |
assertEquals(match.getEnd(), 8); |
435 |
|
} |
436 |
|
|
437 |
|
|
438 |
|
|
439 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (27) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
440 |
1 |
@Test(groups = "Functional")... |
441 |
|
public void testFindAll() |
442 |
|
{ |
443 |
1 |
Finder f = new Finder(av); |
444 |
1 |
f.findAll("EfH", false, false, false, false); |
445 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
446 |
1 |
assertEquals(searchResults.getCount(), 2); |
447 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
448 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
449 |
1 |
assertEquals(match.getStart(), 5); |
450 |
1 |
assertEquals(match.getEnd(), 7); |
451 |
1 |
match = searchResults.getResults().get(1); |
452 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(2)); |
453 |
1 |
assertEquals(match.getStart(), 4); |
454 |
1 |
assertEquals(match.getEnd(), 6); |
455 |
|
|
456 |
|
|
457 |
|
|
458 |
|
|
459 |
1 |
f.findAll("I", false, false, false, false); |
460 |
1 |
searchResults = f.getSearchResults(); |
461 |
1 |
assertEquals(searchResults.getCount(), 3); |
462 |
1 |
match = searchResults.getResults().get(0); |
463 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
464 |
1 |
assertEquals(match.getStart(), 16); |
465 |
1 |
assertEquals(match.getEnd(), 16); |
466 |
1 |
match = searchResults.getResults().get(1); |
467 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
468 |
1 |
assertEquals(match.getStart(), 18); |
469 |
1 |
assertEquals(match.getEnd(), 18); |
470 |
1 |
match = searchResults.getResults().get(2); |
471 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
472 |
1 |
assertEquals(match.getStart(), 8); |
473 |
1 |
assertEquals(match.getEnd(), 8); |
474 |
|
} |
475 |
|
|
476 |
|
|
477 |
|
|
478 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
479 |
1 |
@Test(groups = "Functional")... |
480 |
|
public void testFindAll_caseSensitive() |
481 |
|
{ |
482 |
1 |
Finder f = new Finder(av); |
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
487 |
1 |
f.findAll("BC", true, false, false, false); |
488 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
489 |
1 |
assertEquals(searchResults.getCount(), 2); |
490 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
491 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
492 |
1 |
assertEquals(match.getStart(), 9); |
493 |
1 |
assertEquals(match.getEnd(), 10); |
494 |
1 |
match = searchResults.getResults().get(1); |
495 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
496 |
1 |
assertEquals(match.getStart(), 2); |
497 |
1 |
assertEquals(match.getEnd(), 3); |
498 |
|
|
499 |
|
|
500 |
|
|
501 |
|
|
502 |
1 |
f = new Finder(av); |
503 |
1 |
f.findAll("bc", true, false, false, false); |
504 |
1 |
searchResults = f.getSearchResults(); |
505 |
1 |
assertEquals(searchResults.getCount(), 1); |
506 |
1 |
match = searchResults.getResults().get(0); |
507 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(2)); |
508 |
1 |
assertEquals(match.getStart(), 1); |
509 |
1 |
assertEquals(match.getEnd(), 2); |
510 |
|
|
511 |
1 |
f.findAll("bC", true, false, false, false); |
512 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
513 |
|
} |
514 |
|
|
515 |
|
|
516 |
|
|
517 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (35) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
518 |
1 |
@Test(groups = "Functional")... |
519 |
|
public void testFindNext_inSelection() |
520 |
|
{ |
521 |
|
|
522 |
|
|
523 |
|
|
524 |
|
|
525 |
|
|
526 |
1 |
SequenceGroup sg = new SequenceGroup(); |
527 |
1 |
sg.setStartRes(3); |
528 |
1 |
sg.setEndRes(5); |
529 |
1 |
sg.addSequence(al.getSequenceAt(1), false); |
530 |
1 |
sg.addSequence(al.getSequenceAt(2), false); |
531 |
1 |
av.setSelectionGroup(sg); |
532 |
|
|
533 |
1 |
FinderI f = new Finder(av); |
534 |
1 |
f.findNext("b", false, false, false, false); |
535 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
536 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
537 |
1 |
assertEquals(searchResults.getCount(), 1); |
538 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
539 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
540 |
1 |
assertEquals(match.getStart(), 2); |
541 |
1 |
assertEquals(match.getEnd(), 2); |
542 |
|
|
543 |
|
|
544 |
|
|
545 |
|
|
546 |
1 |
f.findNext("b", false, false, false, false); |
547 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
548 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
549 |
|
|
550 |
1 |
f = new Finder(av); |
551 |
1 |
f.findNext("d", false, false, false, false); |
552 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
553 |
1 |
searchResults = f.getSearchResults(); |
554 |
1 |
assertEquals(searchResults.getCount(), 1); |
555 |
1 |
match = searchResults.getResults().get(0); |
556 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
557 |
1 |
assertEquals(match.getStart(), 4); |
558 |
1 |
assertEquals(match.getEnd(), 4); |
559 |
1 |
f.findNext("d", false, false, false, false); |
560 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
561 |
1 |
searchResults = f.getSearchResults(); |
562 |
1 |
assertEquals(searchResults.getCount(), 1); |
563 |
1 |
match = searchResults.getResults().get(0); |
564 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(2)); |
565 |
1 |
assertEquals(match.getStart(), 3); |
566 |
1 |
assertEquals(match.getEnd(), 3); |
567 |
|
} |
568 |
|
|
569 |
|
|
570 |
|
|
571 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
572 |
1 |
@Test(groups = "Functional")... |
573 |
|
public void testFindAll_inSelection() |
574 |
|
{ |
575 |
|
|
576 |
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
1 |
SequenceGroup sg = new SequenceGroup(); |
581 |
1 |
sg.setStartRes(3); |
582 |
1 |
sg.setEndRes(5); |
583 |
1 |
sg.addSequence(al.getSequenceAt(1), false); |
584 |
1 |
sg.addSequence(al.getSequenceAt(2), false); |
585 |
1 |
av.setSelectionGroup(sg); |
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
|
590 |
1 |
Finder f = new Finder(av); |
591 |
1 |
f.findAll("e", false, false, false, false); |
592 |
1 |
assertEquals(f.getIdMatches().size(), 2); |
593 |
1 |
assertSame(f.getIdMatches().get(0), al.getSequenceAt(1)); |
594 |
1 |
assertSame(f.getIdMatches().get(1), al.getSequenceAt(2)); |
595 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
596 |
1 |
assertEquals(searchResults.getCount(), 1); |
597 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
598 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(2)); |
599 |
1 |
assertEquals(match.getStart(), 4); |
600 |
1 |
assertEquals(match.getEnd(), 4); |
601 |
|
|
602 |
|
|
603 |
|
|
604 |
|
|
605 |
1 |
f = new Finder(av); |
606 |
1 |
f.findAll("Q", false, false, false, false); |
607 |
1 |
assertEquals(f.getIdMatches().size(), 2); |
608 |
1 |
assertSame(f.getIdMatches().get(0), al.getSequenceAt(1)); |
609 |
1 |
assertSame(f.getIdMatches().get(1), al.getSequenceAt(2)); |
610 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
611 |
|
} |
612 |
|
|
613 |
|
|
614 |
|
|
615 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
616 |
1 |
@Test(groups = "Functional")... |
617 |
|
public void testFind_findAllInSelectionWithShortSequence() |
618 |
|
{ |
619 |
|
|
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
1 |
SequenceGroup sg = new SequenceGroup(); |
625 |
1 |
sg.setStartRes(9); |
626 |
1 |
sg.setEndRes(11); |
627 |
1 |
sg.addSequence(al.getSequenceAt(0), false); |
628 |
1 |
sg.addSequence(al.getSequenceAt(1), false); |
629 |
1 |
sg.addSequence(al.getSequenceAt(2), false); |
630 |
1 |
sg.addSequence(al.getSequenceAt(3), false); |
631 |
1 |
av.setSelectionGroup(sg); |
632 |
|
|
633 |
|
|
634 |
|
|
635 |
|
|
636 |
1 |
Finder f = new Finder(av); |
637 |
1 |
f.findAll("I", false, false, false, false); |
638 |
1 |
assertTrue(f.getIdMatches().isEmpty()); |
639 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
640 |
1 |
assertEquals(searchResults.getCount(), 2); |
641 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
642 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
643 |
1 |
assertEquals(match.getStart(), 16); |
644 |
1 |
assertEquals(match.getEnd(), 16); |
645 |
1 |
match = searchResults.getResults().get(1); |
646 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
647 |
1 |
assertEquals(match.getStart(), 8); |
648 |
1 |
assertEquals(match.getEnd(), 8); |
649 |
|
} |
650 |
|
|
651 |
|
|
652 |
|
|
653 |
|
|
654 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (65) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
655 |
1 |
@Test(groups = "Functional")... |
656 |
|
public void testFind_withHiddenColumns() |
657 |
|
{ |
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
662 |
|
|
663 |
|
|
664 |
|
|
665 |
|
|
666 |
|
|
667 |
|
|
668 |
|
|
669 |
|
|
670 |
1 |
HiddenColumns hc = new HiddenColumns(); |
671 |
1 |
hc.hideColumns(3, 3); |
672 |
1 |
al.setHiddenColumns(hc); |
673 |
1 |
Finder f = new Finder(av); |
674 |
1 |
f.findAll("aaa", false, false, false, false); |
675 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
676 |
1 |
assertEquals(searchResults.getCount(), 2); |
677 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
678 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
679 |
1 |
assertEquals(match.getStart(), 1); |
680 |
1 |
assertEquals(match.getEnd(), 3); |
681 |
1 |
match = searchResults.getResults().get(1); |
682 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
683 |
1 |
assertEquals(match.getStart(), 9); |
684 |
1 |
assertEquals(match.getEnd(), 11); |
685 |
|
|
686 |
|
|
687 |
|
|
688 |
|
|
689 |
1 |
hc.hideColumns(2, 4); |
690 |
|
|
691 |
|
|
692 |
|
|
693 |
|
|
694 |
|
|
695 |
1 |
f = new Finder(av); |
696 |
1 |
f.findAll("D", false, false, false, false); |
697 |
1 |
searchResults = f.getSearchResults(); |
698 |
1 |
assertEquals(searchResults.getCount(), 1); |
699 |
1 |
match = searchResults.getResults().get(0); |
700 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
701 |
1 |
assertEquals(match.getStart(), 4); |
702 |
1 |
assertEquals(match.getEnd(), 4); |
703 |
|
|
704 |
|
|
705 |
|
|
706 |
|
|
707 |
|
|
708 |
1 |
f = new Finder(av); |
709 |
1 |
f.findAll("AD", false, false, false, false); |
710 |
1 |
searchResults = f.getSearchResults(); |
711 |
1 |
assertTrue(searchResults.isEmpty()); |
712 |
|
|
713 |
|
|
714 |
|
|
715 |
|
|
716 |
|
|
717 |
1 |
f = new Finder(av); |
718 |
1 |
f.findAll("aaa", false, false, false, false); |
719 |
1 |
searchResults = f.getSearchResults(); |
720 |
1 |
assertEquals(searchResults.getCount(), 2); |
721 |
1 |
match = searchResults.getResults().get(0); |
722 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
723 |
1 |
assertEquals(match.getStart(), 1); |
724 |
1 |
assertEquals(match.getEnd(), 3); |
725 |
1 |
match = searchResults.getResults().get(1); |
726 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
727 |
1 |
assertEquals(match.getStart(), 9); |
728 |
1 |
assertEquals(match.getEnd(), 11); |
729 |
|
|
730 |
|
|
731 |
|
|
732 |
|
|
733 |
|
|
734 |
|
|
735 |
1 |
hc.hideColumns(2, 5); |
736 |
1 |
f = new Finder(av); |
737 |
1 |
f.findAll("aaa", false, false, false, false); |
738 |
1 |
searchResults = f.getSearchResults(); |
739 |
1 |
assertEquals(searchResults.getCount(), 2); |
740 |
1 |
match = searchResults.getResults().get(0); |
741 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
742 |
1 |
assertEquals(match.getStart(), 1); |
743 |
1 |
assertEquals(match.getEnd(), 3); |
744 |
1 |
match = searchResults.getResults().get(1); |
745 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(3)); |
746 |
1 |
assertEquals(match.getStart(), 9); |
747 |
1 |
assertEquals(match.getEnd(), 11); |
748 |
|
|
749 |
|
|
750 |
|
|
751 |
|
|
752 |
1 |
f.findAll("BE", false, false, false, false); |
753 |
1 |
assertTrue(f.getSearchResults().isEmpty()); |
754 |
|
|
755 |
|
|
756 |
|
|
757 |
|
|
758 |
|
|
759 |
1 |
hc.revealAllHiddenColumns(new ColumnSelection()); |
760 |
1 |
hc.hideColumns(8, 13); |
761 |
1 |
f = new Finder(av); |
762 |
1 |
f.findNext("H", false, false, false, false); |
763 |
1 |
searchResults = f.getSearchResults(); |
764 |
1 |
assertEquals(searchResults.getCount(), 1); |
765 |
1 |
match = searchResults.getResults().get(0); |
766 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(2)); |
767 |
1 |
assertEquals(match.getStart(), 6); |
768 |
1 |
assertEquals(match.getEnd(), 6); |
769 |
|
} |
770 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
771 |
1 |
@Test(groups = "Functional")... |
772 |
|
public void testFind_withHiddenColumnsAndSelection() |
773 |
|
{ |
774 |
|
|
775 |
|
|
776 |
|
|
777 |
|
|
778 |
|
|
779 |
|
|
780 |
|
|
781 |
|
|
782 |
|
|
783 |
|
|
784 |
|
|
785 |
1 |
HiddenColumns hc = new HiddenColumns(); |
786 |
1 |
hc.hideColumns(2, 4); |
787 |
1 |
hc.hideColumns(6, 7); |
788 |
1 |
al.setHiddenColumns(hc); |
789 |
|
|
790 |
|
|
791 |
|
|
792 |
|
|
793 |
1 |
SequenceGroup sg = new SequenceGroup(); |
794 |
1 |
sg.addSequence(al.getSequenceAt(1), false); |
795 |
1 |
sg.addSequence(al.getSequenceAt(2), false); |
796 |
1 |
sg.setStartRes(0); |
797 |
1 |
sg.setEndRes(13); |
798 |
1 |
av.setSelectionGroup(sg); |
799 |
|
|
800 |
|
|
801 |
|
|
802 |
|
|
803 |
|
|
804 |
1 |
Finder f = new Finder(av); |
805 |
1 |
f.findAll("[AH]", false, false, false, false); |
806 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
807 |
1 |
assertEquals(searchResults.getCount(), 2); |
808 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
809 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
810 |
1 |
assertEquals(match.getStart(), 1); |
811 |
1 |
assertEquals(match.getEnd(), 1); |
812 |
1 |
match = searchResults.getResults().get(1); |
813 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
814 |
1 |
assertEquals(match.getStart(), 7); |
815 |
1 |
assertEquals(match.getEnd(), 7); |
816 |
|
} |
817 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (79) |
Complexity: 1 |
Complexity Density: 0.01 |
1PASS
|
|
818 |
1 |
@Test(groups = "Functional")... |
819 |
|
public void testFind_ignoreHiddenColumns() |
820 |
|
{ |
821 |
|
|
822 |
|
|
823 |
|
|
824 |
|
|
825 |
|
|
826 |
|
|
827 |
|
|
828 |
1 |
HiddenColumns hc = new HiddenColumns(); |
829 |
1 |
hc.hideColumns(2, 4); |
830 |
1 |
hc.hideColumns(7, 7); |
831 |
1 |
al.setHiddenColumns(hc); |
832 |
|
|
833 |
|
|
834 |
|
|
835 |
|
|
836 |
|
|
837 |
|
|
838 |
|
|
839 |
|
|
840 |
|
|
841 |
1 |
Finder f = new Finder(av); |
842 |
1 |
f.findAll("abe", false, false, false, true); |
843 |
1 |
SearchResultsI searchResults = f.getSearchResults(); |
844 |
|
|
845 |
|
|
846 |
|
|
847 |
|
|
848 |
|
|
849 |
1 |
assertEquals(searchResults.getCount(), 1); |
850 |
1 |
assertEquals(searchResults.getResults().size(), 2); |
851 |
1 |
SearchResultMatchI match = searchResults.getResults().get(0); |
852 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
853 |
1 |
assertEquals(match.getStart(), 8); |
854 |
1 |
assertEquals(match.getEnd(), 9); |
855 |
1 |
match = searchResults.getResults().get(1); |
856 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
857 |
1 |
assertEquals(match.getStart(), 12); |
858 |
1 |
assertEquals(match.getEnd(), 12); |
859 |
|
|
860 |
1 |
f = new Finder(av); |
861 |
1 |
f.findNext("a.E", false, false, false, true); |
862 |
1 |
searchResults = f.getSearchResults(); |
863 |
1 |
assertEquals(searchResults.getCount(), 1); |
864 |
1 |
assertEquals(searchResults.getResults().size(), 2); |
865 |
1 |
match = searchResults.getResults().get(0); |
866 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
867 |
1 |
assertEquals(match.getStart(), 8); |
868 |
1 |
assertEquals(match.getEnd(), 9); |
869 |
1 |
match = searchResults.getResults().get(1); |
870 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
871 |
1 |
assertEquals(match.getStart(), 12); |
872 |
1 |
assertEquals(match.getEnd(), 12); |
873 |
|
|
874 |
1 |
f.findNext("a.E", false, false, false, true); |
875 |
1 |
searchResults = f.getSearchResults(); |
876 |
1 |
assertEquals(searchResults.getCount(), 1); |
877 |
1 |
assertEquals(searchResults.getResults().size(), 2); |
878 |
1 |
match = searchResults.getResults().get(0); |
879 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
880 |
1 |
assertEquals(match.getStart(), 1); |
881 |
1 |
assertEquals(match.getEnd(), 1); |
882 |
1 |
match = searchResults.getResults().get(1); |
883 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
884 |
1 |
assertEquals(match.getStart(), 4); |
885 |
1 |
assertEquals(match.getEnd(), 5); |
886 |
|
|
887 |
|
|
888 |
|
|
889 |
|
|
890 |
|
|
891 |
1 |
f.findAll("BEG", false, false, false, true); |
892 |
1 |
searchResults = f.getSearchResults(); |
893 |
1 |
assertEquals(searchResults.getCount(), 1); |
894 |
1 |
assertEquals(searchResults.getResults().size(), 3); |
895 |
1 |
match = searchResults.getResults().get(0); |
896 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
897 |
1 |
assertEquals(match.getStart(), 9); |
898 |
1 |
assertEquals(match.getEnd(), 9); |
899 |
1 |
match = searchResults.getResults().get(1); |
900 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
901 |
1 |
assertEquals(match.getStart(), 12); |
902 |
1 |
assertEquals(match.getEnd(), 12); |
903 |
1 |
match = searchResults.getResults().get(2); |
904 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(0)); |
905 |
1 |
assertEquals(match.getStart(), 14); |
906 |
1 |
assertEquals(match.getEnd(), 14); |
907 |
|
|
908 |
|
|
909 |
|
|
910 |
|
|
911 |
|
|
912 |
|
|
913 |
1 |
SequenceGroup selection = new SequenceGroup(); |
914 |
1 |
selection.setStartRes(0); |
915 |
1 |
selection.setEndRes(9); |
916 |
1 |
al.getSequences().forEach(seq -> selection.addSequence(seq, false)); |
917 |
1 |
av.setSelectionGroup(selection); |
918 |
1 |
f.findAll("A.*H", false, false, false, true); |
919 |
1 |
searchResults = f.getSearchResults(); |
920 |
1 |
assertEquals(searchResults.getCount(), 1); |
921 |
1 |
assertEquals(searchResults.getResults().size(), 3); |
922 |
|
|
923 |
1 |
match = searchResults.getResults().get(0); |
924 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
925 |
1 |
assertEquals(match.getStart(), 1); |
926 |
1 |
assertEquals(match.getEnd(), 1); |
927 |
1 |
match = searchResults.getResults().get(1); |
928 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
929 |
1 |
assertEquals(match.getStart(), 4); |
930 |
1 |
assertEquals(match.getEnd(), 5); |
931 |
1 |
match = searchResults.getResults().get(2); |
932 |
1 |
assertSame(match.getSequence(), al.getSequenceAt(1)); |
933 |
1 |
assertEquals(match.getStart(), 7); |
934 |
1 |
assertEquals(match.getEnd(), 7); |
935 |
|
} |
936 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (30) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
937 |
1 |
@Test(groups = "Functional")... |
938 |
|
public void testFind_featuresOnly() |
939 |
|
{ |
940 |
1 |
Finder f = new Finder(av); |
941 |
|
|
942 |
1 |
f.findAll("Feature", false, false, false, true); |
943 |
1 |
assertEquals(f.getSearchResults().getCount(), 0); |
944 |
|
|
945 |
|
|
946 |
1 |
f.findAll("feature", true, false, true, true); |
947 |
1 |
assertEquals(f.getSearchResults().getCount(), 0); |
948 |
|
|
949 |
|
|
950 |
1 |
f.findAll("Feature", false, false, true, true); |
951 |
1 |
assertEquals(f.getSearchResults().getCount(), 3); |
952 |
|
|
953 |
1 |
List<SequenceI> seqs = f.getSearchResults().getMatchingSubSequences(); |
954 |
|
|
955 |
1 |
assertEquals(al.getSequenceAt(0).getDatasetSequence(), |
956 |
|
seqs.get(0).getDatasetSequence()); |
957 |
1 |
assertEquals(seqs.get(0).getStart(), 9); |
958 |
1 |
assertEquals(seqs.get(0).getEnd(), 11); |
959 |
1 |
assertEquals(al.getSequenceAt(3).getDatasetSequence(), |
960 |
|
seqs.get(1).getDatasetSequence()); |
961 |
1 |
assertEquals(seqs.get(1).getStart(), 9); |
962 |
1 |
assertEquals(seqs.get(1).getEnd(), 11); |
963 |
1 |
assertEquals(al.getSequenceAt(3).getDatasetSequence(), |
964 |
|
seqs.get(2).getDatasetSequence()); |
965 |
1 |
assertEquals(seqs.get(2).getStart(), 1); |
966 |
1 |
assertEquals(seqs.get(2).getEnd(), 3); |
967 |
|
|
968 |
1 |
SequenceI sq = null; |
969 |
|
|
970 |
|
|
971 |
1 |
f.findNext("Feature", false, false, true, true); |
972 |
1 |
assertEquals(f.getSearchResults().getCount(), 1); |
973 |
1 |
sq = f.getSearchResults().getMatchingSubSequences().get(0); |
974 |
1 |
assertEquals(sq.getSequenceAsString(), |
975 |
|
seqs.get(0).getSequenceAsString()); |
976 |
|
|
977 |
|
|
978 |
1 |
f.findNext("Feature", false, false, true, true); |
979 |
1 |
assertEquals(f.getSearchResults().getCount(), 1); |
980 |
1 |
sq = f.getSearchResults().getMatchingSubSequences().get(0); |
981 |
1 |
assertEquals(sq.getSequenceAsString(), |
982 |
|
seqs.get(1).getSequenceAsString()); |
983 |
|
|
984 |
|
|
985 |
1 |
f.findNext("Feature", false, false, true, true); |
986 |
1 |
assertEquals(f.getSearchResults().getCount(), 1); |
987 |
1 |
sq = f.getSearchResults().getMatchingSubSequences().get(0); |
988 |
1 |
assertEquals(sq.getSequenceAsString(), |
989 |
|
seqs.get(2).getSequenceAsString()); |
990 |
|
|
991 |
|
} |
992 |
|
} |