Revision: 603
http://svn.sourceforge.net/jwebunit/?rev=603&view=rev
Author: henryju
Date: 2006-11-08 07:11:27 -0800 (Wed, 08 Nov 2006)
Log Message:
-----------
Move cookie path fix to HtmlUnitDialog, as it seems to be related to HttpClient
Cookie handling.
Modified Paths:
--------------
branches/1.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/TestContext.java
branches/1.x/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitDialog.java
Modified:
branches/1.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/TestContext.java
===================================================================
---
branches/1.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/TestContext.java
2006-11-08 15:04:53 UTC (rev 602)
+++
branches/1.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/TestContext.java
2006-11-08 15:11:27 UTC (rev 603)
@@ -105,7 +105,6 @@
public void addCookie(String name, String value, String domain) {
Cookie c = new Cookie(name, value);
c.setDomain(domain);
- c.setPath(""); //If we don't do this, cookie is not send to the
server.
cookies.add(c);
}
Modified:
branches/1.x/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitDialog.java
===================================================================
---
branches/1.x/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitDialog.java
2006-11-08 15:04:53 UTC (rev 602)
+++
branches/1.x/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitDialog.java
2006-11-08 15:11:27 UTC (rev 603)
@@ -230,8 +230,9 @@
c.setMaxAge(-1);
} else {
Date now = Calendar.getInstance().getTime();
- //Convert milli-second to second
- Long second = new
Long((expire.getTime()-now.getTime())/1000);
+ // Convert milli-second to second
+ Long second = new Long(
+ (expire.getTime() -
now.getTime()) / 1000);
c.setMaxAge(second.intValue());
}
c.setPath(cookies[i].getPath());
@@ -636,10 +637,11 @@
// Deal with cookies
for (Iterator i = getTestContext().getCookies().iterator();
i.hasNext();) {
javax.servlet.http.Cookie c =
(javax.servlet.http.Cookie) i.next();
+ //If Path==null, cookie is not send to the server.
wc.getWebConnection().getState().addCookie(
new Cookie(c.getDomain() != null ?
c.getDomain() : "", c
- .getName(),
c.getValue(), c.getPath(), c
- .getMaxAge(),
c.getSecure()));
+ .getName(),
c.getValue(), c.getPath() != null ? c
+ .getPath() : "",
c.getMaxAge(), c.getSecure()));
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development