Examples of HttpRequestHandler


Examples of org.apache.commons.httpclient.server.HttpRequestHandler

                method.shouldCloseConnection(connectionManager.getConection()));
        assertTrue("Connection should be force-closed", method.isConnectionCloseForced());
    }
   
    public void testForceCloseConnection2() throws Exception {
        this.server.setRequestHandler(new HttpRequestHandler() {
            public boolean processRequest(SimpleHttpServerConnection conn,
                    SimpleRequest request) throws IOException {
                ResponseWriter out = conn.getWriter();
                out.println("HTTP/1.1 200 OK");
                out.println("Content-Type: garbage");
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpRequestHandler

        }
        assertTrue(connman.getConection().isOpen());
    }

    public void testRequestConnClose() throws Exception {
        this.server.setRequestHandler(new HttpRequestHandler() {
          
            public boolean processRequest(
                    final SimpleHttpServerConnection conn,
                    final SimpleRequest request) throws IOException {
View Full Code Here

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

Examples of org.apache.http.protocol.HttpRequestHandler

     * @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

Examples of org.apache.http.protocol.HttpRequestHandler

        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

Examples of org.apache.http.protocol.HttpRequestHandler

     *            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

Examples of org.apache.http.protocol.HttpRequestHandler

     * @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

Examples of org.apache.http.protocol.HttpRequestHandler

    @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

Examples of org.apache.http.protocol.HttpRequestHandler

        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

Examples of org.apache.http.protocol.HttpRequestHandler

        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
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.