use of java.net.CookieStore in project j2objc by google.
the class CookiesTest method testCookieStoreUriDropsPath.
public void testCookieStoreUriDropsPath() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("http://a.com/a/"), new HttpCookie("a", "android"));
assertEquals(Arrays.asList(new URI("http://a.com")), cookieStore.getURIs());
}
use of java.net.CookieStore in project j2objc by google.
the class CookiesTest method testCookieStoreRemoveAll.
public void testCookieStoreRemoveAll() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("http://code.google.com/"), new HttpCookie("a", "android"));
assertTrue(cookieStore.removeAll());
assertEquals(Collections.<URI>emptyList(), cookieStore.getURIs());
assertEquals(Collections.<HttpCookie>emptyList(), cookieStore.getCookies());
assertFalse("Expected removeAll() to return false when the call doesn't mutate the store", // RI6 fails this
cookieStore.removeAll());
}
use of java.net.CookieStore in project j2objc by google.
the class CookiesTest method testCookieStoreUriDropsQuery.
public void testCookieStoreUriDropsQuery() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("http://a.com/a/foo?query=value"), new HttpCookie("a", "android"));
assertEquals(Arrays.asList(new URI("http://a.com")), cookieStore.getURIs());
}
use of java.net.CookieStore in project j2objc by google.
the class CookiesTest method testCookieStoreUriUsesHttpSchemeAlways.
public void testCookieStoreUriUsesHttpSchemeAlways() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("https://a.com/"), new HttpCookie("a", "android"));
assertEquals(Arrays.asList(new URI("http://a.com")), cookieStore.getURIs());
}
use of java.net.CookieStore in project j2objc by google.
the class CookiesTest method testCookieStoreUriDropsFragment.
public void testCookieStoreUriDropsFragment() throws URISyntaxException {
CookieStore cookieStore = new CookieManager().getCookieStore();
cookieStore.add(new URI("http://a.com/a/foo#fragment"), new HttpCookie("a", "android"));
assertEquals(Arrays.asList(new URI("http://a.com")), cookieStore.getURIs());
}
Aggregations