Package org.asynchttpclient

Examples of org.asynchttpclient.AsyncHttpClient


        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void basicAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server, false);
            f.get();
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here


        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void basicPreemptiveAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server, true);
            f.get();
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void digestAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server2, false);
            f.get();
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void digestPreemptiveAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server2, true);
            f.get();
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void basicFutureAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server, false);
            f.get(1, TimeUnit.SECONDS);
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void basicFuturePreemptiveAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server, true);
            f.get(1, TimeUnit.SECONDS);
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void digestFutureAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server2, false);
            f.get(1, TimeUnit.SECONDS);
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

        }
    }

    @Test(groups = { "standalone", "default_provider" }, enabled = false)
    public void digestFuturePreemptiveAuthTimeoutTest() throws Exception {
        AsyncHttpClient client = newClient();
        try {
            Future<Response> f = execute(client, server2, true);
            f.get(1, TimeUnit.SECONDS);
            fail("expected timeout");
        } catch (Exception e) {
            inspectException(e);
        } finally {
            client.close();
        }
    }
View Full Code Here

    @Test(groups = { "standalone", "default_provider" }, enabled = true)
    public void testUnauthorizedWhileUploading() throws Exception {
        File file = createTempFile(1024 * 1024);

        AsyncHttpClient client = getAsyncHttpClient(null);
        try {
            Response response = client.preparePut(getTargetUrl()).addBodyPart(new FilePart("test", file, "application/octet-stream", UTF_8)).execute()
                    .get();
            assertEquals(response.getStatusCode(), 401);
        } finally {
            client.close();
        }
    }
View Full Code Here

        return new ProxyHandler();
    }

    @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 {
            client.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.asynchttpclient.AsyncHttpClient

Copyright © 2018 www.massapicom. 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.