Package org.xlightweb.client

Examples of org.xlightweb.client.HttpClient.addInterceptor()


        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
        httpClient.addInterceptor(new CacheHandler(5666));
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, resp.getStatus());
        Assert.assertEquals("test", resp.getBody().readString());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
View Full Code Here


        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
        httpClient.addInterceptor(new CacheHandler(5666));
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, resp.getStatus());
        Assert.assertEquals("test", resp.getBlockingBody().readString());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
View Full Code Here

        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
        httpClient.addInterceptor(new CacheHandler(5666));
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, resp.getStatus());
        Assert.assertEquals("test", resp.getBlockingBody().readString());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        RequestAuditHandler auditInterceptor = new RequestAuditHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        String s = "est12345678901234567890";
        // String s = "test";
       
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", s));
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        NonThreadedRequestAuditHandler auditInterceptor = new NonThreadedRequestAuditHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        String s = "est12345678901234567890";
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", s));
       
       
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        RequestAuditReverseHandler auditInterceptor = new RequestAuditReverseHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", "test12345678901234567890"));
       
       
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        NonThreadedRequestAuditReverseHandler auditInterceptor = new NonThreadedRequestAuditReverseHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", "test12345678901234567890"));
       
       
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        RequestAuditHandler auditInterceptor = new RequestAuditHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        String s = "est12345678901234567890";
        // String s = "test";
       
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", s));
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        NonThreadedRequestAuditHandler auditInterceptor = new NonThreadedRequestAuditHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        String s = "est12345678901234567890";
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", s));
       
       
View Full Code Here

        server.start();
      
        HttpClient httpClient = new HttpClient();
       
        RequestAuditReverseHandler auditInterceptor = new RequestAuditReverseHandler();
        httpClient.addInterceptor(auditInterceptor);
       
        IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort()+ "/", "text/plain", "test12345678901234567890"));
       
       
        Assert.assertEquals(200, response.getStatus());
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.