You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jörn Zaefferer (JIRA)" <ji...@apache.org> on 2008/10/22 14:50:44 UTC

[jira] Updated: (WICKET-1886) WicketTester Cookie handling

     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörn Zaefferer updated WICKET-1886:
-----------------------------------

    Description: 
While trying to test my SecureForm implementation (https://issues.apache.org/jira/browse/WICKET-1885) with WicketTester I ran into this issue: A cookie set in the response never shows up in the "next" request, because both have their own lists of cookies that aren't shared.

Afaik both should share the same List instance to handle cookies. That way its possible to set a cookie in the response and read it from the request.

A simple testcase is attached.

  was:
While trying to test my SecureForm implementation (https://issues.apache.org/jira/browse/WICKET-1885) with WicketTester I ran into this issue: A cookie set in the response never shows up in the "next" request, because both have their own lists of cookies that aren't shared.

Afaik both should share the same List instance to handle cookies. That way its possible to set a cookie in the response and read it from the request.

A simple testcase:

{code:title=CookieTest.java|borderStyle=solid}
import javax.servlet.http.Cookie;

import org.apache.wicket.util.tester.WicketTester;

import junit.framework.TestCase;

public class CookieTest extends TestCase {

	public void testWicketTesterCookies() {
		WicketTester tester = new WicketTester();
		tester.getWicketResponse().addCookie(new Cookie("foo", "bar"));
		assertEquals("bar", tester.getWicketRequest().getCookie("foo").getValue());
	}
	
}
{code}


> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.4
>            Reporter: Jörn Zaefferer
>             Fix For: 1.3.6
>
>         Attachments: CookieTest.java
>
>
> While trying to test my SecureForm implementation (https://issues.apache.org/jira/browse/WICKET-1885) with WicketTester I ran into this issue: A cookie set in the response never shows up in the "next" request, because both have their own lists of cookies that aren't shared.
> Afaik both should share the same List instance to handle cookies. That way its possible to set a cookie in the response and read it from the request.
> A simple testcase is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.