Search in sources :

Example 1 with Searcher

use of org.activityinfo.shared.command.handler.search.Searcher in project activityinfo by bedatadriven.

the class SearchTest method testSearchAll.

@Test
@Ignore
public void testSearchAll() throws CommandException {
    Logger.getLogger("com.bedatadriven.rebar").setLevel(Level.ALL);
    SearchResult result = execute(new Search("kivu"));
    assertTrue("Expected all searchers to succeed", result.getFailedSearchers().isEmpty());
    for (Searcher searcher : AllSearcher.supportedSearchers()) {
        assertHasDimension(searcher.getDimensionType(), result);
    }
    assertHasRestrictionWithIds(DimensionType.AdminLevel, result, 2, 3);
    assertHasRestrictionWithIds(DimensionType.Partner, result, 3);
    assertHasRestrictionWithIds(DimensionType.Project, result, 4);
    assertHasRestrictionWithIds(DimensionType.AttributeGroup, result, 3);
    assertHasRestrictionWithIds(DimensionType.Indicator, result, 675);
    assertHasRestrictionWithIds(DimensionType.Location, result, 1);
}
Also used : AllSearcher(org.activityinfo.shared.command.handler.search.AllSearcher) Searcher(org.activityinfo.shared.command.handler.search.Searcher) SearchResult(org.activityinfo.shared.command.result.SearchResult) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

AllSearcher (org.activityinfo.shared.command.handler.search.AllSearcher)1 Searcher (org.activityinfo.shared.command.handler.search.Searcher)1 SearchResult (org.activityinfo.shared.command.result.SearchResult)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1