Search in sources :

Example 1 with DefaultRenderer

use of com.yahoo.search.rendering.DefaultRenderer in project vespa by vespa-engine.

the class SearchHandlerTestCase method testResponseBasics.

@Test
public void testResponseBasics() {
    Query q = new Query("?query=dummy&tracelevel=3");
    q.trace("nalle", 1);
    Result r = new Result(q);
    r.hits().addError(ErrorMessage.createUnspecifiedError("bamse"));
    r.hits().add(new Hit("http://localhost/dummy", 0.5));
    HttpSearchResponse s = new HttpSearchResponse(200, r, q, new DefaultRenderer());
    assertEquals("text/xml", s.getContentType());
    assertNull(s.getCoverage());
    assertEquals("query 'dummy'", s.getParsedQuery());
    assertEquals(5000, s.getTiming().getTimeout());
}
Also used : Hit(com.yahoo.search.result.Hit) Query(com.yahoo.search.Query) DefaultRenderer(com.yahoo.search.rendering.DefaultRenderer) HttpSearchResponse(com.yahoo.search.handler.HttpSearchResponse) Result(com.yahoo.search.Result) Test(org.junit.Test)

Aggregations

Query (com.yahoo.search.Query)1 Result (com.yahoo.search.Result)1 HttpSearchResponse (com.yahoo.search.handler.HttpSearchResponse)1 DefaultRenderer (com.yahoo.search.rendering.DefaultRenderer)1 Hit (com.yahoo.search.result.Hit)1 Test (org.junit.Test)1