assertEquals(match.getStart(), 6);
assertEquals(match.getEnd(), 6);
}
+
+ @Test(groups = "Functional")
+ public void testFind_withHiddenColumnsAndSelection()
+ {
+ /*
+ * 0 5 9
+ * ABCD--EF-GHI
+ * A--BCDefHI
+ * --bcdEFH
+ * aa---aMMMMMaaa
+ */
+
+ /*
+ * hide columns 2-4 and 6-7
+ */
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(2, 4);
+ hc.hideColumns(6, 7);
+ al.setHiddenColumns(hc);
+
+ /*
+ * select rows 2-3
+ */
+ SequenceGroup sg = new SequenceGroup();
+ sg.addSequence(al.getSequenceAt(1), false);
+ sg.addSequence(al.getSequenceAt(2), false);
+ sg.setStartRes(0);
+ sg.setEndRes(13);
+
+ /*
+ * find all search for A or H
+ * should match seq2/1, seq2/7, not seq3/6
+ */
+ Finder f = new Finder(al, sg);
+ f.setFindAll(true);
+ f.find("[AH]");
+ SearchResultsI searchResults = f.getSearchResults();
+ assertEquals(searchResults.getSize(), 2);
+ SearchResultMatchI match = searchResults.getResults().get(0);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 1);
+ assertEquals(match.getEnd(), 1);
+ match = searchResults.getResults().get(1);
+ assertSame(match.getSequence(), al.getSequenceAt(1));
+ assertEquals(match.getStart(), 7);
+ assertEquals(match.getEnd(), 7);
+ }
}