Fix test failures
This commit is contained in:
parent
a6e3d7d0ca
commit
0eb7a42c69
@ -93,11 +93,24 @@ public class CookieEncoderTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEncodingMultipleCookies() {
|
public void testEncodingMultipleServerCookies() {
|
||||||
String c1 = "myCookie=myValue;Max-Age=50;Path=\"/apathsomewhere\";Domain=.adomainsomewhere;Secure;Comment=\"this is a Comment\";Version=1;CommentURL=\"http://aurl.com\";Port=\"80,8080\";Discard;";
|
|
||||||
String c2 = "myCookie2=myValue2;Path=\"/anotherpathsomewhere\";Domain=.anotherdomainsomewhere;Comment=\"this is another Comment\";Version=1;CommentURL=\"http://anotherurl.com\";";
|
|
||||||
String c3 = "myCookie3=myValue3;Version=1";
|
|
||||||
CookieEncoder encoder = new CookieEncoder(true);
|
CookieEncoder encoder = new CookieEncoder(true);
|
||||||
|
encoder.addCookie("a", "b");
|
||||||
|
encoder.addCookie("b", "c");
|
||||||
|
try {
|
||||||
|
encoder.encode();
|
||||||
|
fail();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
// Expected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEncodingMultipleClientCookies() {
|
||||||
|
String c1 = "$Version=1;myCookie=myValue;$Path=\"/apathsomewhere\";$Domain=.adomainsomewhere;$Port=\"80,8080\";";
|
||||||
|
String c2 = "$Version=1;myCookie2=myValue2;$Path=\"/anotherpathsomewhere\";$Domain=.anotherdomainsomewhere;";
|
||||||
|
String c3 = "$Version=1;myCookie3=myValue3";
|
||||||
|
CookieEncoder encoder = new CookieEncoder(false);
|
||||||
Cookie cookie = new DefaultCookie("myCookie", "myValue");
|
Cookie cookie = new DefaultCookie("myCookie", "myValue");
|
||||||
cookie.setVersion(1);
|
cookie.setVersion(1);
|
||||||
cookie.setComment("this is a Comment");
|
cookie.setComment("this is a Comment");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user