You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shale.apache.org by cr...@apache.org on 2006/11/07 08:33:21 UTC

svn commit: r472014 - /shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java

Author: craigmcc
Date: Mon Nov  6 23:33:21 2006
New Revision: 472014

URL: http://svn.apache.org/viewvc?view=rev&rev=472014
Log:
Add explicit methods for resetting the currently saved page, as well as
accessing it, which will be useful in investigating back button behaviors
like SHALE-287.

Modified:
    shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java

Modified: shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java?view=diff&rev=472014&r1=472013&r2=472014
==============================================================================
--- shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java (original)
+++ shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java Mon Nov  6 23:33:21 2006
@@ -232,6 +232,16 @@
 
 
     /**
+     * <p>Return the currently stored page reference.</p>
+     */
+    protected HtmlPage page() {
+
+        return this.page;
+
+    }
+
+
+    /**
      * <p>Retrieve and return the page at the specified context relative path.
      * Save a reference to this page so that other utility methods may be used
      * to retrieve information from it.</p>
@@ -247,6 +257,20 @@
         HtmlPage page = (HtmlPage) webClient.getPage(url(path));
         this.page = page;
         return (page);
+
+    }
+
+
+    /**
+     * <p>Reset the stored page reference to the specified value.  This is
+     * useful for scenarios testing resubmit of the same page (simulating the
+     * user pressing the back button and then submitting again).</p>
+     *
+     * @param page Previously saved page to which to reset
+     */
+    protected void reset(HtmlPage page) {
+
+        this.page = page;
 
     }