Search in sources :

Example 1 with Connection

use of com.yahoo.search.federation.http.Connection in project vespa by vespa-engine.

the class HttpPostTestCase method testPostingSearcher.

@Test
public void testPostingSearcher() throws Exception {
    StupidSingleThreadedHttpServer server = new StupidSingleThreadedHttpServer();
    server.start();
    TestPostSearcher searcher = new TestPostSearcher(new ComponentId("foo:1"), Arrays.asList(new Connection("localhost", server.getServerPort())), "/");
    Query q = new Query("");
    q.setTimeout(10000000L);
    Execution e = new Execution(searcher, Execution.Context.createContextStub());
    searcher.search(q, e);
    assertThat(server.getRequest(), containsString("My POST body"));
    server.stop();
}
Also used : Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) StupidSingleThreadedHttpServer(com.yahoo.search.StupidSingleThreadedHttpServer) Connection(com.yahoo.search.federation.http.Connection) ComponentId(com.yahoo.component.ComponentId) Test(org.junit.Test)

Aggregations

ComponentId (com.yahoo.component.ComponentId)1 Query (com.yahoo.search.Query)1 StupidSingleThreadedHttpServer (com.yahoo.search.StupidSingleThreadedHttpServer)1 Connection (com.yahoo.search.federation.http.Connection)1 Execution (com.yahoo.search.searchchain.Execution)1 Test (org.junit.Test)1