Revision: 598
          http://svn.sourceforge.net/jwebunit/?rev=598&view=rev
Author:   henryju
Date:     2006-11-05 10:20:09 -0800 (Sun, 05 Nov 2006)

Log Message:
-----------
Update API (Cookies)

Modified Paths:
--------------
    
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/IJWebUnitDialog.java
    
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/JWebUnitTester.java
    
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/locator/HtmlElementLocator.java

Modified: 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/IJWebUnitDialog.java
===================================================================
--- 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/IJWebUnitDialog.java 
    2006-11-05 15:13:04 UTC (rev 597)
+++ 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/IJWebUnitDialog.java 
    2006-11-05 18:20:09 UTC (rev 598)
@@ -7,6 +7,8 @@
 import java.net.URL;
 import java.util.List;
 
+import javax.servlet.http.Cookie;
+
 import net.sourceforge.jwebunit.exception.ElementNotFoundException;
 import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
 import net.sourceforge.jwebunit.html.SelectOption;
@@ -66,40 +68,19 @@
     void setScriptingEnabled(boolean value);
 
     /**
-     * Test if a cookie is present with given name.
+     * Get all cookies in current session.
      * 
-     * @param cookieName
-     *            name of the cookie.
-     * @return true if the cookie is present.
      */
-    boolean hasCookie(String cookieName);
+    List<Cookie> getCookies();
 
     /**
-     * Get cookie value.
-     * 
-     * @param cookieName
-     *            name of the cookie.
-     * @return value of the cookie.
-     */
-    String getCookieValue(String cookieName);
-
-    /**
-     * Get all cookies name and value.
-     * 
-     * @param cookieName
-     *            name of the cookie.
-     * @return array with 2 columns. First is cookie names, second is cookie
-     *         values.
-     */
-    String[][] getCookies();
-
-    /**
      * Test if a window is present.
      */
     boolean hasWindow(WindowLocator window);
 
     /**
      * Make the given window active.
+     * Reset the current frame.
      * 
      * @param window
      *            Locator of the window
@@ -108,6 +89,7 @@
 
     /**
      * Make the root window active.
+     * Reset the current frame.
      */
     void gotoRootWindow();
 
@@ -131,7 +113,7 @@
     boolean hasFrame(FrameLocator frame);
 
     /**
-     * Make the frame with the given name active in the current conversation.
+     * Make the frame with the given name active in the current window.
      * 
      * @param frame
      *            a frame locator.
@@ -170,7 +152,7 @@
             String value) throws ElementNotFoundException;
 
     /**
-     * Get the text representation of element childs.
+     * Get the textual representation of element childs.
      * 
      * @param htmlElement
      *            a locator.
@@ -275,7 +257,7 @@
     String getPageTitle();
 
     /**
-     * Return the response of the server.
+     * Return the response from the server (usually header and html source).
      */
     String getServerResponse();
 
@@ -299,16 +281,4 @@
     void clickElement(ClickableHtmlElementLocator htmlElement)
             throws ElementNotFoundException;
 
-    /**
-     * When you perform an action, the dialog keep an history of each 
Javascript
-     * alert thrown. This method get the first Javascript alert in the list and
-     * remove it. With Selenium, you HAVE TO check presence of alert. If not, 
an
-     * exception is thrown on the next action. With HtmlUnit, no exception is
-     * thrown, but the list will never be cleared if you don't check alert.
-     * 
-     * @return Text of the alert.
-     * @throws ElementNotFoundException
-     *             If there is no alert in the list.
-     */
-    String getJavascriptAlert() throws ElementNotFoundException;
 }

Modified: 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/JWebUnitTester.java
===================================================================
--- 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/JWebUnitTester.java  
    2006-11-05 15:13:04 UTC (rev 597)
+++ 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/JWebUnitTester.java  
    2006-11-05 18:20:09 UTC (rev 598)
@@ -49,6 +49,7 @@
  * @author Wilkes Joiner
  */
 public class JWebUnitTester {
+       
     private IJWebUnitDialog dialog = null;
 
     private TestContext testContext = null;
@@ -68,11 +69,11 @@
      * functionality not yet wrappered required by test.
      * 
      * If the dialog is not explicitly set the jWebUnit framework will default
-     * to using the orignal testing engine, which is, htmlunit.
+     * to using the first testing engine available in classpath.
      * 
      * @return IJWebUnitDialog instance used to wrapper htmlunit conversation.
      */
-    protected IJWebUnitDialog getDialog() {
+    public IJWebUnitDialog getDialog() {
         if (dialog == null) {
             // defaulting to the HtmlUnitDialog implementation.
             dialog = initializeDialog();

Modified: 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/locator/HtmlElementLocator.java
===================================================================
--- 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/locator/HtmlElementLocator.java
  2006-11-05 15:13:04 UTC (rev 597)
+++ 
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/locator/HtmlElementLocator.java
  2006-11-05 18:20:09 UTC (rev 598)
@@ -138,7 +138,7 @@
             else {
                 first = false;
             }
-            result.append(a.name).append("=\"").append(a.value).append("\"");
+            
result.append("@").append(a.name).append("=\"").append(a.value).append("\"");
         }
         if (getAttributs().size()>0) {
             result.append("]");


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

Reply via email to