Examples of BasicRequestLine


Examples of org.apache.http.message.BasicRequestLine

            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
    }
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
    }
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

        Assert.assertTrue(requestConsumer instanceof BasicAsyncRequestConsumer);
    }

    @Test
    public void testHandleRequest() throws Exception {
        Mockito.when(this.request.getRequestLine()).thenReturn(new BasicRequestLine("GET", "/", HttpVersion.HTTP_1_0));

        Cancellable cancellable = this.asyncRequestHandler.handle(this.request, this.trigger, this.context);

        Assert.assertNull(cancellable);
        ArgumentCaptor<HttpResponse> argCaptor = ArgumentCaptor.forClass(HttpResponse.class);
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

        Mockito.verify(this.trigger).submitResponse(Mockito.any(BasicAsyncResponseProducer.class));
    }

    @Test
    public void testHandleRequestUnsupportedVersion() throws Exception {
        Mockito.when(this.request.getRequestLine()).thenReturn(new BasicRequestLine("GET", "/", new HttpVersion(234, 456)));

        Cancellable cancellable = this.asyncRequestHandler.handle(this.request, this.trigger, this.context);

        Assert.assertNull(cancellable);
        ArgumentCaptor<HttpResponse> argCaptor = ArgumentCaptor.forClass(HttpResponse.class);
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
    }
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
    }
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

          } else {
            URL url = reverseUrl.getReverseUrl(request.getRequestLine().getUri());
            if (url == null) {
              throw new NotFoundException("url is null.");
            }
            BasicRequestLine line = new BasicRequestLine(
                request.getRequestLine().getMethod(),
                url.toString(),
                request.getRequestLine().getProtocolVersion());
            targetRequest = new ReverseHttpRequest(line, reverseUrl);
            targetRequest.setRequest(request, context);
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

   * <p>Constructs with the original request of {@link HttpRequest}.
   * @param request
   * @param reverseUrl
   */
  public ReverseHttpRequest(HttpRequest request, HttpContext context, ReverseUrl reverseUrl) {
    super(new BasicRequestLine(
          request.getRequestLine().getMethod(),
          reverseUrl.getReverseUrl(request.getRequestLine().getUri()).toString(),
          request.getRequestLine().getProtocolVersion())
    );
    this.reverseUrl = reverseUrl;
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

            requestUri = this.original.getRequestLine().getUri();
        }
        if (requestUri == null || requestUri.length() == 0) {
            requestUri = "/";
        }
        return new BasicRequestLine(this.method, requestUri, getProtocolVersion());
    }
View Full Code Here

Examples of org.apache.http.message.BasicRequestLine

    public static Test suite() {
        return new TestSuite(TestRequestLine.class);
    }

    public void testConstructor() {
        RequestLine requestline = new BasicRequestLine("GET", "/stuff", HttpVersion.HTTP_1_1);
        assertEquals("GET", requestline.getMethod());
        assertEquals("/stuff", requestline.getUri());
        assertEquals(HttpVersion.HTTP_1_1, requestline.getHttpVersion());
    }
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.