Package org.apache.http.nio.protocol

Examples of org.apache.http.nio.protocol.BasicAsyncRequestProducer


        Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());

        BasicHttpRequest request = new BasicHttpRequest("GET", "/");
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool);

        this.server.join(20000);
View Full Code Here


        Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());

        BasicHttpRequest request = new BasicHttpRequest("GET", "/");
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool);

        this.server.join(20000);
View Full Code Here

        Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, this.server.getStatus());

        BasicHttpRequest request = new BasicHttpRequest("GET", "/");
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool);

        requestConns.await();
        Assert.assertEquals(0, requestConns.getCount());
View Full Code Here

        };

        HttpRequest request = new BasicHttpRequest("GET", "/");
        HttpContext context = new BasicHttpContext();
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool, context, callback);

        Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
    }
View Full Code Here

        };

        HttpRequest request = new BasicHttpRequest("GET", "/");
        HttpContext context = new BasicHttpContext();
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool, context, callback);

        Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
    }
View Full Code Here

        };

        HttpRequest request = new BasicHttpRequest("GET", "/");
        HttpContext context = new BasicHttpContext();
        this.executor.execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                this.connpool, context, callback);

        Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
    }
View Full Code Here

        };
        final CountDownLatch latch = new CountDownLatch(targets.length);
        for (final HttpHost target: targets) {
            BasicHttpRequest request = new BasicHttpRequest("GET", "/");
            requester.execute(
                    new BasicAsyncRequestProducer(target, request),
                    new BasicAsyncResponseConsumer(),
                    pool,
                    new BasicHttpContext(),
                    // Handle HTTP response from a callback
                    new FutureCallback<HttpResponse>() {
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(targets.length);
        for (final HttpHost target: targets) {
            BasicHttpRequest request = new BasicHttpRequest("GET", "/");
            HttpCoreContext coreContext = HttpCoreContext.create();
            requester.execute(
                    new BasicAsyncRequestProducer(target, request),
                    new BasicAsyncResponseConsumer(),
                    pool,
                    coreContext,
                    // Handle HTTP response from a callback
                    new FutureCallback<HttpResponse>() {
View Full Code Here

            final HttpHost target,
            final HttpRequest request,
            final HttpContext context,
            final FutureCallback<HttpResponse> callback) {
        return execute(
                new BasicAsyncRequestProducer(target, request),
                new BasicAsyncResponseConsumer(),
                context != null ? context : new BasicHttpContext(),
                callback);
    }
View Full Code Here

        int count = RndTestPatternGenerator.generateCount(1000);

        HttpHost target = new HttpHost("localhost", ((InetSocketAddress)endpoint.getAddress()).getPort());
        BasicHttpRequest request = new BasicHttpRequest("GET", pattern + "x" + count);
        Future<HttpResponse> future = this.client.execute(
                new BasicAsyncRequestProducer(target, request),
                new LenientAsyncResponseConsumer(),
                null, null);

        HttpResponse response = future.get();
        Assert.assertNotNull(response);
View Full Code Here

TOP

Related Classes of org.apache.http.nio.protocol.BasicAsyncRequestProducer

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.