@Test
public void testDoQueryObject() {

    // build a query
    try {
        String querystr = "foo";
        Query q = new QueryParser("uri", analyzer).parse(querystr);
        Collection<Identifiable> results = searchService.doQuery(q, new SingleFieldURIMapper("uri"), dao);
        assertEquals("Wrong number of results", 1, results.size());
        assertTrue("Identifiable 'foo' not found", results.contains(foo));
        querystr = "bar";
        q = new QueryParser("uri", analyzer).parse(querystr);
        results = searchService.doQuery(q, new SingleFieldURIMapper("uri"), dao);
        assertEquals("Wrong number of results", 1, results.size());
        assertTrue("Identifiable 'bar' not found", results.contains(bar));
        querystr = "baz";
        q = new QueryParser("uri", analyzer).parse(querystr);
        results = searchService.doQuery(q, new SingleFieldURIMapper("uri"), dao);
        assertEquals("Wrong number of results", 1, results.size());
        assertTrue("Identifiable 'baz' not found", results.contains(baz));
    }
    catch (ParseException e) {
        e.printStackTrace();
        fail();
    }
    catch (IOException e) {
        e.printStackTrace();
        fail();
    }
}