"a", "b", new Integer[] {},
"XXX", "<html><title>my title1</title><body><h1>wrong title</h1></body></html>", new Integer[] {},
"title", "<html><title>my title1</title><body><h1>wrong title</h1></body></html>", new Integer[] {3, 15}
};
for (int i = 0; i < testData.length; i+= 3) {
Resource resource = new Resource(((String) testData[i + 1]).getBytes(), MediatypeService.XHTML);
String content = SearchIndex.getSearchContent(new StringReader((String) testData[i + 1]));
String searchTerm = (String) testData[i];
Integer[] expectedResult = (Integer[]) testData[i + 2];
List<SearchResult> actualResult = SearchIndex.doSearch(searchTerm, content, resource);
assertEquals("test " + ((i / 3) + 1), expectedResult.length, actualResult.size());