Package org.apache.http.nio.protocol.HttpAsyncRequester

Examples of org.apache.http.nio.protocol.HttpAsyncRequester.ConnRequestCallback


                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        Exception oppsie = new Exception();
        connRequestCallback.failed(oppsie);
        Mockito.verify(this.responseConsumer).failed(oppsie);
        Mockito.verify(this.callback).failed(oppsie);
        Mockito.verify(this.responseConsumer).close();
        Mockito.verify(this.requestProducer).close();
    }
View Full Code Here


                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        connRequestCallback.cancelled();
        Mockito.verify(this.responseConsumer).cancel();
        Mockito.verify(this.callback).cancelled();
        Mockito.verify(this.responseConsumer).close();
        Mockito.verify(this.requestProducer).close();
    }
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        future.cancel(true);
        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        Mockito.verify(this.connPool).release(entry, true);
        Mockito.verify(this.conn, Mockito.never()).requestOutput();
    }
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        BasicAsyncRequestExecutionHandler exchangeHandler = (BasicAsyncRequestExecutionHandler) this.connContext.getAttribute(
                HttpAsyncRequestExecutor.HTTP_HANDLER);
        Assert.assertNotNull(exchangeHandler);
        Mockito.verify(this.conn).requestOutput();
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        BasicAsyncRequestExecutionHandler exchangeHandler = (BasicAsyncRequestExecutionHandler) this.connContext.getAttribute(
                HttpAsyncRequestExecutor.HTTP_HANDLER);
        Assert.assertNotNull(exchangeHandler);
        Mockito.verify(this.conn).requestOutput();
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        BasicAsyncRequestExecutionHandler exchangeHandler = (BasicAsyncRequestExecutionHandler) this.connContext.getAttribute(
                HttpAsyncRequestExecutor.HTTP_HANDLER);
        Assert.assertNotNull(exchangeHandler);
        Mockito.verify(this.conn).requestOutput();
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        Exception oppsie = new Exception();
        connRequestCallback.failed(oppsie);
        Mockito.verify(this.responseConsumer).failed(oppsie);
        Mockito.verify(this.callback).failed(oppsie);
        Mockito.verify(this.responseConsumer).close();
        Mockito.verify(this.requestProducer).close();
    }
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        connRequestCallback.cancelled();
        Mockito.verify(this.responseConsumer).cancel();
        Mockito.verify(this.callback).cancelled();
        Mockito.verify(this.responseConsumer).close();
        Mockito.verify(this.requestProducer).close();
    }
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        future.cancel(true);
        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        Mockito.verify(this.connPool).release(entry, true);
        Mockito.verify(this.conn, Mockito.never()).requestOutput();
    }
View Full Code Here

                this.connPool, this.exchangeContext, this.callback);
        Assert.assertNotNull(future);
        ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
        Mockito.verify(this.connPool).lease(
                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
        ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();

        BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
        connRequestCallback.completed(entry);
        BasicAsyncRequestExecutionHandler exchangeHandler = (BasicAsyncRequestExecutionHandler) this.connContext.getAttribute(
                HttpAsyncRequestExecutor.HTTP_HANDLER);
        Assert.assertNotNull(exchangeHandler);
        Mockito.verify(this.conn).requestOutput();
View Full Code Here

TOP

Related Classes of org.apache.http.nio.protocol.HttpAsyncRequester.ConnRequestCallback

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.