Revision: 792
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=792&view=rev
Author: henryju
Date: 2009-01-04 21:53:48 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
Updated to HtmlUnit 2.4 and fixed failing JUnit tests (mainly because of
HtmlUnit now dealing much more properly with spaces).
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/TableAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ParamsServlet.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/TableAssertionsTest/TableAssertionsTestPage.html
trunk/pom.xml
trunk/src/changes/changes.xml
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
2009-01-04 21:53:48 UTC (rev 792)
@@ -51,7 +51,7 @@
setTextField("text", "sometext");
submit("button");
assertTextPresent("Submitted parameters");
- assertTextPresent("Params are: text=sometext");
+ assertTextPresent("Params are:\ntext=sometext");
clickLink("return");
setTextField("text", "anothertext");
submit();
@@ -116,7 +116,7 @@
checkCheckbox("checkBox", "3");
checkCheckbox("checkBox", "3"); // check for duplicates
submit();
- assertTextPresent("checkBox=1,3 ");
+ assertTextPresent("checkBox=1,3\n");
}
public void testCheckBoxDeSelectionWithSameFieldName() {
@@ -136,7 +136,7 @@
setTextField("color", "blue");
uncheckCheckbox("checkBox");
submit();
- assertTextPresent("color=blue ");
+ assertTextPresent("color=blue\n");
}
public void testRadioSelection() {
@@ -144,7 +144,7 @@
clickRadioOption("radio", "1");
assertRadioOptionSelected("radio", "1");
submit();
- assertTextPresent("radio=1 ");
+ assertTextPresent("radio=1\n");
clickLink("return");
clickRadioOption("radio", "2");
clickRadioOption("radio", "3");
@@ -152,14 +152,14 @@
assertRadioOptionNotSelected("radio", "2");
assertRadioOptionSelected("radio", "3");
submit();
- assertTextPresent("radio=3 ");
+ assertTextPresent("radio=3\n");
}
public void testSingleFormSingleUnnamedButtonSubmission() {
beginAt("/SingleUnnamedButtonForm.html");
setTextField("color", "blue");
submit();
- assertTextPresent("color=blue ");
+ assertTextPresent("color=blue\n");
}
public void testSingleNamedButtonSubmission() {
@@ -172,7 +172,7 @@
public void testSingleFormMultipleButtonSubmission() {
gotoMultiButtonPage();
submit("color");
- assertTextPresent("Params are: color=red");
+ assertTextPresent("Params are:\ncolor=red");
gotoMultiButtonPage();
submit("color", "blue");
assertTextPresent("color=blue");
@@ -252,7 +252,7 @@
beginAt("/MultiFormPage.html");
setTextField("param2", "anyvalue");
submit("button2b");
- assertTextPresent("param2=anyvalue ");
+ assertTextPresent("param2=anyvalue\n");
assertTextPresent("button2b=b2b");
}
@@ -261,7 +261,7 @@
setTextField("param2", "anyvalue");
reset();
submit("button2b");
- assertTextNotPresent("param2=anyvalue ");
+ assertTextNotPresent("param2=anyvalue\n");
assertTextPresent("button2b=b2b");
}
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java
2009-01-04 21:53:48 UTC (rev 792)
@@ -151,7 +151,7 @@
assertFormPresent();
setTextField("color", "red");
submit("submit");
- assertTextPresent("color=red ");
+ assertTextPresent("color=red\n");
}
public void testFormInputInInlineFrame() {
@@ -160,7 +160,7 @@
assertFormPresent();
setTextField("color", "red");
submit("submit");
- assertTextPresent("color=red ");
+ assertTextPresent("color=red\n");
}
//TODO this just posts to a new frameset inside the frame, is the test
needed?
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
2009-01-04 21:53:48 UTC (rev 792)
@@ -26,8 +26,7 @@
public void testDocumentWrite() {
beginAt("DocumentWrite.html");
- //FIXME Fails with HtmlUnit
- //assertTextPresent("Hello World");
+ assertTextPresent("Hello World");
}
public void testAlert() {
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/TableAssertionsTest.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/TableAssertionsTest.java
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/TableAssertionsTest.java
2009-01-04 21:53:48 UTC (rev 792)
@@ -144,8 +144,8 @@
public void testTableWithSpaces() throws Throwable {
assertTablePresent("tree");
- String[][] table = { { "root", "", "", "" },
- { "child1 ;semicolon", "", "child2", "" },
+ String[][] table = { { "root", " ", "" },
+ { "child1 ;semicolon", " ", "child2", " " },
{ "child1.1", "", "child2.1", "child2.2" } };
assertTableEquals("tree", table);
}
@@ -204,7 +204,7 @@
public void testTableWithSpacesMatch() throws Throwable {
assertTablePresent("tree");
- String[][] table = {{"root", "", "", ""},
+ String[][] table = {{"root", "", ""},
{"child1 ;semicolon", "", "child2", ""},
{"child1.1", "", "child2.1", "child2.2"}};
assertTableMatch("tree", table);
Modified:
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ParamsServlet.java
===================================================================
---
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ParamsServlet.java
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ParamsServlet.java
2009-01-04 21:53:48 UTC (rev 792)
@@ -34,10 +34,10 @@
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.write(HtmlHelper.getStart("Submitted parameters"));
- out.write("<h1>Submitted parameters</h1>\n<p>Params are:");
+ out.write("<h1>Submitted parameters</h1>\n<p>Params are:<br/>");
/*
* Prints POST and GET parameters as name=value1[,value2...] separated
- * with spaces
+ * by <BR/>
*/
// Check that we have a file upload request
@@ -75,10 +75,13 @@
String contentType = item.getContentType();
boolean isInMemory = item.isInMemory();
long sizeInBytes = item.getSize();
- out.write(" " + item.getFieldName() + "=" + item.getName()
+ out.write(" " + fieldName + "=" + fileName
+ "{" + new String(item.get()) + "}");
}
+ if (iter.hasNext()) {
+ out.write("<br/>\n");
+ }
}
out.write(" </p>\n");
out.write(HtmlHelper.getLinkParagraph("return", ref));
@@ -87,7 +90,7 @@
for (; params.hasMoreElements();) {
String p = params.nextElement().toString();
String[] v = request.getParameterValues(p);
- out.write(" " + p + "=");
+ out.write(p + "=");
int n = v.length;
if (n > 0) {
out.write(v[0] != null ? v[0] : "");
@@ -95,6 +98,9 @@
out.write("," + (v[i] != null ? v[i] : ""));
}
}
+ if (params.hasMoreElements()) {
+ out.write("<br/>\n");
+ }
}
out.write(" </p>\n");
String ref = request.getHeader("Referer");
Modified:
trunk/jwebunit-commons-tests/src/main/resources/testcases/TableAssertionsTest/TableAssertionsTestPage.html
===================================================================
---
trunk/jwebunit-commons-tests/src/main/resources/testcases/TableAssertionsTest/TableAssertionsTestPage.html
2008-12-17 02:11:09 UTC (rev 791)
+++
trunk/jwebunit-commons-tests/src/main/resources/testcases/TableAssertionsTest/TableAssertionsTestPage.html
2009-01-04 21:53:48 UTC (rev 792)
@@ -23,10 +23,10 @@
<table id="tree"><tbody>
<tr><td>root</td><td> </td>
- <td> </td><td> </td></tr>
+ <td><!-- Empty --></td></tr>
<tr><td><a href="">child1</a><a href="">
;semicolon</a></td><td> </td>
<td>child2</td><td> </td></tr>
- <tr><td>child1.1</td><td> </td>
+ <tr><td>child1.1</td><td></td>
<td>child2.1</td><td>child2.2</td></tr>
</tbody>
</table>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-12-17 02:11:09 UTC (rev 791)
+++ trunk/pom.xml 2009-01-04 21:53:48 UTC (rev 792)
@@ -294,7 +294,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2008-12-17 02:11:09 UTC (rev 791)
+++ trunk/src/changes/changes.xml 2009-01-04 21:53:48 UTC (rev 792)
@@ -7,42 +7,47 @@
</author>
</properties>
<body>
- <release version="2.1" date="December 12, 2008">
- <action type="add" dev="jevonwright">
- Added new IElement element interface, and methods to
directly access elements by XPath.
- </action>
- <action type="add" dev="jevonwright" issue="1744628">
- Added assertHeader*() and assertResponseCode*() methods.
- </action>
- <action type="add" dev="jevonwright" issue="1728676">
- Added WebTestCase(WebTester) constructor.
- </action>
- <action type="add" dev="jevonwright" issue="1519807">
- Added assertLabeledFieldEquals(id, text),
assertLabel*(), and setLabeledFormElementField(id, value) methods.
- </action>
- <action type="update" dev="jevonwright">
- BC CHANGE: setFormElement(), assertFormElementEquals()
methods will no longer assert that a form already exists in the page (as
allowed by the HTML standard).
- </action>
- <action type="fix" dev="jevonwright" issue="1724695">
- navigator.userAgent is no longer null by default.
- Test cases now use the Firefox 3.0 user agent as the
default, rather than MSIE 4.0.
- </action>
- <action type="fix" dev="jevonwright" issue="2306967"
due-to="r_monson">
- Fixed proxy authentication bug in HtmlUnit
implementation.
- </action>
- <action type="add" dev="jevonwright" issue="1637716">
- Added assertMatch(regexp, text) and
assertNotMatch(regexp, text) methods.
- </action>
- <action type="add" dev="jevonwright" issue="1277374">
- Added assertCommentPresent(text) and
assertCommentNotPresent(text) methods.
- </action>
- <action type="add" dev="jevonwright" issue="1674646">
- Added setTimeout() method.
- </action>
- <action type="fix" dev="jevonwright" issue="2404789">
- Cleaned up the quickstart documentation.
- </action>
- </release>
+ <release version="2.2" date="UNKNOW">
+ <action type="update" dev="henryju">
+ Updated to HtmlUnit 2.4.
+ </action>
+ </release>
+ <release version="2.1" date="December 12, 2008">
+ <action type="add" dev="jevonwright">
+ Added new IElement element interface, and methods to directly
access elements by XPath.
+ </action>
+ <action type="add" dev="jevonwright" issue="1744628">
+ Added assertHeader*() and assertResponseCode*() methods.
+ </action>
+ <action type="add" dev="jevonwright" issue="1728676">
+ Added WebTestCase(WebTester) constructor.
+ </action>
+ <action type="add" dev="jevonwright" issue="1519807">
+ Added assertLabeledFieldEquals(id, text), assertLabel*(), and
setLabeledFormElementField(id, value) methods.
+ </action>
+ <action type="update" dev="jevonwright">
+ BC CHANGE: setFormElement(), assertFormElementEquals() methods
will no longer assert that a form already exists in the page (as allowed by the
HTML standard).
+ </action>
+ <action type="fix" dev="jevonwright" issue="1724695">
+ navigator.userAgent is no longer null by default.
+ Test cases now use the Firefox 3.0 user agent as the default,
rather than MSIE 4.0.
+ </action>
+ <action type="fix" dev="jevonwright" issue="2306967"
due-to="r_monson">
+ Fixed proxy authentication bug in HtmlUnit implementation.
+ </action>
+ <action type="add" dev="jevonwright" issue="1637716">
+ Added assertMatch(regexp, text) and assertNotMatch(regexp,
text) methods.
+ </action>
+ <action type="add" dev="jevonwright" issue="1277374">
+ Added assertCommentPresent(text) and
assertCommentNotPresent(text) methods.
+ </action>
+ <action type="add" dev="jevonwright" issue="1674646">
+ Added setTimeout() method.
+ </action>
+ <action type="fix" dev="jevonwright" issue="2404789">
+ Cleaned up the quickstart documentation.
+ </action>
+ </release>
<release version="2.0" date="October 27, 2008">
<action type="update" dev="henryju">
Updated to HtmlUnit 2.3.
@@ -55,7 +60,7 @@
<action type="update" dev="henryju" issue="1950248" due-to="Agnes
Ro">
Updated to HtmlUnit 2.1 and Java 1.5.
</action>
- </release>
+ </release>
<release version="1.5" date="april 22, 2008" description="The latest
major release before Java 1.5 migration">
<action type="fix" dev="henryju" issue="1860745" due-to="Ward
Bergmans">
setProxyAuthorization caused IllegalArgumentException with
null username/password and not null host/port.
@@ -83,24 +88,24 @@
Rename IJWebUnitDialog in ITestingEngine.
</action>
</release>
- <release version="1.4.1" date="may 5, 2007">
- <action type="fix" dev="henryju" issue="1706395"
due-to="meilon">
+ <release version="1.4.1" date="may 5, 2007">
+ <action type="fix" dev="henryju" issue="1706395" due-to="meilon">
getPageSource() now returns source of the current frame or
window.
</action>
- <action type="fix" dev="henryju"
issue="1708229,1710809,1712633" due-to="Jon,Joe Fisher">
+ <action type="fix" dev="henryju" issue="1708229,1710809,1712633"
due-to="Jon,Joe Fisher">
setTextField now doesn't change the current working form if
already set.
clickRadioOption now doesn't change the current working form
if already set.
assertFormElementPresent now only searches the current working
form if already set.
</action>
- </release>
- <release version="1.4" date="march 17, 2007">
- <action type="update" dev="henryju">
+ </release>
+ <release version="1.4" date="march 17, 2007">
+ <action type="update" dev="henryju">
Update to HtmlUnit 1.11.
</action>
- <action type="add" dev="henryju" issue="1677214" due-to="Dragan
Pazin">
+ <action type="add" dev="henryju" issue="1677214" due-to="Dragan
Pazin">
Add a new method: getElementTextByXPath.
</action>
- </release>
+ </release>
<release version="1.4-RC4" date="march 04, 2007">
<action type="add" dev="henryju" issue="993058" due-to="Chris
Eldredge">
Add new ResourceBundle related methods allowing formatting of
resources.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development