Examples of CacheHandler


Examples of org.xlightweb.CacheHandler

        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

Examples of org.xlightweb.CacheHandler

        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

Examples of org.xlightweb.CacheHandler

        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

Examples of org.xlightweb.CacheHandler

   
    sessionManager = new SessionManager();
   
   
    retryHandler = new RetryHandler(HttpClient.this);
    cacheHandler = new CacheHandler(DEFAULT_CACHE_SIZE);
    cookiesHandler = new CookieHandler();
    redirectHandler = new RedirectHandler(this);
    proxyHandler = new ProxyHandler(this);
   
   
View Full Code Here

Examples of org.xlightweb.CacheHandler

   
    sessionManager = new SessionManager();
   
   
    retryHandler = new RetryHandler(HttpClient.this);
    cacheHandler = new CacheHandler(DEFAULT_CACHE_SIZE);
    cookiesHandler = new CookieHandler();
    redirectHandler = new RedirectHandler(this);
    proxyHandler = new ProxyHandler(pool);
   
   
View Full Code Here

Examples of org.xlightweb.CacheHandler

   
    sessionManager = new SessionManager();
   
   
    retryHandler = new RetryHandler(HttpClient.this);
    cacheHandler = new CacheHandler(DEFAULT_CACHE_SIZE);
    cookiesHandler = new CookieHandler();
    redirectHandler = new RedirectHandler(this);
    proxyHandler = new ProxyHandler(pool);
   
   
View Full Code Here

Examples of org.xlightweb.CacheHandler

   
    sessionManager = new SessionManager();
   
   
    retryHandler = new RetryHandler(HttpClient.this);
    cacheHandler = new CacheHandler(DEFAULT_CACHE_SIZE);
    redirectHandler = new RedirectHandler(this);
    cookiesHandler = new CookieHandler();
    proxyHandler = new ProxyHandler(this);
   
   
View Full Code Here

Examples of se.cgbystrom.netty.http.CacheHandler

    @Test
    public void cacheMaxAge() throws IOException, InterruptedException {
        final String content = "Testing the file system";
        File f = createTemporaryFile(content);
        startServer(new CacheHandler(), new ChunkedWriteHandler(), new FileServerHandler(f.getParent(), 100));
        Thread.sleep(1000);

        assertEquals(content, get("/" + f.getName()));
        assertTrue(f.delete());
        assertEquals(content, get("/" + f.getName()));
View Full Code Here

Examples of se.cgbystrom.netty.http.CacheHandler

    @Test
    public void cacheMaxAgeExpire() throws IOException, InterruptedException {
        final String content = "Testing the file system";
        File f = createTemporaryFile(content);
        startServer(new CacheHandler(), new ChunkedWriteHandler(), new FileServerHandler(f.getParent(), 1));
        Thread.sleep(1000);

        assertEquals(content, get("/" + f.getName()));
        Thread.sleep(2000);
        assertTrue(f.delete());
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.