Examples of JettyHttpClient


Examples of io.airlift.http.client.jetty.JettyHttpClient

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);

        server = injector.getInstance(TestingHttpServer.class);

        client = new JettyHttpClient();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

    @BeforeMethod
    public void setup()
            throws Exception
    {
        server = new TestingPrestoServer();
        client = new JettyHttpClient();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);

        server = injector.getInstance(TestingHttpServer.class);

        client = new JettyHttpClient();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

    @BeforeMethod
    public void setup()
            throws Exception
    {
        server = new TestingPrestoServer();
        client = new JettyHttpClient();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

    @BeforeMethod
    public void setup()
            throws Exception
    {
        server = new TestingPrestoServer();
        client = new JettyHttpClient();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

        catch (Exception e) {
            tearDownQueryFramework();
            throw e;
        }

        this.httpClient = new JettyHttpClient(
                new HttpClientConfig()
                        .setConnectTimeout(new Duration(1, TimeUnit.DAYS))
                        .setReadTimeout(new Duration(10, TimeUnit.DAYS)));

        long start = System.nanoTime();
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

        public QueryRunner(ClientSession session, ListeningExecutorService executor)
        {
            this.session = session;
            this.executor = executor;

            httpClient = new JettyHttpClient(new HttpClientConfig().setConnectTimeout(new Duration(10, TimeUnit.SECONDS)));
        }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

    @BeforeMethod
    public void setup()
            throws Exception
    {
        httpClient = new JettyHttpClient(new HttpClientConfig().setConnectTimeout(new Duration(10, SECONDS)));

        servlet = new DummyServlet();
        server = createServer(servlet);
        server.start();
    }
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

        HttpServerInfo httpServerInfo = injector.getInstance(HttpServerInfo.class);

        HttpServer server = injector.getInstance(HttpServer.class);
        server.start();

        try (HttpClient client = new JettyHttpClient()) {

            // test servlet bound correctly
            URI httpUri = httpServerInfo.getHttpUri();
            StatusResponse response = client.execute(prepareGet().setUri(httpUri).build(), createStatusResponseHandler());

            assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK);

            // test filter bound correctly
            response = client.execute(prepareGet().setUri(httpUri.resolve("/filter")).build(), createStatusResponseHandler());

            assertEquals(response.getStatusCode(), HttpServletResponse.SC_PAYMENT_REQUIRED);
            assertEquals(response.getStatusMessage(), "filtered");

            // test http resources
View Full Code Here

Examples of io.airlift.http.client.jetty.JettyHttpClient

        echoServlet.responseStatusCode = responseCode;
        echoServlet.responseHeaders.put("Content-Type", responseContentType);

        long beforeRequest = System.currentTimeMillis();
        long afterRequest;
        try (JettyHttpClient client = new JettyHttpClient()) {

            // test servlet bound correctly
            StringResponse response = client.execute(
                    preparePost().setUri(requestUri)
                            .addHeader(USER_AGENT, userAgent)
                            .addHeader(CONTENT_TYPE, requestContentType)
                            .addHeader(REFERER, referrer)
                            .addHeader("X-Airlift-TraceToken", token)
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.