Examples of prepareGet()


Examples of com.ning.http.client.AsyncHttpClient.prepareGet()

            }
        }, new RecyclableBroadcaster("suspend"));

        AsyncHttpClient c = new AsyncHttpClient();
        try {
            c.prepareGet(urlTarget).execute(new AsyncCompletionHandler<String>() {

                @Override
                public String onCompleted(Response response) throws Exception {
                    try {
                        assertEquals(response.getResponseBody(),
View Full Code Here

Examples of org.asynchttpclient.AsyncHttpClient.prepareGet()

    @Test(groups = { "standalone", "default_provider" })
    public void testRequestLevelProxy() throws IOException, ExecutionException, TimeoutException, InterruptedException {
        AsyncHttpClient client = getAsyncHttpClient(null);
        try {
            String target = "http://127.0.0.1:1234/";
            Future<Response> f = client.prepareGet(target).setProxyServer(new ProxyServer("127.0.0.1", port1)).execute();
            Response resp = f.get(3, TimeUnit.SECONDS);
            assertNotNull(resp);
            assertEquals(resp.getStatusCode(), HttpServletResponse.SC_OK);
            assertEquals(resp.getHeader("target"), "/");
        } finally {
View Full Code Here

Examples of org.asynchttpclient.DefaultAsyncHttpClient.prepareGet()

        AsyncHttpClient client = new DefaultAsyncHttpClient(
                new GrizzlyAsyncHttpProvider(config), config);

        try {
            Future<org.asynchttpclient.Response> f = client.prepareGet(url).execute();
            org.asynchttpclient.Response r = f.get(10, TimeUnit.SECONDS);
            Assert.assertEquals(TEST_MESSAGE, r.getResponseBody());
        } finally {
            client.close();
        }
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareGet()

        client.prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet();

        StopWatch stopWatch = new StopWatch().start();
        for (long i = 0; i < OPERATIONS; i++) {
            client.prepareGet("test", "type1", "1").execute().actionGet();
        }
        stopWatch.stop();

        System.out.println("Ran in " + stopWatch.totalTime() + ", per second: " + (((double) OPERATIONS) / stopWatch.totalTime().secondsFrac()));
View Full Code Here

Examples of org.elasticsearch.client.transport.TransportClient.prepareGet()

                indexRequestBuilders[i] = client.prepareIndex("test", "test", id).setSource("field", "value" + i);
            }
            indexRandom(false, indexRequestBuilders);

            String randomId = "id" + randomInt(numDocs-1);
            GetResponse getResponse = client.prepareGet("test", "test", randomId).get();
            assertThat(getResponse.isExists(), equalTo(true));

            refresh();

            SearchResponse searchResponse = client.prepareSearch("test").get();
View Full Code Here

Examples of org.sonar.server.search.SearchClient.prepareGet()

  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareGet()
        .setIndex(IndexDefinition.RULE.getIndexName())
        .setType(IndexDefinition.RULE.getIndexType())
        .setId("ruleKey")
        .get();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.