Revision: 738
          http://jwebunit.svn.sourceforge.net/jwebunit/?rev=738&view=rev
Author:   henryju
Date:     2008-10-06 13:30:06 +0000 (Mon, 06 Oct 2008)

Log Message:
-----------
Updated to HtmlUnit 2.3

Modified Paths:
--------------
    
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
    trunk/pom.xml
    trunk/src/changes/changes.xml

Modified: 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
===================================================================
--- 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
       2008-07-30 14:18:34 UTC (rev 737)
+++ 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
       2008-10-06 13:30:06 UTC (rev 738)
@@ -83,9 +83,7 @@
 import net.sourceforge.jwebunit.util.TestContext;
 
 import org.apache.commons.httpclient.Cookie;
-import org.apache.commons.httpclient.HttpState;
 import org.apache.commons.httpclient.NameValuePair;
-
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
 import org.slf4j.Logger;
@@ -217,14 +215,13 @@
 
     public List<javax.servlet.http.Cookie> getCookies() {
         List<javax.servlet.http.Cookie> result = new 
LinkedList<javax.servlet.http.Cookie>();
-        final HttpState stateForUrl = wc.getWebConnection().getState();
-        Cookie[] cookies = stateForUrl.getCookies();
-        for (int i = 0; i < cookies.length; i++) {
+        Set<Cookie> cookies = wc.getCookieManager().getCookies();
+        for (Cookie cookie : cookies) {
             javax.servlet.http.Cookie c = new javax.servlet.http.Cookie(
-                    cookies[i].getName(), cookies[i].getValue());
-            c.setComment(cookies[i].getComment());
-            c.setDomain(cookies[i].getDomain());
-            Date expire = cookies[i].getExpiryDate();
+                    cookie.getName(), cookie.getValue());
+            c.setComment(cookie.getComment());
+            c.setDomain(cookie.getDomain());
+            Date expire = cookie.getExpiryDate();
             if (expire == null) {
                 c.setMaxAge(-1);
             } else {
@@ -234,9 +231,9 @@
                         (expire.getTime() - now.getTime()) / 1000);
                 c.setMaxAge(second.intValue());
             }
-            c.setPath(cookies[i].getPath());
-            c.setSecure(cookies[i].getSecure());
-            c.setVersion(cookies[i].getVersion());
+            c.setPath(cookie.getPath());
+            c.setSecure(cookie.getSecure());
+            c.setVersion(cookie.getVersion());
             result.add(c);
         }
         return result;
@@ -839,7 +836,7 @@
         // Deal with cookies
         for (javax.servlet.http.Cookie c : getTestContext().getCookies()) {
             // If Path==null, cookie is not send to the server.
-            wc.getWebConnection().getState().addCookie(
+            wc.getCookieManager().addCookie(
                     new Cookie(c.getDomain() != null ? c.getDomain() : "", c
                             .getName(), c.getValue(), c.getPath() != null ? c
                             .getPath() : "", c.getMaxAge(), c.getSecure()));

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml       2008-07-30 14:18:34 UTC (rev 737)
+++ trunk/pom.xml       2008-10-06 13:30:06 UTC (rev 738)
@@ -282,7 +282,7 @@
                        <dependency>
                                <groupId>net.sourceforge.htmlunit</groupId>
                                <artifactId>htmlunit</artifactId>
-                               <version>2.2</version>
+                               <version>2.3</version>
                        </dependency>
                        <dependency>
                                
<groupId>org.openqa.selenium.client-drivers</groupId>

Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml       2008-07-30 14:18:34 UTC (rev 737)
+++ trunk/src/changes/changes.xml       2008-10-06 13:30:06 UTC (rev 738)
@@ -9,7 +9,7 @@
     <body>
         <release version="2.0" date="UNKNOW">
             <action type="update" dev="henryju">
-                Updated to HtmlUnit 2.2.
+                Updated to HtmlUnit 2.3.
             </action>
             <action type="fix" dev="joshlane" issue="2007985,2009776" 
due-to="Josh Lane">
                 selectOptionByValue failed with Selenium Plugin.
@@ -17,7 +17,7 @@
                 Other improvements to Selenium plugin.
             </action>
             <action type="update" dev="henryju" issue="1950248" due-to="Agnes 
Ro">
-                Update to HtmlUnit 2.1 and Java 1.5.
+                Updated to HtmlUnit 2.1 and Java 1.5.
             </action>
        </release>
         <release version="1.5" date="april 22, 2008" description="The latest 
major release before Java 1.5 migration">


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to