Example usage for org.apache.http.cookie Cookie equals

List of usage examples for org.apache.http.cookie Cookie equals

Introduction

In this page you can find the example usage for org.apache.http.cookie Cookie equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.auraframework.integration.test.util.AuraHttpTestCase.java

/**
 * Checks there is no cookie in httpclient cookie store
 *
 * @param domain cookie domain/*ww w.  j ava  2 s.c  o  m*/
 * @param name cookie name
 * @param path cookie path
 * @throws Exception
 */
protected void assertNoCookie(String domain, String name, String path) throws Exception {
    Cookie expected = makeCookie(domain, name, null, path);
    for (Cookie cookie : getCookies()) {
        if (expected.equals(cookie)) {
            fail("Cookie was not deleted: " + cookie);
        }
    }
}

From source file:org.auraframework.integration.test.util.AuraHttpTestCase.java

/**
 * Checks for cookie//  w w  w.  ja  v a 2s  . c  om
 *
 * @param domain cookie domain
 * @param name cookie name
 * @param value cookie value
 * @param path cookie path
 * @throws Exception
 */
protected void assertCookie(String domain, String name, String path, String value) throws Exception {
    Cookie expected = makeCookie(domain, name, value, path);
    for (Cookie cookie : getCookies()) {
        if (expected.equals(cookie)) {
            assertEquals("Wrong cookie value!", expected.getValue(), cookie.getValue());
            return;
        }
    }
    fail("Missing cookie, expected " + expected);
}