author | alanb |
Fri, 02 Nov 2012 15:50:11 +0000 | |
changeset 14342 | 8435a30053c1 |
parent 13259 | f8aa59b3988e |
child 17926 | 1a74b1b8cad1 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
13259
diff
changeset
|
2 |
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
2 | 22 |
*/ |
23 |
||
24 |
/** |
|
25 |
* @test |
|
26 |
* @summary Unit test for java.net.HttpCookie |
|
4324
5fd48b8b450b
6901170: HttpCookie parsing of version and max-age mis-handled
jccollet
parents:
1932
diff
changeset
|
27 |
* @bug 6244040 6277796 6277801 6277808 6294071 6692802 6790677 6901170 |
2 | 28 |
* @author Edward Wang |
29 |
*/ |
|
30 |
||
31 |
import java.net.HttpCookie; |
|
32 |
import java.util.List; |
|
33 |
||
34 |
public class TestHttpCookie { |
|
35 |
private static int testCount = 0; |
|
36 |
||
37 |
private String cHeader = null; |
|
38 |
private List<HttpCookie> cookies = null; |
|
39 |
||
40 |
// test case here expressed as a string, which represents |
|
41 |
// the header string to be parsed into HttpCookie instance. |
|
42 |
// A TestHttpCookie instance will be created to hold such a HttpCookie |
|
43 |
// object, and TestHttpCookie class has utility methods to check equality |
|
44 |
// between HttpCookie's real property and expected property. |
|
45 |
static TestHttpCookie test(String cookieHeader) { |
|
46 |
testCount++; |
|
47 |
return new TestHttpCookie(cookieHeader); |
|
48 |
} |
|
49 |
||
50 |
TestHttpCookie(String cHeader) { |
|
51 |
this.cHeader = cHeader; |
|
52 |
||
53 |
try { |
|
54 |
List<HttpCookie> cookies = HttpCookie.parse(cHeader); |
|
55 |
this.cookies = cookies; |
|
56 |
} catch (IllegalArgumentException ignored) { |
|
57 |
cookies = null; |
|
58 |
} |
|
59 |
} |
|
60 |
||
61 |
// check name |
|
62 |
TestHttpCookie n(int index, String n) { |
|
63 |
HttpCookie cookie = cookies.get(index); |
|
64 |
if (cookie == null || !n.equalsIgnoreCase(cookie.getName())) { |
|
65 |
raiseError("name", cookie.getName(), n); |
|
66 |
} |
|
67 |
||
68 |
return this; |
|
69 |
} |
|
70 |
TestHttpCookie n(String n) { return n(0, n); } |
|
71 |
||
72 |
// check value |
|
73 |
TestHttpCookie v(int index, String v) { |
|
74 |
HttpCookie cookie = cookies.get(index); |
|
75 |
if (cookie == null || !v.equals(cookie.getValue())) { |
|
76 |
raiseError("value", cookie.getValue(), v); |
|
77 |
} |
|
78 |
||
79 |
return this; |
|
80 |
} |
|
81 |
TestHttpCookie v(String v) { return v(0, v); } |
|
82 |
||
83 |
// check version |
|
84 |
TestHttpCookie ver(int index, int ver) { |
|
85 |
HttpCookie cookie = cookies.get(index); |
|
86 |
if (cookie == null || (ver != cookie.getVersion())) { |
|
87 |
raiseError("version", Integer.toString(cookie.getVersion()), Integer.toString(ver)); |
|
88 |
} |
|
89 |
||
90 |
return this; |
|
91 |
} |
|
92 |
TestHttpCookie ver(int ver) { return ver(0, ver); } |
|
93 |
||
94 |
// check path |
|
95 |
TestHttpCookie p(int index, String p) { |
|
96 |
HttpCookie cookie = cookies.get(index); |
|
97 |
if (cookie == null || !p.equals(cookie.getPath())) { |
|
98 |
raiseError("path", cookie.getPath(), p); |
|
99 |
} |
|
100 |
||
101 |
return this; |
|
102 |
} |
|
103 |
TestHttpCookie p(String p) { return p(0, p); } |
|
104 |
||
105 |
// check null-ability |
|
106 |
TestHttpCookie nil() { |
|
107 |
if (cookies != null) { |
|
108 |
raiseError("Check null-ability fail"); |
|
109 |
} |
|
110 |
||
111 |
return this; |
|
112 |
} |
|
113 |
||
114 |
// check comment |
|
115 |
TestHttpCookie c(int index, String c) { |
|
116 |
HttpCookie cookie = cookies.get(index); |
|
117 |
if (cookie == null || !c.equals(cookie.getComment())) { |
|
118 |
raiseError("comment", cookie.getComment(), c); |
|
119 |
} |
|
120 |
||
121 |
return this; |
|
122 |
} |
|
123 |
TestHttpCookie c(String c) { return c(0, c); } |
|
124 |
||
125 |
// check comment url |
|
126 |
TestHttpCookie cu(int index, String cu) { |
|
127 |
HttpCookie cookie = cookies.get(index); |
|
128 |
if (cookie == null || !cu.equals(cookie.getCommentURL())) { |
|
129 |
raiseError("comment url", cookie.getCommentURL(), cu); |
|
130 |
} |
|
131 |
||
132 |
return this; |
|
133 |
} |
|
134 |
TestHttpCookie cu(String cu) { return cu(0, cu); } |
|
135 |
||
136 |
// check discard |
|
137 |
TestHttpCookie dsc(int index, boolean dsc) { |
|
138 |
HttpCookie cookie = cookies.get(index); |
|
139 |
if (cookie == null || (dsc != cookie.getDiscard())) { |
|
140 |
raiseError("discard", Boolean.toString(cookie.getDiscard()), Boolean.toString(dsc)); |
|
141 |
} |
|
142 |
||
143 |
return this; |
|
144 |
} |
|
145 |
TestHttpCookie dsc(boolean dsc) { return dsc(0, dsc); } |
|
146 |
||
147 |
// check domain |
|
148 |
TestHttpCookie d(int index, String d) { |
|
149 |
HttpCookie cookie = cookies.get(index); |
|
150 |
if (cookie == null || !d.equalsIgnoreCase(cookie.getDomain())) { |
|
151 |
raiseError("domain", cookie.getDomain(), d); |
|
152 |
} |
|
153 |
||
154 |
return this; |
|
155 |
} |
|
156 |
TestHttpCookie d(String d) { return d(0, d); } |
|
157 |
||
158 |
// check max-age |
|
159 |
TestHttpCookie a(int index, long a) { |
|
160 |
HttpCookie cookie = cookies.get(index); |
|
161 |
if (cookie == null || (a != cookie.getMaxAge())) { |
|
162 |
raiseError("max-age", Long.toString(cookie.getMaxAge()), Long.toString(a)); |
|
163 |
} |
|
164 |
||
165 |
return this; |
|
166 |
} |
|
167 |
TestHttpCookie a(long a) { return a(0, a); } |
|
168 |
||
169 |
// check port list |
|
170 |
TestHttpCookie port(int index, String p) { |
|
171 |
HttpCookie cookie = cookies.get(index); |
|
172 |
if (cookie == null || !p.equals(cookie.getPortlist())) { |
|
173 |
raiseError("portlist", cookie.getPortlist(), p); |
|
174 |
} |
|
175 |
||
176 |
return this; |
|
177 |
} |
|
178 |
TestHttpCookie port(String p) { return port(0, p); } |
|
179 |
||
1234
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
180 |
// check http only |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
181 |
TestHttpCookie httpOnly(int index, boolean b) { |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
182 |
HttpCookie cookie = cookies.get(index); |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
183 |
if (cookie == null || b != cookie.isHttpOnly()) { |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
184 |
raiseError("HttpOnly", String.valueOf(cookie.isHttpOnly()), String.valueOf(b)); |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
185 |
} |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
186 |
return this; |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
187 |
} |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
188 |
|
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
189 |
TestHttpCookie httpOnly(boolean b) { |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
190 |
return httpOnly(0, b); |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
191 |
} |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
192 |
|
2 | 193 |
// check equality |
194 |
static void eq(HttpCookie ck1, HttpCookie ck2, boolean same) { |
|
195 |
testCount++; |
|
196 |
if (ck1.equals(ck2) != same) { |
|
197 |
raiseError("Comparison inconsistent: " + ck1 + " " + ck2 |
|
198 |
+ " should " + (same ? "equal" : "not equal")); |
|
199 |
} |
|
200 |
||
201 |
int h1 = ck1.hashCode(); |
|
202 |
int h2 = ck2.hashCode(); |
|
203 |
if ((h1 == h2) != same) { |
|
204 |
raiseError("Comparison inconsistent: hashCode for " + ck1 + " " + ck2 |
|
205 |
+ " should " + (same ? "equal" : "not equal")); |
|
206 |
} |
|
207 |
} |
|
208 |
||
209 |
// check domainMatches() |
|
210 |
static void dm(String domain, String host, boolean matches) { |
|
211 |
testCount++; |
|
212 |
if (HttpCookie.domainMatches(domain, host) != matches) { |
|
213 |
raiseError("Host " + host + (matches?" should ":" should not ") + |
|
214 |
"domain-match with domain " + domain); |
|
215 |
} |
|
216 |
} |
|
217 |
||
218 |
void raiseError(String attr, String realValue, String expectedValue) { |
|
219 |
StringBuilder sb = new StringBuilder(); |
|
220 |
sb.append("Cookie ").append(attr).append(" is ").append(realValue). |
|
221 |
append(", should be ").append(expectedValue). |
|
222 |
append(" (").append(cHeader).append(")"); |
|
223 |
throw new RuntimeException(sb.toString()); |
|
224 |
} |
|
225 |
||
226 |
static void raiseError(String prompt) { |
|
227 |
throw new RuntimeException(prompt); |
|
228 |
} |
|
229 |
||
230 |
static void runTests() { |
|
231 |
rfc2965(); |
|
232 |
netscape(); |
|
233 |
misc(); |
|
234 |
} |
|
235 |
||
236 |
static void rfc2965() { |
|
237 |
header("Test using rfc 2965 syntax"); |
|
238 |
||
239 |
test("set-cookie2: Customer=\"WILE_E_COYOTE\"; Version=\"1\"; Path=\"/acme\"") |
|
240 |
.n("Customer").v("WILE_E_COYOTE").ver(1).p("/acme"); |
|
241 |
||
242 |
// whitespace between attr and = sign |
|
243 |
test("set-cookie2: Customer = \"WILE_E_COYOTE\"; Version = \"1\"; Path = \"/acme\"") |
|
244 |
.n("Customer").v("WILE_E_COYOTE").ver(1).p("/acme"); |
|
245 |
||
246 |
// a 'full' cookie |
|
247 |
test("set-cookie2: Customer=\"WILE_E_COYOTE\"" + |
|
248 |
";Version=\"1\"" + |
|
249 |
";Path=\"/acme\"" + |
|
250 |
";Comment=\"this is a coyote\"" + |
|
251 |
";CommentURL=\"http://www.coyote.org\"" + |
|
252 |
";Discard" + |
|
253 |
";Domain=\".coyote.org\"" + |
|
254 |
";Max-Age=\"3600\"" + |
|
255 |
";Port=\"80\"" + |
|
256 |
";Secure") |
|
257 |
.n("Customer").v("WILE_E_COYOTE").ver(1).p("/acme") |
|
258 |
.c("this is a coyote").cu("http://www.coyote.org").dsc(true) |
|
259 |
.d(".coyote.org").a(3600).port("80"); |
|
260 |
||
261 |
// a 'full' cookie, without leading set-cookie2 token |
|
262 |
test("Customer=\"WILE_E_COYOTE\"" + |
|
263 |
";Version=\"1\"" + |
|
264 |
";Path=\"/acme\"" + |
|
265 |
";Comment=\"this is a coyote\"" + |
|
266 |
";CommentURL=\"http://www.coyote.org\"" + |
|
267 |
";Discard" + |
|
268 |
";Domain=\".coyote.org\"" + |
|
269 |
";Max-Age=\"3600\"" + |
|
270 |
";Port=\"80\"" + |
|
271 |
";Secure") |
|
272 |
.n("Customer").v("WILE_E_COYOTE").ver(1).p("/acme") |
|
273 |
.c("this is a coyote").cu("http://www.coyote.org").dsc(true) |
|
274 |
.d(".coyote.org").a(3600).port("80"); |
|
275 |
||
276 |
// empty set-cookie string |
|
277 |
test("").nil(); |
|
278 |
||
279 |
// NullPointerException expected |
|
280 |
try { |
|
281 |
test(null); |
|
282 |
} catch (NullPointerException ignored) { |
|
283 |
// no-op |
|
284 |
} |
|
285 |
||
286 |
// bug 6277796 |
|
287 |
test("Set-Cookie2:Customer=\"dtftest\"; Discard; Secure; Domain=\".sun.com\"; Max-Age=\"100\"; Version=\"1\"; path=\"/www\"; Port=\"80\"") |
|
288 |
.n("Customer").v("dtftest").ver(1).d(".sun.com").p("/www").port("80").dsc(true).a(100); |
|
289 |
||
290 |
// bug 6277801 |
|
291 |
test("Set-Cookie2:Customer=\"dtftest\"; Discard; Secure; Domain=\".sun.com\"; Max-Age=\"100\"; Version=\"1\"; path=\"/www\"; Port=\"80\"" + |
|
292 |
";Domain=\".java.sun.com\"; Max-Age=\"200\"; path=\"/javadoc\"; Port=\"8080\"") |
|
293 |
.n("Customer").v("dtftest").ver(1).d(".sun.com").p("/www").port("80").dsc(true).a(100); |
|
294 |
||
295 |
// bug 6294071 |
|
296 |
test("Set-Cookie2:Customer=\"dtftest\";Discard; Secure; Domain=\"sun.com\"; Max-Age=\"100\";Version=\"1\"; Path=\"/www\"; Port=\"80,8080\"") |
|
297 |
.n("Customer").v("dtftest").ver(1).d("sun.com").p("/www").port("80,8080").dsc(true).a(100); |
|
298 |
test("Set-Cookie2:Customer=\"developer\";Domain=\"sun.com\";Max-Age=\"100\";Path=\"/www\";Port=\"80,8080\";CommentURL=\"http://www.sun.com/java1,000,000.html\"") |
|
299 |
.n("Customer").v("developer").d("sun.com").p("/www").port("80,8080").a(100).cu("http://www.sun.com/java1,000,000.html"); |
|
300 |
||
301 |
// a header string contains 2 cookies |
|
302 |
test("Set-Cookie2:C1=\"V1\";Domain=\".sun1.com\";path=\"/www1\";Max-Age=\"100\",C2=\"V2\";Domain=\".sun2.com\";path=\"/www2\";Max-Age=\"200\"") |
|
303 |
.n(0, "C1").v(0, "V1").p(0, "/www1").a(0, 100).d(0, ".sun1.com") |
|
304 |
.n(1, "C2").v(1, "V2").p(1, "/www2").a(1, 200).d(1, ".sun2.com"); |
|
1932
d3506bce7d27
6790677: java.net.HttpCookie.parse(String) should ignore unrecognized attributes, RFC2965
jccollet
parents:
1247
diff
changeset
|
305 |
|
d3506bce7d27
6790677: java.net.HttpCookie.parse(String) should ignore unrecognized attributes, RFC2965
jccollet
parents:
1247
diff
changeset
|
306 |
// Bug 6790677: Should ignore bogus attributes |
d3506bce7d27
6790677: java.net.HttpCookie.parse(String) should ignore unrecognized attributes, RFC2965
jccollet
parents:
1247
diff
changeset
|
307 |
test("Set-Cookie2:C1=\"V1\";foobar").n(0, "C1").v(0, "V1"); |
2 | 308 |
} |
309 |
||
310 |
static void netscape() { |
|
311 |
header("Test using netscape cookie syntax"); |
|
312 |
||
313 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT") |
|
314 |
.n("CUSTOMER").v("WILE_E_COYOTE").p("/").ver(0); |
|
315 |
||
316 |
// a Netscape cookie, without set-cookie leading token |
|
317 |
test("CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT") |
|
318 |
.n("CUSTOMER").v("WILE_E_COYOTE").p("/").ver(0); |
|
319 |
||
320 |
// a 'google' cookie |
|
321 |
test("Set-Cookie: PREF=ID=1eda537de48ac25d:CR=1:TM=1112868587:LM=1112868587:S=t3FPA-mT9lTR3bxU;" + |
|
322 |
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com") |
|
323 |
.n("PREF").v("ID=1eda537de48ac25d:CR=1:TM=1112868587:LM=1112868587:S=t3FPA-mT9lTR3bxU") |
|
324 |
.p("/").d(".google.com").ver(0); |
|
325 |
||
326 |
// bug 6277796 |
|
327 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT; Secure") |
|
328 |
.n("CUSTOMER").v("WILE_E_COYOTE").p("/").ver(0); |
|
329 |
||
330 |
// bug 6277801 |
|
331 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT; path=\"/acme\"") |
|
332 |
.n("CUSTOMER").v("WILE_E_COYOTE").p("/").ver(0); |
|
4324
5fd48b8b450b
6901170: HttpCookie parsing of version and max-age mis-handled
jccollet
parents:
1932
diff
changeset
|
333 |
|
5fd48b8b450b
6901170: HttpCookie parsing of version and max-age mis-handled
jccollet
parents:
1932
diff
changeset
|
334 |
// bug 6901170 |
5fd48b8b450b
6901170: HttpCookie parsing of version and max-age mis-handled
jccollet
parents:
1932
diff
changeset
|
335 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE; version='1'").ver(1); |
2 | 336 |
} |
337 |
||
338 |
static void misc() { |
|
339 |
header("Test equals()"); |
|
340 |
||
341 |
// test equals() |
|
342 |
HttpCookie c1 = new HttpCookie("Customer", "WILE_E_COYOTE"); |
|
343 |
c1.setDomain(".coyote.org"); |
|
344 |
c1.setPath("/acme"); |
|
345 |
HttpCookie c2 = (HttpCookie)c1.clone(); |
|
346 |
eq(c1, c2, true); |
|
347 |
||
348 |
// test equals() when domain and path are null |
|
349 |
c1 = new HttpCookie("Customer", "WILE_E_COYOTE"); |
|
350 |
c2 = new HttpCookie("CUSTOMER", "WILE_E_COYOTE"); |
|
351 |
eq(c1, c2, true); |
|
352 |
||
353 |
// path is case-sensitive |
|
354 |
c1 = new HttpCookie("Customer", "WILE_E_COYOTE"); |
|
355 |
c2 = new HttpCookie("CUSTOMER", "WILE_E_COYOTE"); |
|
356 |
c1.setPath("/acme"); |
|
357 |
c2.setPath("/ACME"); |
|
358 |
eq(c1, c2, false); |
|
359 |
||
360 |
header("Test domainMatches()"); |
|
10352
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
361 |
dm(".foo.com", "y.x.foo.com", false); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
362 |
dm(".foo.com", "x.foo.com", true); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
363 |
dm(".com", "whatever.com", false); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
364 |
dm(".com.", "whatever.com", false); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
365 |
dm(".ajax.com", "ajax.com", true); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
366 |
dm(".local", "example.local", true); |
edde66d3118f
7023713: HttpCookie.domainMatches("hostname.local", "hostname") should return true
chegar
parents:
7668
diff
changeset
|
367 |
dm("example.local", "example", true); |
2 | 368 |
|
369 |
// bug 6277808 |
|
370 |
testCount++; |
|
371 |
try { |
|
372 |
c1 = new HttpCookie("", "whatever"); |
|
373 |
} catch (IllegalArgumentException ignored) { |
|
374 |
// expected exception; no-op |
|
375 |
} |
|
1234
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
376 |
|
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
377 |
// CR 6692802: HttpOnly flag |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
378 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE;HttpOnly").httpOnly(true); |
e3dc213d4879
6692802: HttpCookie needs to support HttpOnly attribute
jccollet
parents:
2
diff
changeset
|
379 |
test("set-cookie: CUSTOMER=WILE_E_COYOTE").httpOnly(false); |
2 | 380 |
} |
381 |
||
382 |
static void header(String prompt) { |
|
383 |
System.out.println("== " + prompt + " =="); |
|
384 |
} |
|
385 |
||
386 |
public static void main(String[] args) { |
|
387 |
runTests(); |
|
388 |
||
389 |
System.out.println("Succeeded in running " + testCount + " tests."); |
|
390 |
} |
|
391 |
} |