Examples of CookieStore


Examples of org.apache.http.client.CookieStore

    @Test
    public void testCookieVersionSupportHeader3() throws Exception {
        this.localServer.register("*", new CookieVer2Service());

        final CookieStore cookieStore = new BasicCookieStore();
        final HttpContext context = new BasicHttpContext();
        context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);

        final HttpGet httpget = new HttpGet("/test/");

        final HttpResponse response1 = this.httpclient.execute(getServerHttp(), httpget, context);
        final HttpEntity e1 = response1.getEntity();
        EntityUtils.consume(e1);

        final List<Cookie> cookies = cookieStore.getCookies();
        Assert.assertNotNull(cookies);
        Assert.assertEquals(1, cookies.size());

        final HttpResponse response2 = this.httpclient.execute(getServerHttp(), httpget, context);
        final HttpEntity e2 = response2.getEntity();
View Full Code Here

Examples of org.apache.http.client.CookieStore

    @Test
    public void testSetCookieVersionMix() throws Exception {
        this.localServer.register("*", new SetCookieVersionMixService());

        final CookieStore cookieStore = new BasicCookieStore();
        final HttpContext context = new BasicHttpContext();
        context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);

        final HttpGet httpget = new HttpGet("/test/");

        final HttpResponse response1 = this.httpclient.execute(getServerHttp(), httpget, context);
        final HttpEntity e1 = response1.getEntity();
        EntityUtils.consume(e1);

        final List<Cookie> cookies = cookieStore.getCookies();
        Assert.assertNotNull(cookies);
        Assert.assertEquals(1, cookies.size());
        Assert.assertEquals("right", cookies.get(0).getValue());
        Assert.assertTrue(cookies.get(0) instanceof SetCookie2);
    }
View Full Code Here

Examples of org.apache.http.client.CookieStore

                .register(CookieSpecs.RFC_2965, new RFC2965SpecFactory())
                .register(CookieSpecs.IGNORE_COOKIES, new IgnoreSpecFactory())
                .build();
        }

        CookieStore defaultCookieStore = this.cookieStore;
        if (defaultCookieStore == null) {
            defaultCookieStore = new BasicCookieStore();
        }

        CredentialsProvider defaultCredentialsProvider = this.credentialsProvider;
View Full Code Here

Examples of org.apache.http.client.CookieStore

    public void testRedirectWithCookie() throws Exception {
        final HttpHost target = getServerHttp();

        this.localServer.register("*", new BasicRedirectService());

        final CookieStore cookieStore = new BasicCookieStore();

        final BasicClientCookie cookie = new BasicClientCookie("name", "value");
        cookie.setDomain(target.getHostName());
        cookie.setPath("/");

        cookieStore.addCookie(cookie);

        final HttpContext context = new BasicHttpContext();
        context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
        final HttpGet httpget = new HttpGet("/oldlocation/");

View Full Code Here

Examples of org.apache.slide.projector.store.CookieStore

        sessionStore = new SessionStore(request);
        formStore = new FormStore(this, sessionStore);
        requestAttributeStore = new RequestAttributeStore(request);
        requestParameterStore = new RequestParameterStore(request);
        requestHeaderStore = new RequestHeaderStore(request);
        cookieStore = new CookieStore(request, response);
    }
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.