* result
*/
@Test(groups = "Functional")
- public void testFind_maximalResultOnly()
+ public void testFindAll_maximalResultOnly()
{
Finder f = new Finder(av);
f.findAll("M+", false, false, false);
* Test finding next match of a sequence pattern in a selection group
*/
@Test(groups = "Functional")
- public void testFind_inSelection()
+ public void testFindNext_inSelection()
{
/*
* select sequences 2 and 3, columns 4-6 which contains
* Test finding all matches of a search pattern in a selection group
*/
@Test(groups = "Functional")
- public void testFind_findAllInSelection()
+ public void testFindAll_inSelection()
{
/*
* select sequences 2 and 3, columns 4-6 which contains
}
@Test(groups = "Functional")
- public void testFind_skipHiddenColumns()
+ public void testFind_ignoreHiddenColumns()
{
/*
* 0 5 9
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 14); // G
assertEquals(match.getEnd(), 14);
+
+ /*
+ * now select columns 0-9 and search for A.*H
+ * this should match in the second sequence (split as 3 matches)
+ * but not the first (as H is outside the selection)
+ */
+ SequenceGroup selection = new SequenceGroup();
+ selection.setStartRes(0);
+ selection.setEndRes(9);
+ al.getSequences().forEach(seq -> selection.addSequence(seq, false));
+ av.setSelectionGroup(selection);
+ f.findAll("A.*H", false, false, true);
+ searchResults = f.getSearchResults();
+ assertEquals(searchResults.getSize(), 3);
+ // match made of contiguous matches A, DE, H
+ match = searchResults.getResults().get(0);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 1); // A
+ assertEquals(match.getEnd(), 1);
+ match = searchResults.getResults().get(1);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 4); // D
+ assertEquals(match.getEnd(), 5); // E
+ match = searchResults.getResults().get(2);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 7); // H (there is no G)
+ assertEquals(match.getEnd(), 7);
}
}