Revision: 713
          http://jwebunit.svn.sourceforge.net/jwebunit/?rev=713&view=rev
Author:   henryju
Date:     2007-12-01 09:05:15 -0800 (Sat, 01 Dec 2007)

Log Message:
-----------
Custom RefreshHandler is no more needed with latest HtmlUnit.

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

Removed Paths:
-------------
    
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/ImmediateRefreshHandler.java

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
       2007-12-01 16:50:17 UTC (rev 712)
+++ 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
       2007-12-01 17:05:15 UTC (rev 713)
@@ -10,6 +10,7 @@
 import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider;
 import com.gargoylesoftware.htmlunit.ElementNotFoundException;
 import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.ImmediateRefreshHandler;
 import com.gargoylesoftware.htmlunit.JavaScriptPage;
 import com.gargoylesoftware.htmlunit.Page;
 import com.gargoylesoftware.htmlunit.PromptHandler;
@@ -84,7 +85,6 @@
 import org.apache.commons.httpclient.Cookie;
 import org.apache.commons.httpclient.HttpState;
 import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.logging.LogFactory;
 
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;

Deleted: 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/ImmediateRefreshHandler.java
===================================================================
--- 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/ImmediateRefreshHandler.java
 2007-12-01 16:50:17 UTC (rev 712)
+++ 
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/ImmediateRefreshHandler.java
 2007-12-01 17:05:15 UTC (rev 713)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * JWebUnit project (http://jwebunit.sourceforge.net)                         *
- * Distributed open-source, see full license under LICENCE.txt                *
- 
******************************************************************************/
-package net.sourceforge.jwebunit.htmlunit;
-
-import java.io.IOException;
-import java.net.URL;
-
-import com.gargoylesoftware.htmlunit.Page;
-import com.gargoylesoftware.htmlunit.RefreshHandler;
-import com.gargoylesoftware.htmlunit.SubmitMethod;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.WebRequestSettings;
-import com.gargoylesoftware.htmlunit.WebWindow;
-
-/**
- * Custom Handler until HtmlUnit fix. Cf Bug 1628076
- */
-public class ImmediateRefreshHandler implements RefreshHandler {
-
-    /**
-     * Immediately refreshes the specified page using the specified URL.
-     * 
-     * @param page The page that is going to be refreshed.
-     * @param url The URL where the new page will be loaded.
-     * @param seconds The number of seconds to wait before reloading the page 
(ignored!).
-     * @throws IOException if the refresh fails
-     */
-    public void handleRefresh(final Page page, final URL url, final int 
seconds)
-            throws IOException {
-        final WebWindow window = page.getEnclosingWindow();
-        if (window == null) {
-            return;
-        }
-        final WebClient client = window.getWebClient();
-        if (page.getWebResponse().getUrl().toExternalForm().equals(
-                url.toExternalForm())
-                && SubmitMethod.GET.equals(page.getWebResponse()
-                        .getRequestMethod())) {
-            if (seconds > 0) {
-                // Do not refresh
-                return;
-            } else {
-                final String msg = "Refresh Aborted by HtmlUnit: "
-                        + "Attempted to refresh a page using an 
ImmediateRefreshHandler "
-                        + "which could have caused an OutOfMemoryError "
-                        + "Please use WaitingRefreshHandler or 
ThreadedRefreshHandler instead.";
-                throw new RuntimeException(msg);
-            }
-        }
-        client.getPage(window, new WebRequestSettings(url));
-    }
-
-}


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

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to