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] Created: (WICKET-1886) WicketTester Cookie handling

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:

{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}

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


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho closed WICKET-1886.
-----------------------------------

    Resolution: Fixed

There is now some cookie handling in WicketTester









> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho updated WICKET-1886:
------------------------------------

        Fix Version/s: 1.4-RC2
    Affects Version/s:     (was: 1.3.4)
                       1.3.5
                       1.4-RC1

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652012#action_12652012 ] 

Jörn Zaefferer commented on WICKET-1886:
----------------------------------------

I can't reproduce the issue with the attached file either, even though the SecureForm implementation is exactly the same. I'll post an update as soon as I find something.

If nothing helps, I'll try to extract my own test from the application.

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652001#action_12652001 ] 

Timo Rantalaiho commented on WICKET-1886:
-----------------------------------------

OK, thanks for the comments.  

Could you change the attached SecureFormTest so that it 
demonstrates the problem? There must be something I'm missing 
here.



> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho reopened WICKET-1886:
-------------------------------------


> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676273#action_12676273 ] 

Timo Rantalaiho commented on WICKET-1886:
-----------------------------------------

Jörn (or why not somebody else as well), could you provide a failing test?

As a patch or a quickstart.

I verified again that  SecureFormTest that I attached works on the SecureForm on the same patch, so I'm unsure on what needs to be done still.

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC3
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651996#action_12651996 ] 

Jörn Zaefferer commented on WICKET-1886:
----------------------------------------

Thanks Timo, but that doesn't fix it.

I think the problem is setupRequestAndResponse isn't called "often enough". The flow seems to be like this:

setup
add cookie to response
try to read previous cookie from request -> missing, therefore write new cookie
setup

So between rendering a page and submit a form and processing the submit, setupRequestAndResponse isn't called.

So in that respect, SecureForm needs to read a cookie from the request just after it was written to the response.

The WicketTesterTest is insufficient, as it never reads a cookie from the request after setting it to the response...

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680207#action_12680207 ] 

Jörn Zaefferer commented on WICKET-1886:
----------------------------------------

I'm unable to reproduce the problem outside of our application. Must be something wrong within...

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC3
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg closed WICKET-1886.
---------------------------------

    Resolution: Cannot Reproduce

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC3
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661642#action_12661642 ] 

Igor Vaynberg commented on WICKET-1886:
---------------------------------------

timo, any news?

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: CookieTest.java

> 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.


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

Posted by "Bruno Borges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647368#action_12647368 ] 

Bruno Borges commented on WICKET-1886:
--------------------------------------

The patch I submitted is against trunk (1.4)

> 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
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662116#action_12662116 ] 

Timo Rantalaiho commented on WICKET-1886:
-----------------------------------------

Yeah, unfortunately my holidays are about finishes so in the 
upcoming days IŽll fortunately be more at the computer again. 
IŽll try to look at that next week.



> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Frank Bille Jensen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-1886:
---------------------------------------

    Fix Version/s:     (was: 1.4-RC2)
                   1.4-RC3

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC3
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648129#action_12648129 ] 

Jörn Zaefferer commented on WICKET-1886:
----------------------------------------

Thanks for the patch Bruno. My simple test passes, but my actual application test doesn't. I'm struggling to extract a better testcase, I'll update once I've got something.

> 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
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff
>
>
> 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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651989#action_12651989 ] 

Timo Rantalaiho commented on WICKET-1886:
-----------------------------------------

Jörn, I've committed what I think fixes this issue. Could you please try with the latest snapshot? (Either 1.3.x branch or trunk, the fix is in both.)

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Bruno Borges (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruno Borges updated WICKET-1886:
---------------------------------

    Attachment: patch-WICKET-1886.diff

Apply this patch and check the test2() method inside CookieValuePersisterTest.

Update your own test and tell me if it works. :-)

Regards,
Bruno

> 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
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff
>
>
> 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.


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

Posted by "Jörn Zaefferer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647320#action_12647320 ] 

Jörn Zaefferer commented on WICKET-1886:
----------------------------------------

In testing a form where Cookies are required the flow is REQUEST ---> RESPONSE ---> REQUEST ---> RESPONSE ---> REQUEST and so on. So I need a way to simulate that flow and get the cookies from one response into the the next request.

I don't care about the semantics, as long as I can test my form with WicketTester instead of a browser. I'd be happy to manually "transfer" the cookie, but haven't found any way to do that.

> 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
>            Assignee: Timo Rantalaiho
>             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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho reassigned WICKET-1886:
---------------------------------------

    Assignee: Timo Rantalaiho

> 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
>            Assignee: Timo Rantalaiho
>             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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho updated WICKET-1886:
------------------------------------

    Attachment: WICKET-1886__SecureForm_and_failing_test.patch

Attached an example usage of FormTester to test SecurePage to demonstrate this bug.

> 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
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.


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

Posted by "Bruno Borges (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647289#action_12647289 ] 

Bruno Borges commented on WICKET-1886:
--------------------------------------

The flow of HTTP communications is always:

REQUEST ---> RESPONSE

** there's no flow like this:
RESPONSE ---> REQUEST

To be more clear, the Response object where you are adding cookies in, theoretically came from a different request than the one you are trying to get that cookie back from. So, of course it shouldn't be there. Now, if you create a request to add the cookie and read the cookie from the response, then on a second request that cookie should still be there, *if* it's time-to-live makes sense for this case.

Regards,
Bruno

> 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
>            Assignee: Timo Rantalaiho
>             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.


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

Posted by "Timo Rantalaiho (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Rantalaiho updated WICKET-1886:
------------------------------------

    Fix Version/s:     (was: 1.4-RC3)
                   1.4-RC2

Let's mark this as fixed in 1.3.6 and 1.4-rc2 anyway, because I put in the changes that enable SecureForm testing as far as I can tell.

If there are more problems with this issue, please open another issue (and link to this if relevant).

> WicketTester Cookie handling
> ----------------------------
>
>                 Key: WICKET-1886
>                 URL: https://issues.apache.org/jira/browse/WICKET-1886
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Jörn Zaefferer
>            Assignee: Timo Rantalaiho
>             Fix For: 1.3.6, 1.4-RC2
>
>         Attachments: CookieTest.java, patch-WICKET-1886.diff, WICKET-1886__SecureForm_and_failing_test.patch
>
>
> 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.