Package org.apache.http.cookie

Examples of org.apache.http.cookie.CookieIdentityComparator


     * Default constructor.
     */
    public BasicCookieStore() {
        super();
        this.cookies = new ArrayList<Cookie>();
        this.cookieComparator = new CookieIdentityComparator();
    }
View Full Code Here


    private final TreeSet<Cookie> cookies;

    public OurBasicCookieStore() {
      super();
      this.cookies = new TreeSet<Cookie>(new CookieIdentityComparator());
    }
View Full Code Here

    private final TreeSet<Cookie> cookies;

    public OurBasicCookieStore() {
      super();
      this.cookies = new TreeSet<Cookie>(new CookieIdentityComparator());
    }
View Full Code Here

     * Default constructor.
     */
    public BasicCookieStore() {
        super();
        this.cookies = new ArrayList<Cookie>();
        this.cookieComparator = new CookieIdentityComparator();
    }
View Full Code Here


    // ----------------------------------------------------------- Test Methods

    public void testCookieIdentityComparasionByName() {
        CookieIdentityComparator comparator = new CookieIdentityComparator();
        BasicClientCookie c1 = new BasicClientCookie("name", "value1");
        BasicClientCookie c2 = new BasicClientCookie("name", "value2");
        assertTrue(comparator.compare(c1, c2) == 0);
       
        BasicClientCookie c3 = new BasicClientCookie("name1", "value");
        BasicClientCookie c4 = new BasicClientCookie("name2", "value");
        assertFalse(comparator.compare(c3, c4) == 0);
    }
View Full Code Here

        BasicClientCookie c4 = new BasicClientCookie("name2", "value");
        assertFalse(comparator.compare(c3, c4) == 0);
    }

    public void testCookieIdentityComparasionByNameAndDomain() {
        CookieIdentityComparator comparator = new CookieIdentityComparator();
        BasicClientCookie c1 = new BasicClientCookie("name", "value1");
        c1.setDomain("www.domain.com");
        BasicClientCookie c2 = new BasicClientCookie("name", "value2");
        c2.setDomain("www.domain.com");
        assertTrue(comparator.compare(c1, c2) == 0);
       
        BasicClientCookie c3 = new BasicClientCookie("name", "value1");
        c3.setDomain("www.domain.com");
        BasicClientCookie c4 = new BasicClientCookie("name", "value2");
        c4.setDomain("domain.com");
        assertFalse(comparator.compare(c3, c4) == 0);
    }
View Full Code Here

        c4.setDomain("domain.com");
        assertFalse(comparator.compare(c3, c4) == 0);
    }

    public void testCookieIdentityComparasionByNameAndNullDomain() {
        CookieIdentityComparator comparator = new CookieIdentityComparator();
        BasicClientCookie c1 = new BasicClientCookie("name", "value1");
        c1.setDomain(null);
        BasicClientCookie c2 = new BasicClientCookie("name", "value2");
        c2.setDomain(null);
        assertTrue(comparator.compare(c1, c2) == 0);
       
        BasicClientCookie c3 = new BasicClientCookie("name", "value1");
        c3.setDomain("www.domain.com");
        BasicClientCookie c4 = new BasicClientCookie("name", "value2");
        c4.setDomain(null);
        assertFalse(comparator.compare(c3, c4) == 0);
    }
View Full Code Here

        c4.setDomain(null);
        assertFalse(comparator.compare(c3, c4) == 0);
    }

    public void testCookieIdentityComparasionByNameAndLocalHost() {
        CookieIdentityComparator comparator = new CookieIdentityComparator();
        BasicClientCookie c1 = new BasicClientCookie("name", "value1");
        c1.setDomain("localhost");
        BasicClientCookie c2 = new BasicClientCookie("name", "value2");
        c2.setDomain("localhost");
        assertTrue(comparator.compare(c1, c2) == 0);
       
        BasicClientCookie c3 = new BasicClientCookie("name", "value1");
        c3.setDomain("localhost.local");
        BasicClientCookie c4 = new BasicClientCookie("name", "value2");
        c4.setDomain("localhost");
        assertTrue(comparator.compare(c3, c4) == 0);
    }
View Full Code Here

     * Default constructor.
     */
    public BasicCookieStore() {
        super();
        this.cookies = new ArrayList<Cookie>();
        this.cookieComparator = new CookieIdentityComparator();
    }
View Full Code Here

     * Default constructor.
     */
    public BasicCookieStore() {
        super();
        this.cookies = new ArrayList<Cookie>();
        this.cookieComparator = new CookieIdentityComparator();
    }
View Full Code Here

TOP

Related Classes of org.apache.http.cookie.CookieIdentityComparator

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.