Thread: [JWebUnit-development] SF.net SVN: jwebunit:[853] trunk (Page 4)
Brought to you by:
henryju
|
From: <he...@us...> - 2010-10-18 09:08:37
|
Revision: 853
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=853&view=rev
Author: henryju
Date: 2010-10-18 09:08:30 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
Updated to surefire 2.6 to support parallel build.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-18 07:41:54 UTC (rev 852)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-18 09:08:30 UTC (rev 853)
@@ -14,7 +14,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2010-10-18 07:41:54 UTC (rev 852)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2010-10-18 09:08:30 UTC (rev 853)
@@ -14,7 +14,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<skip>true</skip>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-18 09:17:15
|
Revision: 855
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=855&view=rev
Author: henryju
Date: 2010-10-18 09:17:06 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 1: migrated WebTester to JUnit 4 (and updated tests and documentation accordingly).
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/IElementTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/src/changes/changes.xml
trunk/src/site/site.xml
Added Paths:
-----------
trunk/src/site/xdoc/migration.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 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -26,7 +26,6 @@
import java.io.IOException;
import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -198,10 +197,10 @@
gotoMultiButtonPage();
try {
setTextField("nonexistent", "anyvalue");
- } catch (AssertionFailedError e) {
- return;
+ fail("Expected AssertionError");
+ } catch (AssertionError e) {
+ //OK it was expected
}
- fail("Expected AssertionFailedError");
}
public void testParamSetOnMultiForm() {
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -22,7 +22,6 @@
import java.util.Date;
import java.util.List;
-import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
import net.sourceforge.jwebunit.api.IElement;
@@ -61,7 +60,7 @@
try {
getElementByXPath("//input[@id='test2']");
fail("getElementByXPath() should have thrown an assertion exception.");
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// nothing
}
}
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -21,7 +21,6 @@
import java.lang.reflect.InvocationTargetException;
-import junit.framework.AssertionFailedError;
import net.sourceforge.jwebunit.junit.WebTestCase;
import net.sourceforge.jwebunit.junit.WebTester;
import net.sourceforge.jwebunit.tests.util.reflect.MethodInvoker;
@@ -98,7 +97,7 @@
}
public void assertFail(String methodName, Object[] args) {
- assertException(AssertionFailedError.class, methodName, args);
+ assertException(AssertionError.class, methodName, args);
}
public void assertException(Class<?> exceptionClass, String methodName,
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -22,7 +22,6 @@
import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -91,7 +90,7 @@
try {
clickLinkWithText("an active link", 2);
fail();
- } catch (AssertionFailedError expected) {
+ } catch (AssertionError expected) {
assertEquals("Link with text [an active link] and index [2] "
+ "not found in response.", expected.getMessage());
}
@@ -163,7 +162,7 @@
boolean passed = false;
try {
clickLinkWithExactText("doesn't exist");
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
// expected
passed = true;
}
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -19,7 +19,6 @@
package net.sourceforge.jwebunit.tests;
-import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
import net.sourceforge.jwebunit.tests.util.JettySetup;
@@ -77,15 +76,13 @@
* Check that {@link #assertNoMatch(String)} can actually fail.
*/
public void testAssertNoMatchFails() throws Throwable {
- boolean failed = false;
try {
// 'Span Text' definitely exists in the source page text
assertNoMatch("Span Text");
- failed = true; // should not get this far
- } catch (AssertionFailedError e) {
+ fail("assertNoMatch() did not throw expected failure"); // should not get this far
+ } catch (AssertionError e) {
// expected
}
- assertFalse("assertNoMatch() did not throw expected failure", failed);
}
public void testAssertLinkPresentWithText() throws Throwable {
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-18 09:11:31 UTC (rev 854)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-18 09:17:06 UTC (rev 855)
@@ -41,8 +41,6 @@
import javax.imageio.ImageIO;
import javax.servlet.http.Cookie;
-import junit.framework.Assert;
-import junit.framework.AssertionFailedError;
import net.sourceforge.jwebunit.api.IElement;
import net.sourceforge.jwebunit.api.ITestingEngine;
import net.sourceforge.jwebunit.exception.ExpectedJavascriptAlertException;
@@ -60,6 +58,8 @@
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
+import static org.junit.Assert.*;
+
/**
* Provides a high-level API for basic web application navigation and validation by providing
* JUnit assertions. It supports use of a property file for web resources (a la Struts), though a resource file for the
@@ -160,15 +160,15 @@
try {
getTestingEngine().closeBrowser();
} catch (ExpectedJavascriptAlertException e) {
- Assert.fail("You previously tell that alert with message ["
+ fail("You previously tell that alert with message ["
+ e.getAlertMessage()
+ "] was expected, but nothing appeared.");
} catch (ExpectedJavascriptConfirmException e) {
- Assert.fail("You previously tell that confirm with message ["
+ fail("You previously tell that confirm with message ["
+ e.getConfirmMessage()
+ "] was expected, but nothing appeared.");
} catch (ExpectedJavascriptPromptException e) {
- Assert.fail("You previously tell that prompt with message ["
+ fail("You previously tell that prompt with message ["
+ e.getPromptMessage()
+ "] was expected, but nothing appeared.");
}
@@ -227,7 +227,7 @@
try {
getTestingEngine().beginAt(createUrl(aRelativeURL, getTestContext().getBaseUrl()), testContext);
} catch (MalformedURLException e) {
- Assert.fail(e.getLocalizedMessage());
+ fail(e.getLocalizedMessage());
}
}
@@ -295,7 +295,7 @@
* @param status the expected status code
*/
public void assertResponseCode(int status) {
- Assert.assertEquals( status, getTestingEngine().getServerResponseCode() );
+ assertEquals( status, getTestingEngine().getServerResponseCode() );
}
/**
@@ -306,7 +306,7 @@
* @param higher the upper bound for the expected status code
*/
public void assertResponseCodeBetween(int lower, int higher) {
- Assert.assertTrue( getTestingEngine().getServerResponseCode() >= lower && getTestingEngine().getServerResponseCode() <= higher );
+ assertTrue( getTestingEngine().getServerResponseCode() >= lower && getTestingEngine().getServerResponseCode() <= higher );
}
/**
@@ -325,7 +325,7 @@
* @param name The header to find
*/
public void assertHeaderPresent(String name) {
- Assert.assertFalse( "header '" + name + "' not present", getTestingEngine().getHeader(name) == null );
+ assertFalse( "header '" + name + "' not present", getTestingEngine().getHeader(name) == null );
}
/**
@@ -334,7 +334,7 @@
* @param name The header to find
*/
public void assertHeaderNotPresent(String name) {
- Assert.assertTrue( "header '" + name + "' present", getTestingEngine().getHeader(name) == null );
+ assertTrue( "header '" + name + "' present", getTestingEngine().getHeader(name) == null );
}
/**
@@ -344,7 +344,7 @@
* @param value Value to compare against
*/
public void assertHeaderEquals(String name, String value) {
- Assert.assertEquals( value, getTestingEngine().getHeader(name) );
+ assertEquals( value, getTestingEngine().getHeader(name) );
}
/**
@@ -384,7 +384,7 @@
* expected title value
*/
public void assertTitleEquals(String title) {
- Assert.assertEquals(title, getTestingEngine().getPageTitle());
+ assertEquals(title, getTestingEngine().getPageTitle());
}
/**
@@ -395,7 +395,7 @@
* unexpected title value
*/
public void assertTitleNotSame(String title) {
- Assert.assertNotSame(title, getTestingEngine().getPageTitle());
+ assertNotSame(title, getTestingEngine().getPageTitle());
}
/**
@@ -415,7 +415,7 @@
* web resource key for title
*/
public void assertTitleEqualsKey(String titleKey) {
- Assert.assertEquals(getMessage(titleKey), getTestingEngine().getPageTitle());
+ assertEquals(getMessage(titleKey), getTestingEngine().getPageTitle());
}
/**
@@ -425,7 +425,7 @@
* @param args
*/
public void assertTitleEqualsKey(String titleKey, Object[] args) {
- Assert.assertEquals(getMessage(titleKey, args), getTestingEngine().getPageTitle());
+ assertEquals(getMessage(titleKey, args), getTestingEngine().getPageTitle());
}
/**
@@ -455,7 +455,7 @@
*/
public void assertTextPresent(String text) {
if (!(getTestingEngine().getPageText().contains(text)))
- Assert.fail("Expected text not found in current page: [" + text
+ fail("Expected text not found in current page: [" + text
+ "]\n Page content was: ["
+ getTestingEngine().getPageText() + "]");
}
@@ -468,7 +468,7 @@
public void assertMatch(String regexp) {
RE re = getRE(regexp);
if (!re.match(getTestingEngine().getPageText()))
- Assert.fail("Expected rexexp not matched in response: [" + regexp
+ fail("Expected rexexp not matched in response: [" + regexp
+ "]");
}
@@ -502,7 +502,7 @@
public void assertMatch(String message, String regexp, String text) {
RE re = getRE(regexp);
if (!re.match(text))
- Assert.fail(message);
+ fail(message);
}
/**
@@ -514,7 +514,7 @@
public void assertNotMatch(String message, String regexp, String text) {
RE re = getRE(regexp);
if (re.match(text))
- Assert.fail(message);
+ fail(message);
}
/**
@@ -543,7 +543,7 @@
*/
public void assertTextNotPresent(String text) {
if (getTestingEngine().getPageText().contains(text))
- Assert.fail("Text found in response when not expected: [" + text
+ fail("Text found in response when not expected: [" + text
+ "]");
}
@@ -574,7 +574,7 @@
*/
public void assertTablePresent(String tableSummaryNameOrId) {
if (!getTestingEngine().hasTable(tableSummaryNameOrId))
- Assert.fail("Unable to locate table \"" + tableSummaryNameOrId
+ fail("Unable to locate table \"" + tableSummaryNameOrId
+ "\"");
}
@@ -585,7 +585,7 @@
*/
public void assertTableNotPresent(String tableSummaryNameOrId) {
if (getTestingEngine().hasTable(tableSummaryNameOrId))
- Assert.fail("Located table \"" + tableSummaryNameOrId + "\"");
+ fail("Located table \"" + tableSummaryNameOrId + "\"");
}
/**
@@ -620,7 +620,7 @@
*/
public void assertTextInTable(String tableSummaryNameOrId, String text) {
assertTablePresent(tableSummaryNameOrId);
- Assert.assertTrue("Could not find: [" + text + "]" + "in table ["
+ assertTrue("Could not find: [" + text + "]" + "in table ["
+ tableSummaryNameOrId + "]", getTestingEngine().getTable(
tableSummaryNameOrId).hasText(text));
}
@@ -633,7 +633,7 @@
*/
public void assertMatchInTable(String tableSummaryNameOrId, String regexp) {
assertTablePresent(tableSummaryNameOrId);
- Assert.assertTrue("Could not match: [" + regexp + "]" + "in table ["
+ assertTrue("Could not match: [" + regexp + "]" + "in table ["
+ tableSummaryNameOrId + "]", getTestingEngine().getTable(
tableSummaryNameOrId).hasMatch(regexp));
}
@@ -709,7 +709,7 @@
*/
public void assertTextNotInTable(String tableSummaryNameOrId, String text) {
assertTablePresent(tableSummaryNameOrId);
- Assert.assertTrue("Found text: [" + text + "] in table ["
+ assertTrue("Found text: [" + text + "] in table ["
+ tableSummaryNameOrId + "]", !getTestingEngine().getTable(
tableSummaryNameOrId).hasText(text));
}
@@ -734,7 +734,7 @@
*/
public void assertNoMatchInTable(String tableSummaryNameOrId, String regexp) {
assertTablePresent(tableSummaryNameOrId);
- Assert.assertTrue("Found regexp: [" + regexp + "] in table ["
+ assertTrue("Found regexp: [" + regexp + "] in table ["
+ tableSummaryNameOrId + "]", !getTestingEngine().getTable(
tableSummaryNameOrId).hasMatch(regexp));
}
@@ -813,7 +813,7 @@
assertTablePresent(tableSummaryNameOrId);
int actualRowCount = getTestingEngine().getTable(tableSummaryNameOrId)
.getRowCount();
- Assert.assertTrue("Expected row count was " + expectedRowCount
+ assertTrue("Expected row count was " + expectedRowCount
+ " but actual row count is " + actualRowCount,
actualRowCount == expectedRowCount);
}
@@ -873,7 +873,7 @@
* @param formElementName
*/
public void assertFormElementPresent(String formElementName) {
- Assert.assertTrue("Did not find form element with name ["
+ assertTrue("Did not find form element with name ["
+ formElementName + "].", getTestingEngine()
.hasFormParameterNamed(formElementName));
}
@@ -885,7 +885,7 @@
*/
public void assertFormElementNotPresent(String formElementName) {
try {
- Assert.assertTrue("Found form element with name ["
+ assertTrue("Found form element with name ["
+ formElementName + "] when not expected.", !getTestingEngine()
.hasFormParameterNamed(formElementName));
} catch (UnableToSetFormException e) {
@@ -899,7 +899,7 @@
* @param checkboxName checkbox name.
*/
public void assertCheckboxPresent(String checkboxName) {
- Assert.assertTrue("Did not find form checkbox with name ["
+ assertTrue("Did not find form checkbox with name ["
+ checkboxName + "].", getTestingEngine().hasElementByXPath(
"//input[lower-case(@type)='checkbox' and @name='" + checkboxName + "']"));
}
@@ -911,7 +911,7 @@
* @param checkboxValue checkbox value attribut.
*/
public void assertCheckboxPresent(String checkboxName, String checkboxValue) {
- Assert.assertTrue("Did not find form checkbox with name ["
+ assertTrue("Did not find form checkbox with name ["
+ checkboxName + "] and value [" + checkboxValue + "].",
getTestingEngine().hasElementByXPath(
"//input[lower-case(@type)='checkbox' and @name='" + checkboxName
@@ -924,7 +924,7 @@
* @param checkboxName checkbox name.
*/
public void assertCheckboxNotPresent(String checkboxName) {
- Assert.assertFalse("Found form checkbox with name [" + checkboxName
+ assertFalse("Found form checkbox with name [" + checkboxName
+ "] when not expected.", getTestingEngine().hasElementByXPath(
"//input[lower-case(@type)='checkbox' and @name='" + checkboxName + "']"));
}
@@ -937,7 +937,7 @@
*/
public void assertCheckboxNotPresent(String checkboxName,
String checkboxValue) {
- Assert.assertFalse("Found form checkbox with name [" + checkboxName
+ assertFalse("Found form checkbox with name [" + checkboxName
+ "] and value [" + checkboxValue + "] when not expected.",
getTestingEngine().hasElementByXPath(
"//input[lower-case(@type)='checkbox' and @name='" + checkboxName
@@ -949,7 +949,7 @@
*
*/
public void assertFormPresent() {
- Assert.assertTrue("No form present", getTestingEngine().hasForm());
+ assertTrue("No form present", getTestingEngine().hasForm());
}
/**
@@ -958,7 +958,7 @@
* @param nameOrID
*/
public void assertFormPresent(String nameOrID) {
- Assert.assertTrue("No form present with name or id [" + nameOrID + "]",
+ assertTrue("No form present with name or id [" + nameOrID + "]",
getTestingEngine().hasForm(nameOrID));
}
@@ -967,7 +967,7 @@
*
*/
public void assertFormNotPresent() {
- Assert.assertFalse("A form is present", getTestingEngine().hasForm());
+ assertFalse("A form is present", getTestingEngine().hasForm());
}
/**
@@ -976,7 +976,7 @@
* @param nameOrID
*/
public void assertFormNotPresent(String nameOrID) {
- Assert.assertFalse("Form present with name or id [" + nameOrID + "]",
+ assertFalse("Form present with name or id [" + nameOrID + "]",
getTestingEngine().hasForm(nameOrID));
}
@@ -991,7 +991,7 @@
public void assertFormElementEquals(String formElementName,
String expectedValue) {
assertFormElementPresent(formElementName);
- Assert.assertEquals(expectedValue, getTestingEngine()
+ assertEquals(expectedValue, getTestingEngine()
.getElementAttributByXPath(
"//input[@name='" + formElementName + "']", "value"));
}
@@ -1009,9 +1009,9 @@
try {
re = new RE(regexp, RE.MATCH_SINGLELINE);
} catch (RESyntaxException e) {
- Assert.fail(e.toString());
+ fail(e.toString());
}
- Assert.assertTrue("Unable to match [" + regexp + "] in form element \""
+ assertTrue("Unable to match [" + regexp + "] in form element \""
+ formElementName + "\"", re.match(getTestingEngine()
.getElementAttributByXPath(
"//input[@name='" + formElementName + "']", "value")));
@@ -1027,7 +1027,7 @@
*/
public void assertFormElementEmpty(String formElementName) {
assertFormElementPresent(formElementName);
- Assert.assertEquals("", getTestingEngine().getElementAttributByXPath(
+ assertEquals("", getTestingEngine().getElementAttributByXPath(
"//input[@name='" + formElementName + "']", "value"));
}
@@ -1041,7 +1041,7 @@
public void assertTextFieldEquals(String formElementName,
String expectedValue) {
assertFormElementPresent(formElementName);
- Assert.assertEquals(expectedValue, getTestingEngine()
+ assertEquals(expectedValue, getTestingEngine()
.getTextFieldValue(formElementName));
}
@@ -1055,7 +1055,7 @@
public void assertHiddenFieldPresent(String formElementName,
String expectedValue) {
assertFormElementPresent(formElementName);
- Assert.assertEquals(expectedValue, getTestingEngine()
+ assertEquals(expectedValue, getTestingEngine()
.getHiddenFieldValue(formElementName));
}
@@ -1067,7 +1067,7 @@
public void assertCheckboxSelected(String checkBoxName) {
assertCheckboxPresent(checkBoxName);
if (!getTestingEngine().isCheckboxSelected(checkBoxName)) {
- Assert.fail("Checkbox with name [" + checkBoxName
+ fail("Checkbox with name [" + checkBoxName
+ "] was not found selected.");
}
}
@@ -1081,7 +1081,7 @@
public void assertCheckboxSelected(String checkBoxName, String checkBoxValue) {
assertCheckboxPresent(checkBoxName, checkBoxValue);
if (!getTestingEngine().isCheckboxSelected(checkBoxName, checkBoxValue)) {
- Assert.fail("Checkbox with name [" + checkBoxName + "] and value ["
+ fail("Checkbox with name [" + checkBoxName + "] and value ["
+ checkBoxValue + "] was not found selected.");
}
}
@@ -1094,7 +1094,7 @@
public void assertCheckboxNotSelected(String checkBoxName) {
assertCheckboxPresent(checkBoxName);
if (getTestingEngine().isCheckboxSelected(checkBoxName)) {
- Assert.fail("Checkbox with name [" + checkBoxName
+ fail("Checkbox with name [" + checkBoxName
+ "] was found selected.");
}
}
@@ -1109,7 +1109,7 @@
String checkBoxValue) {
assertCheckboxPresent(checkBoxName, checkBoxValue);
if (getTestingEngine().isCheckboxSelected(checkBoxName, checkBoxValue)) {
- Assert.fail("Checkbox with name [" + checkBoxName + "] and value ["
+ fail("Checkbox with name [" + checkBoxName + "] and value ["
+ checkBoxValue + "] was found selected.");
}
}
@@ -1123,7 +1123,7 @@
public void assertRadioOptionPresent(String name, String radioOption) {
assertFormElementPresent(name);
if (!getTestingEngine().hasRadioOption(name, radioOption)) {
- Assert.fail("Unable to find option [" + radioOption
+ fail("Unable to find option [" + radioOption
+ "] in radio group [" + name + "]");
}
}
@@ -1137,7 +1137,7 @@
public void assertRadioOptionNotPresent(String name, String radioOption) {
assertFormElementPresent(name);
if (getTestingEngine().hasRadioOption(name, radioOption))
- Assert.fail("Found option [" + radioOption + "] in radio group ["
+ fail("Found option [" + radioOption + "] in radio group ["
+ name + "]");
}
@@ -1149,7 +1149,7 @@
*/
public void assertRadioOptionSelected(String name, String radioOption) {
assertRadioOptionPresent(name, radioOption);
- Assert.assertEquals(radioOption, getTestingEngine()
+ assertEquals(radioOption, getTestingEngine()
.getSelectedRadio(name));
}
@@ -1161,7 +1161,7 @@
*/
public void assertRadioOptionNotSelected(String name, String radioOption) {
assertRadioOptionPresent(name, radioOption);
- Assert.assertFalse("Radio option [" + radioOption + "] is selected.",
+ assertFalse("Radio option [" + radioOption + "] is selected.",
radioOption.equals(getTestingEngine()
.getSelectedRadio(name)));
}
@@ -1176,7 +1176,7 @@
String[] optionLabels) {
assertFormElementPresent(selectName);
for (int i = 0; i < optionLabels.length; i++)
- Assert.assertTrue("Option [" + optionLabels[i]
+ assertTrue("Option [" + optionLabels[i]
+ "] not found in select element " + selectName,
getTestingEngine().hasSelectOption(selectName,
optionLabels[i]));
@@ -1204,7 +1204,7 @@
String[] optionLabels) {
assertFormElementPresent(selectName);
for (int i = 0; i < optionLabels.length; i++)
- Assert.assertTrue("Option [" + optionLabels[i]
+ assertTrue("Option [" + optionLabels[i]
+ "] not found in select element " + selectName,
getTestingEngine().hasSelectOption(selectName, index,
optionLabels[i]));
@@ -1233,7 +1233,7 @@
String[] optionValues) {
assertFormElementPresent(selectName);
for (int i = 0; i < optionValues.length; i++)
- Assert.assertTrue("Option [" + optionValues[i]
+ assertTrue("Option [" + optionValues[i]
+ "] not found in select element " + selectName,
getTestingEngine().hasSelectOptionValue(selectName,
optionValues[i]));
@@ -1264,7 +1264,7 @@
String[] optionValues) {
assertFormElementPresent(selectName);
for (int i = 0; i < optionValues.length; i++)
- Assert.assertTrue("Option [" + optionValues[i]
+ assertTrue("Option [" + optionValues[i]
+ "] not found in select element " + selectName,
getTestingEngine().hasSelectOptionValue(selectName,
index,
@@ -1296,10 +1296,10 @@
String optionValue) {
try {
assertSelectOptionValuePresent(selectName, optionValue);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Option value" + optionValue + " found in select element "
+ fail("Option value" + optionValue + " found in select element "
+ selectName + " when not expected.");
}
@@ -1313,10 +1313,10 @@
String optionLabel) {
try {
assertSelectOptionPresent(selectName, optionLabel);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Option " + optionLabel + " found in select element "
+ fail("Option " + optionLabel + " found in select element "
+ selectName + " when not expected.");
}
@@ -1330,10 +1330,10 @@
int index, String optionValue) {
try {
assertSelectOptionValuePresent(selectName, index, optionValue);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Option value" + optionValue + " found in select element "
+ fail("Option value" + optionValue + " found in select element "
+ selectName + " when not expected.");
}
@@ -1347,10 +1347,10 @@
int index, String optionLabel) {
try {
assertSelectOptionPresent(selectName, index, optionLabel);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Option " + optionLabel + " found in select element "
+ fail("Option " + optionLabel + " found in select element "
+ selectName + " when not expected.");
}
@@ -1393,10 +1393,10 @@
assertFormElementPresent(selectName);
try {
assertSelectOptionsEqual(selectName, expectedOptions);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Options not expected to be equal");
+ fail("Options not expected to be equal");
}
/**
@@ -1413,10 +1413,10 @@
assertFormElementPresent(selectName);
try {
assertSelectOptionsEqual(selectName, index, expectedOptions);
- } catch (AssertionFailedError e) {
+ } catch (AssertionError e) {
return;
}
- Assert.fail("Options not expected to be equal");
+ fail("Options not expected to be equal");
}
@@ -1463,10 +1463,10 @@
asse...
[truncated message content] |
|
From: <he...@us...> - 2010-10-18 09:41:25
|
Revision: 858
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=858&view=rev
Author: henryju
Date: 2010-10-18 09:41:18 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
Updated trunk to version 3.0-SNAPSHOT
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-core/pom.xml
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/jwebunit-webtestcase-generator/pom.xml
trunk/pom.xml
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/jwebunit-commons-tests/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/jwebunit-core/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-webtestcase-generator/pom.xml
===================================================================
--- trunk/jwebunit-webtestcase-generator/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/jwebunit-webtestcase-generator/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/pom.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -4,7 +4,7 @@
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>2.5-SNAPSHOT</version>
+ <version>3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2010-10-18 09:33:38 UTC (rev 857)
+++ trunk/src/changes/changes.xml 2010-10-18 09:41:18 UTC (rev 858)
@@ -35,6 +35,8 @@
<action type="update" dev="henryju">
Updated to JUnit 4. See migration section of the documentation.
</action>
+ </release>
+ <release version="2.5" date="UNKNOW" description="Small fixes and dependency updates">
<action type="update" dev="henryju">
Updated to slf4j 1.6.1.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-18 16:01:58
|
Revision: 860
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=860&view=rev
Author: henryju
Date: 2010-10-18 16:01:49 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 2: migrated WebTestCaseGenerator to JUnit 4 (and updated tests and documentation accordingly).
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java
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/HelloWorldTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JUnitPerfTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.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/NavigationTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NonHtmlContentTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/RedirectionTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResourceBundleAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/SelectOptionsTest.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/TestContextTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/XPathTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/reflect/MethodInvoker.java
trunk/jwebunit-commons-tests/src/test/java/net/sourceforge/jwebunit/tests/util/reflect/MethodInvokerTest.java
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java
trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java
trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj
trunk/pom.xml
trunk/src/site/xdoc/migration.xml
Added Paths:
-----------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/Concurrent.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ConcurrentRule.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/reflect/StaticMethodInvoker.java
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/pom.xml 2010-10-18 16:01:49 UTC (rev 860)
@@ -15,10 +15,6 @@
<artifactId>junit</artifactId>
</dependency>
<dependency>
- <groupId>junitperf</groupId>
- <artifactId>junitperf</artifactId>
- </dependency>
- <dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</dependency>
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -19,6 +19,10 @@
package net.sourceforge.jwebunit.tests;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
+import org.junit.Test;
+
public class ButtonAssertionsTest extends JWebUnitAPITestCase {
public void setUp() throws Exception {
@@ -26,6 +30,7 @@
setBaseUrl(HOST_PATH + "/ButtonAssertionsTest");
}
+ @Test
public void testAssertButtonwithOneFormfound() {
beginAt("/pageWithOneForm.html");
assertButtonPresent("button1");
@@ -40,6 +45,7 @@
assertButtonPresentWithText("Input button");
}
+ @Test
public void testAssertButtonwithTowFormsfound() {
beginAt("/pageWithTwoForms.html");
assertButtonPresent("button1");
@@ -58,6 +64,7 @@
assertButtonPresent("buttonOutside");
}
+ @Test
public void testAssertButtonWithText() {
beginAt("/pageWithTwoForms.html");
assertButtonPresentWithText("Testbutton");
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -19,42 +19,39 @@
package net.sourceforge.jwebunit.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import org.junit.Test;
+
/**
* Make sure JWebUnit handles character conversions properly.
*
* @author <a href="mailto:je...@sw...">Jesse Wilson</a>
*/
public class CharsetTest extends JWebUnitAPITestCase {
- public CharsetTest(String name) {
- super(name);
- }
- public static Test suite() {
- return new JettySetup(new TestSuite(CharsetTest.class));
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/CharsetTest");
beginAt("/charset.html_utf-8");
}
+ @Test
public void testEuro() {
assertTextFieldEquals("eur", "\u20AC");
}
+ @Test
public void testDollar() {
assertTextFieldEquals("usd", "$");
}
+ @Test
public void testYen() {
assertTextFieldEquals("yen", "\u00A5");
}
+ @Test
public void testPound() {
assertTextFieldEquals("gbp", "\u00A3");
}
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -20,11 +20,16 @@
package net.sourceforge.jwebunit.tests;
+import static net.sourceforge.jwebunit.junit.JWebUnit.assertTitleEquals;
+import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
+import static net.sourceforge.jwebunit.junit.JWebUnit.getTestContext;
+import static net.sourceforge.jwebunit.junit.JWebUnit.setCustomTester;
import net.sourceforge.jwebunit.junit.WebTester;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.After;
+import org.junit.Test;
+
+
/**
* Test the new constructor methods for custom web testers
*
@@ -53,22 +58,20 @@
}
- public CustomTesterTest() {
- super("CustomTesterTest", new MyWebTester());
- }
-
- public static Test suite() {
- Test suite = new TestSuite(CustomTesterTest.class);
- return new JettySetup(suite);
- }
-
public void setUp() throws Exception {
+ setCustomTester(new MyWebTester());
super.setUp();
getTestContext().setBaseUrl(HOST_PATH + "/CustomTesterTest");
}
+ @Test
public void testCustomTester() throws Throwable {
beginAt("/test.html");
assertTitleEquals("test"); // this will normally fail for a non-custom class
}
+
+ @After
+ public void cleanup() {
+ setCustomTester(null);
+ }
}
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -19,28 +19,26 @@
package net.sourceforge.jwebunit.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
+import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
+
+import org.junit.Test;
+
import net.sourceforge.jwebunit.html.Cell;
import net.sourceforge.jwebunit.html.Table;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
/**
* Test table equals assertions using expected tables.
*/
public class ExpectedTableAssertionsHtmlTest extends JWebUnitAPITestCase {
- public static Test suite() {
- return new JettySetup(new TestSuite(
- ExpectedTableAssertionsHtmlTest.class));
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/ExpectedTableAssertionsTest");
beginAt("/TableAssertionsTestPageHtml.html");
}
+ @Test
public void testAssertTableEquals() throws Throwable {
Cell[][] cells = new Cell[4][];
cells[0] = new Cell[3];
@@ -64,6 +62,7 @@
assertPass("assertTableEquals", new Object[] { "myTable", table });
}
+ @Test
public void testAssertTableEqualsMissingRows() throws Throwable {
Cell[][] cells = new Cell[3][];
cells[0] = new Cell[3];
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -20,27 +20,25 @@
package net.sourceforge.jwebunit.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.Test;
+
import net.sourceforge.jwebunit.html.Cell;
import net.sourceforge.jwebunit.html.Table;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
/**
* Test table equals assertions using expected tables.
*/
public class ExpectedTableAssertionsXHtmlTest extends JWebUnitAPITestCase {
- public static Test suite() {
- return new JettySetup(new TestSuite(ExpectedTableAssertionsXHtmlTest.class));
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/ExpectedTableAssertionsTest");
beginAt("/TableAssertionsTestPageXHtml.html");
}
+ @Test
public void testAssertTableEquals() throws Throwable {
Cell[][] cells = new Cell[4][];
cells[0] = new Cell[3];
@@ -64,6 +62,7 @@
assertPass("assertTableEquals", new Object[]{"myTable", table});
}
+ @Test
public void testAssertTableEqualsMissingRows() throws Throwable {
Cell[][] cells = new Cell[3][];
cells[0] = new Cell[3];
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -19,23 +19,21 @@
package net.sourceforge.jwebunit.tests;
+import org.junit.Test;
+
import net.sourceforge.jwebunit.api.IElement;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import static org.junit.Assert.*;
+
public class FormAssertionsTest extends JWebUnitAPITestCase {
- public static Test suite() {
- Test suite = new TestSuite(FormAssertionsTest.class);
- return new JettySetup(suite);
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/FormAssertionsTest");
}
+ @Test
public void testAssertButtonWithTextPresent() {
beginAt("/assertButtonWithText.html");
assertButtonPresentWithText("foo");
@@ -43,6 +41,7 @@
assertButtonNotPresentWithText("foobar");
}
+ @Test
public void testAssertFormParameterPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertFormElementPresent", "testInputElement", "noSuchElement");
@@ -51,11 +50,13 @@
assertPass("assertFormElementPresent", "text");
}
+ @Test
public void testAssertFormParameterNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertFormElementNotPresent", "noSuchElement", "testInputElement");
}
+ @Test
public void testAssertFormPresent() throws Throwable {
beginAt("/testPage.html");
assertPass("assertFormPresent", NOARGS);
@@ -64,6 +65,7 @@
assertPass("assertFormNotPresent", NOARGS);
}
+ @Test
public void testAssertFormPresentByName() throws Throwable {
beginAt("/testPage.html");
assertPass("assertFormPresent", new String[]{"form2"});
@@ -71,6 +73,7 @@
assertPass("assertFormNotPresent", new String[]{"noform"});
}
+ @Test
public void testAssertFormElementEquals() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertTextFieldEquals", new Object[]{"testInputElement", "testValue"}, new Object[]{"testInputElement", "noSuchValue"});
@@ -88,12 +91,14 @@
assertPassFail("assertTextFieldEquals", new Object[]{"passwordelement", "password"}, new Object[]{"passwordelement", "noSuchValue"});
}
+ @Test
public void testCheckboxSelected() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertCheckboxSelected", "checkboxselected", "checkboxnotselected");
assertFail("assertCheckboxSelected", "nosuchbox");
}
+ @Test
public void testCheckboxSelectedByName() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertCheckboxSelected", new Object[]{"checkboxnotselected", "actuallyselected"},
@@ -101,12 +106,14 @@
assertFail("assertCheckboxSelected", new Object[]{"checkboxselected", "nosuchvalue"});
}
+ @Test
public void testCheckboxNotSelected() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertCheckboxNotSelected", "checkboxnotselected", "checkboxselected");
assertFail("assertCheckboxNotSelected", "nosuchbox");
}
+ @Test
public void testCheckboxNotSelectedByName() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertCheckboxNotSelected", new Object[]{"checkboxselected", "actuallynotselected"},
@@ -114,16 +121,19 @@
assertFail("assertCheckboxNotSelected", new Object[]{"checkboxnotselected", "nosuchvalue"});
}
+ @Test
public void testAssertSubmitButtonPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSubmitButtonPresent", "submitButton", "noSuchButton");
}
+ @Test
public void testAssertSubmitButtonNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSubmitButtonNotPresent", "noSuchButton", "submitButton");
}
+ @Test
public void testAssertSubmitButtonValue() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSubmitButtonPresent",
@@ -131,16 +141,19 @@
new Object[]{"submitButton", "noSuchLabel"});
}
+ @Test
public void testAssertResetButtonPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertResetButtonPresent", "resetButton", "noSuchButton");
}
+ @Test
public void testAssertResetButtonNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertResetButtonNotPresent", "noSuchButton", "resetButton");
}
+ @Test
public void testAssertRadioOptionPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertRadioOptionPresent",
@@ -148,6 +161,7 @@
new String[]{"cool", "fish"});
}
+ @Test
public void testAssertRadioOptionNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertRadioOptionNotPresent",
@@ -155,6 +169,7 @@
new String[]{"cool", "cat"});
}
+ @Test
public void testAssertRadioOptionSelected() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertRadioOptionSelected",
@@ -162,11 +177,13 @@
new String[]{"cool", "cat"});
}
+ @Test
public void testAssertRadioOptionNotSelected() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertRadioOptionNotSelected", new String[]{"cool", "cat"}, new String[]{"cool", "dog"});
}
+ @Test
public void testAssertSelectOptionPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectOptionPresent",
@@ -174,6 +191,7 @@
new String[]{"selectOption", "NoSuchOption"});
}
+ @Test
public void testAssertSelectOptionNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectOptionNotPresent",
@@ -181,6 +199,7 @@
new String[]{"selectOption", "One"});
}
+ @Test
public void testAssertSelectOptionValuePresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectOptionValuePresent",
@@ -188,6 +207,7 @@
new String[]{"selectOption", "NoSuchOption"});
}
+ @Test
public void testAssertSelectOptionValueNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectOptionValueNotPresent",
@@ -195,6 +215,7 @@
new String[]{"selectOption", "1"});
}
+ @Test
public void testAssertSelectOptionsEqual() throws Throwable {
beginAt("/testPage.html");
assertPass("assertSelectOptionsEqual", new Object[]{"select1", new String[]{"one", "two", "three", "four"}});
@@ -202,6 +223,7 @@
assertFail("assertSelectOptionsEqual", new Object[]{"select1", new String[]{"one", "two", "three", "four", "five"}});
}
+ @Test
public void testAssertSelectOptionsNotEqual() throws Throwable {
beginAt("/testPage.html");
assertFail("assertSelectOptionsNotEqual", new Object[]{"select1", new String[]{"one", "two", "three", "four"}});
@@ -209,6 +231,7 @@
assertPass("assertSelectOptionsNotEqual", new Object[]{"select1", new String[]{"one", "two", "three", "four", "five"}});
}
+ @Test
public void testAssertSelectOptionValuesEqual() throws Throwable {
beginAt("/testPage.html");
assertPass("assertSelectOptionValuesEqual", new Object[]{"select1", new String[]{"1", "2", "3", "4"}});
@@ -216,6 +239,7 @@
assertFail("assertSelectOptionValuesEqual", new Object[]{"select1", new String[]{"1", "2", "3", "4", "5"}});
}
+ @Test
public void testAssertSelectOptionValuesNotEqual() throws Throwable {
beginAt("/testPage.html");
assertFail("assertSelectOptionValuesNotEqual", new Object[]{"select1", new String[]{"1", "2", "3", "4"}});
@@ -223,21 +247,25 @@
assertPass("assertSelectOptionValuesNotEqual", new Object[]{"select1", new String[]{"1", "2", "3", "4", "5"}});
}
+ @Test
public void testAssertSelectedOptionEquals() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectedOptionEquals", new String[]{"select1", "one"}, new String[]{"select1", "two"});
}
+ @Test
public void testAssertSelectedOptionValueEquals() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertSelectedOptionValueEquals", new String[]{"select1", "1"}, new String[]{"select1", "2"});
}
+ @Test
public void testAssertButtonPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertButtonPresent", "b1", "nobutton");
}
+ @Test
public void testAssertButtonNotPresent() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertButtonNotPresent", "nobutton", "b1");
@@ -246,6 +274,7 @@
/**
* Test elements with complicated names.
*/
+ @Test
public void testComplicatedElementNames() {
beginAt("/testPage.html");
@@ -264,6 +293,7 @@
/**
* Testing for issue 1996193: clickRadioOption does not work as expected
*/
+ @Test
public void testIssue1996193() {
beginAt("/testPage.html");
@@ -277,6 +307,7 @@
/**
* tests for label elements
*/
+ @Test
public void testLabels() {
beginAt("/testPage.html");
@@ -308,6 +339,7 @@
/**
* Test setting elements retrieved through labels
*/
+ @Test
public void testSetLabels() {
beginAt("/testPage.html");
@@ -345,6 +377,7 @@
* Even though the element has no value set (i.e. getAttribute("value") == null),
* it should still qualify as equal to an empty string.
*/
+ @Test
public void testLabeledEmptyElement() {
beginAt("/testPage.html");
assertLabeledFieldEquals("label9", "");
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -19,28 +19,25 @@
package net.sourceforge.jwebunit.tests;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import org.junit.Test;
+
public class FormAssertionsWithLabelTest extends JWebUnitAPITestCase {
- public static Test suite() {
- Test suite = new TestSuite(FormAssertionsWithLabelTest.class);
- return new JettySetup(suite);
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/FormAssertionsTest");
}
+ @Test
public void testAssertFormParameterPresentWithLabel() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertFormElementPresentWithLabel", "Test Input", "No Such Label");
assertFail("assertFormElementPresentWithLabel", "This is a test page");
}
+ @Test
public void testAssertFormParameterNotPresentWithLabel() throws Throwable {
beginAt("/testPage.html");
assertPassFail("assertFormElementNotPresentWithLabel", "No Such Label", "Test Input");
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 2010-10-18 09:48:01 UTC (rev 859)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2010-10-18 16:01:49 UTC (rev 860)
@@ -25,10 +25,11 @@
import java.io.FileWriter;
import java.io.IOException;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.Test;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import static org.junit.Assert.*;
+
/**
* Test form submission related methods of WebTestCase.
*
@@ -39,16 +40,12 @@
*/
public class FormSubmissionTest extends JWebUnitAPITestCase {
- public static Test suite() {
- Test suite = new TestSuite(FormSubmissionTest.class);
- return new JettySetup(suite);
- }
-
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/FormSubmissionTest");
}
+ @Test
public void testSetTextField() {
beginAt("/SingleNamedButtonForm.html");
setTextField("color", "blue");
@@ -61,6 +58,7 @@
assertTextPresent("color=red");
}
+ @Test
public void testSetTextArea() {
beginAt("/TextAreaForm.html");
setTextField("text", "sometext");
@@ -73,6 +71,7 @@
assertTextPresent("text=anothertext");
}
+ @Test
public void testSetFileField() {
beginAt("/InputFileForm.html");
File temp = null;
@@ -96,6 +95,7 @@
assertTextPresent("file=" + temp.getName() + "{abcdefgh}");
}
+ @Test
public void testSubmitImageInput() {
beginAt("/InputImageForm.html");
setTextField("color", "toto");
@@ -105,6 +105,7 @@
assertTextPresent("color=toto");
}
+ @Test
public void testSubmitImageInputByName() {
beginAt("/InputImageForm.html");
setTextField("color", "toto");
@@ -114,6 +115,7 @@
assertTextPresent("color=toto");
}
+ @Test
public void testCheckBoxSelection() {
beginAt("/SingleNamedButtonForm.html");
checkCheckbox("checkBox");
@@ -125,6 +127,7 @@
assertTextPresent("checkBox=,on");
}
+ @Test
public void testCheckBoxSelectionWithSameFieldName() {
beginAt("/CheckboxForm.html");
checkCheckbox("checkBox", "1");
@@ -134,6 +137,7 @@
assertTextPresent("checkBox=1,3" + System.getProperty("line.separator"));
}
+ @Test
public void testCheckBoxDeSelectionWithSameFieldName() {
beginAt("/CheckboxForm.html");
checkCheckbox("checkBox", "1");
@@ -143,6 +147,7 @@
assertTextPresent("checkBox=1");
}
+ @Test
public void testCheckBoxDeselection() {
beginAt("/SingleNamedButtonForm.html");
checkCheckbox("checkBox"); // Fail with httpunit because of hidden
@@ -154,6 +159,7 @@
assertTextPresent("color=blue" + System.getProperty("line.separator"));
}
+ @Test
public void testRadioSelection() {
beginAt("/RadioForm.html");
clickRadioOption("radio", "1");
@@ -170,6 +176,7 @@
assertTextPresent("radio=3" + System.getProperty("line.separator"));
}
+ @Test
public void testSingleFormSingleUnnamedButtonSubmission() {
beginAt("/SingleUnnamedButtonForm.html");
setTextField("color", "blue");
@@ -177,6 +184,7 @@
assertTextPresent("color=blue" + System.getProperty("line.separator"));
}
+ @Test
public void testSingleNamedButtonSubmission() {
beginAt("/SingleNamedButtonForm.html");
setTextField("color", "red");
@@ -184,6 +192,7 @@
assertTextPresent("color=red");
}
+ @Test
public void testSingleFormMultipleButtonSubmission() {
gotoMultiButtonPage();
submit("color");
@@ -193,6 +202,7 @@
assertTextPresent("color=blue");
}
+ @Test
public void testBogusParameter() {
gotoMultiButtonPage();
try {
@@ -203,6 +213,7 @@
}
}
+ @Test
public void testParamSetOnMultiForm() {
beginAt("/MultiFormPage.html");
setTextField("param1", "anyvalue");
@@ -212,6 +223,7 @@
assertTextPresent("param2=anyvalue");
}
+ @Test
public void testTextFieldSetOnMultiFormWithSameName() {
beginAt("/MultiFormPage.html");
setWorkingForm("f...
[truncated message content] |
|
From: <he...@us...> - 2010-10-20 09:17:38
|
Revision: 868
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=868&view=rev
Author: henryju
Date: 2010-10-20 09:17:31 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
[2970512] Fixed issue with absolute image path. (merge)
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-20 09:17:31 UTC (rev 868)
@@ -19,12 +19,7 @@
package net.sourceforge.jwebunit.tests;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImagePresent;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImageValid;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImageValidAndStore;
-import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
-import static net.sourceforge.jwebunit.junit.JWebUnit.getImage;
-import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
import static org.junit.Assert.assertNotNull;
import java.awt.Image;
@@ -47,7 +42,8 @@
beginAt("/PageWithImages.html");
}
- @Test public void testSimpleImagePresenceAssertion() throws Throwable {
+ @Test
+ public void testSimpleImagePresenceAssertion() throws Throwable {
assertImagePresent("images/Image1.gif", "image 1");
assertImagePresent("images/Image2.png", "image 2");
assertImagePresent("images/photos/Image3.jpg", "image 3");
@@ -59,23 +55,28 @@
assertFail("assertImagePresent", new Object[]{"images/Image2.png", "wrong alt"});
}
- @Test public void testGifCanBeLoaded() throws Throwable {
+ @Test
+ public void testGifCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/Image1.gif", "image 1"});
}
- @Test public void testPngCanBeLoaded() throws Throwable {
+ @Test
+ public void testPngCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/Image2.png", "image 2"});
}
- @Test public void testJpgCanBeLoaded() throws Throwable {
+ @Test
+ public void testJpgCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/photos/Image3.jpg", "image 3"});
}
- @Test public void testFailsOnInvalidImages() throws Throwable {
+ @Test
+ public void testFailsOnInvalidImages() throws Throwable {
assertFail("assertImageValid", new Object[]{"images/InvalidImage.gif", "invalid image"});
}
- @Test public void testSavesImage() throws Throwable {
+ @Test
+ public void testSavesImage() throws Throwable {
File testOut = File.createTempFile("jwebunit-test-", ".png");
testOut.deleteOnExit();
assertImageValidAndStore("images/Image2.png", "image 2", testOut);
@@ -84,16 +85,25 @@
assertNotNull(testImg);
}
- @Test public void testImagesAreExposed() throws Throwable {
+ @Test
+ public void testImagesAreExposed() throws Throwable {
Image image = getImage("images/Image1.gif", "image 1");
// let's just assume it's ok if the image is there
assertNotNull(image);
}
- @Test public void testRelativePathsAreCorrectlyResolved() {
+ @Test
+ public void testRelativePathsAreCorrectlyResolved() {
beginAt("/somedir/AnotherPageWithImages.html");
assertImageValid("Image4.gif", "image 4 - same dir");
assertImageValid("images/Image5.png", "image 5 - subdir");
assertImageValid("../images/photos/Image3.jpg", "image 3 again - topdir");
}
+
+ @Test
+ public void testAbsolutePath() {
+ assertImagePresent("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ assertImageValid("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ }
+
}
Modified: trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-20 09:17:31 UTC (rev 868)
@@ -28,6 +28,7 @@
<body>
<div id="test">
<img src="images/Image1.gif" alt="image 1" />
+ <img src="/jwebunit/ImageTest/images/Image1.gif" alt="absolute image 1" />
<img src="images/Image2.png" alt="image 2" />
<img src="images/photos/Image3.jpg" alt="image 3" />
<img src="somedir/Image4.gif" />
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-20 09:17:31 UTC (rev 868)
@@ -232,6 +232,15 @@
}
+ /**
+ * This way of creating URL is not standard as absolute path are not correctly handled. We have to keep this
+ * non standard method for {@link #beginAt(String)} that advertise a bad usage for a long time.
+ * @param url Absolute or relative URL. If start with '/', then it is incorrectly appended to baseURL.
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ @Deprecated
private URL createUrl(String url, URL baseURL) throws MalformedURLException {
if (url.startsWith("http://") || url.startsWith("https://")
|| url.startsWith("file://")) {
@@ -245,6 +254,24 @@
}
/**
+ *
+ * @param url Absolute or relative URL
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ private URL createUrlFixed(String url, URL baseURL) throws MalformedURLException {
+ if (url.startsWith("http://") || url.startsWith("https://") //Absolute URL
+ || url.startsWith("file://")) {
+ return new URL(url);
+ } else if (url.startsWith("www.")) { //Absolute URL with missing scheme (accepted by some browsers)
+ return new URL("http://" + url);
+ } else { //Relative path
+ return new URL(baseURL, url);
+ }
+ }
+
+ /**
* Return the value of a web resource based on its key. This translates to a property file lookup with the locale
* based on the current TestContext.
*
@@ -3426,7 +3453,7 @@
assertImagePresent(imageSrc, imageAlt);
URL imageUrl = null;
try {
- imageUrl = createUrl(imageSrc, getTestingEngine().getPageURL());
+ imageUrl = createUrlFixed(imageSrc, getTestingEngine().getPageURL());
} catch (MalformedURLException e1) {
fail(e1.getLocalizedMessage());
}
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/src/changes/changes.xml 2010-10-20 09:17:31 UTC (rev 868)
@@ -27,7 +27,7 @@
<properties>
<title>JWebUnit changes</title>
<author email="henryju at users.sourceforge.net">
- Julien Henry
+ Julien HENRY
</author>
</properties>
<body>
@@ -37,6 +37,9 @@
</action>
</release>
<release version="2.5" date="UNKNOW" description="Small fixes and dependency updates">
+ <action type="fix" dev="henryju" issue="2970512" due-to="Todd Owen">
+ Fixed handling of absolute image path (when src attribute start with a /).
+ </action>
<action type="update" dev="henryju">
Updated to slf4j 1.6.1.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-20 10:03:00
|
Revision: 869
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=869&view=rev
Author: henryju
Date: 2010-10-20 10:02:51 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 3: restored WebTestCase generator and added a new generator for JWebUnit.
Modified Paths:
--------------
trunk/jwebunit-core/pom.xml
Added Paths:
-----------
trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj
trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj
Removed Paths:
-------------
trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2010-10-20 09:17:31 UTC (rev 868)
+++ trunk/jwebunit-core/pom.xml 2010-10-20 10:02:51 UTC (rev 869)
@@ -41,21 +41,34 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
+ <id>generate-webtestcase</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
- <sourceRoot>
- ${project.build.directory}/generated-sources/main/java
- </sourceRoot>
+ <mainClass>
+ net.sourceforge.jwebunit.javacc.WebTestCaseGenerator
+ </mainClass>
</configuration>
</execution>
+ <execution>
+ <id>generate-jwebunit</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>
+ net.sourceforge.jwebunit.javacc.JWebUnitGenerator
+ </mainClass>
+ </configuration>
+ </execution>
</executions>
<configuration>
- <mainClass>
- net.sourceforge.jwebunit.javacc.WebTestCaseGenerator
- </mainClass>
+ <sourceRoot>
+ ${project.build.directory}/generated-sources/main/java
+ </sourceRoot>
<arguments>
<argument>${basedir}/src/main/java</argument>
<argument>
Copied: trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj (from rev 860, trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj)
===================================================================
--- trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj (rev 0)
+++ trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj 2010-10-20 10:02:51 UTC (rev 869)
@@ -0,0 +1,1605 @@
+
+/*
+ * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has
+ * intellectual property rights relating to technology embodied in the product
+ * that is described in this document. In particular, and without limitation,
+ * these intellectual property rights may include one or more of the U.S.
+ * patents listed at http://www.sun.com/patents and one or more additional
+ * patents or pending patent applications in the U.S. and in other countries.
+ * U.S. Government Rights - Commercial software. Government users are subject
+ * to the Sun Microsystems, Inc. standard license agreement and applicable
+ * provisions of the FAR and its supplements. Use is subject to license terms.
+ * Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
+ * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This
+ * product is covered and controlled by U.S. Export Control laws and may be
+ * subject to the export or import laws in other countries. Nuclear, missile,
+ * chemical biological weapons or nuclear maritime end uses or end users,
+ * whether direct or indirect, are strictly prohibited. Export or reexport
+ * to countries subject to U.S. embargo or to entities identified on U.S.
+ * export exclusion lists, including, but not limited to, the denied persons
+ * and specially designated nationals lists is strictly prohibited.
+ */
+
+options {
+ JAVA_UNICODE_ESCAPE = true;
+ ERROR_REPORTING = false;
+ STATIC = false;
+}
+
+PARSER_BEGIN(JWebUnitGenerator)
+package net.sourceforge.jwebunit.javacc;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Grammar to parse Java version 1.5
+ * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
+ */
+public class JWebUnitGenerator
+{
+ /**
+ * Class to hold modifiers.
+ */
+ static public final class ModifierSet
+ {
+ /* Definitions of the bits in the modifiers field. */
+ public static final int PUBLIC = 0x0001;
+ public static final int PROTECTED = 0x0002;
+ public static final int PRIVATE = 0x0004;
+ public static final int ABSTRACT = 0x0008;
+ public static final int STATIC = 0x0010;
+ public static final int FINAL = 0x0020;
+ public static final int SYNCHRONIZED = 0x0040;
+ public static final int NATIVE = 0x0080;
+ public static final int TRANSIENT = 0x0100;
+ public static final int VOLATILE = 0x0200;
+ public static final int STRICTFP = 0x1000;
+
+ /** A set of accessors that indicate whether the specified modifier
+ is in the set. */
+
+ public boolean isPublic(int modifiers)
+ {
+ return (modifiers & PUBLIC) != 0;
+ }
+
+ public boolean isProtected(int modifiers)
+ {
+ return (modifiers & PROTECTED) != 0;
+ }
+
+ public boolean isPrivate(int modifiers)
+ {
+ return (modifiers & PRIVATE) != 0;
+ }
+
+ public boolean isStatic(int modifiers)
+ {
+ return (modifiers & STATIC) != 0;
+ }
+
+ public boolean isAbstract(int modifiers)
+ {
+ return (modifiers & ABSTRACT) != 0;
+ }
+
+ public boolean isFinal(int modifiers)
+ {
+ return (modifiers & FINAL) != 0;
+ }
+
+ public boolean isNative(int modifiers)
+ {
+ return (modifiers & NATIVE) != 0;
+ }
+
+ public boolean isStrictfp(int modifiers)
+ {
+ return (modifiers & STRICTFP) != 0;
+ }
+
+ public boolean isSynchronized(int modifiers)
+ {
+ return (modifiers & SYNCHRONIZED) != 0;
+ }
+
+ public boolean isTransient(int modifiers)
+ {
+ return (modifiers & TRANSIENT) != 0;
+ }
+
+ public boolean isVolatile(int modifiers)
+ {
+ return (modifiers & VOLATILE) != 0;
+ }
+
+ /**
+ * Removes the given modifier.
+ */
+ static int removeModifier(int modifiers, int mod)
+ {
+ return modifiers & ~mod;
+ }
+ }
+
+ public JWebUnitGenerator(String fileName)
+ {
+ this(System.in);
+ try { ReInit(new FileInputStream(new File(fileName))); }
+ catch(Exception e) { e.printStackTrace(); }
+ }
+
+ public static void main(String args[]) {
+ JWebUnitGenerator parser;
+ StringBuffer sb = new StringBuffer();
+ String webTesterPath;
+ String webTestCasePath;
+ File inputFile;
+ File outputFile;
+ FileOutputStream output;
+ if (args.length == 2) {
+ webTesterPath = args[0] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "WebTester.java";
+ webTestCasePath = args[1] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "JWebUnit.java";
+ inputFile = new File(webTesterPath);
+ if (inputFile.exists()) {
+ System.out.println("JWebUnitGenerator: Reading from file " + webTesterPath + " . . .");
+ } else {
+ System.out.println("JWebUnitGenerator: [ERROR] File " + webTesterPath + " not found . . .");
+ return;
+ }
+
+ try {
+ parser = new JWebUnitGenerator(new java.io.FileInputStream(inputFile));
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("JWebUnitGenerator: [ERROR] File " + webTesterPath + " not found . . .");
+ return;
+ }
+ outputFile = new File(webTestCasePath);
+ if (!outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs()) {
+ System.out.println("JWebUnitGenerator: [ERROR] Can not create output directory " + outputFile.getParentFile() + ".");
+ return;
+ }
+ try {
+ output = new java.io.FileOutputStream(outputFile);
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("JWebUnitGenerator: File " + webTestCasePath + " can not be opened.");
+ return;
+ }
+
+ } else {
+ System.out.println("JWebUnitGenerator: Usage is :");
+ System.out.println(" java JWebUnitGenerator dir_to_WebTester.java output_dir_for_JWebUnit.java");
+ return;
+ }
+ try {
+
+ parser.CompilationUnit(sb);
+ System.out.println("JWebUnitGenerator: WebTester.java parsed successfully.");
+ } catch (ParseException e) {
+ System.out.println(e.getMessage());
+ System.out.println("JWebUnitGenerator: Encountered errors during parse.");
+ }
+ try {
+ output.write(sb.toString().getBytes("UTF-8"));
+ output.close();
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
+
+PARSER_END(JWebUnitGenerator)
+
+/* WHITE SPACE */
+
+SKIP :
+{
+ " "
+| "\t"
+| "\n"
+| "\r"
+| "\f"
+}
+
+/* COMMENTS */
+
+MORE :
+{
+ "//" : IN_SINGLE_LINE_COMMENT
+|
+ <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
+|
+ "/*" : IN_MULTI_LINE_COMMENT
+}
+
+<IN_SINGLE_LINE_COMMENT>
+SPECIAL_TOKEN :
+{
+ <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT
+}
+
+<IN_FORMAL_COMMENT>
+SPECIAL_TOKEN :
+{
+ <FORMAL_COMMENT: "*/" > : DEFAULT
+}
+
+<IN_MULTI_LINE_COMMENT>
+SPECIAL_TOKEN :
+{
+ <MULTI_LINE_COMMENT: "*/" > : DEFAULT
+}
+
+<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
+MORE :
+{
+ < ~[] >
+}
+
+/* RESERVED WORDS AND LITERALS */
+
+TOKEN :
+{
+ < ABSTRACT: "abstract" >
+| < ASSERT: "assert" >
+| < BOOLEAN: "boolean" >
+| < BREAK: "break" >
+| < BYTE: "byte" >
+| < CASE: "case" >
+| < CATCH: "catch" >
+| < CHAR: "char" >
+| < CLASS: "class" >
+| < CONST: "const" >
+| < CONTINUE: "continue" >
+| < _DEFAULT: "default" >
+| < DO: "do" >
+| < DOUBLE: "double" >
+| < ELSE: "else" >
+| < ENUM: "enum" >
+| < EXTENDS: "extends" >
+| < FALSE: "false" >
+| < FINAL: "final" >
+| < FINALLY: "finally" >
+| < FLOAT: "float" >
+| < FOR: "for" >
+| < GOTO: "goto" >
+| < IF: "if" >
+| < IMPLEMENTS: "implements" >
+| < IMPORT: "import" >
+| < INSTANCEOF: "instanceof" >
+| < INT: "int" >
+| < INTERFACE: "interface" >
+| < LONG: "long" >
+| < NATIVE: "native" >
+| < NEW: "new" >
+| < NULL: "null" >
+| < PACKAGE: "package">
+| < PRIVATE: "private" >
+| < PROTECTED: "protected" >
+| < PUBLIC: "public" >
+| < RETURN: "return" >
+| < SHORT: "short" >
+| < STATIC: "static" >
+| < STRICTFP: "strictfp" >
+| < SUPER: "super" >
+| < SWITCH: "switch" >
+| < SYNCHRONIZED: "synchronized" >
+| < THIS: "this" >
+| < THROW: "throw" >
+| < THROWS: "throws" >
+| < TRANSIENT: "transient" >
+| < TRUE: "true" >
+| < TRY: "try" >
+| < VOID: "void" >
+| < VOLATILE: "volatile" >
+| < WHILE: "while" >
+}
+
+/* LITERALS */
+
+TOKEN :
+{
+ < INTEGER_LITERAL:
+ <DECIMAL_LITERAL> (["l","L"])?
+ | <HEX_LITERAL> (["l","L"])?
+ | <OCTAL_LITERAL> (["l","L"])?
+ >
+|
+ < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
+|
+ < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
+|
+ < #OCTAL_LITERAL: "0" (["0"-"7"])* >
+|
+ < FLOATING_POINT_LITERAL:
+ (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
+ | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
+ | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
+ | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
+ >
+|
+ < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
+|
+ < CHARACTER_LITERAL:
+ "'"
+ ( (~["'","\\","\n","\r"])
+ | ("\\"
+ ( ["n","t","b","r","f","\\","'","\""]
+ | ["0"-"7"] ( ["0"-"7"] )?
+ | ["0"-"3"] ["0"-"7"] ["0"-"7"]
+ )
+ )
+ )
+ "'"
+ >
+|
+ < STRING_LITERAL:
+ "\""
+ ( (~["\"","\\","\n","\r"])
+ | ("\\"
+ ( ["n","t","b","r","f","\\","'","\""]
+ | ["0"-"7"] ( ["0"-"7"] )?
+ | ["0"-"3"] ["0"-"7"] ["0"-"7"]
+ )
+ )
+ )*
+ "\""
+ >
+}
+
+/* IDENTIFIERS */
+
+TOKEN :
+{
+ < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
+|
+ < #LETTER:
+ [
+ "\u0024",
+ "\u0041"-"\u005a",
+ "\u005f",
+ "\u0061"-"\u007a",
+ "\u00c0"-"\u00d6",
+ "\u00d8"-"\u00f6",
+ "\u00f8"-"\u00ff",
+ "\u0100"-"\u1fff",
+ "\u3040"-"\u318f",
+ "\u3300"-"\u337f",
+ "\u3400"-"\u3d2d",
+ "\u4e00"-"\u9fff",
+ "\uf900"-"\ufaff"
+ ]
+ >
+|
+ < #DIGIT:
+ [
+ "\u0030"-"\u0039",
+ "\u0660"-"\u0669",
+ "\u06f0"-"\u06f9",
+ "\u0966"-"\u096f",
+ "\u09e6"-"\u09ef",
+ "\u0a66"-"\u0a6f",
+ "\u0ae6"-"\u0aef",
+ "\u0b66"-"\u0b6f",
+ "\u0be7"-"\u0bef",
+ "\u0c66"-"\u0c6f",
+ "\u0ce6"-"\u0cef",
+ "\u0d66"-"\u0d6f",
+ "\u0e50"-"\u0e59",
+ "\u0ed0"-"\u0ed9",
+ "\u1040"-"\u1049"
+ ]
+ >
+}
+
+/* SEPARATORS */
+
+TOKEN :
+{
+ < LPAREN: "(" >
+| < RPAREN: ")" >
+| < LBRACE: "{" >
+| < RBRACE: "}" >
+| < LBRACKET: "[" >
+| < RBRACKET: "]" >
+| < SEMICOLON: ";" >
+| < COMMA: "," >
+| < DOT: "." >
+| < AT: "@" >
+}
+
+/* OPERATORS */
+
+TOKEN :
+{
+ < ASSIGN: "=" >
+| < LT: "<" >
+| < BANG: "!" >
+| < TILDE: "~" >
+| < HOOK: "?" >
+| < COLON: ":" >
+| < EQ: "==" >
+| < LE: "<=" >
+| < GE: ">=" >
+| < NE: "!=" >
+| < SC_OR: "||" >
+| < SC_AND: "&&" >
+| < INCR: "++" >
+| < DECR: "--" >
+| < PLUS: "+" >
+| < MINUS: "-" >
+| < STAR: "*" >
+| < SLASH: "/" >
+| < BIT_AND: "&" >
+| < BIT_OR: "|" >
+| < XOR: "^" >
+| < REM: "%" >
+| < LSHIFT: "<<" >
+| < PLUSASSIGN: "+=" >
+| < MINUSASSIGN: "-=" >
+| < STARASSIGN: "*=" >
+| < SLASHASSIGN: "/=" >
+| < ANDASSIGN: "&=" >
+| < ORASSIGN: "|=" >
+| < XORASSIGN: "^=" >
+| < REMASSIGN: "%=" >
+| < LSHIFTASSIGN: "<<=" >
+| < RSIGNEDSHIFTASSIGN: ">>=" >
+| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
+| < ELLIPSIS: "..." >
+}
+
+/* >'s need special attention due to generics syntax. */
+TOKEN :
+{
+ < RUNSIGNEDSHIFT: ">>>" >
+ {
+ matchedToken.kind = GT;
+ ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
+ input_stream.backup(2);
+ }
+| < RSIGNEDSHIFT: ">>" >
+ {
+ matchedToken.kind = GT;
+ ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
+ input_stream.backup(1);
+ }
+| < GT: ">" >
+}
+
+
+/*****************************************
+ * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
+ *****************************************/
+
+/*
+ * Program structuring syntax follows.
+ */
+
+void CompilationUnit(StringBuffer sb):
+{}
+{
+ {sb.append(getToken(1).specialToken.image).append("\n");}
+ [ PackageDeclaration(sb) ]
+
+ {sb.append("import java.awt.Image;\n");
+ sb.append("import java.io.File;\n");
+ sb.append("import java.io.PrintStream;\n");
+ sb.append("import java.util.List;\n");
+ sb.append("import java.util.Map;\n");
+ sb.append("import java.net.URL;\n\n");
+ sb.append("import net.sourceforge.jwebunit.api.IElement;\n");
+ sb.append("import net.sourceforge.jwebunit.api.ITestingEngine;\n");
+ sb.append("import net.sourceforge.jwebunit.exception.TestingEngineResponseException;\n");
+ sb.append("import net.sourceforge.jwebunit.html.Table;\n");
+ sb.append("import net.sourceforge.jwebunit.util.TestContext;\n\n");}
+
+ ( ImportDeclaration(sb) )*
+
+ {sb.append("/**\n");
+ sb.append(" * Utility class for JUnit 4 tests which provides web application navigation and \n");
+ sb.append(" * JUnit assertions. This class uses and is generated from {@link net.sourceforge.jwebunit.junit.WebTester}.\n");
+ sb.append(" * \n");
+ sb.append(" * @author JavaCC\n");
+ sb.append(" */\n");}
+
+ ( TypeDeclaration(sb) )*
+ <EOF>
+}
+
+void PackageDeclaration(StringBuffer sb):
+{String name;}
+{
+ "package" name=Name() ";"
+ {sb.append("package ").append(name).append(";\n\n");}
+
+}
+
+void ImportDeclaration(StringBuffer sb):
+{}
+{
+ "import" [ "static" ] Name() [ "." "*" ] ";"
+}
+
+/*
+ * Modifiers. We match all modifiers in a single rule to reduce the chances of
+ * syntax errors for simple modifier mistakes. It will also enable us to give
+ * better error messages.
+ */
+
+int Modifiers():
+{
+ int modifiers = 0;
+}
+{
+ (
+ LOOKAHEAD(2)
+ (
+ "public" { modifiers |= ModifierSet.PUBLIC; }
+ |
+ "static" { modifiers |= ModifierSet.STATIC; }
+ |
+ "protected" { modifiers |= ModifierSet.PROTECTED; }
+ |
+ "private" { modifiers |= ModifierSet.PRIVATE; }
+ |
+ "final" { modifiers |= ModifierSet.FINAL; }
+ |
+ "abstract" { modifiers |= ModifierSet.ABSTRACT; }
+ |
+ "synchronized" { modifiers |= ModifierSet.SYNCHRONIZED; }
+ |
+ "native" { modifiers |= ModifierSet.NATIVE; }
+ |
+ "transient" { modifiers |= ModifierSet.TRANSIENT; }
+ |
+ "volatile" { modifiers |= ModifierSet.VOLATILE; }
+ |
+ "strictfp" { modifiers |= ModifierSet.STRICTFP; }
+ |
+ Annotation()
+ )
+ )*
+
+ {
+ return modifiers;
+ }
+}
+
+/*
+ * Declaration syntax follows.
+ */
+void TypeDeclaration(StringBuffer sb):
+{
+ int modifiers;
+}
+{
+ ";"
+|
+ modifiers = Modifiers()
+ (
+ ClassOrInterfaceDeclaration(modifiers, sb)
+ |
+ EnumDeclaration(modifiers)
+ |
+ AnnotationTypeDeclaration(modifiers)
+ )
+}
+
+
+void ClassOrInterfaceDeclaration(int modifiers, StringBuffer sb):
+{
+ boolean isInterface = false;
+}
+{
+ ( "class" | "interface" { isInterface = true; } )
+ <IDENTIFIER>
+ [ TypeParameters() ]
+ [ ExtendsList(isInterface) ]
+ [ ImplementsList(isInterface) ]
+ {sb.append("public class JWebUnit ");}
+ ClassOrInterfaceBody(isInterface, sb)
+}
+
+void ExtendsList(boolean isInterface):
+{
+ boolean extendsMoreThanOne = false;
+}
+{
+ "extends" ClassOrInterfaceType()
+ ( "," ClassOrInterfaceType() { extendsMoreThanOne = true; } )*
+ {
+ if (extendsMoreThanOne && !isInterface)
+ throw new ParseException("A class cannot extend more than one other class");
+ }
+}
+
+void ImplementsList(boolean isInterface):
+{}
+{
+ "implements" ClassOrInterfaceType()
+ ( "," ClassOrInterfaceType() )*
+ {
+ if (isInterface)
+ throw new ParseException("An interface cannot implement other interfaces");
+ }
+}
+
+void EnumDeclaration(int modifiers):
+{}
+{
+ "enum" <IDENTIFIER>
+ [ ImplementsList(false) ]
+ EnumBody()
+}
+
+void EnumBody():
+{}
+{
+ "{"
+ EnumConstant() ( "," EnumConstant() )*
+ [ ";" ( ClassOrInterfaceBodyDeclaration(false, null) )* ]
+ "}"
+}
+
+void EnumConstant():
+{}
+{
+ <IDENTIFIER> [ Arguments() ] [ ClassOrInterfaceBody(false, null) ]
+}
+
+void TypeParameters():
+{}
+{
+ "<" TypeParameter() ( "," TypeParameter() )* ">"
+}
+
+void TypeParameter():
+{}
+{
+ <IDENTIFIER> [ TypeBound() ]
+}
+
+void TypeBound():
+{}
+{
+ "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )*
+}
+
+void ClassOrInterfaceBody(boolean isInterface, StringBuffer sb):
+{}
+{ {sb.append("{\n");
+ sb.append(" private static InheritableThreadLocal<WebTester> tester = new InheritableThreadLocal<WebTester>() {\n");
+ sb.append(" @Override\n");
+ sb.append(" protected WebTester childValue(WebTester parentValue) {\n");
+ sb.append(" //Create a new web tester for each child thread\n");
+ sb.append(" WebTester webTester = new WebTester();\n");
+ sb.append(" //But initialize it with parent TestContext\n");
+ sb.append(" webTester.setTestContext(parentValue.getTestContext());\n");
+ sb.append(" return webTester;\n");
+ sb.append(" }\n");
+ sb.append(" };\n\n");
+ sb.append(" private JWebUnit() {\n");
+ sb.append(" //This class should not be instanciated, but instead used statically\n");
+ sb.append(" }\n\n");
+
+ sb.append(" /**\n");
+ sb.append(" * Get internal WebTester.\n");
+ sb.append(" */\n");
+ sb.append(" public static WebTester getTester() {\n");
+ sb.append(" if (tester.get() == null) {\n");
+ sb.append(" tester.set(new WebTester());\n");
+ sb.append(" }\n");
+ sb.append(" return tester.get();\n");
+ sb.append(" }\n\n");
+
+ sb.append(" /**\n");
+ sb.append(" * Set a custom WebTester (for example your own subclass).\n");
+ sb.append(" */\n");
+ sb.append(" public static void setCustomTester(WebTester tester) {\n");
+ sb.append(" JWebUnit.tester.set(tester);\n");
+ sb.append(" }\n\n");}
+
+ "{" ( ClassOrInterfaceBodyDeclaration(isInterface, sb) )* "}"
+ {sb.append("}\n");}
+}
+
+void ClassOrInterfaceBodyDeclaration(boolean isInterface, StringBuffer sb):
+{
+ boolean isNestedInterface = false;
+ int modifiers;
+ String comment;
+}
+{
+ LOOKAHEAD(2)
+ Initializer()
+ {
+ if (isInterface)
+ throw new ParseException("An interface cannot have initializers");
+ }
+|
+ {comment=getToken(1).specialToken!=null?getToken(1).specialToken.image:"";}
+ modifiers = Modifiers() // Just get all the modifiers out of the way. If you want to do
+ // more checks, pass the modifiers down to the member
+ (
+ ClassOrInterfaceDeclaration(modifiers, sb)
+ |
+ EnumDeclaration(modifiers)
+ |
+ LOOKAHEAD( [ TypeParameters() ] <IDENTIFIER> "(" )
+ ConstructorDeclaration()
+ |
+ LOOKAHEAD( Type() <IDENTIFIER> ( "[" "]" )* ( "," | "=" | ";" ) )
+ FieldDeclaration(modifiers)
+ |
+ MethodDeclaration(modifiers, sb, comment)
+ )
+|
+ ";"
+}
+
+void FieldDeclaration(int modifiers):
+{}
+{
+ // Modifiers are already matched in the caller
+ Type() VariableDeclarator() ( "," VariableDeclarator() )* ";"
+}
+
+void VariableDeclarator():
+{}
+{
+ VariableDeclaratorId() [ "=" VariableInitializer() ]
+}
+
+String VariableDeclaratorId():
+{String result;
+ Token t;}
+{
+ t=<IDENTIFIER> {result=t.image;} ( "[" "]" {result+="[]";} )*
+ {return result;}
+}
+
+void VariableInitializer():
+{}
+{
+ ArrayInitializer()
+|
+ Expression()
+}
+
+void ArrayInitializer():
+{}
+{
+ "{" [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}"
+}
+
+void MethodDeclaration(int modifiers, StringBuffer sb, String comment):
+{ boolean append;
+ String resultType;
+ List params;
+ String throwsList;
+ boolean isVoid;}
+{
+ // Modifiers already matched in the caller!
+ { append = (modifiers & ModifierSet.PUBLIC) != 0;}
+ { if (append && comment!=null) sb.append(" ").append(comment).append("\n");}
+ { if (append) sb.append(" public static ");}
+ [ TypeParameters() ]
+ isVoid=ResultType(append, sb)
+ params=MethodDeclarator(append, sb) [ "throws" throwsList=NameList() {if (append) sb.append("throws "+throwsList);} ]
+ ( Block() | ";" )
+ {if (append) {
+ sb.append(" {\n");
+ sb.append(" ");
+ if (!isVoid) sb.append("return ");
+ sb.append("getTester().").append(params.remove(0)).append("(");
+ for (Iterator i = params.iterator(); i.hasNext();) {
+ i.next();
+ sb.append(i.next());
+ if (i.hasNext()) sb.append(", ");
+ }
+ sb.append(");\n");
+ sb.append(" }\n\n");
+ }}
+}
+
+List MethodDeclarator(boolean append, StringBuffer sb):
+{Token t;
+List result;}
+{
+ t=<IDENTIFIER> {if(append) sb.append(t.image);} result=FormalParameters(append, sb) ( "[" "]" )*
+ {result.add(0, t.image); return result;}
+}
+
+List FormalParameters(boolean append, StringBuffer sb):
+{List result = new LinkedList();
+ List tmp;}
+{
+ "(" {if(append) sb.append("(");} [ tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}}
+ ( ","{if(append) sb.append(", ");} tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}} )* ] ")" {if(append) sb.append(")");}
+ {return result;}
+}
+
+List FormalParameter():
+{List result = new ArrayList();
+ String tmp;}
+{
+ [ "final" ] tmp=Type() {result.add(tmp);} [ "..." ] tmp=VariableDeclaratorId() {result.add(tmp);}
+ {return result;}
+}
+
+void ConstructorDeclaration():
+{}
+{
+ [ TypeParameters() ]
+ // Modifiers matched in the caller
+ <IDENTIFIER> FormalParameters(false, null) [ "throws" NameList() ]
+ "{"
+ [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
+ ( BlockStatement() )*
+ "}"
+}
+
+void ExplicitConstructorInvocation():
+{}
+{
+ LOOKAHEAD("this" Arguments() ";")
+ "this" Arguments() ";"
+|
+ [ LOOKAHEAD(2) PrimaryExpression() "." ] "super" Arguments() ";"
+}
+
+void Initializer():
+{}
+{
+ [ "static" ] Block()
+}
+
+
+/*
+ * Type, name and expression syntax follows.
+ */
+
+String Type():
+{String s;}
+{
+ (LOOKAHEAD(2) s=ReferenceType()
+ |
+ s=PrimitiveType())
+ {return s;}
+}
+
+String ReferenceType():
+{String result;}
+{
+ (result=PrimitiveType() ( LOOKAHEAD(2) "[" "]" {result+="[]";} )+
+ |
+ ( result=ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" {result+="[]";} )*)
+ {return result;}
+}
+
+String ClassOrInterfaceType():
+{String result="";
+ String result2="";
+ Token t;}
+{
+ t=<IDENTIFIER> {result=t.image;} [ LOOKAHEAD(2) result2=TypeArguments() ]
+ ( LOOKAHEAD(2) "." <IDENTIFIER> [ LOOKAHEAD(2) TypeArguments() ] )*
+ {return result+result2;}
+}
+
+String TypeArguments():
+{String resultTmp;
+ StringBuffer sb = new StringBuffer();}
+{
+ "<" {sb.append("<");} resultTmp=TypeArgument() {sb.append(resultTmp);} ( "," {sb.append(",");} resultTmp=TypeArgument() {sb.append(resultTmp);} )* ">" {sb.append(">");}
+ {return sb.toString();}
+}
+
+String TypeArgument():
+{String resultTmp = "";
+ StringBuffer sb = new StringBuffer();}
+{
+ (resultTmp=ReferenceType() {sb.append(resultTmp);}
+ |
+ "?" {sb.append("?");} [ resultTmp=WildcardBounds() {sb.append(resultTmp);} ])
+ {return sb.toString();}
+}
+
+String WildcardBounds():
+{String resultTmp = "";
+ StringBuffer sb = new StringBuffer();}
+{
+ "extends" {sb.append("extends");} resultTmp=ReferenceType() {sb.append(resultTmp);}
+ |
+ "super" {sb.append("super");} resultTmp=ReferenceType() {sb.append(resultTmp);}
+ {return sb.toString();}
+}
+
+
+String PrimitiveType():
+{}
+{
+ "boolean" {return "boolean";}
+|
+ "char" {return "char";}
+|
+ "byte" {return "byte";}
+|
+ "short" {return "short";}
+|
+ "int" {return "int";}
+|
+ "long" {return "long";}
+|
+ "float" {return "float";}
+|
+ "double" {return "double";}
+}
+
+boolean ResultType(boolean append, StringBuffer sb):
+{String result;}
+{
+ "void" {if (append) sb.append("void "); return true;}
+|
+ result=Type() {if (append) sb.append(result+" "); return false;}
+}
+
+String Name():
+/*
+ * A lookahead of 2 is required below since "Name" can be followed
+ * by a ".*" when used in the context of an "ImportDeclaration".
+ */
+{String name = "";
+Token t;}
+{
+ t=<IDENTIFIER>
+ {name+=t.image;}
+ ( LOOKAHEAD(2) "." t=<IDENTIFIER> {name+="."+t.image;} )*
+ {return name;}
+}
+
+String NameList():
+{String result, tmp;}
+{
+ result=Name() ( "," tmp=Name() {result+=", "+tmp;} )*
+ {return result;}
+}
+
+
+/*
+ * Expression syntax follows.
+ */
+
+void Expression():
+/*
+ * This expansion has been written this way instead of:
+ * Assignment() | ConditionalExpression()
+ * for performance reasons.
+ * However, it is a weakening of the grammar for it allows the LHS of
+ * assignments to be any conditional expression whereas it can only be
+ * a primary expression. Consider adding a semantic predicate to work
+ * around this.
+ */
+{}
+{
+ ConditionalExpression()
+ [
+ LOOKAHEAD(2)
+ AssignmentOperator() Expression()
+ ]
+}
+
+void AssignmentOperator():
+{}
+{
+ "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|="
+}
+
+void ConditionalExpression():
+{}
+{
+ ConditionalOrExpression() [ "?" Expression() ":" Expression() ]
+}
+
+void ConditionalOrExpression():
+{}
+{
+ ConditionalAndExpression() ( "||" ConditionalAndExpression() )*
+}
+
+void ConditionalAndExpression():
+{}
+{
+ InclusiveOrExpression() ( "&&" InclusiveOrExpression() )*
+}
+
+void InclusiveOrExpression():
+{}
+{
+ ExclusiveOrExpression() ( "|" ExclusiveOrExpression() )*
+}
+
+void ExclusiveOrExpression():
+{}
+{
+ AndExpression() ( "^" AndExpression() )*
+}
+
+void AndExpression():
+{}
+{
+ EqualityExpression() ( "&" EqualityExpression() )*
+}
+
+void EqualityExpression():
+{}
+{
+ InstanceOfExpression() ( ( "==" | "!=" ) InstanceOfExpression() )*
+}
+
+void InstanceOfExpression():
+{}
+{
+ RelationalExpression() [ "instanceof" Type() ]
+}
+
+void RelationalExpression():
+{}
+{
+ ShiftExpression() ( ( "<" | ">" | "<=" | ">=" ) ShiftExpression() )*
+}
+
+void ShiftExpression():
+{}
+{
+ AdditiveExpression() ( ( "<<" | RSIGNEDSHIFT() | RUNSIGNEDSHIFT() ) AdditiveExpression() )*
+}
+
+void AdditiveExpression():
+{}
+{
+ MultiplicativeExpression() ( ( "+" | "-" ) MultiplicativeExpression() )*
+}
+
+void MultiplicativeExpression():
+{}
+{
+ UnaryExpression() ( ( "*" | "/" | "%" ) UnaryExpression() )*
+}
+
+void UnaryExpression():
+{}
+{
+ ( "+" | "-" ) UnaryExpression()
+|
+ PreIncrementExpression()
+|
+ PreDecrementExpression()
+|
+ UnaryExpressionNotPlusMinus()
+}
+
+void PreIncrementExpression():
+{}
+{
+ "++" PrimaryExpression()
+}
+
+void PreDecrementExpression():
+{}
+{
+ "--" PrimaryExpression()
+}
+
+void UnaryExpressionNotPlusMinus():
+{}
+{
+ ( "~" | "!" ) UnaryExpression()
+|
+ LOOKAHEAD( CastLookahead() )
+ CastExpression()
+|
+ PostfixExpression()
+}
+
+// This production is to determine lookahead only. The LOOKAHEAD specifications
+// below are not used, but they are there just to indicate that we know about
+// this.
+void CastLookahead():
+{}
+{
+ LOOKAHEAD(2)
+ "(" PrimitiveType()
+|
+ LOOKAHEAD("(" Type() "[")
+ "(" Type() "[" "]"
+|
+ "(" Type() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
+}
+
+void PostfixExpression():
+{}
+{
+ PrimaryExpression() [ "++" | "--" ]
+}
+
+void CastExpression():
+{}
+{
+ LOOKAHEAD("(" PrimitiveType())
+ "("...
[truncated message content] |
|
From: <he...@us...> - 2010-10-20 12:14:30
|
Revision: 872
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=872&view=rev
Author: henryju
Date: 2010-10-20 12:14:24 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 5: renamed webtestcase generator module to reflect the fact it is now generating more than WebTestCase.
Modified Paths:
--------------
trunk/pom.xml
Added Paths:
-----------
trunk/jwebunit-code-generator/
Removed Paths:
-------------
trunk/jwebunit-webtestcase-generator/
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-20 12:04:14 UTC (rev 871)
+++ trunk/pom.xml 2010-10-20 12:14:24 UTC (rev 872)
@@ -21,7 +21,7 @@
</issueManagement>
<inceptionYear>2002</inceptionYear>
<modules>
- <module>jwebunit-webtestcase-generator</module>
+ <module>jwebunit-code-generator</module>
<module>jwebunit-core</module>
<module>jwebunit-commons-tests</module>
<module>jwebunit-htmlunit-plugin</module>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-20 12:19:53
|
Revision: 873
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=873&view=rev
Author: henryju
Date: 2010-10-20 12:19:47 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 5 bis: renamed webtestcase generator module to reflect the fact it is now generating more than WebTestCase.
Modified Paths:
--------------
trunk/jwebunit-code-generator/pom.xml
trunk/jwebunit-core/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2010-10-20 12:14:24 UTC (rev 872)
+++ trunk/jwebunit-code-generator/pom.xml 2010-10-20 12:19:47 UTC (rev 873)
@@ -6,9 +6,9 @@
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jwebunit-webtestcase-generator</artifactId>
- <name>WebTestCase Generator</name>
- <description>A little parser that create WebTestCase from WebTester.</description>
+ <artifactId>jwebunit-code-generator</artifactId>
+ <name>Code Generator</name>
+ <description>JavaCC parsers that create WebTestCase and JWebUnit based on WebTester.</description>
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
<!-- Prevents deployment as this module is not intended to be used by end-users -->
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2010-10-20 12:14:24 UTC (rev 872)
+++ trunk/jwebunit-core/pom.xml 2010-10-20 12:19:47 UTC (rev 873)
@@ -85,9 +85,7 @@
<dependencies>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
- <artifactId>
- jwebunit-webtestcase-generator
- </artifactId>
+ <artifactId>jwebunit-code-generator</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-20 12:14:24 UTC (rev 872)
+++ trunk/pom.xml 2010-10-20 12:19:47 UTC (rev 873)
@@ -314,7 +314,8 @@
<exclude>COPYING*</exclude>
<exclude>src/test/clover/clover.license</exclude>
<exclude>src/site/resources/images/jwebunit-architecture.odg</exclude>
- <exclude>src/main/javacc/Java1.5.jj</exclude>
+ <exclude>src/main/javacc/WebTestCase.jj</exclude>
+ <exclude>src/main/javacc/JWebUnit.jj</exclude>
<exclude>src/main/javacc/Token.java</exclude>
<exclude>src/main/resources/testcases/CharsetTest/charset.html_utf-8</exclude>
<exclude>src/main/resources/testcases/NonHtmlContentTest/text.bin</exclude>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-20 13:10:18
|
Revision: 874
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=874&view=rev
Author: henryju
Date: 2010-10-20 13:10:11 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 6: updated documentation.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml
trunk/jwebunit-selenium-plugin/src/site/xdoc/index.xml
trunk/src/site/xdoc/articles.xml
trunk/src/site/xdoc/building-maven.xml
trunk/src/site/xdoc/how-to-contribute.xml
trunk/src/site/xdoc/index.xml
trunk/src/site/xdoc/installation.xml
trunk/src/site/xdoc/quickstart.xml
Modified: trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -53,10 +53,11 @@
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
-import junit.framework.TestCase;
+import org.junit.Test;
-public class SearchExample extends TestCase {
+public class SearchExample {
+ @Test
public void testSearch() throws Exception {
final WebClient webClient = new WebClient();
final URL url = new URL("http://www.google.com");
@@ -76,17 +77,20 @@
</td>
<td valign="top" nowrap="nowrap">
<source>
-import net.sourceforge.jwebunit.util.TestingEngineRegistry;
-import net.sourceforge.jwebunit.junit.WebTestCase;
+import org.junit.Before;
+import org.junit.Test;
-public class SearchExample extends WebTestCase {
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
+public class SearchExample {
- public void setUp() {
- setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
- getTestContext().setBaseUrl("http://www.google.com");
- }
+ @Before
+ public void prepare() {
+ setBaseUrl("http://www.google.com");
+ }
- public void testSearch() throws Exception {
+ @Test
+ public void testSearch() {
beginAt("/");
setTextField("q", "htmlunit");
submit("btnG");
@@ -111,7 +115,7 @@
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
- <version>2.0</version>
+ <version>3.0</version>
</dependency>
...
</dependencies>
Modified: trunk/jwebunit-selenium-plugin/src/site/xdoc/index.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/src/site/xdoc/index.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/jwebunit-selenium-plugin/src/site/xdoc/index.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -49,7 +49,7 @@
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-selenium-plugin</artifactId>
- <version>2.0</version>
+ <version>3.0</version>
</dependency>
...
</dependencies>
Modified: trunk/src/site/xdoc/articles.xml
===================================================================
--- trunk/src/site/xdoc/articles.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/articles.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -30,9 +30,11 @@
<p>
<ul>
- <li><a href="http://www.brodwall.com/johannes/blog/2006/12/10/in-process-web-integration-tests-with-jetty-and-jwebunit/">In-process Web Integration Tests with Jetty and JWebUnit</a></li>
+ <li><a href="http://johannesbrodwall.com/2006/12/10/in-process-web-integration-tests-with-jetty-and-jwebunit/">In-process Web Integration Tests with Jetty and JWebUnit</a></li>
<li><a href="http://portletwork.blogspot.com/2007/08/testing-portlets-with-jetty-pluto-and.html">Testing Portlets with Jetty, Pluto and JWebUnit</a></li>
<li><a href="http://blog.ippon.fr/2008/11/14/testez-vos-applications-graphiques-web">Testez vos applications graphiques web (FR)</a></li>
+ <li><a href="http://www.wakaleo.com/component/content/article/183">Web testing BDD-style with JWebUnit and Easyb</a></li>
+ <li><a href="http://cvalcarcel.wordpress.com/2009/12/13/and-now-by-popular-demand-jwebunit/">Eclipse development, Software Development, Testing > And Now By Popular Demand: jWebUnit</a></li>
</ul>
</p>
Modified: trunk/src/site/xdoc/building-maven.xml
===================================================================
--- trunk/src/site/xdoc/building-maven.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/building-maven.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -26,18 +26,12 @@
<title>Building JWebUnit</title>
</properties>
<body class="default">
- <section name="Building JWebUnit with Maven 2">
+ <section name="Building JWebUnit">
<p>
- Maven is, just like ant, a build tool. However, where
- you have to tell ant what it needs to do and how, you
- only have to tell Maven what you need, if you adhere to
- the Maven standards.
- </p>
- <p>
- In order to use Maven to build JWebUnit, you need to
- have Maven 2 installed. This should not be any more
+ In order to build JWebUnit, you need to
+ have Maven installed. This should not be any more
difficult than installing ant. We've included a best
- practise installation and configuration for Maven.
+ practice installation and configuration for Maven.
</p>
<subsection name="Installing Sun JDK 1.5">
<p>
@@ -46,35 +40,35 @@
<p>
You need to download and install latest Sun JDK 1.5 for your platform.
Let's say the JDK location is:
- <source>/opt/jdk1.5.0_15</source>
+ <source>/opt/jdk1.5.0_22</source>
</p>
</subsection>
<subsection name="Installing Maven">
<p>
- First you need to download the latest Maven 2, which
+ First you need to download the latest Maven, which
currently is
<a href="http://maven.apache.org">
- <tt>Maven-2.2.1</tt>
+ <tt>Maven-3.0</tt>
</a>
, make sure you download the binary archive
- (e.g. apache-maven-2.2.1-bin.tar.bz2).
+ (e.g. apache-maven-3.0-bin.tar.bz2).
</p>
<p>
- Installing Maven should be easy: unzip the file to
+ Installing Maven should be easy: extract the file to
any directory you like, let's say:
- <source>/opt/apache-maven-2.2.1</source>
+ <source>/opt/apache-maven-3.0</source>
</p>
<p>
Next you need to do 2 things:
<ul>
<li>
- add an environment variable MAVEN_HOME which
+ add an environment variable M2_HOME which
points to the install directory of Maven,
- i.e. /opt/apache-maven-2.2.1
+ i.e. /opt/apache-maven-3.0
</li>
<li>
add
- <tt>$MAVEN_HOME/bin</tt>
+ <tt>$M2_HOME/bin</tt> (Linux) or <tt>%M2_HOME%\bin</tt> (Windows)
to your path (using the variable you can
switch more easily when a new version
arrives)
@@ -89,7 +83,7 @@
<subsection name="Configure Maven toolchains">
<p>
You can run Maven with any JDK (let's say JDK 1.6) but JWebUnit should be compiled
- with JDK 1.5. To achieve this we are using Maven toolchains mecanism.
+ with JDK 1.5. To achieve this we are using <a href="http://maven.apache.org/guides/mini/guide-using-toolchains.html">Maven toolchains mecanism</a>.
</p>
<p>
Create a file <tt>~/.m2/toolchains.xml</tt> with the given content:
@@ -105,7 +99,7 @@
<id>1.5</id>
</provides>
<configuration>
- <jdkHome>/opt/jdk1.5.0_15</jdkHome>
+ <jdkHome>/opt/jdk1.5.0_22</jdkHome>
</configuration>
</toolchain>
</toolchains>]]>
Modified: trunk/src/site/xdoc/how-to-contribute.xml
===================================================================
--- trunk/src/site/xdoc/how-to-contribute.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/how-to-contribute.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -41,7 +41,7 @@
Improve Web 2.0 support (AJAX, drag&drop, focus, mouse clicks, keypress, ...). Will need additions/modifications of the API.
</li>
<li>
- Take advantage of Java 5 (migrate to JUnit 4, use generics, ...)
+ Take advantage of Java 5 (use generics, ...)
</li>
<li>
Create a record tool like SeleniumIDE or WebTestRecorder.
Modified: trunk/src/site/xdoc/index.xml
===================================================================
--- trunk/src/site/xdoc/index.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/index.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -55,7 +55,7 @@
</p>
<p>
- The current version of JWebUnit is 2.4. This is the "stable" version of
+ The current version of JWebUnit is 3.0. This is the "stable" version of
JWebUnit, and requires Java 1.5.
</p>
</section>
Modified: trunk/src/site/xdoc/installation.xml
===================================================================
--- trunk/src/site/xdoc/installation.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/installation.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -29,7 +29,7 @@
<section name="JWebUnit Installation">
<subsection name="Using Maven">
<p>
- If your project use Maven 2, it's very simple. Just add the plugin you want as dependency:
+ If your project use Maven, it's very simple. Just add the plugin you want as dependency:
</p>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
@@ -43,7 +43,7 @@
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
- <version>2.2</version>
+ <version>3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: trunk/src/site/xdoc/quickstart.xml
===================================================================
--- trunk/src/site/xdoc/quickstart.xml 2010-10-20 12:19:47 UTC (rev 873)
+++ trunk/src/site/xdoc/quickstart.xml 2010-10-20 13:10:11 UTC (rev 874)
@@ -32,9 +32,67 @@
of the methods available, consult the <a href="apidocs/index.html">Javadocs</a> - particularly
the WebTestCase class for full documentation.
</p>
-<subsection name="Creating a TestCase">
+<subsection name="Creating a JUnit 4 TestCase">
<p>
- JWebUnit uses two approaches for creating test cases: inheritance and delegation. The simplest is
+ JWebUnit uses two approaches for creating JUnit 4 test cases: static import and delegation. The simplest is
+ to statically import all methods of net.sourceforge.jwebunit.junit.JWebUnit.
+
+ <source>
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
+public class ExampleWebTestCase {
+
+ @Before
+ public void prepare() {
+ setBaseUrl("http://localhost:8080/test");
+ }
+
+ @Test
+ public void test1() {
+ beginAt("home.xhtml"); //Open the browser on http://localhost:8080/test/home.xhtml
+ clickLink("login");
+ assertTitleEquals("Login");
+ setTextField("username", "test");
+ setTextField("password", "test123");
+ submit();
+ assertTitleEquals("Welcome, test!");
+ }
+}
+ </source>
+ An alternative is to include an instance of the WebTester class in your TestCase and delegate navigation
+ and assertions to it. This is provided in case you need or prefer delegation.
+
+ <source>
+import net.sourceforge.jwebunit.junit.WebTester;
+
+public class ExampleWebTestCase {
+ private WebTester tester;
+
+ @Before
+ public void prepare() {
+ tester = new WebTester();
+ tester.setBaseUrl("http://localhost:8080/test");
+ }
+
+ @Test
+ public void test1() {
+ tester.beginAt("home.xhtml"); //Open the browser on http://localhost:8080/test/home.xhtml
+ tester.clickLink("login");
+ tester.assertTitleEquals("Login");
+ tester.setTextField("username", "test");
+ tester.setTextField("password", "test123");
+ tester.submit();
+ tester.assertTitleEquals("Welcome, test!");
+ }
+}
+ </source>
+In the following samples, JUnit 4 and static import will be used.
+</p>
+</subsection>
+
+<subsection name="Creating a JUnit 3 TestCase (deprecated)">
+<p>
+ JWebUnit uses two approaches for creating JUnit 3 test cases: inheritance and delegation. The simplest is
to inherit from WebTestCase rather than junit.framework.TestCase.
<source>
@@ -48,7 +106,7 @@
}
public void test1() {
- beginAt("/home");
+ beginAt("home.xhtml"); //Open the browser on http://localhost:8080/test/home.xhtml
clickLink("login");
assertTitleEquals("Login");
setTextField("username", "test");
@@ -60,7 +118,8 @@
</source>
An alternative is to include an instance of the WebTester class in your TestCase and delegate navigation
and assertions to it. This is provided in case you need or prefer delegation.
-
+ <b>WARNING: WebTester was migrated to JUnit 4. As a result all assertXX will throw java.lang.AssertionError
+ instead of old junit.framework.AssertionFailedError.</b>
<source>
import junit.framework.TestCase;
import net.sourceforge.jwebunit.junit.WebTester;
@@ -71,10 +130,11 @@
public void setUp() {
super.setUp();
tester = new WebTester();
+ tester.setBaseUrl("http://localhost:8080/test");
}
public void test1() {
- tester.beginAt("/home");
+ tester.beginAt("home.xhtml"); //Open the browser on http://localhost:8080/test/home.xhtml
tester.clickLink("login");
tester.assertTitleEquals("Login");
tester.setTextField("username", "test");
@@ -84,7 +144,6 @@
}
}
</source>
-In the following samples, inheritance will be used.
</p>
</subsection>
@@ -92,12 +151,15 @@
<p>
JWebUnit can use different plugins to execute the tests you write. Only one line makes the difference:
<source>
-import net.sourceforge.jwebunit.junit.WebTestCase;
import net.sourceforge.jwebunit.util.TestingEngineRegistry;
+import org.junit.Before;
-public class ExampleWebTestCase extends WebTestCase {
- public void setUp() {
- super.setUp();
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
+public class ExampleWebTestCase {
+
+ @Before
+ public void prepare() {
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT); <i>// use HtmlUnit</i>
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_SELENIUM); <i>// use Selenium</i>
}
@@ -113,11 +175,11 @@
The primary way that JWebUnit allows you to test your web application is through navigation
of the application itself. You can consider each test case as a use case through the
application itself. The first step is to point where the testable application is hosted
- so that it may be accessed by JWebUnit.
+ so that it may be accessed by JWebUnit. It can generally be done in a test fixture.
<source>
- public void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void prepare() {
setBaseUrl("http://myserver:8080/myapp");
}
</source>
@@ -135,8 +197,9 @@
under "Login", you may test these assertions through the following code:
<source>
+ @Test
public void testIndexLogin() {
- beginAt("/index.html"); <i>// start at index.html</i>
+ beginAt("index.html"); <i>// start at index.html</i>
assertTitleEquals("Home"); <i>// the home page should be titled "Home"</i>
assertLinkPresent("Login"); <i>// there should be a "Login" link</i>
clickLink("Login"); <i>// click the link</i>
@@ -155,8 +218,9 @@
that it works as expected.
<source>
+ @Test
public void testFormSubmission() {
- beginAt("/login.html");
+ beginAt("login.html");
assertTitleEquals("Login"); <i>// we should be on the login page</i>
// fill out the form
@@ -186,16 +250,18 @@
For pages with more than one form, JWebUnit will usually establish which form is being worked with
implicitly from the form elements being accessed. You can also set the form explicitly by form ID or name:
<source>
+ @Test
public void testBottomFormSubmission() {
- beginAt("/twoForm.html");
+ beginAt("twoForm.html");
setWorkingForm("bottomForm");
submit();
}
</source>
You can work with non-submit (type='button') buttons as well:
<source>
+ @Test
public void testPopupButton() {
- beginAt("/info.html");
+ beginAt("info.html");
assertButtonPresent("popupButtonId"); <i>// clickButton() will also check this</i>
clickButton("popupButtonId");
assertWindowPresent("popupWindow");
@@ -212,8 +278,9 @@
as follows:
</p>
<source>
+ @Test
public void testPopupWindow() {
- beginAt("/rootPage.html");
+ beginAt("rootPage.html");
clickLink("popupLink");
assertWindowPresent("popupWindow): <i>// optional - gotoWindow will</i>
<i>// also perform this assertion.</i>
@@ -226,8 +293,9 @@
You can work with frames in a similar manner:
</p>
<source>
+ @Test
public void testFrame() {
- beginAt("/info.html");
+ beginAt("info.html");
assertFramePresent("contentFrame");
gotoFrame("contentFrame");
...
@@ -241,8 +309,9 @@
verify it's correctness.
</p>
<source>
+ @Test
public void testCorrectness() {
- beginAt("/mainPage");
+ beginAt("mainPage.xhtml");
assertTitleEquals("Main Page");
assertLinkPresentWithText("Add Widget");
clickLinkWithText("Add Widget");
@@ -271,8 +340,9 @@
</table>
</p>
<source>
+ @Test
public void testAgeTable() {
- beginAt("/agePage");
+ beginAt("agePage.html");
<i>// check that table is present</i>
assertTablePresent("ageTable");
@@ -303,8 +373,9 @@
</table>
</p>
<source>
+ @Test
public void testAgeTable() {
- beginAt("/agePage");
+ beginAt("agePage.html");
ExpectedTable ageTable = new Table(new Object[][] {
{new Cell("Age Table", 2, 1)},
{"Name", "Age"},
@@ -327,8 +398,9 @@
<p><![CDATA[<span id="welcomeMessage">Welcome, Joe User!</span>]]>
</p>
<source>
+ @Test
public void testWelcomeMessage() {
- beginAt("/mainPage");
+ beginAt("mainPage.xhtml");
<i>// check for presence of welcome message by text</i>
assertTextPresent("Welcome, Joe User!");
@@ -353,20 +425,21 @@
Locale (default is Locale.getDefault()).
</p>
<source>
- public void setUp() throws Exception {
- super.setUp();
- getTestContext().setbaseUrl("http://myserver:8080/myapp");
+ @Before
+ public void prepare() {
+ setbaseUrl("http://myserver:8080/myapp");
getTestContext().setResourceBundleName("ApplicationResources");
}
+ @Test
public void testMainPage() {
- beginAt("/mainPage");
+ beginAt("mainPage.html");
assertTitleEqualsKey("title.mainPage");
assertKeyPresent("message.welcome");
assertKeyInTable("mainPageTable", "header.mainPageTable");
}
</source>
- There is also a getMessage() method on WebTester and WebTestCase that can be used to access
+ There is also a getMessage() method on WebTester, WebTestCase and JWebUnit that can be used to access
resource bundle messages directly in your tests.
</p>
<p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-27 08:42:04
|
Revision: 886
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=886&view=rev
Author: henryju
Date: 2010-10-27 08:41:56 +0000 (Wed, 27 Oct 2010)
Log Message:
-----------
Updated Selenium deps version and test configuration.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-24 11:50:58 UTC (rev 885)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2010-10-27 08:41:56 UTC (rev 886)
@@ -9,24 +9,6 @@
<artifactId>jwebunit-htmlunit-plugin</artifactId>
<name>HtmlUnit Plugin</name>
<description>HtmlUnit plugin for JWebUnit.</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Tests.java</include>
- </includes>
- <excludes>
- <exclude>**/*AbstractTest.java</exclude>
- <exclude>**/*AbstractTests.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
<dependencies>
<dependency>
<groupId>junit</groupId>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2010-10-24 11:50:58 UTC (rev 885)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2010-10-27 08:41:56 UTC (rev 886)
@@ -17,20 +17,12 @@
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<skip>true</skip>
- <includes>
- <include>**/*Test.java</include>
- <include>**/*Tests.java</include>
- </includes>
- <excludes>
- <exclude>**/*AbstractTest.java</exclude>
- <exclude>**/*AbstractTests.java</exclude>
- </excludes>
</configuration>
</plugin>
- <!-- Requires java 1.5 -->
- <!--plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
+ <version>1.1</version>
<executions>
<execution>
<id>start</id>
@@ -43,15 +35,15 @@
<multiWindow>true</multiWindow>
</configuration>
</execution>
+ <execution>
+ <id>stop</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop-server</goal>
+ </goals>
+ </execution>
</executions>
- <dependencies>
- <dependency>
- <groupId>org.openqa.selenium.server</groupId>
- <artifactId>selenium-server</artifactId>
- <version>1.0-beta-1</version>
- </dependency>
- </dependencies>
- </plugin-->
+ </plugin>
</plugins>
</build>
<dependencies>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-24 11:50:58 UTC (rev 885)
+++ trunk/pom.xml 2010-10-27 08:41:56 UTC (rev 886)
@@ -383,7 +383,7 @@
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>regexp</groupId>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-11-24 16:13:15
|
Revision: 888
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=888&view=rev
Author: henryju
Date: 2010-11-24 16:13:09 +0000 (Wed, 24 Nov 2010)
Log Message:
-----------
[3116839] Deprecated assertTitleNotSame and replaced by a working assertTitleNotEquals. Thanks to Tony Qian for reporting the bug.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
trunk/jwebunit-core/pom.xml
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/pom.xml
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-commons-tests/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <artifactId>junit-dep</artifactId>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java 2010-11-24 16:13:09 UTC (rev 888)
@@ -53,46 +53,50 @@
beginAt("/testPage.html");
}
- @Test public void testAssertTitleEquals() throws Throwable {
+ @Test
+ public void testAssertTitleEquals() throws Throwable {
assertPass("assertTitleEquals", new String[] { "testPage" });
assertFail("assertTitleEquals", "wrong title");
}
- @Test public void testAssertTitleMatch() throws Throwable {
+ @Test
+ public void testAssertTitleMatch() throws Throwable {
assertPass("assertTitleMatch", new String[] { "test[Pp]age" });
assertFail("assertTitleMatch", "[Ww]rong title");
}
- @Test public void testAssertTextPresent() throws Throwable {
- assertPassFail("assertTextPresent", "This is a test.",
- "no such text");
- }
- @Test public void testAssertMatch() throws Throwable {
+ @Test
+ public void testAssertTitleNotEquals() throws Throwable {
+ assertPass("assertTitleNotEquals", new String[] { "wrong title" });
+ assertFail("assertTitleNotEquals", "testPage");
+ }
+
+ @Test
+ public void testAssertTextPresent() throws Throwable {
+ assertPassFail("assertTextPresent", "This is a test.", "no such text");
+ }
+
+ @Test
+ public void testAssertMatch() throws Throwable {
assertPassFail("assertMatch", "This (is)* a .* test.", "no.*text");
}
- @Test public void testAssertTextNotPresent() throws Throwable {
- assertTextNotPresent("no such text");
- //assertPassFail("assertTextNotPresent", "no such text",
- // "This is a test page.");
- }
+ @Test
+ public void testAssertTextNotPresent() throws Throwable {
+ assertPassFail("assertTextNotPresent", "no such text", "This is a test.");
+ }
@Test public void testAssertNoMatch() throws Throwable {
- assertNoMatch("no.*text");
- //assertPassFail("assertNoMatch", "no.*text", "This (is)* a .* page.");
+ assertPassFail("assertNoMatch", "no.*text", "This (is)* a .* test.");
}
/**
* Check that {@link #assertNoMatch(String)} can actually fail.
*/
- @Test public void testAssertNoMatchFails() throws Throwable {
- try {
- // 'Span Text' definitely exists in the source page text
- assertNoMatch("Span Text");
- fail("assertNoMatch() did not throw expected failure"); // should not get this far
- } catch (AssertionError e) {
- // expected
- }
+ @Test(expected=AssertionError.class)
+ public void testAssertNoMatchFails() throws Throwable {
+ // 'Span Text' definitely exists in the source page text
+ assertNoMatch("Span Text");
}
@Test public void testAssertLinkPresentWithText() throws Throwable {
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-core/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -14,13 +14,13 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <artifactId>junit-dep</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.7</version>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>regexp</groupId>
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-11-24 16:13:09 UTC (rev 888)
@@ -58,6 +58,7 @@
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
+import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
/**
@@ -420,12 +421,25 @@
*
* @param title
* unexpected title value
+ * @deprecated Replaced by {@link #assertTitleNotEquals(String)}
*/
+ @Deprecated
public void assertTitleNotSame(String title) {
- assertNotSame(title, getTestingEngine().getPageTitle());
+ assertTitleNotEquals(title);
}
/**
+ * Assert title of current html page in conversation is not
+ * equal to another value.
+ *
+ * @param title
+ * unexpected title value
+ */
+ public void assertTitleNotEquals(String title) {
+ assertThat(title, not(equalTo(getTestingEngine().getPageTitle())));
+ }
+
+ /**
* Assert title of current html page in conversation matches an expected regexp.
*
* @param regexp expected title regexp
@@ -2861,7 +2875,7 @@
assertNotNull("no label for id [" + id + "] found", label);
List<IElement> fields = getFieldsForLabel(label);
- assertNotSame("there should be at least one element referenced for label [" + id + "]", 0, fields.size());
+ assertFalse("there should be at least one element referenced for label [" + id + "]", fields.size()==0);
// find the first element that we can change
for (IElement field : fields) {
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <artifactId>junit-dep</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -49,7 +49,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <artifactId>junit-dep</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -357,7 +357,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <artifactId>junit-dep</artifactId>
<version>4.8.2</version>
</dependency>
<dependency>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2010-11-10 11:15:41 UTC (rev 887)
+++ trunk/src/changes/changes.xml 2010-11-24 16:13:09 UTC (rev 888)
@@ -32,6 +32,9 @@
</properties>
<body>
<release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4">
+ <action type="fix" dev="henryju" issue="3116839" due-to="Tony Qian">
+ assertTitleNotSame works incorrectly. Deprecated and replaced by a working assertTitleNotEquals.
+ </action>
<action type="update" dev="henryju" issue="2837745">
Updated to JUnit 4. See migration section of the documentation.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-11-29 16:19:11
|
Revision: 889
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=889&view=rev
Author: henryju
Date: 2010-11-29 16:19:05 +0000 (Mon, 29 Nov 2010)
Log Message:
-----------
Updated site plugin for Maven 2.2.1, minor doc fixes, plugin version lock.
Modified Paths:
--------------
trunk/pom.xml
trunk/src/site/xdoc/how-to-release.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-11-24 16:13:09 UTC (rev 888)
+++ trunk/pom.xml 2010-11-29 16:19:05 UTC (rev 889)
@@ -210,6 +210,21 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
</plugin>
@@ -264,7 +279,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>2.1.1</version>
+ <version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Modified: trunk/src/site/xdoc/how-to-release.xml
===================================================================
--- trunk/src/site/xdoc/how-to-release.xml 2010-11-24 16:13:09 UTC (rev 888)
+++ trunk/src/site/xdoc/how-to-release.xml 2010-11-29 16:19:05 UTC (rev 889)
@@ -33,16 +33,16 @@
<subsection name="Last checks and updates">
<p>
<ul>
- <li>Ensure you repository is up to date by running: <tt>svn update</tt></li>
- <li>Edit <tt>src/changes/changes.xml</tt> to set release date instead of "unknow"</li>
+ <li>Ensure your repository is up to date by running: <tt>svn update</tt></li>
+ <li>Edit <tt>src/changes/changes.xml</tt> to set the release date instead of "unknow"</li>
<li>Update readme.txt (at least update the version number)</li>
<li>Update JWebUnit latest version in src/site/xdoc/index.xml, src/site/xdoc/installation.xml, jwebunit-htmlunit-plugin/src/site/xdoc/index.xml, jwebunit-selenium-plugin/src/site/xdoc/index.xml</li>
<li>Commit the changes</li>
</ul>
</p>
<p>
- Now check that in your <tt>settings.xml</tt> (usually in <tt>$M2_HOME/conf</tt> or better in <tt>~/.m2</tt>
- your JWebUnit details are correct:
+ Now check that in your <tt>settings.xml</tt> (usually in <tt>~/.m2</tt>)
+ the JWebUnit server details are correct:
<source><![CDATA[
<server>
<id>jwebunit-website</id>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-01-27 13:03:45
|
Revision: 892
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=892&view=rev
Author: henryju
Date: 2011-01-27 13:03:38 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
[3166502] Added indexed alternatives of methods clickLinkWithImage, assertLinkPresentWithImage and assertLinkNotPresentWithImage to test and expose a bug in HtmlUnit testing engine.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLink.html
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2011-01-27 12:37:47 UTC (rev 891)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2011-01-27 13:03:38 UTC (rev 892)
@@ -34,6 +34,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+
+import org.junit.Before;
+
import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
import org.junit.Test;
@@ -47,20 +50,24 @@
*/
public class NavigationTest extends JWebUnitAPITestCase {
+ @Before
public void setUp() throws Exception {
super.setUp();
setBaseUrl(HOST_PATH + "/NavigationTest");
}
- @Test public void testBeginAtRelative() {
+ @Test
+ public void testBeginAtRelative() {
beginAt("/blah.html");
}
- @Test public void testBeginAtAbsolute() {
+ @Test
+ public void testBeginAtAbsolute() {
beginAt(HOST_PATH + "/NavigationTest/blah.html");
}
- @Test public void testForwardSlashConfusion() throws Exception {
+ @Test
+ public void testForwardSlashConfusion() throws Exception {
beginAt("/blah.html");
beginAt("blah.html");
getTestContext().setBaseUrl(HOST_PATH + "/NavigationTest/");
@@ -68,14 +75,16 @@
beginAt("blah.html");
}
- @Test public void testInvalidBeginAt() {
+ @Test
+ public void testInvalidBeginAt() {
//the testing engines should throw an exception if a 404 Error is found.
assertException(TestingEngineResponseException.class, "beginAt", new Object[] {"/nosuchresource.html"});
}
- @Test public void testClickLinkWithText() {
+ @Test
+ public void testClickLinkWithText() {
beginAt("/pageWithLink.html");
assertTitleEquals("pageWithLink");
@@ -106,7 +115,8 @@
assertTitleEquals("pageWithLink");
}
- @Test public void testClickLinkWithImage() {
+ @Test
+ public void testClickLinkWithImage() {
beginAt("/pageWithLink.html");
assertTitleEquals("pageWithLink");
@@ -114,7 +124,26 @@
assertTitleEquals("targetPage2");
}
- @Test public void testClickLinkByID() {
+ @Test
+ public void testClickLinkWithImageAnd0Index() {
+ beginAt("/pageWithLink.html");
+ assertTitleEquals("pageWithLink");
+
+ clickLinkWithImage("graphic.jpg", 0);
+ assertTitleEquals("targetPage2");
+ }
+
+ @Test
+ public void testClickLinkWithImageAnd1Index() {
+ beginAt("/pageWithLink.html");
+ assertTitleEquals("pageWithLink");
+
+ clickLinkWithImage("graphic.jpg", 1);
+ assertTitleEquals("targetPage");
+ }
+
+ @Test
+ public void testClickLinkByID() {
beginAt("/pageWithLink.html");
assertTitleEquals("pageWithLink");
@@ -122,7 +151,8 @@
assertTitleEquals("targetPage");
}
- @Test public void testInvalidClickLink() {
+ @Test
+ public void testInvalidClickLink() {
beginAt("/pageWithLink.html");
assertTitleEquals("pageWithLink");
@@ -134,14 +164,16 @@
fail("Expected exception");
}
- @Test public void testGotoPageRelative() {
+ @Test
+ public void testGotoPageRelative() {
beginAt("/targetPage.html");
assertTitleEquals("targetPage");
gotoPage("/targetPage2.html");
assertTitleEquals("targetPage2");
}
- @Test public void testGotoPageAbsolute() {
+ @Test
+ public void testGotoPageAbsolute() {
beginAt("/targetPage.html");
assertTitleEquals("targetPage");
gotoPage(HOST_PATH + "/NavigationTest/targetPage2.html");
@@ -149,7 +181,8 @@
}
//For bug 726143
- @Test public void testLinkWithEscapedText() {
+ @Test
+ public void testLinkWithEscapedText() {
beginAt("/pageWithAmpersandInLink.html");
assertLinkPresentWithText("Map & Directions");
clickLinkWithText("Map & Directions");
@@ -159,7 +192,8 @@
/**
* Testing for issue 996031
*/
- @Test public void testLinkExactText() {
+ @Test
+ public void testLinkExactText() {
beginAt("/test1.html");
assertTitleEquals("test1");
assertLinkPresentWithExactText("one");
Modified: trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLink.html
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLink.html 2011-01-27 12:37:47 UTC (rev 891)
+++ trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLink.html 2011-01-27 13:03:38 UTC (rev 892)
@@ -29,5 +29,8 @@
<img src="graphic.jpg"/>
</a>
<a href="/jwebunit/NavigationTest/targetPage2.html">an active <i>link</i></a>
+ <a href="/jwebunit/NavigationTest/targetPage.html">
+ <img src="graphic.jpg"/>
+ </a>
</body>
</html>
\ No newline at end of file
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2011-01-27 12:37:47 UTC (rev 891)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2011-01-27 13:03:38 UTC (rev 892)
@@ -2035,18 +2035,44 @@
}
/**
+ * Assert that a link containing a specified image is present.
+ *
+ * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
+ * you could just pass in <tt>"my_icon.png"</tt>.
+ * @param index The 0-based index, when more than one link with the same image is expected.
+ */
+ public void assertLinkPresentWithImage(String imageFileName, int index) {
+ assertTrue("Link with image file [" + imageFileName
+ + "] and index " + index + " not found in response.", getTestingEngine()
+ .hasLinkWithImage(imageFileName, index));
+ }
+
+ /**
* Assert that a link containing a specified image is not present.
*
* @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
* you could just pass in <tt>"my_icon.png"</tt>.
*/
public void assertLinkNotPresentWithImage(String imageFileName) {
- assertTrue("Link with image file [" + imageFileName
- + "] found in response.", !getTestingEngine().hasLinkWithImage(
+ assertFalse("Link with image file [" + imageFileName
+ + "] found in response.", getTestingEngine().hasLinkWithImage(
imageFileName, 0));
}
/**
+ * Assert that a link containing a specified image is not present.
+ *
+ * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
+ * you could just pass in <tt>"my_icon.png"</tt>.
+ * @param index The 0-based index, when more than one link with the same image is expected.
+ */
+ public void assertLinkNotPresentWithImage(String imageFileName, int index) {
+ assertFalse("Link with image file [" + imageFileName
+ + "] and index " + index + " found in response.",
+ getTestingEngine().hasLinkWithImage(imageFileName, index));
+ }
+
+ /**
* Assert that an element with a given id is present.
*
* @param anID element id to test for.
@@ -2601,6 +2627,18 @@
}
/**
+ * Navigate by selection of a link with a given image.
+ *
+ * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
+ * you could just pass in <tt>"my_icon.png"</tt>.
+ * @param index The 0-based index, when more than one link with the same image is expected.
+ */
+ public void clickLinkWithImage(String imageFileName, int index) {
+ assertLinkPresentWithImage(imageFileName, index);
+ getTestingEngine().clickLinkWithImage(imageFileName, index);
+ }
+
+ /**
* Navigate by selection of a link with given id.
*
* @param linkId id of link
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 2011-01-27 12:37:47 UTC (rev 891)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2011-01-27 13:03:38 UTC (rev 892)
@@ -1822,7 +1822,7 @@
private HtmlAnchor getLinkWithImage(String filename, int index) {
return (HtmlAnchor) getHtmlElementByXPath("(//a[img[contains(@src,\""
- + filename + "\")]])[" + index + 1 + "]");
+ + filename + "\")]])[" + (index + 1) + "]");
}
private HtmlAnchor getLinkWithText(String linkText, int index) {
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-01-27 12:37:47 UTC (rev 891)
+++ trunk/src/changes/changes.xml 2011-01-27 13:03:38 UTC (rev 892)
@@ -32,6 +32,9 @@
</properties>
<body>
<release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4">
+ <action type="add" dev="henryju" issue="3166502" due-to="Harri">
+ Added indexed alternatives of methods clickLinkWithImage, assertLinkPresentWithImage and assertLinkNotPresentWithImage.
+ </action>
<action type="fix" dev="henryju" issue="3116839" due-to="Tony Qian">
assertTitleNotSame works incorrectly. Deprecated and replaced by a working assertTitleNotEquals.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-01-27 13:42:19
|
Revision: 894
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=894&view=rev
Author: henryju
Date: 2011-01-27 13:42:12 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Updated some dependencies and plugins versions.
Modified Paths:
--------------
trunk/jwebunit-core/pom.xml
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2011-01-27 13:15:33 UTC (rev 893)
+++ trunk/jwebunit-core/pom.xml 2011-01-27 13:42:12 UTC (rev 894)
@@ -18,8 +18,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.7</version>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2011-01-27 13:15:33 UTC (rev 893)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2011-01-27 13:42:12 UTC (rev 894)
@@ -17,8 +17,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.7</version>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-01-27 13:15:33 UTC (rev 893)
+++ trunk/pom.xml 2011-01-27 13:42:12 UTC (rev 894)
@@ -226,7 +226,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.7</version>
+ <version>2.7.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -316,7 +316,7 @@
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
- <version>1.8.0</version>
+ <version>1.9.0</version>
<configuration>
<header>${topDirectoryLocation}/src/license/header.txt</header>
<aggregate>false</aggregate>
@@ -349,6 +349,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.3</version>
+ <inherited>false</inherited>
<executions>
<execution>
<id>validate-changes</id>
@@ -378,7 +379,7 @@
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
- <version>6.1.21</version>
+ <version>6.1.26</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
@@ -388,7 +389,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>1.4</version>
+ <version>2.0.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
@@ -423,9 +424,15 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>0.9.24</version>
+ <version>0.9.28</version>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<profiles>
@@ -529,7 +536,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.7</version>
+ <version>2.7.2</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-03-14 09:22:45
|
Revision: 895
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=895&view=rev
Author: henryju
Date: 2011-03-14 09:22:38 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
[3190055] Fixed support of same named cookies/headers.
Modified Paths:
--------------
trunk/jwebunit-code-generator/src/main/javacc/JWebUnit.jj
trunk/jwebunit-code-generator/src/main/javacc/WebTestCase.jj
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java
trunk/src/changes/changes.xml
Added Paths:
-----------
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java
Modified: trunk/jwebunit-code-generator/src/main/javacc/JWebUnit.jj
===================================================================
--- trunk/jwebunit-code-generator/src/main/javacc/JWebUnit.jj 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-code-generator/src/main/javacc/JWebUnit.jj 2011-03-14 09:22:38 UTC (rev 895)
@@ -493,6 +493,7 @@
sb.append("import java.util.List;\n");
sb.append("import java.util.Map;\n");
sb.append("import java.net.URL;\n\n");
+ sb.append("import net.sourceforge.jwebunit.api.HttpHeader;\n");
sb.append("import net.sourceforge.jwebunit.api.IElement;\n");
sb.append("import net.sourceforge.jwebunit.api.ITestingEngine;\n");
sb.append("import net.sourceforge.jwebunit.exception.TestingEngineResponseException;\n");
Modified: trunk/jwebunit-code-generator/src/main/javacc/WebTestCase.jj
===================================================================
--- trunk/jwebunit-code-generator/src/main/javacc/WebTestCase.jj 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-code-generator/src/main/javacc/WebTestCase.jj 2011-03-14 09:22:38 UTC (rev 895)
@@ -493,6 +493,7 @@
sb.append("import java.util.List;\n");
sb.append("import java.util.Map;\n");
sb.append("import java.net.URL;\n\n");
+ sb.append("import net.sourceforge.jwebunit.api.HttpHeader;\n");
sb.append("import net.sourceforge.jwebunit.api.IElement;\n");
sb.append("import net.sourceforge.jwebunit.api.ITestingEngine;\n");
sb.append("import net.sourceforge.jwebunit.exception.TestingEngineResponseException;\n");
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -19,16 +19,21 @@
package net.sourceforge.jwebunit.tests;
+import java.util.List;
+import net.sourceforge.jwebunit.api.HttpHeader;
+import org.junit.Test;
+
import static net.sourceforge.jwebunit.junit.JWebUnit.assertCookiePresent;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertCookieValueEquals;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertCookieValueMatch;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertTextPresent;
import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
+import static net.sourceforge.jwebunit.junit.JWebUnit.getResponseHeaders;
import static net.sourceforge.jwebunit.junit.JWebUnit.getTestContext;
import static net.sourceforge.jwebunit.junit.JWebUnit.gotoPage;
import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
+import static org.junit.Assert.assertTrue;
-import org.junit.Test;
/**
* Test the Cookies methods provided by WebTestCase.
@@ -44,38 +49,56 @@
setBaseUrl(HOST_PATH);
}
- @Test public void testAddCookie() {
+ @Test
+ public void testAddCookie() {
beginAt("/cookies.jsp");
assertTextPresent("cookie1=Cookievalue1");
}
- @Test public void testAddAnotherCookie() {
+ @Test
+ public void testAddAnotherCookie() {
getTestContext().addCookie("cookie2", "Cookievalue2", "localhost");
beginAt("/cookies.jsp");
assertTextPresent("cookie1=Cookievalue1");
assertTextPresent("cookie2=Cookievalue2");
}
- @Test public void testAssertCookiePresent() throws Throwable {
+ @Test
+ public void testAssertCookiePresent() throws Throwable {
beginAt("/cookies.jsp");
assertCookiePresent("serveurCookie");
}
- @Test public void testAssertCookieValue() throws Throwable {
+ @Test
+ public void testAssertCookieValue() throws Throwable {
beginAt("/cookies.jsp");
assertCookieValueEquals("serveurCookie", "foo");
}
- @Test public void testAssertCookieMatch() throws Throwable {
+ @Test
+ public void testAssertCookieMatch() throws Throwable {
beginAt("/cookies.jsp");
assertCookieValueMatch("serveurCookie", "fo*");
}
/**
+ * When there are several cookies with the same name, it is the last one that should
+ * be taken.
+ * See <a href="http://tools.ietf.org/html/draft-ietf-httpstate-cookie-21#section-5.3">the spec</a> (§ 11)
+ */
+ @Test
+ public void testCookieMatchLastCookie() {
+ beginAt("/cookies.jsp?threesamecookies=true&dont_set=1");
+ assertCookieValueMatch("JSESSIONID", "(.)*worker3");
+ }
+
+
+ /**
* Test that the cookie still exists across multiple requests,
* even if the cookie is not explicitly set each time.
*/
- @Test public void testCookieWithoutExplicitSet() {
+ @Test
+ public void testCookieWithoutExplicitSet() {
beginAt("/cookies.jsp"); // beginAt also resets cookies
assertCookieValueEquals("serveurCookie", "foo");
gotoPage("/cookies.jsp?dont_set=1");
@@ -84,8 +107,34 @@
assertCookieValueEquals("serveurCookie", "foo"); // should still be there
gotoPage("/cookies.jsp?dont_set=1");
assertCookieValueEquals("serveurCookie", "foo"); // should still be there
-
-
}
+ /**
+ * Tests if all cookies are received when the server sets several cookies
+ * with same domain, path and name.<p>
+ *
+ * See http://tools.ietf.org/html/draft-ietf-httpstate-cookie-21#section-5.3, 11
+ */
+ @Test
+ public void testCookieSetInHeaders() {
+ beginAt("/cookies.jsp?threesamecookies=true&dont_set=1");
+ List<HttpHeader> headers = getResponseHeaders();
+ boolean foundCookie1 = false;
+ boolean foundCookie2 = false;
+ boolean foundCookie3 = false;
+ for (HttpHeader h : headers) {
+ if (h.getName().equals("Set-Cookie")) {
+ if (h.getValue().contains(".worker1")) {
+ foundCookie1 = true;
+ }
+ else if (h.getValue().contains(".worker2")) {
+ foundCookie2 = true;
+ }
+ else if (h.getValue().contains(".worker3")) {
+ foundCookie3 = true;
+ }
+ }
+ }
+ assertTrue("getResponseHeaders should return all headers even duplicates", foundCookie1 && foundCookie2 && foundCookie3);
+ }
}
\ No newline at end of file
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -72,6 +72,40 @@
Cookie cookie = new Cookie("serveurCookie","foo");
response.addCookie(cookie);
}
+
+ /*
+ * To test if serveral same cookies with same path, domain and name
+ * are passed through to the test API. This "should" not be done by a
+ * server but there are use cases where it has to be done. One example is
+ * the JSESSIONID cookie which is set by Tomcat but has to be modified in a
+ * mod_jk - clustered environment in order to let the client jump to another
+ * worker (-> Tomcat cluster member). However within the web application the
+ * JSESSIONID cookie has already been added to the response and cannot be
+ * removed from there via API. Solution is to set another cookie to overwrite this.
+ *
+ * See http://tools.ietf.org/html/draft-ietf-httpstate-cookie-21#section-5.3, 11
+ */
+ if(request.getParameter("threesamecookies") != null) {
+ // 1
+ Cookie jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker1");
+ jsessionIDCookie.setPath("/");
+ // session cookie:
+ jsessionIDCookie.setMaxAge(-2);
+ jsessionIDCookie.setDomain("localhost");
+ response.addCookie(jsessionIDCookie);
+ // 2
+ jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker2");
+ jsessionIDCookie.setMaxAge(-2);
+ jsessionIDCookie.setDomain("localhost");
+ response.addCookie(jsessionIDCookie);
+
+ // 3
+ jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker3");
+ jsessionIDCookie.setMaxAge(-2);
+ jsessionIDCookie.setDomain("localhost");
+ jsessionIDCookie.setSecure(true);
+ response.addCookie(jsessionIDCookie);
+ }
}
}
Added: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java (rev 0)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2010, JWebUnit team.
+ *
+ * This file is part of JWebUnit.
+ *
+ * JWebUnit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * JWebUnit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.sourceforge.jwebunit.api;
+
+/**
+ * A name/value pair to store HTTP headers.
+ *
+ * Inspired from HtmlUnit NameValuePair.
+ * @author Julien HENRY
+ */
+public class HttpHeader {
+
+ /** The name. */
+ private final String name_;
+
+ /** The value. */
+ private final String value_;
+
+ /**
+ * Creates a new instance.
+ * @param name the name
+ * @param value the value
+ */
+ public HttpHeader(final String name, final String value) {
+ name_ = name;
+ value_ = value;
+ }
+
+ /**
+ * Returns the name.
+ * @return the name
+ */
+ public String getName() {
+ return name_;
+ }
+
+ /**
+ * Returns the value.
+ * @return the value
+ */
+ public String getValue() {
+ return value_;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return name_ + "=" + value_;
+ }
+
+}
Property changes on: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -19,6 +19,8 @@
package net.sourceforge.jwebunit.api;
+import java.util.Map;
+
import java.io.InputStream;
import java.net.URL;
import java.util.List;
@@ -907,22 +909,30 @@
*/
String getHeader(String name);
- /**
- * Get all headers.
- *
- * @return The header values stored in a map.
- */
- java.util.Map<String,String> getAllHeaders();
-
- /**
- * Should the tester ignore failing status codes (300+)? Otherwise,
- * failing status codes will throw an exception.
- *
- * @param ignore
- */
- public void setIgnoreFailingStatusCodes(boolean ignore);
-
/**
+ * Get all distinct response headers. In case there are duplicate headers with same name, the last one will be returned.
+ *
+ * @return The header values stored in a map.
+ * @deprecated Use {@link #getResponseHeaders()}
+ */
+ @Deprecated
+ Map<String, String> getAllHeaders();
+
+ /**
+ * Get all response headers.
+ * @return the response headers as a list of {@link HttpHeader}s
+ */
+ List<HttpHeader> getResponseHeaders();
+
+ /**
+ * Should the tester ignore failing status codes (300+)? Otherwise,
+ * failing status codes will throw an exception.
+ *
+ * @param ignore
+ */
+ public void setIgnoreFailingStatusCodes(boolean ignore);
+
+ /**
* Get all the comments in a document, as a list of strings.
*/
public List<String> getComments();
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -37,10 +37,9 @@
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
-
import javax.imageio.ImageIO;
import javax.servlet.http.Cookie;
-
+import net.sourceforge.jwebunit.api.HttpHeader;
import net.sourceforge.jwebunit.api.IElement;
import net.sourceforge.jwebunit.api.ITestingEngine;
import net.sourceforge.jwebunit.exception.ExpectedJavascriptAlertException;
@@ -54,7 +53,6 @@
import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
import net.sourceforge.jwebunit.util.TestContext;
import net.sourceforge.jwebunit.util.TestingEngineRegistry;
-
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
@@ -399,10 +397,21 @@
* Get all response headers.
*
* @return A map of response headers
+ * @deprecated This method do not deal with several headers with same name. Use {@link #getResponseHeaders()} instead.
*/
+ @Deprecated
public Map<String, String> getAllHeaders() {
- return getTestingEngine().getAllHeaders();
+ return getTestingEngine().getAllHeaders();
}
+
+ /**
+ * Return all HTTP headers that are in last response. It is possible to have several headers with same name.
+ *
+ * @return A list of {@link HttpHeader} elements.
+ */
+ public List<HttpHeader> getResponseHeaders() {
+ return getTestingEngine().getResponseHeaders();
+ }
/**
* Assert title of current html page in conversation matches an expected
@@ -2269,12 +2278,11 @@
List<?> cookies = getTestingEngine().getCookies();
for (Iterator<?> i = cookies.iterator(); i.hasNext();) {
Cookie c = (Cookie) i.next();
- if (c.getName().equals(cookieName)) {
- assertEquals(expectedValue, c.getValue());
+ if (c.getName().equals(cookieName) && c.getValue().equals(expectedValue)) {
return;
}
}
- fail("Should not be reached");
+ fail("Could not find cookie with name [" + cookieName + "] and value [" + expectedValue + "]");
}
/**
@@ -2289,19 +2297,17 @@
try {
re = new RE(regexp, RE.MATCH_SINGLELINE);
} catch (RESyntaxException e) {
- fail(e.toString());
+ fail(e.getMessage());
}
List<?> cookies = getTestingEngine().getCookies();
for (Iterator<?> i = cookies.iterator(); i.hasNext();) {
Cookie c = (Cookie) i.next();
- if (c.getName().equals(cookieName)) {
- assertTrue("Unable to match [" + regexp
- + "] in cookie \"" + cookieName + "\"", re.match(c
- .getValue()));
+ if (c.getName().equals(cookieName) &&
+ re.match(c.getValue())) {
return;
}
}
- fail("Should not be reached");
+ fail("Could not find cookie with name [" + cookieName + "] with value matching [" + regexp + "]");
}
// Form interaction methods
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 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -19,6 +19,8 @@
package net.sourceforge.jwebunit.htmlunit;
+import net.sourceforge.jwebunit.api.HttpHeader;
+
import org.apache.http.auth.AuthScope;
import java.io.IOException;
@@ -2331,6 +2333,7 @@
/* (non-Javadoc)
* @see net.sourceforge.jwebunit.api.ITestingEngine#getAllHeaders()
*/
+ @Deprecated
public Map<String, String> getAllHeaders() {
Map<String, String> map = new java.util.HashMap<String, String>();
for (NameValuePair header : getWebResponse().getResponseHeaders()) {
@@ -2338,6 +2341,14 @@
}
return map;
}
+
+ public List<HttpHeader> getResponseHeaders() {
+ List<HttpHeader> result = new LinkedList<HttpHeader>();
+ for (NameValuePair header : getWebResponse().getResponseHeaders()) {
+ result.add(new HttpHeader(header.getName(), header.getValue()));
+ }
+ return result;
+ }
/**
* An alternative to setting the {@link TestContext#setUserAgent(String) user agent string manually}
Modified: trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java 2011-03-14 09:22:38 UTC (rev 895)
@@ -20,6 +20,8 @@
package net.sourceforge.jwebunit.selenium;
+import net.sourceforge.jwebunit.api.HttpHeader;
+
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
@@ -720,10 +722,16 @@
/* (non-Javadoc)
* @see net.sourceforge.jwebunit.api.ITestingEngine#getAllHeaders()
*/
+ @Deprecated
public Map<String, String> getAllHeaders() {
// TODO implement method
throw new UnsupportedOperationException("getAllHeaders");
}
+
+ public List<HttpHeader> getResponseHeaders() {
+ // TODO implement method
+ throw new UnsupportedOperationException("getResponseHeaders");
+ }
/* (non-Javadoc)
* @see net.sourceforge.jwebunit.api.ITestingEngine#getHeader(java.lang.String)
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-01-27 13:42:12 UTC (rev 894)
+++ trunk/src/changes/changes.xml 2011-03-14 09:22:38 UTC (rev 895)
@@ -32,6 +32,12 @@
</properties>
<body>
<release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4">
+ <action type="fix" dev="henryju" issue="3190055" due-to="Achim Westermann">
+ Fixed handling of several cookies/headers with same name. getAllHeaders() was wrongly returning only the latest header
+ header with the same name so this method was deprecated and a new one was added with a different return type.
+ See getResponseHeaders().
+ AssertCookiePresent/Match was also updated to take the last set cookie of the given name instead of the first one.
+ </action>
<action type="add" dev="henryju" issue="3166502" due-to="Harri">
Added indexed alternatives of methods clickLinkWithImage, assertLinkPresentWithImage and assertLinkNotPresentWithImage.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-03-14 11:11:42
|
Revision: 897
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=897&view=rev
Author: henryju
Date: 2011-03-14 11:11:36 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
Minor fixes and added hamcrest-library to pom.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java
trunk/pom.xml
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2011-03-14 10:52:09 UTC (rev 896)
+++ trunk/jwebunit-commons-tests/pom.xml 2011-03-14 11:11:36 UTC (rev 897)
@@ -15,6 +15,10 @@
<artifactId>junit-dep</artifactId>
</dependency>
<dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</dependency>
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java 2011-03-14 10:52:09 UTC (rev 896)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java 2011-03-14 11:11:36 UTC (rev 897)
@@ -17,9 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-/**
- *
- */
package net.sourceforge.jwebunit.api;
import java.util.List;
Modified: trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java 2011-03-14 10:52:09 UTC (rev 896)
+++ trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java 2011-03-14 11:11:36 UTC (rev 897)
@@ -20,10 +20,6 @@
package net.sourceforge.jwebunit.htmlunit;
-import static org.junit.Assert.fail;
-
-import java.net.URL;
-
import net.sourceforge.jwebunit.tests.ButtonAssertionsTest;
import net.sourceforge.jwebunit.tests.CharsetTest;
import net.sourceforge.jwebunit.tests.CustomTesterTest;
@@ -37,7 +33,6 @@
import net.sourceforge.jwebunit.tests.IElementTest;
import net.sourceforge.jwebunit.tests.ImageTest;
import net.sourceforge.jwebunit.tests.JUnitPerfTest;
-import net.sourceforge.jwebunit.tests.JWebUnitAPITestCase;
import net.sourceforge.jwebunit.tests.JavaScriptEventsTest;
import net.sourceforge.jwebunit.tests.JavaScriptTest;
import net.sourceforge.jwebunit.tests.NavigationTest;
@@ -52,21 +47,8 @@
import net.sourceforge.jwebunit.tests.WebCookieTest;
import net.sourceforge.jwebunit.tests.XPathTest;
import net.sourceforge.jwebunit.tests.util.JettySetup;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.MimeTypes;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.DefaultHandler;
-import org.mortbay.jetty.handler.HandlerCollection;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.HashUserRealm;
-import org.mortbay.jetty.security.UserRealm;
-import org.mortbay.jetty.webapp.WebAppContext;
/**
* Test Suite for JWebUnit.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-03-14 10:52:09 UTC (rev 896)
+++ trunk/pom.xml 2011-03-14 11:11:36 UTC (rev 897)
@@ -377,6 +377,11 @@
<version>4.8.2</version>
</dependency>
<dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3.RC2</version>
+ </dependency>
+ <dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-03-16 09:23:26
|
Revision: 898
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=898&view=rev
Author: henryju
Date: 2011-03-16 09:23:19 +0000 (Wed, 16 Mar 2011)
Log Message:
-----------
Updated some plugins. Migrated from Jetty 6 to Jetty 6.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java
trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml
trunk/pom.xml
Added Paths:
-----------
trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/jwebunit-commons-tests/pom.xml 2011-03-16 09:23:19 UTC (rev 898)
@@ -19,8 +19,8 @@
<artifactId>hamcrest-library</artifactId>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java 2011-03-16 09:23:19 UTC (rev 898)
@@ -88,8 +88,8 @@
*/
@Test
public void testCookieMatchLastCookie() {
- beginAt("/cookies.jsp?threesamecookies=true&dont_set=1");
- assertCookieValueMatch("JSESSIONID", "(.)*worker3");
+ beginAt("/cookies.jsp?set_by_headers=true&dont_set=1");
+ assertCookieValueMatch("JSESSIONID", "(.)*worker2");
}
@@ -117,11 +117,10 @@
*/
@Test
public void testCookieSetInHeaders() {
- beginAt("/cookies.jsp?threesamecookies=true&dont_set=1");
+ beginAt("/cookies.jsp?set_by_headers=true&dont_set=1");
List<HttpHeader> headers = getResponseHeaders();
boolean foundCookie1 = false;
boolean foundCookie2 = false;
- boolean foundCookie3 = false;
for (HttpHeader h : headers) {
if (h.getName().equals("Set-Cookie")) {
if (h.getValue().contains(".worker1")) {
@@ -130,11 +129,8 @@
else if (h.getValue().contains(".worker2")) {
foundCookie2 = true;
}
- else if (h.getValue().contains(".worker3")) {
- foundCookie3 = true;
- }
}
}
- assertTrue("getResponseHeaders should return all headers even duplicates", foundCookie1 && foundCookie2 && foundCookie3);
+ assertTrue("getResponseHeaders should return all headers even duplicates", foundCookie1 && foundCookie2);
}
}
\ No newline at end of file
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java 2011-03-16 09:23:19 UTC (rev 898)
@@ -28,6 +28,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.eclipse.jetty.http.HttpHeaders;
+
public class CookiesServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@@ -74,7 +76,7 @@
}
/*
- * To test if serveral same cookies with same path, domain and name
+ * To test if several same cookies with same path, domain and name
* are passed through to the test API. This "should" not be done by a
* server but there are use cases where it has to be done. One example is
* the JSESSIONID cookie which is set by Tomcat but has to be modified in a
@@ -85,7 +87,7 @@
*
* See http://tools.ietf.org/html/draft-ietf-httpstate-cookie-21#section-5.3, 11
*/
- if(request.getParameter("threesamecookies") != null) {
+ if(request.getParameter("set_by_headers") != null) {
// 1
Cookie jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker1");
jsessionIDCookie.setPath("/");
@@ -93,18 +95,13 @@
jsessionIDCookie.setMaxAge(-2);
jsessionIDCookie.setDomain("localhost");
response.addCookie(jsessionIDCookie);
- // 2
- jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker2");
- jsessionIDCookie.setMaxAge(-2);
- jsessionIDCookie.setDomain("localhost");
- response.addCookie(jsessionIDCookie);
- // 3
- jsessionIDCookie = new Cookie("JSESSIONID", "07D486AC962DE67F176F70B7C9816AAE.worker3");
- jsessionIDCookie.setMaxAge(-2);
- jsessionIDCookie.setDomain("localhost");
- jsessionIDCookie.setSecure(true);
- response.addCookie(jsessionIDCookie);
+ //With Jetty 6 we are now forced to access low level API to be able to set 2 same named cookies in the same response
+ org.eclipse.jetty.server.Response responseJetty = (org.eclipse.jetty.server.Response) response;
+ String cookie1 = responseJetty.getHttpFields().getStringField(HttpHeaders.SET_COOKIE);
+ // 2
+ String cookie2 = cookie1.replace("worker1", "worker2");
+ response.addHeader(HttpHeaders.SET_COOKIE, cookie2);
}
}
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java 2011-03-16 09:23:19 UTC (rev 898)
@@ -19,25 +19,22 @@
package net.sourceforge.jwebunit.tests.util;
-import static org.junit.Assert.fail;
-
import java.net.URL;
-
import net.sourceforge.jwebunit.tests.JWebUnitAPITestCase;
-
+import org.eclipse.jetty.http.MimeTypes;
+import org.eclipse.jetty.security.HashLoginService;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.DefaultHandler;
+import org.eclipse.jetty.server.handler.HandlerCollection;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.MimeTypes;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.DefaultHandler;
-import org.mortbay.jetty.handler.HandlerCollection;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.HashUserRealm;
-import org.mortbay.jetty.security.UserRealm;
-import org.mortbay.jetty.webapp.WebAppContext;
+import static org.junit.Assert.fail;
+
/**
* Sets up and tears down the Jetty servlet engine before and after the tests in
* the <code>TestSuite</code> have run.
@@ -81,12 +78,10 @@
handlers.setHandlers(new Handler[]{wah, new DefaultHandler()});
jettyServer.setHandler(wah);
- HashUserRealm myrealm = new HashUserRealm("MyRealm");
- myrealm.put("jetty", "jetty");
- myrealm.addUserToRole("jetty", "user");
- myrealm.put("admin", "admin");
- myrealm.addUserToRole("admin", "admin");
- jettyServer.setUserRealms(new UserRealm[]{myrealm});
+ HashLoginService myrealm = new HashLoginService("MyRealm");
+ URL config = JettySetup.class.getResource("/jetty-users.properties");
+ myrealm.setConfig(config.toString());
+ jettyServer.addBean(myrealm);
wah.setContextPath(JWebUnitAPITestCase.JETTY_URL);
Added: trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties (rev 0)
+++ trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties 2011-03-16 09:23:19 UTC (rev 898)
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2010, JWebUnit team.
+#
+# This file is part of JWebUnit.
+#
+# JWebUnit is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# JWebUnit is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
+#
+
+jetty: jetty,user
+admin: admin,admin
Property changes on: trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml 2011-03-16 09:23:19 UTC (rev 898)
@@ -38,7 +38,7 @@
<logger name="org.apache.commons.httpclient" level="ERROR"/>
<logger name="org.apache.http" level="ERROR"/>
- <logger name="org.mortbay" level="ERROR"/>
+ <logger name="org.eclipse.jetty" level="ERROR"/>
<logger name="ch.qos.logback" level="ERROR"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-03-14 11:11:36 UTC (rev 897)
+++ trunk/pom.xml 2011-03-16 09:23:19 UTC (rev 898)
@@ -226,12 +226,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.2</version>
+ <version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.4.3</version>
+ <version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -348,7 +348,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
<inherited>false</inherited>
<executions>
<execution>
@@ -382,9 +382,9 @@
<version>1.3.RC2</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.26</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <version>7.3.1.v20110307</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
@@ -541,7 +541,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.7.2</version>
+ <version>2.8</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
@@ -554,7 +554,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4</version>
<inherited>false</inherited>
<reportSets>
<reportSet>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jev...@us...> - 2011-03-28 23:30:29
|
Revision: 902
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=902&view=rev
Author: jevonwright
Date: 2011-03-28 23:30:22 +0000 (Mon, 28 Mar 2011)
Log Message:
-----------
clarifying the functionality of assertButtonPresentWithText() when the Button is currently invisible
adding test case to check functionality
fixing a bug in assertButtonPresentWithText() where <button>s were treated differently from <input>s
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithOneForm.html
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2011-03-21 16:20:16 UTC (rev 901)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2011-03-28 23:30:22 UTC (rev 902)
@@ -21,6 +21,8 @@
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import net.sourceforge.jwebunit.junit.WebTester;
+
import org.junit.Test;
public class ButtonAssertionsTest extends JWebUnitAPITestCase {
@@ -85,5 +87,16 @@
assertButtonPresentWithText("Testbutton2");
assertButtonPresentWithText("Outside");
}
+
+ /**
+ * As per the semantics of {@link WebTester#assertButtonPresentWithText(String)},
+ * buttons that are not currently displayed are still "present".
+ */
+ @Test
+ public void testHiddenButtonsAreStillFound() {
+ beginAt("/pageWithOneForm.html");
+ assertButtonPresentWithText("Hidden Input");
+ assertButtonPresentWithText("Hidden Button");
+ }
}
Modified: trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithOneForm.html
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithOneForm.html 2011-03-21 16:20:16 UTC (rev 901)
+++ trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithOneForm.html 2011-03-28 23:30:22 UTC (rev 902)
@@ -30,5 +30,8 @@
</form>
<button id="buttonOutside">Outside</button>
<input type="button" value="Input button" />
+
+<input type="button" value="Hidden Input" style="display: none;" />
+<button style="display: none;">Hidden Button</button>
</body>
</html>
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 2011-03-21 16:20:16 UTC (rev 901)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2011-03-28 23:30:22 UTC (rev 902)
@@ -1359,7 +1359,11 @@
* Checks whether a button containing the specified text as its label exists.
* For HTML input tags of type submit, reset, or button, this checks the
* value attribute. For HTML button tags, this checks the element's
- * content by converting it to text.
+ * content by retrieving the text content.
+ *
+ * <p>This method does not check whether the button is currently visible to the
+ * client.
+ *
* @param text the text of the button (between <button></button>)
* or the value of the "value" attribute.
* @return <code>true</code> when the button with text could be found.
@@ -1372,19 +1376,29 @@
* Returns the first button that contains the specified text as its label.
* For HTML input tags of type submit, reset, or button, this checks the
* value attribute. For HTML button tags, this checks the element's
- * content by converting it to text.
+ * content by retrieving the text content.
+ *
+ * <p>This method does not check whether the button is currently visible to the
+ * client.
+ *
* @param buttonValueText the text of the button (between <button></button>)
* or the value of the "value" attribute.
* @return the ClickableElement with the specified text or null if
* no such button is found.
*/
public HtmlElement getButtonWithText(String buttonValueText) {
+ if (buttonValueText == null)
+ throw new NullPointerException("Cannot search for button with null text");
+
List<? extends HtmlElement> l = ((HtmlPage) win.getEnclosedPage()).getDocumentElement()
.getHtmlElementsByTagNames(
Arrays.asList(new String[] { "button", "input" }));
for (HtmlElement e : l) {
if ( e instanceof HtmlButton ) {
- if (((HtmlButton) e).asText().equals(buttonValueText)) {
+ // we cannot use asText(), as this returns an empty string if the
+ // button is not currently displayed, resulting in different
+ // behaviour as the <input> Buttons
+ if (buttonValueText.equals(((HtmlButton) e).getTextContent())) {
return e;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-16 09:40:14
|
Revision: 903
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=903&view=rev
Author: henryju
Date: 2011-08-16 09:40:07 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Update to HtmlUnit 2.9
Modified Paths:
--------------
trunk/pom.xml
trunk/src/changes/changes.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-03-28 23:30:22 UTC (rev 902)
+++ trunk/pom.xml 2011-08-16 09:40:07 UTC (rev 903)
@@ -399,7 +399,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.8</version>
+ <version>2.9</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-03-28 23:30:22 UTC (rev 902)
+++ trunk/src/changes/changes.xml 2011-08-16 09:40:07 UTC (rev 903)
@@ -31,7 +31,10 @@
</author>
</properties>
<body>
- <release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4">
+ <release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4. HtmlUnit 2.9.">
+ <action type="update" dev="henryju">
+ Updated to HtmlUnit 2.9.
+ </action>
<action type="fix" dev="henryju" issue="3190055" due-to="Achim Westermann">
Fixed handling of several cookies/headers with same name. getAllHeaders() was wrongly returning only the latest header
header with the same name so this method was deprecated and a new one was added with a different return type.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-16 10:06:05
|
Revision: 905
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=905&view=rev
Author: henryju
Date: 2011-08-16 10:05:52 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Update header of all files (2010->2011).
Modified Paths:
--------------
trunk/jwebunit-code-generator/src/site/site.xml
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java
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/HelloWorldTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JUnitPerfTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.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/NavigationTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NonHtmlContentTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/RedirectionTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResourceBundleAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/SelectOptionsTest.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/TestContextTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/WebCookieTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/XPathTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/Concurrent.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ConcurrentRule.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/CookiesServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/HtmlHelper.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java
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/RedirectServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/ResponseServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/reflect/MethodInvoker.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/reflect/StaticMethodInvoker.java
trunk/jwebunit-commons-tests/src/main/resources/MessageBundle.properties
trunk/jwebunit-commons-tests/src/main/resources/TestContextBundle.properties
trunk/jwebunit-commons-tests/src/main/resources/jetty-users.properties
trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml
trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithOneForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ButtonAssertionsTest/pageWithTwoForms.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/CustomTesterTest/test.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ExpectedTableAssertionsTest/TableAssertionsTestPageHtml.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ExpectedTableAssertionsTest/TableAssertionsTestPageXHtml.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormAssertionsTest/assertButtonWithText.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormAssertionsTest/noFormPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormAssertionsTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/CheckboxForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/CheckboxFormWithLabels.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/InputFileForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/InputImageForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/InvalidActionForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/MultiFormPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/MultiNamedButtonForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/QueryFormSimple.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/QueryFormTricky.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/RadioForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/SingleNamedButtonForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/SingleUnnamedButtonForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/Submit1.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/Submit2.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/Submit3.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FormSubmissionTest/TextAreaForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/BottomFrame.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/ChildPage1.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/ChildPage2.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/ChildPage3.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/ContentFrame.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/Frames.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/InlineFrame.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/RootPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/FramesAndWindowsTest/temp.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/InvalidForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/InvalidFormNoDoctype.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/NoDoctype.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/SimpleForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/ValidComplexForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/ValidFormNoDoctype.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/HtmlTest/XhtmlStrict.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/IElementTest/template.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/somedir/AnotherPageWithImages.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/FormOnSubmit.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/FormOnSubmitSetTarget.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/index.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/nav.js
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/next.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptEventsTest/onchange.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/Alert.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/Confirm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/DocumentWrite.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/MultipleAlerts.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/Prompt.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/prototype-1.6.0.3.js
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/prototype.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/JavaScriptTest/userAgent.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/blah.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithAmpersandInLink.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLink.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/pageWithLinkWithTextAfterText.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/targetPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/targetPage2.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test1.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test2.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NavigationTest/test3.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/NonHtmlContentTest/text.txt
trunk/jwebunit-commons-tests/src/main/resources/testcases/RedirectionTest/redirect.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/RedirectionTest/redirected.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/RefreshHandlerTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ResourceBundleAssertionsTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/ResponseServletTest/SimpleForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/SelectOptionsTest/pageWithOneForm.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/SelectOptionsTest/pageWithOneFormMulti.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/SelectOptionsTest/pageWithTwoForms.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/SelectOptionsTest/pageWithTwoFormsMulti.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/TableAssertionsTest/TableAssertionsTestPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/TestContextTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/WEB-INF/web.xml
trunk/jwebunit-commons-tests/src/main/resources/testcases/WebAssertionsTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/XPathTest/next.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/XPathTest/testPage.html
trunk/jwebunit-commons-tests/src/main/resources/testcases/helloworld.html
trunk/jwebunit-commons-tests/src/site/site.xml
trunk/jwebunit-commons-tests/src/test/java/net/sourceforge/jwebunit/tests/util/reflect/MethodInvokerTest.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/HttpHeader.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/ElementNotFoundException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/ExpectedJavascriptAlertException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/ExpectedJavascriptConfirmException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/ExpectedJavascriptPromptException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/TestingEngineRegistryException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/TestingEngineResponseException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/UnableToSetFormException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/UnexpectedJavascriptAlertException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/UnexpectedJavascriptConfirmException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/exception/UnexpectedJavascriptPromptException.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Cell.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Row.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Table.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/javascript/JavascriptAlert.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/javascript/JavascriptConfirm.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/javascript/JavascriptPrompt.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestContext.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestingEngineRegistry.java
trunk/jwebunit-core/src/site/site.xml
trunk/jwebunit-core/src/test/java/net/sourceforge/jwebunit/TableTest.java
trunk/jwebunit-core/src/test/java/net/sourceforge/jwebunit/junit/WebTesterTest.java
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/jwebunit-htmlunit-plugin/src/site/site.xml
trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImplTest.java
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java
trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java
trunk/jwebunit-selenium-plugin/src/site/site.xml
trunk/jwebunit-selenium-plugin/src/site/xdoc/index.xml
trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java
trunk/src/assemble/release.xml
trunk/src/changes/changes.xml
trunk/src/checkstyle/header-checkstyle.txt
trunk/src/checkstyle/jwebunit-checkstyle.xml
trunk/src/license/header.txt
trunk/src/site/fml/faq.fml
trunk/src/site/resources/style/project.css
trunk/src/site/site.xml
trunk/src/site/xdoc/articles.xml
trunk/src/site/xdoc/building-maven.xml
trunk/src/site/xdoc/how-to-contribute.xml
trunk/src/site/xdoc/how-to-release.xml
trunk/src/site/xdoc/index.xml
trunk/src/site/xdoc/installation.xml
trunk/src/site/xdoc/migration.xml
trunk/src/site/xdoc/quickstart.xml
Modified: trunk/jwebunit-code-generator/src/site/site.xml
===================================================================
--- trunk/jwebunit-code-generator/src/site/site.xml 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-code-generator/src/site/site.xml 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2010, JWebUnit team.
+ Copyright (c) 2011, JWebUnit team.
This file is part of JWebUnit.
@@ -19,7 +19,6 @@
along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
-->
-
<project name="JWebUnit">
<body>
<menu ref="reports" />
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -17,7 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertTitleEquals;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -17,7 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import org.junit.Test;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import org.junit.Test;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
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 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -17,7 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import java.io.BufferedWriter;
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 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HelloWorldTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HelloWorldTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HelloWorldTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertTitleEquals;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -17,7 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertElementPresent;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertCommentNotPresent;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JUnitPerfTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JUnitPerfTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JUnitPerfTest.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -17,7 +17,6 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertTitleEquals;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2011-08-16 10:05:52 UTC (rev 905)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2011, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -16,7 +16,6 @@
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.sourceforge.jwebunit.tests;
import java.lang.reflect.InvocationTargetException;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.java 2011-08-16 09:40:44 UTC (rev 904)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.java 2011-08-16 10:05:52 UTC (rev 9...
[truncated message content] |
|
From: <he...@us...> - 2011-08-16 11:55:43
|
Revision: 906
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=906&view=rev
Author: henryju
Date: 2011-08-16 11:55:37 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Update plugins and dependencies versions. A fix was needed for MCHECKSTYLE-159.
Modified Paths:
--------------
trunk/pom.xml
trunk/src/checkstyle/jwebunit-checkstyle.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-16 10:05:52 UTC (rev 905)
+++ trunk/pom.xml 2011-08-16 11:55:37 UTC (rev 906)
@@ -226,7 +226,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.8</version>
+ <version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -236,7 +236,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -246,7 +246,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>2.2</version>
+ <version>2.2.1</version>
<configuration>
<attach>false</attach>
<descriptors>
@@ -259,7 +259,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
- <version>2.1</version>
+ <version>2.2.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<preparationGoals>clean install</preparationGoals>
@@ -279,12 +279,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>2.2</version>
+ <version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.7</version>
+ <version>2.8</version>
<configuration>
<quiet>true</quiet>
</configuration>
@@ -348,7 +348,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
- <version>2.4</version>
+ <version>2.6</version>
<inherited>false</inherited>
<executions>
<execution>
@@ -429,7 +429,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>0.9.28</version>
+ <version>0.9.29</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -454,7 +454,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
- <version>1.1</version>
+ <version>1.3</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -525,7 +525,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.6</version>
+ <version>2.7</version>
<configuration>
<configLocation>
${basedir}/${topDirectoryLocation}/src/checkstyle/jwebunit-checkstyle.xml
@@ -536,12 +536,16 @@
<xrefLocation>
${project.reporting.outputDirectory}/${topDirectoryLocation}/xref
</xrefLocation>
+ <!-- Needed for MCHECKSTYLE-159 -->
+ <propertyExpansion>
+ cacheFile=${project.build.directory}/checkstyle-cachefile
+ </propertyExpansion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.8</version>
+ <version>2.9</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
@@ -572,7 +576,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.1</version>
+ <version>2.3.2</version>
<configuration>
<xrefLocation>
${project.reporting.outputDirectory}/${topDirectoryLocation}/xref
@@ -582,7 +586,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.7</version>
+ <version>2.8</version>
<reportSets>
<reportSet>
<id>aggregate</id>
@@ -618,7 +622,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
- <version>2.2</version>
+ <version>2.3</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
@@ -643,7 +647,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.3.1</version>
+ <version>2.4</version>
<reportSets>
<reportSet>
<reports>
Modified: trunk/src/checkstyle/jwebunit-checkstyle.xml
===================================================================
--- trunk/src/checkstyle/jwebunit-checkstyle.xml 2011-08-16 10:05:52 UTC (rev 905)
+++ trunk/src/checkstyle/jwebunit-checkstyle.xml 2011-08-16 11:55:37 UTC (rev 906)
@@ -36,6 +36,7 @@
</module>
<module name="FileLength" />
<module name="TreeWalker">
+ <property name="cacheFile" value="${cacheFile}"/><!-- Needed for MCHECKSTYLE-159 -->
<module name="JavadocMethod" />
<module name="JavadocType" />
<module name="JavadocVariable">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-18 08:17:39
|
Revision: 908
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=908&view=rev
Author: henryju
Date: 2011-08-18 08:17:32 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
Prepare the release
Modified Paths:
--------------
trunk/README.txt
trunk/src/changes/changes.xml
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2011-08-16 11:56:33 UTC (rev 907)
+++ trunk/README.txt 2011-08-18 08:17:32 UTC (rev 908)
@@ -1,4 +1,4 @@
-The JWebUnit team is pleased to announce the JWebUnit 2.4 release!
+The JWebUnit team is pleased to announce the JWebUnit 3.0 release!
http://jwebunit.sourceforge.net
@@ -7,7 +7,7 @@
JUnit to create acceptance tests. As the tests were being written, they were
continuously refactored to remove duplication and other bad smells in the test
code. JWebUnit is the result of these refactorings.
-We are now using HtmlUnit (htmlunit.sourceforge.net).
+We are using HtmlUnit (htmlunit.sourceforge.net).
Changes in this version are available here:
http://jwebunit.sourceforge.net/changes-report.html
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-08-16 11:56:33 UTC (rev 907)
+++ trunk/src/changes/changes.xml 2011-08-18 08:17:32 UTC (rev 908)
@@ -30,7 +30,7 @@
</author>
</properties>
<body>
- <release version="3.0" date="UNKNOW" description="Updated all internals to JUnit 4. HtmlUnit 2.9.">
+ <release version="3.0" date="August 18, 2011" description="Updated all internals to JUnit 4. HtmlUnit 2.9.">
<action type="update" dev="henryju">
Updated to HtmlUnit 2.9.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-18 08:26:45
|
Revision: 909
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=909&view=rev
Author: henryju
Date: 2011-08-18 08:26:38 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
[maven-release-plugin] prepare release jwebunit-3.0
Modified Paths:
--------------
trunk/jwebunit-code-generator/pom.xml
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-core/pom.xml
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/jwebunit-code-generator/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/jwebunit-commons-tests/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/jwebunit-core/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-18 08:17:32 UTC (rev 908)
+++ trunk/pom.xml 2011-08-18 08:26:38 UTC (rev 909)
@@ -1,10 +1,9 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
@@ -181,9 +180,9 @@
</license>
</licenses>
<scm>
- <connection>scm:svn:http://jwebunit.svn.sourceforge.net/svnroot/jwebunit/trunk</connection>
- <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/trunk</developerConnection>
- <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/trunk</url>
+ <connection>scm:svn:http://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.0</connection>
+ <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.0</developerConnection>
+ <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/tags/jwebunit-3.0</url>
</scm>
<organization>
<name>SourceForge</name>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-18 08:27:39
|
Revision: 911
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=911&view=rev
Author: henryju
Date: 2011-08-18 08:27:33 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/jwebunit-code-generator/pom.xml
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-core/pom.xml
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/jwebunit-code-generator/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/jwebunit-commons-tests/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/jwebunit-core/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-18 08:27:09 UTC (rev 910)
+++ trunk/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
@@ -3,7 +3,7 @@
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>3.0</version>
+ <version>3.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
@@ -180,9 +180,9 @@
</license>
</licenses>
<scm>
- <connection>scm:svn:http://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.0</connection>
- <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.0</developerConnection>
- <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/tags/jwebunit-3.0</url>
+ <connection>scm:svn:http://jwebunit.svn.sourceforge.net/svnroot/jwebunit/trunk</connection>
+ <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/trunk</developerConnection>
+ <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/trunk</url>
</scm>
<organization>
<name>SourceForge</name>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-08-18 12:17:57
|
Revision: 912
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=912&view=rev
Author: henryju
Date: 2011-08-18 12:17:50 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
Update documentation and site deployment location.
Modified Paths:
--------------
trunk/pom.xml
trunk/src/site/xdoc/how-to-release.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-18 08:27:33 UTC (rev 911)
+++ trunk/pom.xml 2011-08-18 12:17:50 UTC (rev 912)
@@ -248,12 +248,21 @@
<version>2.2.1</version>
<configuration>
<attach>false</attach>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
<descriptors>
- <descriptor>
- src/assemble/release.xml
- </descriptor>
+ <descriptor>src/assemble/release.xml</descriptor>
</descriptors>
+ <descriptorRefs>
+ <descriptorRef>source-release</descriptorRef>
+ </descriptorRefs>
</configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.apache.resources</groupId>
+ <artifactId>apache-source-release-assembly-descriptor</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -669,7 +678,7 @@
<id>jwebunit-website</id>
<name>JWebUnit WebSite - Sourceforge</name>
<url>
- scp://shell.sourceforge.net/home/groups/j/jw/jwebunit/htdocs
+ scp://web.sourceforge.net/home/project-web/jwebunit/htdocs
</url>
</site>
<snapshotRepository>
Modified: trunk/src/site/xdoc/how-to-release.xml
===================================================================
--- trunk/src/site/xdoc/how-to-release.xml 2011-08-18 08:27:33 UTC (rev 911)
+++ trunk/src/site/xdoc/how-to-release.xml 2011-08-18 12:17:50 UTC (rev 912)
@@ -45,9 +45,14 @@
<source><![CDATA[
<server>
<id>jwebunit-website</id>
- <username>henryju,jwebunit</username>
+ <username>henryju</username>
<password>XXXXXXXX</password>
</server>
+ <server>
+ <id>jwebunit.svn.sourceforge.net</id>
+ <username>henryju</username>
+ <password>XXXXXXXX</password>
+ </server>
<server>
<id>sonatype-nexus</id>
@@ -55,7 +60,7 @@
<password>YYYYYYYYYY</password>
</server>
]]></source>
- Don't forget to put your own sourceforge account and password for jwebunit-website. Concerning sonatype-nexus you need
+ Don't forget to put your own sourceforge account and password for jwebunit-website and svn. Concerning sonatype-nexus you need
the username and password from http://oss.sonatype.org/ (see <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">OSS Repository Hosting</a>)
for instructions on how to set up your configuration like GPG signature.
Reminder: in order to have access granted to a new JWebUnit developper, ask on <a href="https://issues.sonatype.org/browse/OSSRH-384">OSSRH-384</a>.
@@ -75,55 +80,43 @@
</p>
</subsection>
<subsection name="Perform the release (deploy artifacts and site)">
- <p>
- First you need to activate a time-limited shell in Sourceforge to allow upload by SCP.
- On Linux you can use:
- <source>ssh henryju,jwe...@sh... create</source>
- On Windows you can use:
- <source>plink henryju,jwe...@sh... create</source>
- </p>
<p>
- Now the process is done by maven-release-plugin.
+ The process is done by maven-release-plugin.
<source>mvn release:perform -Darguments="-Dgpg.passphrase=XXXXXXXXXX"</source>
</p>
<p>
This will automatically checkout the tag from SVN in target/checkout folder then run <tt>mvn deploy site-deploy</tt>.
- Artifacts will be uploaded in http://jwebunit.sourceforge.net/m2-repo (this repository is synchronized to Maven central repo).
+ Artifacts will be staged in http://oss.sonatype.org.
Site will also be uploaded.
</p>
<p>
- Now close your Sourceforge shell:
- <source>ssh henryju,jwe...@sh... shutdown</source> (Linux)
- <source>plink henryju,jwe...@sh... shutdown</source> (Windows)
+ Now connect to http://oss.sonatype.org and go to <i>Staging Repositories</i> section. There you can close and release the repository.
+ If everything is fine the artifacts will be synced to Maven central.
</p>
</subsection>
<subsection name="Dealing with non-maven bundle">
<p>
- We have to provide a bundle for non Maven users.
+ We also provide a bundle for non Maven users.
<source>
cd target
cd checkout
mvn package assembly:assembly
</source>
- This will create a release bundle in target/checkout/target/jwebunit-XX-release.zip. Move this zip to another directory then run:
- <source>mvn clean</source>
- Now remove every .svn folders in target/checkout:
- <tt>find . -name .svn -exec rm -rf '{}' \;</tt> (works for Linux, on Windows I use the graphical search feature)
- And finally create a zip of the whole target/checkout folder content with name <tt>jwebunit-XX-sources.zip</tt>
+ This will create a release bundle in [target/checkout/]target/jwebunit-XX-release.zip and a source bundle in [target/checkout/]target/jwebunit-XX-source-release.zip.
</p>
<p>
- Open your browser at <a href="https://sourceforge.net/projects/jwebunit/">JWebUnir admin page</a>.<br/>
+ Open your browser at <a href="https://sourceforge.net/projects/jwebunit/">JWebUnit admin page</a>.<br/>
Use your Sourceforge account to log in.<br/>
- In the menu select Project Admin -> File Manager (beta).<br/>
+ In the menu select "Files".<br/>
Click on JWebUnit folder.<br/>
Click on the [Add Folder] button.<br/>
- Type the name of the new release: JWebUnit-XX<br/>
+ Type the name of the new release: JWebUnit XX<br/>
Select the folder you just have created<br/>
Click on the [Add File] button.<br/>
Browse and select for upload:
<ul>
<li>jwebunit-XX-release.zip</li>
- <li>jwebunit-XX-sources.zip</li>
+ <li>jwebunit-XX-source-release.zip</li>
<li>README.txt</li>
</ul>
Click on the [Upload] button.<br/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|