Package org.apache.http.protocol

Examples of org.apache.http.protocol.HttpRequestHandler


        mgr.shutdown();
    }

    public void testReleaseOnIOException() throws Exception {
       
        localServer.register("/dropdead", new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here


     * @throws Exception
     *             if there was a problem
     */
    @Test
    public void testResponseWithNoContent() throws Exception {
        this.localServer.register("*", new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(
View Full Code Here

        final String entityText = "Hello, this is some plain text coming back.";

        /* Assume that server will see an Accept-Encoding header. */
        final boolean [] sawAcceptEncodingHeader = { true };

        this.localServer.register("*", new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException, IOException {
View Full Code Here

     *            then it will return an RFC2616 compliant deflate encoded zlib stream.
     * @return a non-null {@link HttpRequestHandler}
     */
    private HttpRequestHandler createDeflateEncodingRequestHandler(
            final String entityText, final boolean rfc1951) {
        return new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(
View Full Code Here

     * @param entityText
     *            the non-null String entity to be returned by the server
     * @return a non-null {@link HttpRequestHandler}
     */
    private HttpRequestHandler createGzipEncodingRequestHandler(final String entityText) {
        return new HttpRequestHandler() {

            /**
             * {@inheritDoc}
             */
            public void handle(
View Full Code Here

    @Test
    public void testBasicRedirect302NoLocation() throws Exception {
        InetSocketAddress address = this.localServer.getServiceAddress();
        int port = address.getPort();
        String host = address.getHostName();
        this.localServer.register("*", new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

        final int connNo = 10;
        final RequestCount requestConns = new RequestCount(connNo);
        final RequestCount closedServerConns = new RequestCount(connNo);
        final RequestCount closedClientConns = new RequestCount(connNo);
       
        HttpRequestHandler requestHandler = new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

        assertEquals(0, closedServerConns.getValue());
    }
   
    public void testRuntimeException() throws Exception {

        HttpRequestHandler requestHandler = new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

    public void testUnhandledRuntimeException() throws Exception {

        final RequestCount requestConns = new RequestCount(1);
       
        HttpRequestHandler requestHandler = new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

    public void testHandledRuntimeException() throws Exception {

        final RequestCount requestConns = new RequestCount(1);
       
        HttpRequestHandler requestHandler = new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

TOP

Related Classes of org.apache.http.protocol.HttpRequestHandler

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.