Recently I was upgrading my jWebUnit from 1.1.1 to 1.2 and I had to change a few lines of my code. Where I used to call:
getDialog().getWebConversation().getCookieValue(cookieName)
I figured I would switch to:
getDialog().getCookieValue(cookieName)
However, this does not produce the same results. After looking at it for a bit, I believe I see why. The HttpUnitDialog.getCookies() method is only going to consider cookies which were sent with the current response. What I'm looking for is to reference all cookies which have been sent during the test. This could be accomplished by changing the methods in HttpUnitDialog to use the WebClient.getCookieNames() and WebClient.getCookieValue().
I would suggest modifying the HttpUnitDialog.hasCookie() and HttpUnitDialog.getCookieValue(). I would also suggest modifying the HttpUnitDialog.dumpCookies(), although this method's javadoc comments do correctly state that it dumps the response's cookies.
I know I'm not the only one who expected this behaviour, there seem to be 2 or 3 posts on the users list which relate to this issue.
I'd be happy to submit a patch with these changes if they sound good.
Brian ..
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development
