use of org.kie.workbench.common.services.refactoring.model.index.terms.valueterms.ValueFullFileNameIndexTerm in project kie-wb-common by kiegroup.
the class ListAssetsTest method listFilesShouldNotHaveDuplicatesFromLibraryIndexer.
@Test
public void listFilesShouldNotHaveDuplicatesFromLibraryIndexer() throws IOException, InterruptedException {
// Add test files
addTestFile(TEST_MODULE_ROOT, "rule1.rule");
addTestFile(TEST_MODULE_ROOT, "rule2.rule");
addTestFile(TEST_MODULE_ROOT, "rule3.rule");
// wait for events to be consumed from jgit -> (notify changes -> watcher -> index) -> lucene index
Thread.sleep(5000);
{
final RefactoringPageRequest request = new RefactoringPageRequest(TestFindFilesQuery.NAME, new HashSet<ValueIndexTerm>() {
{
add(new ValueFullFileNameIndexTerm("*.rule", ValueIndexTerm.TermSearchType.WILDCARD));
}
}, 0, 10);
try {
final PageResponse<RefactoringPageRow> response = service.query(request);
assertNotNull(response);
for (RefactoringPageRow refactoringPageRow : response.getPageRowList()) {
System.out.println(refactoringPageRow.getValue());
}
assertEquals(3, response.getPageRowList().size());
} catch (IllegalArgumentException e) {
fail("Exception thrown: " + e.getMessage());
}
}
}
Aggregations