1 29 30 package org.apache.commons.httpclient.cookie; 31 32 import junit.framework.TestCase; 33 34 import org.apache.commons.httpclient.Cookie; 35 import org.apache.commons.httpclient.Header; 36 37 43 public class TestCookieBase extends TestCase { 44 45 47 public TestCookieBase(String name) { 48 super(name); 49 } 50 51 public static Cookie[] cookieParse( 52 final CookieSpec parser, 53 String host, 54 int port, 55 String path, 56 boolean isSecure, 57 Header setHeader) 58 throws MalformedCookieException { 59 Cookie[] cookies = parser.parse(host, port, path, isSecure, setHeader); 60 if (cookies != null) { 61 for (int i = 0; i < cookies.length; i++) { 62 parser.validate(host, port, path, isSecure, cookies[i]); 63 } 64 } 65 return cookies; 66 } 67 } 68 | Popular Tags |