Package org.apache.http

Examples of org.apache.http.UnsupportedHttpVersionException


        this.connContext.setAttribute(HttpAsyncServiceHandler.HTTP_EXCHANGE, httpExchange);
        Mockito.when(this.decoder.isCompleted()).thenReturn(true);
        Mockito.when(this.requestConsumer.getException()).thenReturn(null);
        Object data = new Object();
        Mockito.when(this.requestConsumer.getResult()).thenReturn(data);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                this.requestHandler).handle(
                        Mockito.eq(data),
                        Mockito.any(HttpAsyncResponseTrigger.class),
                        Mockito.eq(exchangeContext));
View Full Code Here


            LOG.debug("Target URI: " + reqline.getUri());
        }

        HttpVersion ver = reqline.getHttpVersion();
        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
            throw new UnsupportedHttpVersionException("Unsupported HTTP version: " + ver);
        }

        MessageContext msgContext = new MessageContext();
        msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
View Full Code Here

        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 200, context)).thenReturn(response);
        HttpResponse error = new BasicHttpResponse(HttpVersion.HTTP_1_0, 500, "Oppsie");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 500, context)).thenReturn(error);
        Mockito.when(handlerResolver.lookup("/")).thenReturn(requestHandler);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                requestHandler).handle(request, response, context);
        Mockito.when(connReuseStrategy.keepAlive(error, context)).thenReturn(false);

        httpservice.handleRequest(conn, context);
View Full Code Here

        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 200, context)).thenReturn(response);
        final HttpResponse error = new BasicHttpResponse(HttpVersion.HTTP_1_0, 500, "Oppsie");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 500, context)).thenReturn(error);
        Mockito.when(handlerResolver.lookup(request)).thenReturn(requestHandler);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                requestHandler).handle(request, response, context);
        Mockito.when(connReuseStrategy.keepAlive(error, context)).thenReturn(Boolean.FALSE);

        httpservice.handleRequest(conn, context);
View Full Code Here

        this.connContext.setAttribute(HttpAsyncService.HTTP_EXCHANGE_STATE, state);
        Mockito.when(this.decoder.isCompleted()).thenReturn(true);
        Mockito.when(this.requestConsumer.getException()).thenReturn(null);
        Object data = new Object();
        Mockito.when(this.requestConsumer.getResult()).thenReturn(data);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                this.requestHandler).handle(
                        Mockito.eq(data),
                        Mockito.any(HttpAsyncExchange.class),
                        Mockito.eq(exchangeContext));
View Full Code Here

        this.connContext.setAttribute(HttpAsyncService.HTTP_EXCHANGE_STATE, state);
        Mockito.when(this.decoder.isCompleted()).thenReturn(true);
        Mockito.when(this.requestConsumer.getException()).thenReturn(null);
        Object data = new Object();
        Mockito.when(this.requestConsumer.getResult()).thenReturn(data);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                this.requestHandler).handle(
                        Mockito.eq(data),
                        Mockito.any(HttpAsyncExchange.class),
                        Mockito.eq(exchangeContext));
View Full Code Here

        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 200, context)).thenReturn(response);
        HttpResponse error = new BasicHttpResponse(HttpVersion.HTTP_1_0, 500, "Oppsie");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 500, context)).thenReturn(error);
        Mockito.when(handlerResolver.lookup("/")).thenReturn(requestHandler);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                requestHandler).handle(request, response, context);
        Mockito.when(connReuseStrategy.keepAlive(error, context)).thenReturn(false);

        httpservice.handleRequest(conn, context);
View Full Code Here

            LOG.debug("Target URI: " + reqline.getUri());
        }

        HttpVersion ver = reqline.getHttpVersion();
        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
            throw new UnsupportedHttpVersionException("Unsupported HTTP version: " + ver);
        }

        MessageContext msgContext = new MessageContext();
        msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
        try {
View Full Code Here

        this.connContext.setAttribute(HttpAsyncService.HTTP_EXCHANGE_STATE, state);
        Mockito.when(this.decoder.isCompleted()).thenReturn(Boolean.TRUE);
        Mockito.when(this.requestConsumer.getException()).thenReturn(null);
        Object data = new Object();
        Mockito.when(this.requestConsumer.getResult()).thenReturn(data);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                this.requestHandler).handle(
                        Mockito.eq(data),
                        Mockito.any(HttpAsyncExchange.class),
                        Mockito.eq(exchangeContext));
View Full Code Here

        HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 200, context)).thenReturn(response);
        HttpResponse error = new BasicHttpResponse(HttpVersion.HTTP_1_0, 500, "Oppsie");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 500, context)).thenReturn(error);
        Mockito.when(handlerResolver.lookup(request)).thenReturn(requestHandler);
        Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                requestHandler).handle(request, response, context);
        Mockito.when(connReuseStrategy.keepAlive(error, context)).thenReturn(Boolean.FALSE);

        httpservice.handleRequest(conn, context);
View Full Code Here

TOP

Related Classes of org.apache.http.UnsupportedHttpVersionException

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.