Thread: [JWebUnit-development] SF.net SVN: jwebunit:[914] trunk (Page 5)
Brought to you by:
henryju
|
From: <he...@us...> - 2011-08-22 09:27:45
|
Revision: 914
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=914&view=rev
Author: henryju
Date: 2011-08-22 09:27:38 +0000 (Mon, 22 Aug 2011)
Log Message:
-----------
[3395872] HtmlUnitTestingEngineImpl.gotoPage no longer returns the failing status. Fix and add tests. Thanks to Tim Pizey for reporting.
Modified Paths:
--------------
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-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/JWebUnitAPITestCase.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2011-08-18 13:18:44 UTC (rev 913)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2011-08-22 09:27:38 UTC (rev 914)
@@ -91,17 +91,19 @@
assertException(AssertionError.class, methodName, args);
}
- public void assertException(Class<?> exceptionClass, String methodName,
+ public <G extends Throwable> G assertException(Class<G> exceptionClass, String methodName,
Object[] args) {
StaticMethodInvoker invoker = new StaticMethodInvoker(JWebUnit.class, methodName, args);
try {
invoker.invoke();
fail("Expected test failure did not occur for method: "
+ methodName);
+ return null; //never called
} catch (InvocationTargetException e) {
assertTrue("Expected " + exceptionClass.getName() + "but was "
+ e.getTargetException().getClass().getName(),
exceptionClass.isInstance(e.getTargetException()));
+ return (G) e.getTargetException();
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
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-08-18 13:18:44 UTC (rev 913)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2011-08-22 09:27:38 UTC (rev 914)
@@ -76,12 +76,11 @@
@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"});
-
+ TestingEngineResponseException e = assertException(TestingEngineResponseException.class, "beginAt", new Object[] {"/nosuchresource.html"});
+ assertEquals(404, e.getHttpStatusCode());
}
-
+
@Test
public void testClickLinkWithText() {
beginAt("/pageWithLink.html");
@@ -170,7 +169,7 @@
gotoPage("/targetPage2.html");
assertTitleEquals("targetPage2");
}
-
+
@Test
public void testGotoPageAbsolute() {
beginAt("/targetPage.html");
@@ -179,6 +178,14 @@
assertTitleEquals("targetPage2");
}
+ @Test
+ public void testInvalidGotoPage() {
+ beginAt("/targetPage.html");
+ //the testing engines should throw an exception if a 404 Error is found.
+ TestingEngineResponseException e = assertException(TestingEngineResponseException.class, "gotoPage", new Object[] {"/nosuchresource.html"});
+ assertEquals(404, e.getHttpStatusCode());
+ }
+
//For bug 726143
@Test
public void testLinkWithEscapedText() {
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-08-18 13:18:44 UTC (rev 913)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2011-08-22 09:27:38 UTC (rev 914)
@@ -259,7 +259,7 @@
} catch (FailingHttpStatusCodeException ex) {
// only throw exception if necessary
if (!ignoreFailingStatusCodes) {
- throw new TestingEngineResponseException(
+ throw new TestingEngineResponseException(ex.getStatusCode(),
"unexpected status code ["+ex.getStatusCode()+"] at URL: ["+initialURL+"]", ex);
}
} catch (IOException ex) {
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-08-18 13:18:44 UTC (rev 913)
+++ trunk/src/changes/changes.xml 2011-08-22 09:27:38 UTC (rev 914)
@@ -30,6 +30,12 @@
</author>
</properties>
<body>
+ <release version="3.0.1" date="UNKNOW" description="Minor fixes">
+ <action type="fix" dev="henryju" issue="3395872" due-to="Tim Pizey">
+ HtmlUnitTestingEngineImpl.gotoPage no longer returns the failing status. Broken since 2.5 after applying
+ patch from issue 1864365.
+ </action>
+ </release>
<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.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 13:57:58
|
Revision: 916
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=916&view=rev
Author: henryju
Date: 2011-09-23 13:57:52 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Deprecate gotoWindow(windowID) and fix gotoRootWindow().
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.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/src/changes/changes.xml
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-09-22 09:18:05 UTC (rev 915)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2011-09-23 13:57:52 UTC (rev 916)
@@ -57,12 +57,6 @@
assertTextPresent("child 1");
}
- @Test public void testGotoWindowByID() {
- gotoRootAndOpenChild("ChildPage3");
- gotoWindow(1);
- assertTextPresent("child 3");
- }
-
@Test public void testGotoWindowByTitle() {
gotoRootAndOpenChild("ChildPage2");
gotoWindowByTitle("Child Page 2");
@@ -74,13 +68,6 @@
assertPassFail("assertWindowPresentWithTitle", new Object[]{"Child Page 2"}, new Object[]{"NoSuchTitle"});
}
- @Test public void testSwitchWindows() {
- gotoRootAndOpenChild("ChildPage1");
- gotoWindow("ChildPage1");
- gotoRootWindow();
- assertTextPresent("This is the Root");
- }
-
@Test public void testCloseWindow() {
beginAt("RootPage.html");
assertTitleEquals("This is the Root");
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-09-22 09:18:05 UTC (rev 915)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java 2011-09-23 13:57:52 UTC (rev 916)
@@ -130,18 +130,23 @@
* Goto window with the given Javascript ID.
*
* @param windowID Javascript ID of the window
+ * @deprecated Javascript ID does'nt not exists. Currently this is an index
+ * in the list of available windows, but this is not portable (and probably not stable).
+ * Use {@link #gotoWindow(String)} or {@link #gotoWindowByTitle(String)} instead.
*/
+ @Deprecated
void gotoWindow(int windowID);
/**
- * Make the root window active.
+ * Make the root window active. Used to reset the effect of {@link ITestingEngine#gotoFrame(String)}.
+ *
*/
void gotoRootWindow();
/**
- * Get the number of openend Windows.
+ * Get the number of opened Windows.
*
- * @return Number of openend Windows.
+ * @return Number of opened Windows.
*/
int getWindowCount();
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-09-22 09:18:05 UTC (rev 915)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2011-09-23 13:57:52 UTC (rev 916)
@@ -2984,14 +2984,18 @@
* Make a given window active.
*
* @param windowID Javascript ID of the window
+ * @deprecated Javascript ID does'nt not exists. Currently this is an index
+ * in the list of available windows, but this is not portable (and probably not stable).
+ * Use {@link #gotoWindow(String)} or {@link #gotoWindowByTitle(String)} instead.
*/
+ @Deprecated
public void gotoWindow(int windowID) {
assertWindowPresent(windowID);
getTestingEngine().gotoWindow(windowID);
}
/**
- * Make the root window active.
+ * Make the root window active. Used to reset the effect of {@link ITestingEngine#gotoFrame(String)}.
*/
public void gotoRootWindow() {
getTestingEngine().gotoRootWindow();
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-09-22 09:18:05 UTC (rev 915)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2011-09-23 13:57:52 UTC (rev 916)
@@ -2192,10 +2192,10 @@
}
/**
- * Make the root window in the current conversation active.
+ * {@inheritDoc}
*/
public void gotoRootWindow() {
- setMainWindow((WebWindow) wc.getWebWindows().get(0));
+ win = win.getTopWindow();
}
private void setMainWindow(WebWindow win) {
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-09-22 09:18:05 UTC (rev 915)
+++ trunk/src/changes/changes.xml 2011-09-23 13:57:52 UTC (rev 916)
@@ -30,6 +30,14 @@
</author>
</properties>
<body>
+ <release version="3.1" date="UNKNOW" description="Cleanup for Webdriver integration">
+ <action type="update" dev="henryju">
+ gotoRootWindow() now goes to the root "frame" in a multi-frame window. Previously it was only by chance.
+ </action>
+ <action type="update" dev="henryju">
+ Deprecated gotoWindow(windowID) method as implementation is not stable and window ID is not something well-defined.
+ </action>
+ </release>
<release version="3.0.1" date="UNKNOW" description="Minor fixes">
<action type="fix" dev="henryju" issue="3395872" due-to="Tim Pizey">
HtmlUnitTestingEngineImpl.gotoPage no longer returns the failing status. Broken since 2.5 after applying
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 14:17:18
|
Revision: 917
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=917&view=rev
Author: henryju
Date: 2011-09-23 14:17:12 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Use tempus-fugit instead of custom code to run parallel test.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java
trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java
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-09-23 13:57:52 UTC (rev 916)
+++ trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java 2011-09-23 14:17:12 UTC (rev 917)
@@ -31,7 +31,7 @@
import net.sourceforge.jwebunit.tests.HtmlParsingTest;
import net.sourceforge.jwebunit.tests.IElementTest;
import net.sourceforge.jwebunit.tests.ImageTest;
-import net.sourceforge.jwebunit.tests.JUnitPerfTest;
+import net.sourceforge.jwebunit.tests.ConcurrentJWebUnitTest;
import net.sourceforge.jwebunit.tests.JavaScriptEventsTest;
import net.sourceforge.jwebunit.tests.JavaScriptTest;
import net.sourceforge.jwebunit.tests.NavigationTest;
@@ -82,7 +82,7 @@
IElementTest.class,
ResponseServletTest.class,
CustomTesterTest.class,
- JUnitPerfTest.class
+ ConcurrentJWebUnitTest.class
})
public class JWebUnitTest extends JettySetup {
Modified: trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java
===================================================================
--- trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java 2011-09-23 13:57:52 UTC (rev 916)
+++ trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java 2011-09-23 14:17:12 UTC (rev 917)
@@ -59,7 +59,7 @@
IElementTest.class,
ResponseServletTest.class,
CustomTesterTest.class,
- JUnitPerfTest.class
+ ConcurrentJWebUnitTest.class
})
public class JWebUnitTest extends JettySetup {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 14:44:09
|
Revision: 920
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=920&view=rev
Author: henryju
Date: 2011-09-23 14:44:03 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
HTMLUnitTestingEngine#getPageText() was updated to only return text that is inside <body> element. Consequently some JUnit tests needed update.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java
trunk/src/changes/changes.xml
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-09-23 14:33:49 UTC (rev 919)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2011-09-23 14:44:03 UTC (rev 920)
@@ -51,16 +51,18 @@
assertPassFail("assertWindowPresent", new Object[]{"ChildPage1"}, new Object[]{"NoSuchChild"});
}
- @Test public void testGotoWindow() {
+ @Test
+ public void testGotoWindow() {
gotoRootAndOpenChild("ChildPage1");
gotoWindow("ChildPage1");
- assertTextPresent("child 1");
+ assertTextPresent("Child Page 1");
}
- @Test public void testGotoWindowByTitle() {
+ @Test
+ public void testGotoWindowByTitle() {
gotoRootAndOpenChild("ChildPage2");
gotoWindowByTitle("Child Page 2");
- assertTextPresent("child 2");
+ assertTextPresent("This is child 2");
}
@Test public void testAssertWindowWithTitle() throws Throwable {
@@ -68,12 +70,13 @@
assertPassFail("assertWindowPresentWithTitle", new Object[]{"Child Page 2"}, new Object[]{"NoSuchTitle"});
}
- @Test public void testCloseWindow() {
+ @Test
+ public void testCloseWindow() {
beginAt("RootPage.html");
assertTitleEquals("This is the Root");
clickLink("ChildPage1");
gotoWindow("ChildPage1");
- assertTextPresent("child 1");
+ assertTextPresent("Child Page 1");
closeWindow();
assertWindowCountEquals(1);
assertTitleEquals("This is the Root");
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-09-23 14:33:49 UTC (rev 919)
+++ trunk/src/changes/changes.xml 2011-09-23 14:44:03 UTC (rev 920)
@@ -32,6 +32,9 @@
<body>
<release version="3.1" date="UNKNOW" description="Cleanup for Webdriver integration">
<action type="update" dev="henryju">
+ getPageText() (and all related assertXX methods) now only deals with what is inside <body> element. Previously it was also returning page title for example.
+ </action>
+ <action type="update" dev="henryju">
gotoRootWindow() now goes to the root "frame" in a multi-frame window. Previously it was only by chance.
</action>
<action type="update" dev="henryju">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 14:47:01
|
Revision: 921
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=921&view=rev
Author: henryju
Date: 2011-09-23 14:46:55 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Cleanup of pom dependencies. Add WebDriverTestingEngine in the list of available engines.
Modified Paths:
--------------
trunk/jwebunit-core/pom.xml
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestingEngineRegistry.java
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-selenium-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/pom.xml
Property Changed:
----------------
trunk/jwebunit-webdriver-plugin/
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/jwebunit-core/pom.xml 2011-09-23 14:46:55 UTC (rev 921)
@@ -24,10 +24,12 @@
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
+ <version>1.3</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
</dependency>
</dependencies>
<properties>
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestingEngineRegistry.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestingEngineRegistry.java 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/util/TestingEngineRegistry.java 2011-09-23 14:46:55 UTC (rev 921)
@@ -40,6 +40,11 @@
*/
public final static String TESTING_ENGINE_SELENIUM = "TestingEngineSelenium";
+ /**
+ * Key of HtmlUnit testing engine.
+ */
+ public final static String TESTING_ENGINE_WEBDRIVER = "TestingEngineWebdriver";
+
private static Hashtable<String,Class<?>> testingEngineMap = new Hashtable<String,Class<?>>();
static {
@@ -57,6 +62,13 @@
} catch (ClassNotFoundException e) {
// Selenium Testing Engine is not present in the classpath. Nothing to do.
}
+ cp = "net.sourceforge.jwebunit.webdriver.WebDriverTestingEngineImpl";
+ // Try to load Webdriver Testing Engine to check if it is present.
+ try {
+ addTestingEngine(TESTING_ENGINE_WEBDRIVER, cp);
+ } catch (ClassNotFoundException e) {
+ // Webdriver Testing Engine is not present in the classpath. Nothing to do.
+ }
}
/**
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2011-09-23 14:46:55 UTC (rev 921)
@@ -23,6 +23,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
+ <version>2.9</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
@@ -56,6 +57,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
</dependency>
</dependencies>
<properties>
Modified: trunk/jwebunit-selenium-plugin/pom.xml
===================================================================
--- trunk/jwebunit-selenium-plugin/pom.xml 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/jwebunit-selenium-plugin/pom.xml 2011-09-23 14:46:55 UTC (rev 921)
@@ -55,6 +55,7 @@
<dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
@@ -78,6 +79,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
</dependency>
</dependencies>
<properties>
Property changes on: trunk/jwebunit-webdriver-plugin
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.project
.classpath
.settings
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2011-09-23 14:46:55 UTC (rev 921)
@@ -1,8 +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/xsd/maven-4.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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -30,13 +31,19 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
- <version>2.0b2</version>
- </dependency>
+ <version>2.6.0</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
- <version>2.0b2</version>
- </dependency>
+ <version>2.6.0</version>
+ </dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-core</artifactId>
@@ -59,7 +66,27 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <version>2.5</version>
</dependency>
+ <dependency>
+ <groupId>biz.neustar</groupId>
+ <artifactId>browsermob-proxy</artifactId>
+ <version>2.0-beta-3</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>org.apache.commons</artifactId>
+ <groupId>commons-io</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
</dependencies>
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 14:44:03 UTC (rev 920)
+++ trunk/pom.xml 2011-09-23 14:46:55 UTC (rev 921)
@@ -25,6 +25,7 @@
<module>jwebunit-commons-tests</module>
<module>jwebunit-htmlunit-plugin</module>
<module>jwebunit-selenium-plugin</module>
+ <module>jwebunit-webdriver-plugin</module>
</modules>
<mailingLists>
<mailingList>
@@ -395,36 +396,6 @@
<version>7.3.1.v20110307</version>
</dependency>
<dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2.2</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.0.1</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.9</version>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium.client-drivers</groupId>
- <artifactId>selenium-java-client-driver</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>regexp</groupId>
- <artifactId>regexp</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 14:52:34
|
Revision: 923
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=923&view=rev
Author: henryju
Date: 2011-09-23 14:52:27 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
It is now possible to run each test individually (in Eclipse, I first have to run the full test suite, but after I can select which individual test or package I want re-run).
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.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
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-09-23 14:50:45 UTC (rev 922)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2011-09-23 14:52:27 UTC (rev 923)
@@ -18,6 +18,8 @@
*/
package net.sourceforge.jwebunit.tests;
+import net.sourceforge.jwebunit.tests.util.JettySetup;
+
import java.lang.reflect.InvocationTargetException;
import org.junit.After;
@@ -35,7 +37,7 @@
*
* @author Nicholas Neuberger
*/
-public abstract class JWebUnitAPITestCase {
+public abstract class JWebUnitAPITestCase extends JettySetup {
protected static final Object[] NOARGS = new Object[0];
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-09-23 14:50:45 UTC (rev 922)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/JettySetup.java 2011-09-23 14:52:27 UTC (rev 923)
@@ -45,6 +45,8 @@
* The Jetty server we are going to use as test server.
*/
private static Server jettyServer = null;
+
+ private static boolean started = false;
/**
@@ -54,62 +56,61 @@
* @see junit.extensions.TestSetup#setUp()
*/
@BeforeClass
- public static void setUp() throws Exception {
- try {
- jettyServer = new Server();
- SelectChannelConnector connector = new SelectChannelConnector();
- connector.setPort(JWebUnitAPITestCase.JETTY_PORT);
- connector.setAcceptors(5);
- connector.setPort(JWebUnitAPITestCase.JETTY_PORT);
- jettyServer.setConnectors(new Connector[] { connector });
-
- WebAppContext wah = new WebAppContext();
-
- // Handle files encoded in UTF-8
- MimeTypes mimeTypes = new MimeTypes();
- mimeTypes.addMimeMapping("html_utf-8", "text/html; charset=UTF-8");
- mimeTypes.addMimeMapping("txt", "text/plain");
- mimeTypes.addMimeMapping("bin", "application/octet-stream");
- wah.setMimeTypes(mimeTypes);
-
-
- HandlerCollection handlers= new HandlerCollection();
- handlers.setHandlers(new Handler[]{wah, new DefaultHandler()});
-
- jettyServer.setHandler(wah);
- 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);
-
- URL url = JettySetup.class.getResource("/testcases/");
- wah.setWar(url.toString());
-
- jettyServer.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- fail("Could not start the Jetty server: " + e);
- }
+ public static void startup() throws Exception {
+ if (!started) {
+ try {
+ jettyServer = new Server();
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setPort(JWebUnitAPITestCase.JETTY_PORT);
+ connector.setAcceptors(5);
+ connector.setPort(JWebUnitAPITestCase.JETTY_PORT);
+ jettyServer.setConnectors(new Connector[] { connector });
+
+ WebAppContext wah = new WebAppContext();
+
+ // Handle files encoded in UTF-8
+ MimeTypes mimeTypes = new MimeTypes();
+ mimeTypes.addMimeMapping("html_utf-8", "text/html; charset=UTF-8");
+ mimeTypes.addMimeMapping("txt", "text/plain");
+ mimeTypes.addMimeMapping("bin", "application/octet-stream");
+ wah.setMimeTypes(mimeTypes);
+
+
+ HandlerCollection handlers= new HandlerCollection();
+ handlers.setHandlers(new Handler[]{wah, new DefaultHandler()});
+
+ jettyServer.setHandler(wah);
+ 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);
+
+ URL url = JettySetup.class.getResource("/testcases/");
+ wah.setWar(url.toString());
+
+ jettyServer.start();
+
+ started = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Could not start the Jetty server: " + e);
+ }
+ }
}
-
- /**
- * Stops the Jetty server.
- *
- * @see junit.extensions.TestSetup#tearDown()
- */
- @AfterClass
- public static void tearDown() throws Exception {
- try {
- jettyServer.stop();
- } catch (InterruptedException e) {
- e.printStackTrace();
- fail("Jetty server was interrupted: " + e);
- } catch (Exception e) {
- e.printStackTrace();
- fail("Could not stop the Jetty server: " + e);
- }
- }
+
+ protected static void shutdown() throws Exception {
+ try {
+ jettyServer.stop();
+ started = false;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ fail("Jetty server was interrupted: " + e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Could not stop the Jetty server: " + e);
+ }
+ }
}
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-09-23 14:50:45 UTC (rev 922)
+++ trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/JWebUnitTest.java 2011-09-23 14:52:27 UTC (rev 923)
@@ -19,6 +19,8 @@
package net.sourceforge.jwebunit.htmlunit;
+import org.junit.AfterClass;
+
import net.sourceforge.jwebunit.tests.ButtonAssertionsTest;
import net.sourceforge.jwebunit.tests.CharsetTest;
import net.sourceforge.jwebunit.tests.CustomTesterTest;
@@ -85,5 +87,10 @@
ConcurrentJWebUnitTest.class
})
public class JWebUnitTest extends JettySetup {
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ shutdown();
+ }
}
Modified: trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java 2011-09-23 14:50:45 UTC (rev 922)
+++ trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java 2011-09-23 14:52:27 UTC (rev 923)
@@ -18,21 +18,20 @@
*/
package net.sourceforge.jwebunit.htmlunit;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import net.sourceforge.jwebunit.tests.JWebUnitAPITestCase;
-import net.sourceforge.jwebunit.tests.util.JettySetup;
-import net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl;
import com.gargoylesoftware.htmlunit.ThreadedRefreshHandler;
import com.gargoylesoftware.htmlunit.WaitingRefreshHandler;
+import net.sourceforge.jwebunit.tests.JWebUnitAPITestCase;
+import org.junit.Test;
-import static net.sourceforge.jwebunit.junit.JWebUnit.*;
-import static org.junit.Assert.*;
+import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
+import static net.sourceforge.jwebunit.junit.JWebUnit.getTestContext;
+import static net.sourceforge.jwebunit.junit.JWebUnit.getTestingEngine;
+import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
- * Unit test to validate JWEbUnit's HtmlUnit plugin will now allow for custom
+ * Unit test to validate JWebUnit's HtmlUnit plugin will now allow for custom
* RefreshHandler to be passed in prior to initialization, as well as changed on
* the fly.
*
@@ -40,16 +39,6 @@
* @author Jason McSwain
*/
public class RefreshHandlerTest extends JWebUnitAPITestCase {
-
- @BeforeClass
- public static void startJetty() throws Exception {
- JettySetup.setUp();
- }
-
- @AfterClass
- public static void stopJetty() throws Exception {
- JettySetup.tearDown();
- }
@Test
public void testDefaultRefreshHandler() throws Exception {
Modified: trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java
===================================================================
--- trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java 2011-09-23 14:50:45 UTC (rev 922)
+++ trunk/jwebunit-selenium-plugin/src/test/java/net/sourceforge/jwebunit/selenium/JWebUnitTest.java 2011-09-23 14:52:27 UTC (rev 923)
@@ -18,6 +18,8 @@
*/
package net.sourceforge.jwebunit.selenium;
+import org.junit.AfterClass;
+
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -63,4 +65,8 @@
})
public class JWebUnitTest extends JettySetup {
+ @AfterClass
+ public static void tearDown() throws Exception {
+ shutdown();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-09-23 14:56:58
|
Revision: 924
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=924&view=rev
Author: henryju
Date: 2011-09-23 14:56:50 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Lot of work on WebDriver testing engine. Many tests are passing.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java
Added Paths:
-----------
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitWebElement.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
Removed Paths:
-------------
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebdriverElementImpl.java
Modified: trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml 2011-09-23 14:52:27 UTC (rev 923)
+++ trunk/jwebunit-commons-tests/src/main/resources/logback-test.xml 2011-09-23 14:56:50 UTC (rev 924)
@@ -40,6 +40,8 @@
<logger name="org.eclipse.jetty" level="ERROR"/>
<logger name="ch.qos.logback" level="ERROR"/>
+
+ <logger name="org.browsermob.proxy" level="ERROR"/>
<root level="DEBUG">
<appender-ref ref="consoleAppender"/>
Added: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java (rev 0)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java 2011-09-23 14:56:50 UTC (rev 924)
@@ -0,0 +1,20 @@
+package net.sourceforge.jwebunit.webdriver;
+
+import org.openqa.selenium.Capabilities;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+
+
+public class FixedHtmlUnitDriver extends HtmlUnitDriver {
+
+ public FixedHtmlUnitDriver(Capabilities capabilities) {
+ super(capabilities);
+ }
+
+ protected WebElement newHtmlUnitWebElement(HtmlElement element) {
+ return new FixedHtmlUnitWebElement(this, element);
+ }
+
+}
Property changes on: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitWebElement.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitWebElement.java (rev 0)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitWebElement.java 2011-09-23 14:56:50 UTC (rev 924)
@@ -0,0 +1,65 @@
+package net.sourceforge.jwebunit.webdriver;
+
+import com.gargoylesoftware.htmlunit.html.DomElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSelect;
+import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
+import java.net.MalformedURLException;
+import java.util.List;
+
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlOption;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+
+import org.openqa.selenium.htmlunit.HtmlUnitWebElement;
+
+/**
+ * Fix for issue http://code.google.com/p/selenium/issues/detail?id=2295
+ *
+ * @author julien, 23 sept. 2011
+ */
+public class FixedHtmlUnitWebElement extends HtmlUnitWebElement {
+
+ public FixedHtmlUnitWebElement(HtmlUnitDriver parent, HtmlElement element) {
+ super(parent, element);
+ }
+
+ @Override
+ public boolean isSelected() {
+ assertElementNotStale();
+
+ if (element instanceof HtmlInput) {
+ return ((HtmlInput) element).isChecked();
+ }
+ else if (element instanceof HtmlOption) {
+ return ((HtmlOption) element).isSelected();
+ }
+
+ throw new UnsupportedOperationException("Unable to determine if element is selected. Tag name is: " + element.getTagName());
+ }
+
+ @Override
+ public String getAttribute(String name) {
+ assertElementNotStale();
+
+ final String lowerName = name.toLowerCase();
+
+ if (element instanceof HtmlOption && "selected".equals(lowerName)) {
+ return ((HtmlOption) element).isSelected() ? "true" : null;
+ }
+
+ if ("value".equals(lowerName)) {
+ if (element instanceof HtmlTextArea) {
+ return ((HtmlTextArea) element).getText();
+ }
+
+ if (element instanceof HtmlOption) {
+ return ((HtmlOption) element).getValueAttribute();
+ }
+ }
+
+ return super.getAttribute(name);
+ }
+}
Property changes on: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitWebElement.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java (from rev 913, trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebdriverElementImpl.java)
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java (rev 0)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java 2011-09-23 14:56:50 UTC (rev 924)
@@ -0,0 +1,198 @@
+/**
+ * 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.webdriver;
+
+import org.openqa.selenium.JavascriptExecutor;
+
+import org.openqa.selenium.By;
+
+import org.openqa.selenium.WebElement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.jwebunit.api.IElement;
+
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
+
+/**
+ * Webdriver implementation of IElement wrapper.
+ *
+ * @author henryju
+ *
+ */
+public class WebDriverElementImpl implements IElement {
+
+ /**
+ * The wrapped element.
+ */
+ private WebElement element;
+
+ public WebDriverElementImpl(WebElement element) {
+ if (element == null)
+ throw new NullPointerException("Cannot create an IElement for a null element.");
+ this.element = element;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#attribute(java.lang.String)
+ */
+ public String getAttribute(String name) {
+ return element.getAttribute(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#name()
+ */
+ public String getName() {
+ return element.getTagName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getChildren()
+ */
+ public List<IElement> getChildren() {
+ List<IElement> children = new ArrayList<IElement>();
+ for (WebElement e : element.findElements(By.xpath("child::*"))) {
+ if (e != null)
+ children.add(new WebDriverElementImpl(e));
+ }
+ return children;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getParent()
+ */
+ public IElement getParent() {
+ return new WebDriverElementImpl(element.findElement(By.xpath("//parent::*")));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getTextContent()
+ */
+ public String getTextContent() {
+ return element.getText();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getElement(java.lang.String)
+ */
+ public IElement getElement(String xpath) {
+ return new WebDriverElementImpl((WebElement) element.findElement(By.xpath(xpath)));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getElements(java.lang.String)
+ */
+ public List<IElement> getElements(String xpath) {
+ List<IElement> elements = new ArrayList<IElement>();
+ for (WebElement o : element.findElements(By.xpath(xpath))) {
+ elements.add(new WebDriverElementImpl(o));
+ }
+ return elements;
+ }
+
+ public String toString() {
+ return "IElement[name=" + getName() + " wrapped=" + element + "]";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String)
+ */
+ public void setAttribute(String string) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String, java.lang.String)
+ */
+ public void setAttribute(String string, String value) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setTextContent(java.lang.String)
+ */
+ public void setTextContent(String value) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 37;
+ int result = 1;
+ result = prime * result + ((element == null) ? 0 : element.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final WebDriverElementImpl other = (WebDriverElementImpl) obj;
+ if (element == null) {
+ if (other.element != null)
+ return false;
+ }
+ else if (!element.equals(other.element))
+ return false;
+ return true;
+ }
+
+ /**
+ * Return the unwrapped Webdriver element that this IElement represents.
+ *
+ * @return the Webdriver element this IElement represents.
+ */
+ public WebElement getHtmlElement() {
+ return element;
+ }
+
+}
Property changes on: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2011-09-23 14:52:27 UTC (rev 923)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2011-09-23 14:56:50 UTC (rev 924)
@@ -18,12 +18,16 @@
*/
package net.sourceforge.jwebunit.webdriver;
-import org.apache.regexp.RE;
-import org.apache.regexp.RESyntaxException;
+import org.apache.http.conn.BasicManagedEntity;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.util.NameValuePair;
-import com.gargoylesoftware.htmlunit.BrowserVersion;
+import java.io.ByteArrayInputStream;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.WebResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
@@ -33,6 +37,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import java.util.Set;
import net.sourceforge.jwebunit.api.HttpHeader;
import net.sourceforge.jwebunit.api.IElement;
@@ -41,19 +46,39 @@
import net.sourceforge.jwebunit.exception.ExpectedJavascriptConfirmException;
import net.sourceforge.jwebunit.exception.ExpectedJavascriptPromptException;
import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
+import net.sourceforge.jwebunit.html.Cell;
+import net.sourceforge.jwebunit.html.Row;
import net.sourceforge.jwebunit.html.Table;
import net.sourceforge.jwebunit.javascript.JavascriptAlert;
import net.sourceforge.jwebunit.javascript.JavascriptConfirm;
import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
import net.sourceforge.jwebunit.util.TestContext;
+import org.apache.commons.io.input.ProxyInputStream;
+import org.apache.http.Header;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpException;
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.HttpStatus;
+import org.apache.http.entity.HttpEntityWrapper;
+import org.apache.http.message.BasicHttpResponse;
+import org.apache.http.protocol.HttpContext;
+import org.apache.regexp.RE;
+import org.apache.regexp.RESyntaxException;
+import org.browsermob.proxy.ProxyServer;
import org.openqa.selenium.By;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.NoSuchWindowException;
+import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+import org.openqa.selenium.remote.CapabilityType;
+import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.Select;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,47 +95,234 @@
* Logger for this class.
*/
private final Logger logger = LoggerFactory.getLogger(WebDriverTestingEngineImpl.class);
+ private ProxyServer proxyServer;
private WebDriver driver;
private TestContext testContext;
+ private static final int TRY_COUNT = 50;
+ private static final int DEFAULT_PORT = 8183;
+ private static final Random RANDOM = new Random();
+ private HttpResponse response;
+ private BasicBufferedHttpEntity entity;
// The xpath string that identifie the current form
// ie : @name='myForm'
private String formIdent;
+ private boolean throwExceptionOnScriptError = true;//TODO
+ private boolean ignoreFailingStatusCodes = false;
+ private Map<String, String> requestHeaders;
+ /**
+ * Is Javascript enabled.
+ */
+ private boolean jsEnabled = true;
public WebDriverTestingEngineImpl() {
}
public void beginAt(URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException {
this.setTestContext(aTestContext);
- driver = new HtmlUnitDriver(BrowserVersion.FIREFOX_3);
- ((HtmlUnitDriver) driver).setJavascriptEnabled(true);
+ // start the proxy
+ Proxy proxy = startBrowserMobProxy();
+ DesiredCapabilities capabilities = new DesiredCapabilities();
+ capabilities.setCapability(CapabilityType.PROXY, proxy);
+ capabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, jsEnabled);
+ capabilities.setBrowserName("htmlunit");
+ capabilities.setVersion("firefox");
+
+ driver = new FixedHtmlUnitDriver(capabilities);
//Reset form
formIdent = null;
+ // Deal with cookies
+ for (javax.servlet.http.Cookie c : aTestContext.getCookies()) {
+ //FIXME Hack for BrowserMob
+ String domain = c.getDomain();
+ if ("localhost".equals(domain)) {
+ domain = null;
+ }
+ if ("".equals(domain)) {
+ domain = null;
+ }
+ Date expiry = null;
+ if (c.getMaxAge() != -1) {
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.SECOND, c.getMaxAge());
+ expiry = cal.getTime();
+ }
+ driver.manage().addCookie(
+ new org.openqa.selenium.Cookie(c
+ .getName(), c.getValue(), domain, c.getPath() != null ? c
+ .getPath() : "", expiry, c.getSecure()));
+ }
+ // Deal with custom request header
+ this.requestHeaders = aTestContext.getRequestHeaders();
+
gotoPage(aInitialURL);
}
+
+ private Proxy startBrowserMobProxy() {
+ for (int i = 1; i <= TRY_COUNT; i++) {
+ int port = getRandomPort();
+ proxyServer = new ProxyServer(port);
+ try {
+ proxyServer.start();
+ proxyServer.addResponseInterceptor(new HttpResponseInterceptor() {
+ public void process(HttpResponse response, HttpContext context) throws HttpException, IOException {
+ WebDriverTestingEngineImpl.this.response = response;
+ if (response instanceof BasicHttpResponse) {
+ BasicHttpResponse basicResponse = (BasicHttpResponse) response;
+ WebDriverTestingEngineImpl.this.entity = new BasicBufferedHttpEntity(response.getEntity());
+ basicResponse.setEntity(WebDriverTestingEngineImpl.this.entity);
+ }
+ else {
+ logger.error("Response is of type {}. Impossible to buffer content.", response.getClass().getSimpleName());
+ }
+ }
+ });
+ proxyServer.addRequestInterceptor(new HttpRequestInterceptor() {
+ public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
+ for (Map.Entry<String, String> requestHeader : requestHeaders.entrySet()) {
+ request.addHeader(requestHeader.getKey(), requestHeader.getValue());
+ }
+ }
+ });
+ return proxyServer.seleniumProxy();
+ }
+ catch (Exception e) {
+ if (i<TRY_COUNT) {
+ logger.error("Error while starting BrowserMob proxy. Retry...", e);
+ continue;
+ }
+ }
+ }
+ throw new RuntimeException("Unable to start BrowserMob proxy after " + TRY_COUNT + " retries");
+ }
+
+ private class BasicBufferedHttpEntity extends HttpEntityWrapper {
+
+ private BufferedInputStream bis;
+ public BasicBufferedHttpEntity(HttpEntity wrapped) {
+ super(wrapped);
+ }
+
+ @Override
+ public InputStream getContent() throws IOException {
+ if (bis == null) {
+ bis = new BufferedInputStream(super.getContent());
+ }
+ return bis;
+ }
+
+ public byte[] getBufferedContent() {
+ return bis.getBuffer();
+ }
+
+ }
+
+ private class BufferedInputStream extends ProxyInputStream {
+
+ private ByteArrayOutputStream bos = new ByteArrayOutputStream();
+
+ public BufferedInputStream(InputStream proxy) {
+ super(proxy);
+ }
+
+
+ public byte[] getBuffer() {
+ return bos.toByteArray();
+ }
+
+ @Override
+ public int read() throws IOException {
+ int b = super.read();
+ if (b != -1) {
+ bos.write(b);
+ }
+ return b;
+ }
+
+ @Override
+ public int read(byte[] array) throws IOException {
+ int len = super.read(array);
+ if (len > 0) {
+ bos.write(array, 0, len);
+ }
+ return len;
+ }
+
+ @Override
+ public int read(byte[] array, int off, int len) throws IOException {
+ int len2 = super.read(array, off, len);
+ if (len2 > 0) {
+ bos.write(array, 0, len2);
+ }
+ return len2;
+ }
+
+ }
+
+ private static int getRandomPort() {
+ synchronized (RANDOM) {
+ return DEFAULT_PORT + RANDOM.nextInt(1000);
+ }
+ }
+
public void setTestContext(TestContext testContext) {
this.testContext = testContext;
}
public void closeBrowser() throws ExpectedJavascriptAlertException, ExpectedJavascriptConfirmException, ExpectedJavascriptPromptException {
formIdent = null;
- driver.close();
+ if (driver != null) {
+ driver.quit();
+ driver = null;
+ }
+ if (proxyServer != null) {
+ try {
+ proxyServer.stop();
+ proxyServer = null;
+ }
+ catch (Exception e) {
+ logger.error("Error while stopping proxy", e);
+ throw new RuntimeException("Error while stopping proxy", e);
+ }
+ }
}
public void gotoPage(URL url) throws TestingEngineResponseException {
formIdent = null;
- driver.get(url.toString());
+ //Big hack for browsermob
+ String urlStr = url.toString().replace("http://localhost", "http://127.0.0.1");
+ driver.get(urlStr);
+ throwFailingHttpStatusCodeExceptionIfNecessary(
+ response.getStatusLine().getStatusCode(), urlStr);
}
+
+ /**
+ * Copied from {@link WebClient#throwFailingHttpStatusCodeExceptionIfNecessary(WebResponse)}
+ *
+ * @param webResponse
+ */
+ private void throwFailingHttpStatusCodeExceptionIfNecessary(int statusCode, String url) {
+ final boolean successful = (statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES)
+ || statusCode == HttpStatus.SC_USE_PROXY
+ || statusCode == HttpStatus.SC_NOT_MODIFIED;
+ if (!this.ignoreFailingStatusCodes && !successful) {
+ throw new TestingEngineResponseException(statusCode,
+ "unexpected status code [" + statusCode + "] at URL: [" + url + "]");
+ }
+ }
public void setScriptingEnabled(boolean value) {
- if (driver instanceof HtmlUnitDriver) {
+ // This variable is used to set Javascript before wc is instancied
+ jsEnabled = value;
+ if (driver != null && driver instanceof HtmlUnitDriver) {
((HtmlUnitDriver) driver).setJavascriptEnabled(value);
}
}
public void setThrowExceptionOnScriptError(boolean value) {
+ this.throwExceptionOnScriptError = true;
}
public List<javax.servlet.http.Cookie> getCookies() {
@@ -171,19 +383,21 @@
String current = driver.getWindowHandle();
for (String handle : driver.getWindowHandles()) {
driver.switchTo().window(handle);
- if (driver.getTitle().equals(title)) {
+ if (title.equals(driver.getTitle())) {
return;
}
}
driver.switchTo().window(current);
+ throw new RuntimeException("No window found with title [" + title + "]");
}
public void gotoWindow(int windowID) {
- throw new UnsupportedOperationException("Not supported yet.");
+ Set<String> handles = driver.getWindowHandles();
+ driver.switchTo().window(handles.toArray(new String[handles.size()])[windowID]);
}
public void gotoRootWindow() {
- throw new UnsupportedOperationException("Not supported yet.");
+ driver.switchTo().defaultContent();
}
public int getWindowCount() {
@@ -192,11 +406,18 @@
public void closeWindow() {
formIdent = null;
- driver.close();
+ driver.close();//FIXME Issue 1466
}
public boolean hasFrame(String frameNameOrId) {
- throw new UnsupportedOperationException("Not supported yet.");
+ List<WebElement> frameset = driver.findElements(By.tagName("frame"));
+ for (WebElement frame : frameset) {
+ if (frameNameOrId.equals(frame.getAttribute("name"))
+ || frameNameOrId.equals(frame.getAttribute("id"))) {
+ return true;
+ }
+ }
+ return false;
}
public void gotoFrame(String frameNameOrId) {
@@ -209,7 +430,7 @@
public void setWorkingForm(String nameOrId, int index) {
if (nameOrId != null) {
- formIdent = "(@name='" + nameOrId + "' or @id='" + nameOrId + "')][position()="
+ formIdent = "(@name=" + escapeQuotes(nameOrId) + " or @id=" + escapeQuotes(nameOrId) + ")][position()="
+ (index + 1);
} else {
formIdent = null;
@@ -228,20 +449,20 @@
}
public boolean hasForm(String nameOrID) {
- return hasElementByXPath("//form[@name='" + nameOrID + "' or @id='" + nameOrID + "']");
+ return hasElementByXPath("//form[@name=" + escapeQuotes(nameOrID) + " or @id=" + escapeQuotes(nameOrID) + "]");
}
public boolean hasFormParameterNamed(String paramName) {
- return hasElementByXPath(formSelector() + "//*[@name='" + paramName + "']");
+ return getWebElementByXPath("//*[@name=" + escapeQuotes(paramName) + "]", false, true) != null;
}
- private WebElement getWebElementByXPath(String xpathAfterForm, boolean onlyInCurrentForm) {
+ private WebElement getWebElementByXPath(String xpathAfterForm, boolean searchOnlyInCurrentForm, boolean overrideWorkingForm) {
//First try the current form
if (formIdent != null) {
try {
return driver.findElement(By.xpath("//form[" + formIdent + "]" + xpathAfterForm));
} catch (NoSuchElementException ex) {
- if (onlyInCurrentForm) {
+ if (searchOnlyInCurrentForm) {
return null;
}
}
@@ -252,7 +473,9 @@
for (WebElement f : forms) {
try {
WebElement e = driver.findElement(By.xpath("//form[position()=" + (index + 1) + "]" + xpathAfterForm));
- setWorkingForm(index);
+ if (overrideWorkingForm) {
+ setWorkingForm(index);
+ }
return e;
} catch (NoSuchElementException ex) {
index ++;
@@ -275,29 +498,40 @@
}
public String getTextFieldValue(String paramName) {
- WebElement e = getWebElementByXPath("//input[@type='text' and @name='" + paramName + "']", false);
- return e.getValue();
+ WebElement e = getTextField(paramName);
+ return e.getAttribute("value");
}
public String getHiddenFieldValue(String paramName) {
- WebElement e = getWebElementByXPath("//input[@type='hidden' and @name='" + paramName + "']", false);
- return e.getValue();
+ WebElement e = getWebElementByXPath("//input[@type='hidden' and @name=" + escapeQuotes(paramName) + "]", false, true);
+ return e.getAttribute("value");
}
public void setTextField(String inputName, String text) {
- WebElement e = getWebElementByXPath("//input[@type='text' and @name='" + inputName + "']", false);
+ WebElement e = getTextField(inputName);
+ e.clear();
+ e.sendKeys(text);
+ }
+
+ /**
+ * Look for any text field (input text, input password, textarea, file input).
+ */
+ private WebElement getTextField(String paramName) {
+ WebElement e = getWebElementByXPath("//input[@type='text' and @name=" + escapeQuotes(paramName) + "]", false, true);
if (e == null) {
- e = getWebElementByXPath("//textarea[@name='" + inputName + "']", false);
+ e = getWebElementByXPath("//textarea[@name=" + escapeQuotes(paramName) + "]", false, true);
}
if (e == null) {
- e = getWebElementByXPath("//input[@type='file' and @name='" + inputName + "']", false);
+ e = getWebElementByXPath("//input[@type='file' and @name=" + escapeQuotes(paramName) + "]", false, true);
}
- e.clear();
- e.sendKeys(text);
+ if (e == null) {
+ e = getWebElementByXPath("//input[@type='password' and @name=" + escapeQuotes(paramName) + "]", false, true);
+ }
+ re...
[truncated message content] |
|
From: <he...@us...> - 2011-09-23 15:35:30
|
Revision: 927
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=927&view=rev
Author: henryju
Date: 2011-09-23 15:35:23 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
Fix xpath expressions and getParent()
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
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-09-23 15:05:27 UTC (rev 926)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2011-09-23 15:35:23 UTC (rev 927)
@@ -78,7 +78,7 @@
/**
* Test parent, child methods
*/
- @Test public void testChildren() {
+ @Test public void testChildrenAndParent() {
assertElementPresent("first");
IElement element = getElementById("first");
assertEquals(element.getName(), "li");
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java 2011-09-23 15:05:27 UTC (rev 926)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java 2011-09-23 15:35:23 UTC (rev 927)
@@ -95,7 +95,7 @@
* @see net.sourceforge.jwebunit.api.IElement#getParent()
*/
public IElement getParent() {
- return new WebDriverElementImpl(element.findElement(By.xpath("//parent::*")));
+ return new WebDriverElementImpl(element.findElement(By.xpath("parent::*")));
}
/*
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2011-09-23 15:05:27 UTC (rev 926)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2011-09-23 15:35:23 UTC (rev 927)
@@ -540,7 +540,7 @@
}
public String[] getSelectOptionValues(String selectName, int index) {
- Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + " and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
ArrayList<String> result = new ArrayList<String>();
for (WebElement opt : select.getOptions()) {
result.add(opt.getAttribute("value"));
@@ -563,7 +563,7 @@
}
public String[] getSelectedOptions(String selectName, int index) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "' and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
return getSelectedOptions(select);
}
@@ -586,22 +586,22 @@
}
public String getSelectOptionLabelForValue(String selectName, String optionValue) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "']", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "]", true, true));
return getSelectOptionLabelForValue(select, optionValue);
}
public String getSelectOptionLabelForValue(String selectName, int index, String optionValue) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "' and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
return getSelectOptionLabelForValue(select, optionValue);
}
public String getSelectOptionValueForLabel(String selectName, String optionLabel) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "']", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "]", true, true));
return getSelectOptionValueForLabel(select, optionLabel);
}
public String getSelectOptionValueForLabel(String selectName, int index, String optionLabel) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "' and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
return getSelectOptionValueForLabel(select, optionLabel);
}
@@ -610,7 +610,7 @@
}
public void selectOptions(String selectName, int index, String[] optionValues) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "' and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
if (!select.isMultiple() && optionValues.length > 1)
throw new RuntimeException("Multiselect not enabled");
for (String option : optionValues) {
@@ -634,7 +634,7 @@
}
public void unselectOptions(String selectName, int index, String[] optionValues) {
- Select select = new Select(getWebElementByXPath("//select[@name='" + selectName + "' and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
if (!select.isMultiple() && optionValues.length > 1)
throw new RuntimeException("Multiselect not enabled");
for (String option : optionValues) {
@@ -662,7 +662,7 @@
}
public boolean hasSelectOption(String selectName, int index, String optionLabel) {
- Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + " and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
for (WebElement opt : select.getOptions()) {
if (opt.getText().equals(optionLabel)) {
return true;
@@ -672,7 +672,7 @@
}
public boolean hasSelectOptionValue(String selectName, int index, String optionValue) {
- Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + " and position()=" + (index + 1) + "]", true, true));
+ Select select = new Select(getWebElementByXPath("//select[@name=" + escapeQuotes(selectName) + "][" + (index + 1) + "]", true, true));
for (WebElement opt : select.getOptions()) {
if (opt.getAttribute("value").equals(optionValue)) {
return true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2011-11-28 10:11:44
|
Revision: 933
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=933&view=rev
Author: henryju
Date: 2011-11-28 10:11:30 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
Update Maven build/plugins + Fix a deadlock in a test with refresh handler
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java
trunk/pom.xml
trunk/src/changes/changes.xml
trunk/src/site/site.xml
Modified: trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java 2011-10-10 15:53:54 UTC (rev 932)
+++ trunk/jwebunit-htmlunit-plugin/src/test/java/net/sourceforge/jwebunit/htmlunit/RefreshHandlerTest.java 2011-11-28 10:11:30 UTC (rev 933)
@@ -18,6 +18,8 @@
*/
package net.sourceforge.jwebunit.htmlunit;
+import org.junit.After;
+
import com.gargoylesoftware.htmlunit.ThreadedRefreshHandler;
import com.gargoylesoftware.htmlunit.WaitingRefreshHandler;
import net.sourceforge.jwebunit.tests.JWebUnitAPITestCase;
@@ -109,5 +111,13 @@
.println("[WARN] skipping test [testChangeRefreshHandler] b/c it only applies to HtmlUnitTestEngineImpl");
}
}
+
+ @After
+ public void cleanup() {
+ if (getTestingEngine() instanceof HtmlUnitTestingEngineImpl) {
+ HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) getTestingEngine();
+ engine.setRefreshHandler(null);
+ }
+ }
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-10-10 15:53:54 UTC (rev 932)
+++ trunk/pom.xml 2011-11-28 10:11:30 UTC (rev 933)
@@ -221,12 +221,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.3.1</version>
+ <version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.9</version>
+ <version>2.10</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.6</version>
+ <version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -283,12 +283,12 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
- <version>1.2</version>
+ <version>1.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>2.3</version>
+ <version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -433,7 +433,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
- <version>1.3</version>
+ <version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
@@ -447,64 +447,13 @@
</plugins>
</build>
</profile>
- <profile>
- <id>maven-3</id>
- <activation>
- <file>
- <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
- <exists>${basedir}</exists>
- </file>
- </activation>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.0-beta-3</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-descriptor</id>
- <goals>
- <goal>attach-descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>m2e</id>
- <activation>
- <property>
- <name>m2e.version</name><!-- Activate only when within eclipse -->
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <!-- Set to false to work around Maven Eclipse plugin (m2e) bug MNGECLIPSE-2215 -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-toolchains-plugin</artifactId>
- <inherited>false</inherited>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.7</version>
+ <version>2.8</version>
<configuration>
<configLocation>
${basedir}/${topDirectoryLocation}/src/checkstyle/jwebunit-checkstyle.xml
@@ -524,7 +473,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.9</version>
+ <version>2.10</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
@@ -617,7 +566,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
<configuration>
<aggregate>true</aggregate>
<targetJdk>1.5</targetJdk>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2011-10-10 15:53:54 UTC (rev 932)
+++ trunk/src/changes/changes.xml 2011-11-28 10:11:30 UTC (rev 933)
@@ -32,7 +32,7 @@
<body>
<release version="3.1" date="UNKNOW" description="Cleanup for Webdriver integration">
<action type="update" dev="henryju">
- getPageText() (and all related assertXX methods) now only deals with what is inside <body> element. Previously it was also returning page title for example.
+ getPageText() (and all related assertXX methods) now only deals with what is inside <body> element. Previously it was also returning page title for example.
</action>
<action type="update" dev="henryju">
gotoRootWindow() now goes to the root "frame" in a multi-frame window. Previously it was only by chance.
Modified: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2011-10-10 15:53:54 UTC (rev 932)
+++ trunk/src/site/site.xml 2011-11-28 10:11:30 UTC (rev 933)
@@ -22,8 +22,8 @@
<project name="JWebUnit">
<skin>
<groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-stylus-skin</artifactId>
- <version>1.1</version>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.0</version>
</skin>
<bannerLeft>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-01-27 09:43:46
|
Revision: 935
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=935&view=rev
Author: henryju
Date: 2012-01-27 09:43:35 +0000 (Fri, 27 Jan 2012)
Log Message:
-----------
Update WebDriver to version 2.17.0. Minor fixes.
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.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/IElementTest.java
trunk/jwebunit-core/pom.xml
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java
Added Paths:
-----------
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.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-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -47,7 +47,7 @@
}
@Test
- public void testAssertButtonwithTowFormsfound() {
+ public void testAssertButtonwithTwoFormsFound() {
beginAt("/pageWithTwoForms.html");
assertButtonPresent("button1");
assertButtonPresent("button2");
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -51,7 +51,7 @@
setBaseUrl(HOST_PATH + "/NavigationTest");
}
- @Rule public Timeout timeoutRule = new Timeout(2000);
+ @Rule public Timeout timeoutRule = new Timeout(10000);
@Rule public ConcurrentRule concurrently = new ConcurrentRule();
@Rule public RepeatingRule repeatedly = new RepeatingRule();
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-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -21,6 +21,8 @@
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
import static org.junit.Assert.*;
+import static org.hamcrest.Matchers.containsString;
+
import org.junit.Test;
/**
@@ -113,9 +115,8 @@
@Test public void testGetFrameSource() {
beginAt("Frames.html");
- assertTrue(getPageSource().indexOf("<frameset rows=\"33%, 33%, 33%\">")>=0);
+ assertThat(getPageSource(), containsString("<frameset rows=\"33%, 33%, 33%\">"));
gotoFrame("TopFrame");
- assertEquals("<html><body>TopFrame</body></html>", getPageSource());
assertTextPresent("TopFrame");
}
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-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -55,7 +55,8 @@
beginAt("/template.html");
}
- @Test public void testSimple() {
+ @Test
+ public void testSimple() {
// test an element that exists
IElement element = getElementByXPath("//input[@id='test']");
assertNotNull(element);
@@ -65,7 +66,8 @@
assertEquals(element.getAttribute("value"), "test3");
}
- @Test public void testMissing() {
+ @Test
+ public void testMissing() {
// a missing element should throw an exception
try {
getElementByXPath("//input[@id='test2']");
@@ -78,7 +80,8 @@
/**
* Test parent, child methods
*/
- @Test public void testChildrenAndParent() {
+ @Test
+ public void testChildrenAndParent() {
assertElementPresent("first");
IElement element = getElementById("first");
assertEquals(element.getName(), "li");
@@ -105,7 +108,8 @@
/**
* Test getting the XPath for multiple possible results
*/
- @Test public void testMultiple() {
+ @Test
+ public void testMultiple() {
List<IElement> children = getElementsByXPath("//li");
assertEquals(children.size(), 4);
assertEquals(children.get(0).getTextContent(), "one");
@@ -118,7 +122,8 @@
/**
* change the element and make sure XPath has changed
*/
- @Test public void testChanging() {
+ @Test
+ public void testChanging() {
{
IElement element = getElementByXPath("//input[@id='test']");
assertNotNull(element);
@@ -147,7 +152,8 @@
}
- @Test public void testWithXpath() {
+ @Test
+ public void testWithXpath() {
IElement element = getElementByXPath("//body");
assertNotNull(element);
assertEquals("body", element.getName());
@@ -184,15 +190,16 @@
* Test that setting attributes manually (e.g setAttribute("value")
* properly calls any attached Javascript.
*/
- @Test public void testAttributeJavascript() {
+ @Test
+ public void testAttributeJavascript() {
String testingText = new Date().toString();
{
IElement js1 = getElementById("js1");
IElement js2 = getElementById("js2");
- assertEquals(js1.getAttribute("value"), "initial");
- assertEquals(js2.getAttribute("value"), "unchanged");
+ assertEquals("initial", js1.getAttribute("value"));
+ assertEquals("unchanged", js2.getAttribute("value"));
// change js1's value
js1.setAttribute("value", testingText);
@@ -203,8 +210,8 @@
IElement js1 = getElementById("js1");
IElement js2 = getElementById("js2");
- assertEquals(js1.getAttribute("value"), testingText);
- assertEquals(js2.getAttribute("value"), testingText);
+ assertEquals(testingText, js1.getAttribute("value"));
+ assertEquals(testingText, js2.getAttribute("value"));
}
}
@@ -228,7 +235,8 @@
* Test preceding element XPath.
* preceding: "Selects everything in the document that is before the start tag of the current node"
*/
- @Test public void testPreceding() {
+ @Test
+ public void testPreceding() {
IElement element = getElementById("first"); // li
// should get the first <input>, which is
// <input id="test" name="element_name" value="test3">
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-core/pom.xml 2012-01-27 09:43:35 UTC (rev 935)
@@ -31,6 +31,11 @@
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
</dependencies>
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
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-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/IElement.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -87,7 +87,7 @@
*
* @param string
*/
- public void setAttribute(String string);
+ public void setAttribute(String name);
/**
* Set an attribute on this element.
@@ -95,7 +95,7 @@
* @param string
* @param value
*/
- public void setAttribute(String string, String value);
+ public void setAttribute(String name, String value);
/**
* Set the text content on this element.
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-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -19,6 +19,15 @@
package net.sourceforge.jwebunit.junit;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
@@ -36,8 +45,10 @@
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;
@@ -52,12 +63,10 @@
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;
-import static org.hamcrest.CoreMatchers.*;
-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
@@ -2885,13 +2894,13 @@
// get the selected option
for (IElement child : field.getChildren()) {
if (child.getName().equals("option") && child.getAttribute("selected") != null) {
- value = child.getAttribute("value") == null ? child.getTextContent() : child.getAttribute("value");
+ value = child.getAttribute("value");
break;
}
if (child.getName().equals("optgroup")) {
for (IElement subchild : child.getChildren()) {
if (subchild.getName().equals("option") && subchild.getAttribute("selected") != null) {
- value = child.getAttribute("value") == null ? child.getTextContent() : child.getAttribute("value");
+ value = child.getAttribute("value");
break;
}
}
@@ -2962,8 +2971,7 @@
// get the selected option
for (IElement children : field.getChildren()) {
// find the option which matches the given value (we can't specify random values)
- if (children.getName().equals("option") &&
- (children.getAttribute("value") == null ? value.equals(children.getTextContent()) : value.equals(children.getAttribute("value")))) {
+ if (children.getName().equals("option") && value.equals(children.getAttribute("value"))) {
children.setAttribute("selected");
return;
}
Modified: trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -146,12 +146,12 @@
/* (non-Javadoc)
* @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String, java.lang.String)
*/
- public void setAttribute(String string, String value) {
- if ("value".equals(string) && element instanceof HtmlInput) {
+ public void setAttribute(String name, String value) {
+ if ("value".equals(name) && element instanceof HtmlInput) {
// for HtmlInputs, we want to run any onChange code if the value changes
((HtmlInput) element).setValueAttribute(value);
} else {
- element.setAttributeNS(null, string, value);
+ element.setAttribute(name, value);
}
}
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2012-01-27 09:43:35 UTC (rev 935)
@@ -30,7 +30,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
- <version>2.8.0</version>
+ <version>2.17.0</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
@@ -41,7 +41,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
- <version>2.8.0</version>
+ <version>2.17.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
Added: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java (rev 0)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -0,0 +1,21 @@
+package net.sourceforge.jwebunit.webdriver;
+
+import com.gargoylesoftware.htmlunit.TopLevelWindow;
+import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+
+public class FixedHtmlUnitDriver extends HtmlUnitDriver {
+
+ @Override
+ public void close() {
+ if (getCurrentWindow() != null) {
+ if (getWebClient().getWebWindows().size() > 1) {
+ ((TopLevelWindow) getCurrentWindow().getTopWindow()).close();
+
+ }
+ else {
+ quit();
+ }
+ }
+ }
+
+}
Property changes on: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -21,21 +21,15 @@
*/
package net.sourceforge.jwebunit.webdriver;
-import org.openqa.selenium.JavascriptExecutor;
-
-import org.openqa.selenium.By;
-
-import org.openqa.selenium.WebElement;
-
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.jwebunit.api.IElement;
-import com.gargoylesoftware.htmlunit.html.DomNode;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
/**
* Webdriver implementation of IElement wrapper.
@@ -49,8 +43,14 @@
* The wrapped element.
*/
private WebElement element;
+
+ /**
+ * A reference to the driver.
+ */
+ private WebDriver driver;
- public WebDriverElementImpl(WebElement element) {
+ public WebDriverElementImpl(WebDriver driver, WebElement element) {
+ this.driver = driver;
if (element == null)
throw new NullPointerException("Cannot create an IElement for a null element.");
this.element = element;
@@ -83,7 +83,7 @@
List<IElement> children = new ArrayList<IElement>();
for (WebElement e : element.findElements(By.xpath("child::*"))) {
if (e != null)
- children.add(new WebDriverElementImpl(e));
+ children.add(new WebDriverElementImpl(driver, e));
}
return children;
}
@@ -94,7 +94,7 @@
* @see net.sourceforge.jwebunit.api.IElement#getParent()
*/
public IElement getParent() {
- return new WebDriverElementImpl(element.findElement(By.xpath("parent::*")));
+ return new WebDriverElementImpl(driver, element.findElement(By.xpath("parent::*")));
}
/*
@@ -112,7 +112,7 @@
* @see net.sourceforge.jwebunit.api.IElement#getElement(java.lang.String)
*/
public IElement getElement(String xpath) {
- return new WebDriverElementImpl((WebElement) element.findElement(By.xpath(xpath)));
+ return new WebDriverElementImpl(driver, (WebElement) element.findElement(By.xpath(xpath)));
}
/*
@@ -123,7 +123,7 @@
public List<IElement> getElements(String xpath) {
List<IElement> elements = new ArrayList<IElement>();
for (WebElement o : element.findElements(By.xpath(xpath))) {
- elements.add(new WebDriverElementImpl(o));
+ elements.add(new WebDriverElementImpl(driver, o));
}
return elements;
}
@@ -137,8 +137,8 @@
*
* @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String)
*/
- public void setAttribute(String string) {
- throw new UnsupportedOperationException("Not supported yet.");
+ public void setAttribute(String name) {
+ ((JavascriptExecutor) driver).executeScript("return arguments[0].setAttribute(arguments[1], true);", element, name);
}
/*
@@ -146,8 +146,13 @@
*
* @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String, java.lang.String)
*/
- public void setAttribute(String string, String value) {
- throw new UnsupportedOperationException("Not supported yet.");
+ public void setAttribute(String name, String value) {
+ if ("value".equals(name) && "input".equals(element.getTagName())) {
+ // for inputs, we want to run any onChange code if the value changes
+ element.sendKeys(value);
+ } else {
+ ((JavascriptExecutor) driver).executeScript("return arguments[0].setAttribute(arguments[1], arguments[2]);", element, name, value);
+ }
}
/*
@@ -156,7 +161,19 @@
* @see net.sourceforge.jwebunit.api.IElement#setTextContent(java.lang.String)
*/
public void setTextContent(String value) {
- throw new UnsupportedOperationException("Not supported yet.");
+ if (element.getTagName().equals("textarea")) {
+ element.clear();
+ element.sendKeys(value);
+ } else {
+ ((JavascriptExecutor) driver).executeScript(
+ "var parent = arguments[0];" +
+ "var children = parent.childNodes;" +
+ "for (i=0; i< children.length; i++) {" +
+ " parent.removeChild(children[i]);" +
+ "}" +
+ "parent.appendChild(document.createTextNode(arguments[1]));"
+ , element, value);
+ }
}
@Override
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -717,7 +717,7 @@
private WebElement getButton(String nameOrID) {
WebElement e = getWebElementByXPath("//input[(@type='submit' or @type='image' or @type='reset' or @type='button') and (@name=" + escapeQuotes(nameOrID) + " or @id=" + escapeQuotes(nameOrID) + ")]", false, true);
if (e == null) {
- e = getWebElementByXPath("//button[@type='submit' and (@name=" + escapeQuotes(nameOrID) + " or @id=" + escapeQuotes(nameOrID) + ")]", false, true);
+ e = getWebElementByXPath("//button[@name=" + escapeQuotes(nameOrID) + " or @id=" + escapeQuotes(nameOrID) + "]", false, true);
}
return e;
}
@@ -756,7 +756,7 @@
public String getPageText() {
try {
- return driver.findElement(By.xpath("//body")).getText();
+ return driver.findElement(By.tagName("body")).getText();
} catch (Exception e) {
//Maybe this is not HTML
return driver.getPageSource();
@@ -764,17 +764,19 @@
}
public String getPageSource() {
- String encoding = "ISO-8859-1";
- if (response.getEntity().getContentEncoding() != null) {
- encoding = response.getEntity().getContentEncoding().getValue();
- }
-
- try {
- return IOUtils.toString(response.getEntity().getContent(), encoding);
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
+ return driver.getPageSource();
+ //Do not work when there are requests following loading of main page (like frames)
+// String encoding = "ISO-8859-1";
+// if (response.getEntity().getContentEncoding() != null) {
+// encoding = response.getEntity().getContentEncoding().getValue();
+// }
+//
+// try {
+// return IOUtils.toString(response.getEntity().getContent(), encoding);
+// }
+// catch (IOException e) {
+// throw new RuntimeException(e);
+// }
}
public String getPageTitle() {
@@ -1018,7 +1020,7 @@
public IElement getElementByXPath(String xpath) {
try {
- return new WebDriverElementImpl(driver.findElement(By.xpath(xpath)));
+ return new WebDriverElementImpl(driver, driver.findElement(By.xpath(xpath)));
}
catch (NoSuchElementException e) {
return null;
@@ -1027,7 +1029,7 @@
public IElement getElementByID(String id) {
try {
- return new WebDriverElementImpl(driver.findElement(By.id(id)));
+ return new WebDriverElementImpl(driver, driver.findElement(By.id(id)));
}
catch (NoSuchElementException e) {
return null;
@@ -1038,7 +1040,7 @@
List<IElement> result = new ArrayList<IElement>();
List<WebElement> elements = driver.findElements(By.xpath(xpath));
for (WebElement child : elements) {
- result.add(new WebDriverElementImpl(child));
+ result.add(new WebDriverElementImpl(driver, child));
}
return result;
}
Modified: trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java 2011-12-30 15:06:39 UTC (rev 934)
+++ trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java 2012-01-27 09:43:35 UTC (rev 935)
@@ -18,10 +18,9 @@
*/
package net.sourceforge.jwebunit.webdriver;
-import org.junit.AfterClass;
-
import net.sourceforge.jwebunit.tests.ButtonAssertionsTest;
import net.sourceforge.jwebunit.tests.CharsetTest;
+import net.sourceforge.jwebunit.tests.ConcurrentJWebUnitTest;
import net.sourceforge.jwebunit.tests.CustomTesterTest;
import net.sourceforge.jwebunit.tests.ExpectedTableAssertionsHtmlTest;
import net.sourceforge.jwebunit.tests.ExpectedTableAssertionsXHtmlTest;
@@ -32,12 +31,10 @@
import net.sourceforge.jwebunit.tests.HtmlParsingTest;
import net.sourceforge.jwebunit.tests.IElementTest;
import net.sourceforge.jwebunit.tests.ImageTest;
-import net.sourceforge.jwebunit.tests.ConcurrentJWebUnitTest;
import net.sourceforge.jwebunit.tests.JavaScriptEventsTest;
import net.sourceforge.jwebunit.tests.JavaScriptTest;
import net.sourceforge.jwebunit.tests.NavigationTest;
import net.sourceforge.jwebunit.tests.NonHtmlContentTest;
-import net.sourceforge.jwebunit.tests.RedirectionTest;
import net.sourceforge.jwebunit.tests.ResourceBundleAssertionsTest;
import net.sourceforge.jwebunit.tests.ResponseServletTest;
import net.sourceforge.jwebunit.tests.SelectOptionsTest;
@@ -47,6 +44,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.runner.RunWith;
import org.junit.runners.Suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-07-25 12:38:41
|
Revision: 942
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=942&view=rev
Author: henryju
Date: 2012-07-25 12:38:29 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
Update HtmlUnit to version 2.10.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2012-07-25 12:30:31 UTC (rev 941)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2012-07-25 12:38:29 UTC (rev 942)
@@ -23,7 +23,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.9</version>
+ <version>2.10</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
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 2012-07-25 12:30:31 UTC (rev 941)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2012-07-25 12:38:29 UTC (rev 942)
@@ -174,7 +174,7 @@
/**
* The default browser version.
*/
- private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_3;
+ private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_3_6;
/**
* Should we ignore failing status codes?
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2012-07-25 12:30:31 UTC (rev 941)
+++ trunk/src/changes/changes.xml 2012-07-25 12:38:29 UTC (rev 942)
@@ -32,6 +32,9 @@
<body>
<release version="3.1" date="UNKNOW" description="Cleanup for Webdriver integration">
<action type="update" dev="henryju">
+ Updated to HtmlUnit 2.10.
+ </action>
+ <action type="update" dev="henryju">
getPageText() (and all related assertXX methods) now only deals with what is inside <body> element. Previously it was also returning page title for example.
</action>
<action type="update" dev="henryju">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-07-25 13:37:36
|
Revision: 944
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=944&view=rev
Author: henryju
Date: 2012-07-25 13:37:29 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
Update dependencies (including selenium).
Modified Paths:
--------------
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2012-07-25 13:10:22 UTC (rev 943)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2012-07-25 13:37:29 UTC (rev 944)
@@ -30,7 +30,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
- <version>2.17.0</version>
+ <version>2.25.0</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
@@ -41,7 +41,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
- <version>2.17.0</version>
+ <version>2.25.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
@@ -70,7 +70,7 @@
<dependency>
<groupId>biz.neustar</groupId>
<artifactId>browsermob-proxy</artifactId>
- <version>2.0-beta-3</version>
+ <version>2.0-beta-6</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-25 13:10:22 UTC (rev 943)
+++ trunk/pom.xml 2012-07-25 13:37:29 UTC (rev 944)
@@ -369,38 +369,38 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
- <version>1.3.RC2</version>
+ <version>1.3</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
- <version>1.3.RC2</version>
+ <version>1.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
- <version>7.3.1.v20110307</version>
+ <version>7.3.0.v20110203</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.6.1</version>
+ <version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
- <version>1.6.1</version>
+ <version>1.6.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>0.9.29</version>
+ <version>1.0.6</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>1.8.5</version>
+ <version>1.9.0</version>
<scope>test</scope>
</dependency>
</dependencies>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-08-16 19:41:59
|
Revision: 954
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=954&view=rev
Author: henryju
Date: 2012-08-16 19:41:52 +0000 (Thu, 16 Aug 2012)
Log Message:
-----------
[3476459] Do not include logback transitively and provide documentation on how to use it.
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/src/changes/changes.xml
trunk/src/site/site.xml
trunk/src/site/xdoc/quickstart.xml
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2012-08-16 19:40:21 UTC (rev 953)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2012-08-16 19:41:52 UTC (rev 954)
@@ -53,6 +53,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2012-08-16 19:40:21 UTC (rev 953)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2012-08-16 19:41:52 UTC (rev 954)
@@ -61,6 +61,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2012-08-16 19:40:21 UTC (rev 953)
+++ trunk/src/changes/changes.xml 2012-08-16 19:41:52 UTC (rev 954)
@@ -31,6 +31,10 @@
</properties>
<body>
<release version="3.1" date="UNKNOW" description="Cleanup for Webdriver integration">
+ <action type="update" dev="henryju" issue="3476459" due-to="Jevon Wright">
+ Updated dependencies to not provide logback transitively. Added a section in documentation
+ to explain how to use logback.
+ </action>
<action type="update" dev="henryju">
Updated to HtmlUnit 2.10.
</action>
Modified: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2012-08-16 19:40:21 UTC (rev 953)
+++ trunk/src/site/site.xml 2012-08-16 19:41:52 UTC (rev 954)
@@ -54,8 +54,12 @@
<item name="Installation" href="installation.html" />
<item name="Quick start" href="quickstart.html"
collapse="true">
- <item name="Creating a TestCase"
- href="#Creating_a_TestCase" />
+ <item name="JUnit 4"
+ href="#Creating_a_JUnit_4_TestCase" />
+ <item name="JUnit 3 (deprecated)"
+ href="#Creating_a_JUnit_3_TestCase_deprecated" />
+ <item name="Configuring logging"
+ href="#Configuring_logging" />
<item name="Selecting a plugin"
href="#Selecting_the_plugin_you_want_to_use" />
<item name="Site Navigation"
Modified: trunk/src/site/xdoc/quickstart.xml
===================================================================
--- trunk/src/site/xdoc/quickstart.xml 2012-08-16 19:40:21 UTC (rev 953)
+++ trunk/src/site/xdoc/quickstart.xml 2012-08-16 19:41:52 UTC (rev 954)
@@ -35,13 +35,13 @@
<p>
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>
+</p>
+<source>
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
public class ExampleWebTestCase {
- @Before
+ @Before
public void prepare() {
setBaseUrl("http://localhost:8080/test");
}
@@ -56,12 +56,12 @@
submit();
assertTitleEquals("Welcome, test!");
}
-}
- </source>
+}</source>
+<p>
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>
+</p>
+<source>
import net.sourceforge.jwebunit.junit.WebTester;
public class ExampleWebTestCase {
@@ -83,8 +83,8 @@
tester.submit();
tester.assertTitleEquals("Welcome, test!");
}
-}
- </source>
+}</source>
+<p>
In the following samples, JUnit 4 and static import will be used.
</p>
</subsection>
@@ -93,8 +93,8 @@
<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>
+</p>
+<source>
import net.sourceforge.jwebunit.junit.WebTestCase;
public class ExampleWebTestCase extends WebTestCase {
@@ -113,13 +113,14 @@
submit();
assertTitleEquals("Welcome, test!");
}
-}
- </source>
+}</source>
+<p>
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.
+ and assertions to it. This is provided in case you need or prefer delegation.<br/>
<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>
+</p>
+<source>
import junit.framework.TestCase;
import net.sourceforge.jwebunit.junit.WebTester;
@@ -141,37 +142,59 @@
tester.submit();
tester.assertTitleEquals("Welcome, test!");
}
-}
- </source>
-</p>
+}</source>
+
</subsection>
-<subsection name="Configuring Logback">
+<subsection name="Configuring logging">
<p>
- <a href="http://hc.apache.org/">Apache Commons' HTTP Components project</a>, one of the dependencies of JWebUnit, uses the <a href="http://logback.qos.ch/">logback logging framework</a> extensively.
- This means that if you do not have logback correctly configured, you will get <a href="http://stackoverflow.com/questions/4915414/disable-httpclient-logging">a lot of debug information</a> piped to stdout.
+ JWebUnit use <a href="http://www.slf4j.org/">SLF4J</a> to log. SLF4J is only a facade so with the default
+ Maven configuration you will only get slf4j-api in your classpath with no implementation. If you run your tests
+ you will see a message like this:
</p>
+<source>
+SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
+SLF4J: Defaulting to no-operation (NOP) logger implementation
+SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.</source>
+<p>
+ but no log at all.
+</p>
+<p>
+ Many popular logging framework do support SLF4J: log4j, jcl, logback, ... For example here are the steps to
+ configure <a href="http://logback.qos.ch/">logback logging framework</a>:<br/>
+ <br/>
+ First you should add logback JAR to your classpath. If you are using Maven, simply add:
+</p>
+<source><![CDATA[
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.0.6</version>
+ <scope>test</scope>
+ </dependency>]]></source>
<p>
- A simple way to configure logback is to create a file called <i>logback.xml</i> with the following contents, and placing it in your source folder (for example, <i>src</i>).
- This will suppress all debugging messages unless they are at the ERROR level or higher.
+ Now if you run your tests everything will be logged to console. Some components are very verbose so here is a sample logback configuration
+ to reduce verbosity. Just create a file called logback-test.xml in your classpath (<tt>src/test/resources</tt> is a good place if you are following
+ Maven conventions). This will suppress all debugging messages unless they are at the ERROR level or higher.
</p>
+<source><![CDATA[
+<configuration debug="false">
+ <!-- definition of appender STDOUT -->
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
+ </encoder>
+ </appender>
-<source>
-<configuration debug="false">
- <!-- definition of appender STDOUT -->
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
- </encoder>
- </appender>
-
- <root level="ERROR">
- <!-- appender referenced after it is defined -->
- <appender-ref ref="STDOUT"/>
- </root>
-</configuration>
-</source>
+ <root level="ERROR">
+ <!-- appender referenced after it is defined -->
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>]]></source>
+<p>
+ Please read <a href="http://logback.qos.ch/manual/configuration.html">logback documentation</a> for more details.
+</p>
</subsection>
<subsection name="Selecting the plugin you want to use">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-11-12 17:37:51
|
Revision: 957
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=957&view=rev
Author: henryju
Date: 2012-11-12 17:37:41 +0000 (Mon, 12 Nov 2012)
Log Message:
-----------
Update to HtmlUnit 2.11
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java
trunk/jwebunit-htmlunit-plugin/pom.xml
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/test/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImplTest.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
trunk/pom.xml
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java 2012-09-13 00:28:45 UTC (rev 956)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResponseServletTest.java 2012-11-12 17:37:41 UTC (rev 957)
@@ -19,6 +19,10 @@
package net.sourceforge.jwebunit.tests;
+import org.junit.Test;
+
+import java.net.SocketTimeoutException;
+
import static net.sourceforge.jwebunit.junit.JWebUnit.assertHeaderEquals;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertHeaderMatches;
import static net.sourceforge.jwebunit.junit.JWebUnit.assertHeaderNotPresent;
@@ -36,98 +40,99 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.net.SocketTimeoutException;
-
-import org.junit.Test;
-
/**
* Test redirection support.
- *
+ *
* @author Julien Henry
*/
public class ResponseServletTest extends JWebUnitAPITestCase {
- public void setUp() throws Exception {
- super.setUp();
- setIgnoreFailingStatusCodes(true); // ignore failing status codes
- setBaseUrl(HOST_PATH + "/ResponseServletTest");
- }
+ public void setUp() throws Exception {
+ super.setUp();
+ setIgnoreFailingStatusCodes(true); // ignore failing status codes
+ setBaseUrl(HOST_PATH + "/ResponseServletTest");
+ }
- /*
- * currently we can't get the response code from HtmlUnit unless it is a failing code
- */
- @Test public void testDefault() {
- beginAt("/SimpleForm.html");
- submit();
- assertResponseCodeBetween(200, 299);
-
- // test the headers
- assertHeaderPresent("Test");
- assertHeaderNotPresent("Not-present");
- assertHeaderEquals("Test", "test2");
- assertHeaderMatches("Header-Added", "[0-9]{2}");
- }
+ /*
+ * currently we can't get the response code from HtmlUnit unless it is a failing code
+ */
+ @Test
+ public void testDefault() {
+ beginAt("/SimpleForm.html");
+ submit();
+ assertResponseCodeBetween(200, 299);
- @Test public void testResponse200() {
- beginAt("/SimpleForm.html");
- setTextField("status", "200");
- submit();
- assertResponseCode(200);
- }
+ // test the headers
+ assertHeaderPresent("Test");
+ assertHeaderNotPresent("Not-present");
+ assertHeaderEquals("Test", "test2");
+ assertHeaderMatches("Header-Added", "[0-9]{2}");
+ }
- /*
- * HtmlUnit cannot handle a 301 without a valid Location: header
+ @Test
+ public void testResponse200() {
+ beginAt("/SimpleForm.html");
+ setTextField("status", "200");
+ submit();
+ assertResponseCode(200);
+ }
+
+ /*
+ * HtmlUnit cannot handle a 301 without a valid Location: header
@Test public void testResponse301() {
beginAt("/SimpleForm.html");
setTextField("status", "301");
submit();
assertResponseCode(301);
}
- */
+ */
- @Test public void testResponse404() {
- beginAt("/SimpleForm.html");
- assertTitleEquals("response form");
- setTextField("status", "404");
- submit();
- assertResponseCode(404);
- }
+ @Test
+ public void testResponse404() {
+ beginAt("/SimpleForm.html");
+ assertTitleEquals("response form");
+ setTextField("status", "404");
+ submit();
+ assertResponseCode(404);
+ }
- @Test public void testResponse501() {
- beginAt("/SimpleForm.html");
- assertTitleEquals("response form");
- setTextField("status", "501");
- submit();
- assertResponseCode(501);
+ @Test
+ public void testResponse501() {
+ beginAt("/SimpleForm.html");
+ assertTitleEquals("response form");
+ setTextField("status", "501");
+ submit();
+ assertResponseCode(501);
+ }
+
+ /**
+ * Issue 1674646: add support for specifying the timeout of pages
+ */
+ @Test
+ public void testTimeout() {
+
+ // test that timeout was fired
+ setTimeout(500); // specify a global timeout of 0.5 seconds (must be set before the WebConnection is initialised)
+ beginAt("/SimpleForm.html");
+ assertTitleEquals("response form");
+ setTextField("timeout", "1"); // server wait for 1 seconds
+ try {
+ submit();
+ fail("timeout was not called"); // we should not get here
+ } catch (RuntimeException e) {
+ assertTrue("timeout caused by SocketTimeoutException, but was " + e.getCause().getClass(), e.getCause() instanceof SocketTimeoutException);
}
-
- /**
- * Issue 1674646: add support for specifying the timeout of pages
- */
- @Test public void testTimeout() {
-
- // test that timeout was fired
- setTimeout(500); // specify a global timeout of 0.5 seconds (must be set before the WebConnection is initialised)
- beginAt("/SimpleForm.html");
- assertTitleEquals("response form");
- setTextField("timeout", "1"); // server wait for 1 seconds
- try {
- submit();
- fail("timeout was not called"); // we should not get here
- } catch (RuntimeException e) {
- assertTrue("timeout caused by SocketTimeoutException, but was " + e.getCause().getClass(), e.getCause() instanceof SocketTimeoutException);
- }
-
- // close and reset the browser
- closeBrowser();
-
- // test that timeout wasn't fired
- setTimeout(2000); // specify a global timeout of 2 seconds (must be set before the WebConnection is initialised)
- beginAt("/SimpleForm.html");
- assertTitleEquals("response form");
- setTextField("timeout", "1"); // server wait for 1 seconds
- submit();
- assertTextPresent("hello, world!");
- }
+ // close and reset the browser
+ closeBrowser();
+
+ // test that timeout wasn't fired
+ setTimeout(2000); // specify a global timeout of 2 seconds (must be set before the WebConnection is initialised)
+ beginAt("/SimpleForm.html");
+ assertTitleEquals("response form");
+ setTextField("timeout", "1"); // server wait for 1 seconds
+ submit();
+ assertTextPresent("hello, world!");
+ }
+
}
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2012-09-13 00:28:45 UTC (rev 956)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2012-11-12 17:37:41 UTC (rev 957)
@@ -23,7 +23,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.10</version>
+ <version>2.11</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
Modified: trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java 2012-09-13 00:28:45 UTC (rev 956)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitElementImpl.java 2012-11-12 17:37:41 UTC (rev 957)
@@ -17,194 +17,204 @@
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
*/
/**
- *
+ *
*/
package net.sourceforge.jwebunit.htmlunit;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.sourceforge.jwebunit.api.IElement;
-
+import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlOption;
import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
+import net.sourceforge.jwebunit.api.IElement;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* HtmlUnit implementation of IElement wrapper.
- *
+ *
* @author jmwright
*
*/
public class HtmlUnitElementImpl implements IElement {
-
- /**
- * The wrapped element.
- */
- private HtmlElement element;
-
- public HtmlUnitElementImpl(HtmlElement element) {
- if (element == null)
- throw new NullPointerException("Cannot create an IElement for a null element.");
- this.element = element;
- }
+ /**
+ * The wrapped element.
+ */
+ private DomElement element;
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#attribute(java.lang.String)
- */
- public String getAttribute(String name) {
- if ("value".equals(name) && element instanceof HtmlOption) {
- // for options, we want text if no value was specified
- return ((HtmlOption) element).getValueAttribute();
- } else {
- if (!element.hasAttribute(name))
- return null;
-
- return element.getAttribute(name);
- }
- }
+ public HtmlUnitElementImpl(DomElement element) {
+ if (element == null)
+ throw new NullPointerException("Cannot create an IElement for a null element.");
+ this.element = element;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#attribute(java.lang.String)
+ */
+ public String getAttribute(String name) {
+ if ("value".equals(name) && element instanceof HtmlOption) {
+ // for options, we want text if no value was specified
+ return ((HtmlOption) element).getValueAttribute();
+ } else {
+ if (!element.hasAttribute(name))
+ return null;
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#name()
- */
- public String getName() {
- return element.getNodeName();
- }
+ return element.getAttribute(name);
+ }
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#name()
+ */
+ public String getName() {
+ return element.getNodeName();
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#getChildren()
- */
- public List<IElement> getChildren() {
- List<IElement> children = new ArrayList<IElement>();
- for (HtmlElement e : element.getChildElements()) {
- if (e != null)
- children.add(new HtmlUnitElementImpl(e));
- }
- return children;
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getChildren()
+ */
+ public List<IElement> getChildren() {
+ List<IElement> children = new ArrayList<IElement>();
+ for (DomElement e : element.getChildElements()) {
+ if (e != null)
+ children.add(new HtmlUnitElementImpl(e));
+ }
+ return children;
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getParent()
+ */
+ public IElement getParent() {
+ DomNode p = element.getParentNode();
+ while (true) {
+ if (p == null)
+ return null;
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#getParent()
- */
- public IElement getParent() {
- DomNode p = element.getParentNode();
- while (true) {
- if (p == null)
- return null;
-
- if (p instanceof HtmlElement)
- return new HtmlUnitElementImpl((HtmlElement) p);
-
- // get next parent
- p = p.getParentNode();
- }
- }
+ if (p instanceof HtmlElement)
+ return new HtmlUnitElementImpl((HtmlElement) p);
+ // get next parent
+ p = p.getParentNode();
+ }
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#getTextContent()
- */
- public String getTextContent() {
- return element.getTextContent();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getTextContent()
+ */
+ public String getTextContent() {
+ return element.getTextContent();
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getElement(java.lang.String)
+ */
+ public IElement getElement(String xpath) {
+ // if this fails with a ClassCastException, use getElements().get(0) (performance penalty)
+ return new HtmlUnitElementImpl((HtmlElement) element.getFirstByXPath(xpath));
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#getElement(java.lang.String)
- */
- public IElement getElement(String xpath) {
- // if this fails with a ClassCastException, use getElements().get(0) (performance penalty)
- return new HtmlUnitElementImpl((HtmlElement) element.getFirstByXPath(xpath));
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#getElements(java.lang.String)
+ */
+ public List<IElement> getElements(String xpath) {
+ List<IElement> elements = new ArrayList<IElement>();
+ for (Object o : element.getByXPath(xpath)) {
+ if (o instanceof HtmlElement)
+ elements.add(new HtmlUnitElementImpl((HtmlElement) o));
+ }
+ return elements;
+ }
+ public String toString() {
+ return "IElement[name=" + getName() + " wrapped=" + element + "]";
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#getElements(java.lang.String)
- */
- public List<IElement> getElements(String xpath) {
- List<IElement> elements = new ArrayList<IElement>();
- for (Object o : element.getByXPath(xpath)) {
- if (o instanceof HtmlElement)
- elements.add(new HtmlUnitElementImpl((HtmlElement) o));
- }
- return elements;
- }
-
- public String toString() {
- return "IElement[name=" + getName() + " wrapped=" + element + "]";
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String)
+ */
+ public void setAttribute(String string) {
+ element.setAttributeNS(null, string, "1");
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String, java.lang.String)
+ */
+ public void setAttribute(String name, String value) {
+ if ("value".equals(name) && element instanceof HtmlInput) {
+ // for HtmlInputs, we want to run any onChange code if the value changes
+ ((HtmlInput) element).setValueAttribute(value);
+ } else {
+ element.setAttribute(name, value);
+ }
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String)
- */
- public void setAttribute(String string) {
- element.setAttributeNS(null, string, "1");
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see net.sourceforge.jwebunit.api.IElement#setTextContent(java.lang.String)
+ */
+ public void setTextContent(String value) {
+ if (element instanceof HtmlTextArea) {
+ ((HtmlTextArea) element).setText(value);
+ } else {
+ element.setTextContent(value);
+ }
+ }
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((element == null) ? 0 : element.hashCode());
+ return result;
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#setAttribute(java.lang.String, java.lang.String)
- */
- public void setAttribute(String name, String value) {
- if ("value".equals(name) && element instanceof HtmlInput) {
- // for HtmlInputs, we want to run any onChange code if the value changes
- ((HtmlInput) element).setValueAttribute(value);
- } else {
- element.setAttribute(name, value);
- }
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final HtmlUnitElementImpl other = (HtmlUnitElementImpl) obj;
+ if (element == null) {
+ if (other.element != null)
+ return false;
+ } else if (!element.equals(other.element))
+ return false;
+ return true;
+ }
+ /**
+ * Return the unwrapped HtmlUnit element that this IElement represents.
+ *
+ * @return the HtmlUnit element this IElement represents.
+ */
+ public DomElement getHtmlElement() {
+ return element;
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.jwebunit.api.IElement#setTextContent(java.lang.String)
- */
- public void setTextContent(String value) {
- if (element instanceof HtmlTextArea) {
- ((HtmlTextArea) element).setText(value);
- } else {
- element.setTextContent(value);
- }
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((element == null) ? 0 : element.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final HtmlUnitElementImpl other = (HtmlUnitElementImpl) obj;
- if (element == null) {
- if (other.element != null)
- return false;
- } else if (!element.equals(other.element))
- return false;
- return true;
- }
-
- /**
- * Return the unwrapped HtmlUnit element that this IElement represents.
- *
- * @return the HtmlUnit element this IElement represents.
- */
- public HtmlElement getHtmlElement() {
- return element;
- }
-
}
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 2012-09-13 00:28:45 UTC (rev 956)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2012-11-12 17:37:41 UTC (rev 957)
@@ -18,51 +18,6 @@
*/
package net.sourceforge.jwebunit.htmlunit;
-import com.gargoylesoftware.htmlunit.TopLevelWindow;
-
-import net.sourceforge.jwebunit.api.HttpHeader;
-
-import org.apache.http.auth.AuthScope;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import net.sourceforge.jwebunit.api.IElement;
-import net.sourceforge.jwebunit.api.ITestingEngine;
-import net.sourceforge.jwebunit.exception.ExpectedJavascriptAlertException;
-import net.sourceforge.jwebunit.exception.ExpectedJavascriptConfirmException;
-import net.sourceforge.jwebunit.exception.ExpectedJavascriptPromptException;
-import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
-import net.sourceforge.jwebunit.exception.UnableToSetFormException;
-import net.sourceforge.jwebunit.exception.UnexpectedJavascriptAlertException;
-import net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException;
-import net.sourceforge.jwebunit.exception.UnexpectedJavascriptPromptException;
-import net.sourceforge.jwebunit.html.Cell;
-import net.sourceforge.jwebunit.html.Row;
-import net.sourceforge.jwebunit.html.Table;
-import net.sourceforge.jwebunit.javascript.JavascriptAlert;
-import net.sourceforge.jwebunit.javascript.JavascriptConfirm;
-import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
-import net.sourceforge.jwebunit.util.TestContext;
-
-import org.apache.regexp.RE;
-import org.apache.regexp.RESyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
import com.gargoylesoftware.htmlunit.AlertHandler;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.ConfirmHandler;
@@ -75,6 +30,7 @@
import com.gargoylesoftware.htmlunit.PromptHandler;
import com.gargoylesoftware.htmlunit.RefreshHandler;
import com.gargoylesoftware.htmlunit.TextPage;
+import com.gargoylesoftware.htmlunit.TopLevelWindow;
import com.gargoylesoftware.htmlunit.UnexpectedPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebResponse;
@@ -103,2313 +59,2344 @@
import com.gargoylesoftware.htmlunit.html.HtmlTable;
import com.gargoylesoftware.htmlunit.html.HtmlTableCell;
import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
-import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
import com.gargoylesoftware.htmlunit.html.HtmlTableRow.CellIterator;
+import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
import com.gargoylesoftware.htmlunit.util.Cookie;
import com.gargoylesoftware.htmlunit.util.NameValuePair;
import com.gargoylesoftware.htmlunit.xml.XmlPage;
+import net.sourceforge.jwebunit.api.HttpHeader;
+import net.sourceforge.jwebunit.api.IElement;
+import net.sourceforge.jwebunit.api.ITestingEngine;
+import net.sourceforge.jwebunit.exception.ExpectedJavascriptAlertException;
+import net.sourceforge.jwebunit.exception.ExpectedJavascriptConfirmException;
+import net.sourceforge.jwebunit.exception.ExpectedJavascriptPromptException;
+import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
+import net.sourceforge.jwebunit.exception.UnableToSetFormException;
+import net.sourceforge.jwebunit.exception.UnexpectedJavascriptAlertException;
+import net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException;
+import net.sourceforge.jwebunit.exception.UnexpectedJavascriptPromptException;
+import net.sourceforge.jwebunit.html.Cell;
+import net.sourceforge.jwebunit.html.Row;
+import net.sourceforge.jwebunit.html.Table;
+import net.sourceforge.jwebunit.javascript.JavascriptAlert;
+import net.sourceforge.jwebunit.javascript.JavascriptConfirm;
+import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
+import net.sourceforge.jwebunit.util.TestContext;
+import org.apache.http.auth.AuthScope;
+import org.apache.regexp.RE;
+import org.apache.regexp.RESyntaxException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
/**
* Acts as the wrapper for HtmlUnit access. A testing engine is initialized with a given URL, and maintains conversational state
* as the dialog progresses through link navigation, form submission, etc.
- *
+ *
* @author Julien Henry
- *
+ *
*/
public class HtmlUnitTestingEngineImpl implements ITestingEngine {
- /**
- * Logger for this class.
- */
- private final Logger logger = LoggerFactory.getLogger(HtmlUnitTestingEngineImpl.class);
+ /**
+ * Logger for this class.
+ */
+ private final Logger logger = LoggerFactory.getLogger(HtmlUnitTestingEngineImpl.class);
- /**
- * holder for alternative refresh handler.
- */
- private RefreshHandler refreshHandler;
- /**
- * Encapsulate browser abilities.
- */
- private WebClient wc;
+ /**
+ * holder for alternative refresh handler.
+ */
+ private RefreshHandler refreshHandler;
+ /**
+ * Encapsulate browser abilities.
+ */
+ private WebClient wc;
- /**
- * The currently selected window.
- */
- private WebWindow win;
+ /**
+ * The currently selected window.
+ */
+ private WebWindow win;
- /**
- * A ref to the test context.
- */
- private TestContext testContext;
+ /**
+ * A ref to the test context.
+ */
+ private TestContext testContext;
- /**
- * The currently selected form.
- */
- private HtmlForm form;
+ /**
+ * The currently selected form.
+ */
+ private HtmlForm form;
- /**
- * Is Javascript enabled.
- */
- private boolean jsEnabled = true;
+ /**
+ * Is Javascript enabled.
+ */
+ private boolean jsEnabled = true;
- /**
- * Should throw exception on Javascript error.
- */
- private boolean throwExceptionOnScriptError = true;
+ /**
+ * Should throw exception on Javascript error.
+ */
+ private boolean throwExceptionOnScriptError = true;
- /**
- * Javascript alerts.
- */
- private List<JavascriptAlert> expectedJavascriptAlerts = new LinkedList<JavascriptAlert>();
+ /**
+ * Javascript alerts.
+ */
+ private List<JavascriptAlert> expectedJavascriptAlerts = new LinkedList<JavascriptAlert>();
- /**
- * Javascript confirms.
- */
- private List<JavascriptConfirm> expectedJavascriptConfirms = new LinkedList<JavascriptConfirm>();
+ /**
+ * Javascript confirms.
+ */
+ private List<JavascriptConfirm> expectedJavascriptConfirms = new LinkedList<JavascriptConfirm>();
- /**
- * Javascript prompts.
- */
- private List<JavascriptPrompt> expectedJavascriptPrompts = new LinkedList<JavascriptPrompt>();
-
- /**
- * The default browser version.
- */
- private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_3_6;
-
- /**
+ /**
+ * Javascript prompts.
+ */
+ private List<JavascriptPrompt> expectedJavascriptPrompts = new LinkedList<JavascriptPrompt>();
+
+ /**
+ * The default browser version.
+ */
+ private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_3_6;
+
+ /**
* Should we ignore failing status codes?
*/
- private boolean ignoreFailingStatusCodes = false;
-
- /**
- * Do we provide a timeout limit (in seconds)? Default 0 = unlimited timeout.
- */
- private int timeout = 0;
-
- // Implementation of IJWebUnitDialog
+ private boolean ignoreFailingStatusCodes = false;
- /**
- * Initializes default HtmlUnit testing engine implementation.
- */
- public HtmlUnitTestingEngineImpl() {
- }
+ /**
+ * Do we provide a timeout limit (in seconds)? Default 0 = unlimited timeout.
+ */
+ private int timeout = 0;
- /**
- * Initializes HtmlUnit testing engine implementation with web client.
- *
- * @param client web client
- */
- HtmlUnitTestingEngineImpl(WebClient client) {
- this.wc = client;
- }
+ // Implementation of IJWebUnitDialog
- /**
- * Begin a dialog with an initial URL and test client context.
- *
- * @param initialURL absolute url at which to begin dialog.
- * @param context contains context information for the test client.
- * @throws TestingEngineResponseException
- */
- public void beginAt(URL initialURL, TestContext context)
- throws TestingEngineResponseException {
- this.setTestContext(context);
- initWebClient();
- gotoPage(initialURL);
- }
+ /**
+ * Initializes default HtmlUnit testing engine implementation.
+ */
+ public HtmlUnitTestingEngineImpl() {
+ }
- /**
- * Close the browser and check that all expected Javascript alerts, confirms and
- * prompts have been taken care of.
- */
- public void closeBrowser() throws ExpectedJavascriptAlertException,
- ExpectedJavascriptConfirmException,
- ExpectedJavascriptPromptException {
- if (wc!=null) {
- wc.closeAllWindows();
- wc = null;
- }
- form = null; // reset current form
- if (this.expectedJavascriptAlerts.size() > 0) {
- throw new ExpectedJavascriptAlertException(
- ((JavascriptAlert) (expectedJavascriptAlerts.get(0)))
- .getMessage());
- }
- if (this.expectedJavascriptConfirms.size() > 0) {
- throw new ExpectedJavascriptConfirmException(
- ((JavascriptConfirm) (expectedJavascriptConfirms.get(0)))
- .getMessage());
- }
- if (this.expectedJavascriptPrompts.size() > 0) {
- throw new ExpectedJavascriptPromptException(
- ((JavascriptPrompt) (expectedJavascriptPrompts.get(0)))
- .getMessage());
- }
+ /**
+ * Initializes HtmlUnit testing engine implementation with web client.
+ *
+ * @param client web client
+ */
+ HtmlUnitTestingEngineImpl(WebClient client) {
+ this.wc = client;
+ }
- }
+ /**
+ * Begin a dialog with an initial URL and test client context.
+ *
+ * @param initialURL absolute url at which to begin dialog.
+ * @param context contains context information for the test client.
+ * @throws TestingEngineResponseException
+ */
+ public void beginAt(URL initialURL, TestContext context)
+ throws TestingEngineResponseException {
+ this.setTestContext(context);
+ initWebClient();
+ gotoPage(initialURL);
+ }
- /**
- * Go to a particular page.
- *
- * @throws TestingEngineResponseException if an error response code is encountered
- * and ignoreFailingStatusCodes is not enabled.
- */
- public void gotoPage(URL initialURL) throws TestingEngineResponseException {
- try {
- wc.getPage(initialURL);
- win = wc.getCurrentWindow();
- form = null;
- } catch (FailingHttpStatusCodeException ex) {
- // only throw exception if necessary
- if (!ignoreFailingStatusCodes) {
- throw new TestingEngineResponseException(ex.getStatusCode(),
- "unexpected status code ["+ex.getStatusCode()+"] at URL: ["+initi...
[truncated message content] |
|
From: <he...@us...> - 2012-11-22 09:38:15
|
Revision: 958
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=958&view=rev
Author: henryju
Date: 2012-11-22 09:37:57 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
Prepare release 3.1
Modified Paths:
--------------
trunk/LICENSE.txt
trunk/README.txt
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/ConcurrentJWebUnitTest.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/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/CookiesServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/HeadersServlet.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-webdriver-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/jwebunit-webdriver-plugin/src/site/site.xml
trunk/jwebunit-webdriver-plugin/src/site/xdoc/index.xml
trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/JWebUnitTest.java
trunk/pom.xml
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/LICENSE.txt
===================================================================
--- trunk/LICENSE.txt 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/LICENSE.txt 2012-11-22 09:37:57 UTC (rev 958)
@@ -2,7 +2,7 @@
/********************************************************************************
* JWebUnit, simplified web testing API
- * Copyright (c) 2010, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
* http://jwebunit.sourceforge.net
*
* JWebUnit is free software: you can redistribute it and/or modify
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/README.txt 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,4 +1,4 @@
-The JWebUnit team is pleased to announce the JWebUnit 3.0 release!
+The JWebUnit team is pleased to announce the JWebUnit 3.1 release!
http://jwebunit.sourceforge.net
Modified: trunk/jwebunit-code-generator/src/site/site.xml
===================================================================
--- trunk/jwebunit-code-generator/src/site/site.xml 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-code-generator/src/site/site.xml 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2011, JWebUnit team.
+ Copyright (c) 2002-2012, JWebUnit team.
This file is part of JWebUnit.
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of 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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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/CustomTesterTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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/ExpectedTableAssertionsHtmlTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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/FormAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of 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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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.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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of 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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HelloWorldTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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.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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, JWebUnit team.
*
* This file is part of JWebUnit.
*
@@ -34,7 +34,7 @@
/**
* This class is intended be used by all "testcase" classes that are used to test the functionality of the jwebunit core
* api. This isn't to be extended by end users of the jwebunit api.
- *
+ *
* @author Nicholas Neuberger
*/
public abstract class JWebUnitAPITestCase extends JettySetup {
@@ -53,7 +53,7 @@
getTestContext().setBaseUrl(HOST_PATH);
getTestContext().setAuthorization("admin", "admin");
}
-
+
@After
public void closeBrowser() {
JWebUnit.closeBrowser();
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 2012-11-12 17:37:41 UTC (rev 957)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.java 2012-11-22 09:37:57 UTC (rev 958)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011, JWebUnit team.
+ * Copyright (c) 2002-2012, 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.assertButtonPresent;
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java 201...
[truncated message content] |
|
From: <he...@us...> - 2012-11-22 09:49:02
|
Revision: 959
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=959&view=rev
Author: henryju
Date: 2012-11-22 09:48:51 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
[maven-release-plugin] prepare release jwebunit-3.1
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-webdriver-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/jwebunit-code-generator/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/jwebunit-commons-tests/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/jwebunit-core/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -1,9 +1,8 @@
-<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/xsd/maven-4.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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-22 09:37:57 UTC (rev 958)
+++ trunk/pom.xml 2012-11-22 09:48:51 UTC (rev 959)
@@ -3,7 +3,7 @@
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>3.1-SNAPSHOT</version>
+ <version>3.1</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
@@ -183,9 +183,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.1</connection>
+ <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.1</developerConnection>
+ <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/tags/jwebunit-3.1</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...> - 2012-11-22 09:49:27
|
Revision: 961
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=961&view=rev
Author: henryju
Date: 2012-11-22 09:49:16 +0000 (Thu, 22 Nov 2012)
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-webdriver-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/jwebunit-code-generator/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1</version>
+ <version>3.2-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 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/jwebunit-commons-tests/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1</version>
+ <version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/jwebunit-core/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1</version>
+ <version>3.2-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 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1</version>
+ <version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.1</version>
+ <version>3.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-22 09:49:07 UTC (rev 960)
+++ trunk/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
@@ -3,7 +3,7 @@
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>3.1</version>
+ <version>3.2-SNAPSHOT</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
@@ -183,9 +183,9 @@
</license>
</licenses>
<scm>
- <connection>scm:svn:http://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.1</connection>
- <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.1</developerConnection>
- <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/tags/jwebunit-3.1</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...> - 2012-11-22 11:21:58
|
Revision: 962
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=962&view=rev
Author: henryju
Date: 2012-11-22 11:21:47 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
Fix a few things detected during the release.
Modified Paths:
--------------
trunk/pom.xml
trunk/src/changes/changes.xml
trunk/src/site/xdoc/how-to-release.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-22 09:49:16 UTC (rev 961)
+++ trunk/pom.xml 2012-11-22 11:21:47 UTC (rev 962)
@@ -283,7 +283,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
+ <dependencies>
+ <dependency><!-- add support for ssh/scp -->
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -573,7 +580,7 @@
<id>jwebunit-website</id>
<name>JWebUnit WebSite - Sourceforge</name>
<url>
- scp://web.sourceforge.net/home/project-web/jwebunit/htdocs
+ scp://shell.sourceforge.net/home/project-web/jwebunit/htdocs
</url>
</site>
<snapshotRepository>
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2012-11-22 09:49:16 UTC (rev 961)
+++ trunk/src/changes/changes.xml 2012-11-22 11:21:47 UTC (rev 962)
@@ -47,8 +47,6 @@
<action type="update" dev="henryju">
Deprecated gotoWindow(windowID) method as implementation is not stable and window ID is not something well-defined.
</action>
- </release>
- <release version="3.0.1" date="UNKNOW" description="Minor fixes">
<action type="fix" dev="henryju" issue="3395872" due-to="Tim Pizey">
HtmlUnitTestingEngineImpl.gotoPage no longer returns the failing status. Broken since 2.5 after applying
patch from issue 1864365.
Modified: trunk/src/site/xdoc/how-to-release.xml
===================================================================
--- trunk/src/site/xdoc/how-to-release.xml 2012-11-22 09:49:16 UTC (rev 961)
+++ trunk/src/site/xdoc/how-to-release.xml 2012-11-22 11:21:47 UTC (rev 962)
@@ -69,19 +69,21 @@
<subsection name="Preparing the release (tag and update pom)">
<p>
This process is automatically done by maven-release-plugin.
- <source>mvn release:prepare -Dusername=henryju -Dpassword=XXXXXX</source>
- Don't forget to put your own sourceforge account and password.<br/>
+ <source>mvn release:prepare</source>
The plugin will ask for next release version, tag name and next development version. Most of the time defaults are ok.<br/>
- <em>NB:</em> Sometimes with SVN 1.5 the tag operation fails with a message like <tt>file XXX already exists</tt>. The solution is
- to run <tt>svn update</tt> then run <tt>mvn release:prepare -Dusername=henryju -Dpassword=XXXXXX</tt> again.
</p>
<p>
Now the tag is done in SVN and the trunk is ready for next developments. It's time to actually do the release.
</p>
</subsection>
<subsection name="Perform the release (deploy artifacts and site)">
- <p>
- The process is done by maven-release-plugin.
+ <p>
+ Create a shell on sourceforge (<a href="http://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html">more informations</a>).
+ <source>ssh -t henryju,jwe...@sh... create</source>
+ Then exit the shell (type exit).
+ </p>
+ <p>
+ The release process is done by maven-release-plugin:
<source>mvn release:perform -Darguments="-Dgpg.passphrase=XXXXXXXXXX"</source>
</p>
<p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2012-11-27 15:39:53
|
Revision: 963
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=963&view=rev
Author: henryju
Date: 2012-11-27 15:39:46 +0000 (Tue, 27 Nov 2012)
Log Message:
-----------
[3415400] Configure HtmlUnit to accept self-signed certificates
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/src/changes/changes.xml
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 2012-11-22 11:21:47 UTC (rev 962)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2012-11-27 15:39:46 UTC (rev 963)
@@ -205,6 +205,7 @@
* @param context contains context information for the test client.
* @throws TestingEngineResponseException
*/
+ @Override
public void beginAt(URL initialURL, TestContext context)
throws TestingEngineResponseException {
this.setTestContext(context);
@@ -216,6 +217,7 @@
* Close the browser and check that all expected Javascript alerts, confirms and
* prompts have been taken care of.
*/
+ @Override
public void closeBrowser() throws ExpectedJavascriptAlertException,
ExpectedJavascriptConfirmException,
ExpectedJavascriptPromptException {
@@ -226,17 +228,17 @@
form = null; // reset current form
if (this.expectedJavascriptAlerts.size() > 0) {
throw new ExpectedJavascriptAlertException(
- ((JavascriptAlert) (expectedJavascriptAlerts.get(0)))
+ (expectedJavascriptAlerts.get(0))
.getMessage());
}
if (this.expectedJavascriptConfirms.size() > 0) {
throw new ExpectedJavascriptConfirmException(
- ((JavascriptConfirm) (expectedJavascriptConfirms.get(0)))
+ (expectedJavascriptConfirms.get(0))
.getMessage());
}
if (this.expectedJavascriptPrompts.size() > 0) {
throw new ExpectedJavascriptPromptException(
- ((JavascriptPrompt) (expectedJavascriptPrompts.get(0)))
+ (expectedJavascriptPrompts.get(0))
.getMessage());
}
@@ -248,6 +250,7 @@
* @throws TestingEngineResponseException if an error response code is encountered
* and ignoreFailingStatusCodes is not enabled.
*/
+ @Override
public void gotoPage(URL initialURL) throws TestingEngineResponseException {
try {
wc.getPage(initialURL);
@@ -264,6 +267,7 @@
/**
* @see net.sourceforge.jwebunit.api.IJWebUnitDialog#setScriptingEnabled(boolean)
*/
+ @Override
public void setScriptingEnabled(boolean value) {
// This variable is used to set Javascript before wc is instancied
jsEnabled = value;
@@ -272,6 +276,7 @@
}
}
+ @Override
public void setThrowExceptionOnScriptError(boolean value) {
throwExceptionOnScriptError = value;
if (wc != null) {
@@ -279,6 +284,7 @@
}
}
+ @Override
public List<javax.servlet.http.Cookie> getCookies() {
List<javax.servlet.http.Cookie> result = new LinkedList<javax.servlet.http.Cookie>();
Set<Cookie> cookies = wc.getCookieManager().getCookies();
@@ -304,6 +310,7 @@
return result;
}
+ @Override
public boolean hasWindow(String windowName) {
try {
getWindow(windowName);
@@ -313,6 +320,7 @@
return true;
}
+ @Override
public boolean hasWindowByTitle(String title) {
return getWindowByTitle(title) != null;
}
@@ -322,14 +330,17 @@
*
* @param windowName
*/
+ @Override
public void gotoWindow(String windowName) {
setMainWindow(getWindow(windowName));
}
+ @Override
public void gotoWindow(int windowID) {
- setMainWindow((WebWindow) wc.getWebWindows().get(windowID));
+ setMainWindow(wc.getWebWindows().get(windowID));
}
+ @Override
public int getWindowCount() {
return wc.getWebWindows().size();
}
@@ -339,6 +350,7 @@
*
* @param title
*/
+ @Override
public void gotoWindowByTitle(String title) {
WebWindow window = getWindowByTitle(title);
if (window != null) {
@@ -352,6 +364,7 @@
/**
* Close the current window.
*/
+ @Override
public void closeWindow() {
if (win != null) {
((TopLevelWindow) win.getTopWindow()).close();
@@ -364,6 +377,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasFrame(String frameNameOrId) {
return getFrame(frameNameOrId) != null;
}
@@ -371,6 +385,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void gotoFrame(String frameNameOrId) {
WebWindow frame = getFrame(frameNameOrId);
if (frame == null) {
@@ -382,6 +397,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void setWorkingForm(int index) {
setWorkingForm(getForm(index));
}
@@ -389,6 +405,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void setWorkingForm(String nameOrId, int index) {
setWorkingForm(getForm(nameOrId, index));
}
@@ -396,6 +413,7 @@
/**
* Return true if the current response contains a form.
*/
+ @Override
public boolean hasForm() {
return ((HtmlPage) win.getEnclosedPage()).getForms().size() > 0;
}
@@ -405,16 +423,19 @@
*
* @param nameOrID name of id of the form to check for.
*/
+ @Override
public boolean hasForm(String nameOrID) {
return getForm(nameOrID) != null;
}
+ @Override
public boolean hasFormParameterNamed(String paramName) {
for (HtmlElement e : getCurrentPage().getHtmlElementDescendants()) {
if (e.getAttribute("name").equals(paramName)) {
// set the working form if none has been set
- if (e.getEnclosingForm() != null && getWorkingForm() == null)
+ if (e.getEnclosingForm() != null && getWorkingForm() == null) {
setWorkingForm(e.getEnclosingForm());
+ }
return true;
}
}
@@ -427,6 +448,7 @@
* @param paramName name of the input element. TODO: Find a way to handle multiple text input element with same
* name.
*/
+ @Override
public String getTextFieldValue(String paramName) {
// first try the current form
if (form != null) {
@@ -447,14 +469,16 @@
if (outside_element != null) {
if (outside_element instanceof HtmlInput) {
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return ((HtmlInput) outside_element).getValueAttribute();
}
if (outside_element instanceof HtmlTextArea) {
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return ((HtmlTextArea) outside_element).getText();
}
}
@@ -471,6 +495,7 @@
* @param paramName name of the input element. TODO: Find a way to handle multiple hidden input element with same
* name.
*/
+ @Override
public String getHiddenFieldValue(String paramName) {
// first try the current form
if (form != null) {
@@ -487,8 +512,9 @@
if (outside_element != null) {
if (outside_element instanceof HtmlHiddenInput) {
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return ((HtmlHiddenInput) outside_element).getValueAttribute();
}
}
@@ -504,6 +530,7 @@
* @param fieldName name of the input element or textarea
* @param text parameter value to submit for the element.
*/
+ @Override
public void setTextField(String paramName, String text) {
// first try the current form
if (form != null) {
@@ -527,15 +554,17 @@
if (outside_element instanceof HtmlInput) {
((HtmlInput) outside_element).setValueAttribute(text);
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return;
}
if (outside_element instanceof HtmlTextArea) {
((HtmlTextArea) outside_element).setText(text);
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return;
}
}
@@ -551,6 +580,7 @@
* @param fieldName name of the hidden input element
* @param paramValue parameter value to submit for the element.
*/
+ @Override
public void setHiddenField(String fieldName, String text) {
// first try the current form
if (form != null) {
@@ -569,8 +599,9 @@
if (outside_element instanceof HtmlHiddenInput) {
((HtmlHiddenInput) outside_element).setValueAttribute(text);
// set current form if not null
- if (outside_element.getEnclosingForm() != null)
+ if (outside_element.getEnclosingForm() != null) {
form = outside_element.getEnclosingForm();
+ }
return;
}
}
@@ -585,6 +616,7 @@
*
* @param selectName name of the select box.
*/
+ @Override
public String[] getSelectOptionValues(String selectName) {
HtmlSelect sel = getForm().getSelectByName(selectName);
ArrayList<String> result = new ArrayList<String>();
@@ -601,6 +633,7 @@
* @param index the 0-based index when more than one
* select with the same name is expected.
*/
+ @Override
public String[] getSelectOptionValues(String selectName, int index) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
@@ -612,7 +645,7 @@
for (HtmlOption opt : sel.getOptions()) {
result.add(opt.getValueAttribute());
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
private String[] getSelectedOptions(HtmlSelect sel) {
@@ -624,11 +657,13 @@
return result;
}
+ @Override
public String[] getSelectedOptions(String selectName) {
HtmlSelect sel = getForm().getSelectByName(selectName);
return getSelectedOptions(sel);
}
+ @Override
public String[] getSelectedOptions(String selectName, int index) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
@@ -649,18 +684,20 @@
+ sel.getNameAttribute());
}
+ @Override
public String getSelectOptionValueForLabel(String selectName, String label) {
HtmlSelect sel = getForm().getSelectByName(selectName);
return getSelectOptionValueForLabel(sel, label);
}
+ @Override
public String getSelectOptionValueForLabel(String selectName, int index, String label) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
throw new RuntimeException("Did not find select with name [" + selectName
+ "] at index " + index);
}
- HtmlSelect sel = (HtmlSelect) sels.get(index);
+ HtmlSelect sel = sels.get(index);
return getSelectOptionValueForLabel(sel, label);
}
@@ -674,34 +711,40 @@
+ sel.getNameAttribute());
}
+ @Override
public String getSelectOptionLabelForValue(String selectName, String value) {
HtmlSelect sel = getForm().getSelectByName(selectName);
return getSelectOptionLabelForValue(sel, value);
}
+ @Override
public String getSelectOptionLabelForValue(String selectName, int index, String value) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
throw new RuntimeException("Did not find select with name [" + selectName
+ "] at index " + index);
}
- HtmlSelect sel = (HtmlSelect) sels.get(index);
+ HtmlSelect sel = sels.get(index);
return getSelectOptionLabelForValue(sel, value);
}
+ @Override
public URL getPageURL() {
return win.getEnclosedPage().getWebResponse().getWebRequest().getUrl();
}
+ @Override
public String getPageSource() {
return win.getEnclosedPage().getWebResponse()
.getContentAsString();
}
+ @Override
public String getPageTitle() {
return getCurrentPageTitle();
}
+ @Override
public String getPageText() {
Page page = win.getEnclosedPage();
if (page instanceof HtmlPage) {
@@ -724,6 +767,7 @@
"Unexpected error in getPageText(). This method need to be updated.");
}
+ @Override
public String getServerResponse() {
StringBuffer result = new StringBuffer();
WebResponse wr = wc.getCurrentWindow().getEnclosedPage()
@@ -740,6 +784,7 @@
return result.toString();
}
+ @Override
public InputStream getInputStream() {
try {
return wc.getCurrentWindow().getEnclosedPage().getWebResponse()
@@ -749,6 +794,7 @@
}
}
+ @Override
public InputStream getInputStream(URL resourceUrl)
throws TestingEngineResponseException {
WebWindow imageWindow = null;
@@ -815,6 +861,7 @@
wc.getOptions().setThrowExceptionOnFailingStatusCode(!ignoreFailingStatusCodes);
wc.getOptions().setThrowExceptionOnScriptError(throwExceptionOnScriptError);
wc.getOptions().setRedirectEnabled(true);
+ wc.getOptions().setUseInsecureSSL(true);
if (refreshHandler == null) {
wc.setRefreshHandler(new ImmediateRefreshHandler());
} else {
@@ -846,6 +893,7 @@
}
wc.setCredentialsProvider(creds);
wc.addWebWindowListener(new WebWindowListener() {
+ @Override
public void webWindowClosed(WebWindowEvent event) {
if (win == null || event.getOldPage().equals(win.getEnclosedPage())) {
win = wc.getCurrentWindow();
@@ -860,6 +908,7 @@
logger.debug("Window {} closed : {}", win, oldPageTitle);
}
+ @Override
public void webWindowContentChanged(WebWindowEvent event) {
form = null;
String winName = event.getWebWindow().getName();
@@ -876,6 +925,7 @@
logger.debug("Window \"{}\" changed : \"{}\" became \"{}", new Object[] {winName, oldPageTitle, newPageTitle});
}
+ @Override
public void webWindowOpened(WebWindowEvent event) {
String win = event.getWebWindow().getName();
Page newPage = event.getNewPage();
@@ -888,11 +938,12 @@
});
// Add Javascript Alert Handler
wc.setAlertHandler(new AlertHandler() {
+ @Override
public void handleAlert(Page page, String msg) {
if (expectedJavascriptAlerts.size() < 1) {
throw new UnexpectedJavascriptAlertException(msg);
} else {
- JavascriptAlert expected = (JavascriptAlert) expectedJavascriptAlerts
+ JavascriptAlert expected = expectedJavascriptAlerts
.remove(0);
if (!msg.equals(expected.getMessage())) {
throw new UnexpectedJavascriptAlertException(msg);
@@ -902,11 +953,12 @@
});
// Add Javascript Confirm Handler
wc.setConfirmHandler(new ConfirmHandler() {
+ @Override
public boolean handleConfirm(Page page, String msg) {
if (expectedJavascriptConfirms.size() < 1) {
throw new UnexpectedJavascriptConfirmException(msg);
} else {
- JavascriptConfirm expected = (JavascriptConfirm) expectedJavascriptConfirms
+ JavascriptConfirm expected = expectedJavascriptConfirms
.remove(0);
if (!msg.equals(expected.getMessage())) {
throw new UnexpectedJavascriptConfirmException(msg);
@@ -918,11 +970,12 @@
});
// Add Javascript Prompt Handler
wc.setPromptHandler(new PromptHandler() {
+ @Override
public String handlePrompt(Page page, String msg) {
if (expectedJavascriptPrompts.size() < 1) {
throw new UnexpectedJavascriptPromptException(msg);
} else {
- JavascriptPrompt expected = (JavascriptPrompt) expectedJavascriptPrompts
+ JavascriptPrompt expected = expectedJavascriptPrompts
.remove(0);
if (!msg.equals(expected.getMessage())) {
throw new UnexpectedJavascriptPromptException(msg);
@@ -995,6 +1048,7 @@
/**
* Get all the comments in a document, as a list of strings.
*/
+ @Override
public List<String> getComments() {
List<String> comments = new ArrayList<String>();
getComments(comments, ((HtmlPage) win.getEnclosedPage()));
@@ -1075,7 +1129,7 @@
}
private HtmlForm getForm(int formIndex) {
- return (HtmlForm) ((HtmlPage) win.getEnclosedPage()).getForms().get(
+ return ((HtmlPage) win.getEnclosedPage()).getForms().get(
formIndex);
}
@@ -1296,6 +1350,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasSubmitButton() {
final HtmlForm htmlForm = getForm();
List<?> l = htmlForm.getByXPath("//input[@type='submit' or @type='image']");
@@ -1306,6 +1361,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasSubmitButton(String buttonName) {
return getSubmitButton(buttonName) != null;
}
@@ -1313,6 +1369,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasSubmitButton(String buttonName, String buttonValue) {
try {
return getSubmitButton(buttonName, buttonValue) != null;
@@ -1322,6 +1379,7 @@
}
+ @Override
public boolean hasResetButton() {
HtmlForm form = getForm();
List<?> l = form.getByXPath("//input[@type='reset']");
@@ -1329,6 +1387,7 @@
return (l.size() > 0 || l2.size() > 0);
}
+ @Override
public boolean hasResetButton(String buttonName) {
return getResetButton(buttonName) != null;
}
@@ -1366,6 +1425,7 @@
* or the value of the "value" attribute.
* @return <code>true</code> when the button with text could be found.
*/
+ @Override
public boolean hasButtonWithText(String text) {
return getButtonWithText(text) != null ? true : false;
}
@@ -1385,8 +1445,9 @@
* no such button is found.
*/
public HtmlElement getButtonWithText(String buttonValueText) {
- if (buttonValueText == null)
+ if (buttonValueText == null) {
throw new NullPointerException("Cannot search for button with null text");
+ }
List<? extends HtmlElement> l = ((HtmlPage) win.getEnclosedPage()).getDocumentElement()
.getHtmlElementsByTagNames(
@@ -1417,6 +1478,7 @@
* @param buttonId the id of the button
* @return <code>true</code> when the button was found.
*/
+ @Override
public boolean hasButton(String buttonId) {
try {
return getButton(buttonId) != null;
@@ -1425,11 +1487,13 @@
}
}
+ @Override
public boolean isCheckboxSelected(String checkBoxName) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName);
return cb.isChecked();
}
+ @Override
public boolean isCheckboxSelected(String checkBoxName, String checkBoxValue) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName, checkBoxValue);
return cb.isChecked();
@@ -1461,6 +1525,7 @@
return false;
}
+ @Override
public Table getTable(String tableSummaryNameOrId) {
HtmlTable table = getHtmlTable(tableSummaryNameOrId);
Table result = new Table();
@@ -1508,6 +1573,7 @@
return null;
}
+ @Override
public boolean hasTable(String tableSummaryNameOrId) {
return getHtmlTable(tableSummaryNameOrId) != null;
}
@@ -1516,6 +1582,7 @@
* Submit the current form with the default submit button. See {@link #getForm}for an explanation of how the
* current form is established.
*/
+ @Override
public void submit() {
try {
Object[] inpt = getForm().getHtmlElementsByTagName("input")
@@ -1555,6 +1622,7 @@
*
* @param buttonName name of the button to use for submission.
*/
+ @Override
public void submit(String buttonName) {
List<HtmlElement> l = new LinkedList<HtmlElement>();
l.addAll(getForm().getInputsByName(buttonName));
@@ -1596,6 +1664,7 @@
* @param buttonName name of the button to use for submission.
* @param buttonValue value/label of the button to use for submission
*/
+ @Override
public void submit(String buttonName, String buttonValue) {
List<HtmlElement> l = new LinkedList<HtmlElement>();
l.addAll(getForm().getInputsByName(buttonName));
@@ -1644,6 +1713,7 @@
/**
* Reset the current form. See {@link #getForm}for an explanation of how the current form is established.
*/
+ @Override
public void reset() {
getForm().reset();
}
@@ -1656,14 +1726,17 @@
* @param linkText text to check for in links on the response.
* @param index The 0-based index, when more than one link with the same text is expected.
*/
+ @Override
public boolean hasLinkWithText(String linkText, int index) {
return getLinkWithText(linkText, index) != null;
}
+ @Override
public boolean hasLinkWithExactText(String linkText, int index) {
return getLinkWithExactText(linkText, index) != null;
}
+ @Override
public boolean hasLinkWithImage(String imageFileName, int index) {
return getLinkWithImage(imageFileName, index) != null;
}
@@ -1673,6 +1746,7 @@
*
* @param anId link id to check for.
*/
+ @Override
public boolean hasLink(String anId) {
try {
((HtmlPage) win.getEnclosedPage()).getHtmlElementById(anId);
@@ -1682,6 +1756,7 @@
return true;
}
+ @Override
public void clickLinkWithText(String linkText, int index) {
HtmlAnchor link = getLinkWithText(linkText, index);
if (link == null) {
@@ -1695,6 +1770,7 @@
}
}
+ @Override
public void clickLinkWithExactText(String linkText, int index) {
HtmlAnchor link = getLinkWithExactText(linkText, index);
if (link == null) {
@@ -1737,6 +1813,7 @@
*
* @param checkBoxName name of checkbox to be deselected.
*/
+ @Override
public void checkCheckbox(String checkBoxName) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName);
if (!cb.isChecked()) {
@@ -1748,6 +1825,7 @@
}
}
+ @Override
public void checkCheckbox(String checkBoxName, String value) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName, value);
if (!cb.isChecked()) {
@@ -1765,6 +1843,7 @@
*
* @param checkBoxName name of checkbox to be deselected.
*/
+ @Override
public void uncheckCheckbox(String checkBoxName) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName);
if (cb.isChecked()) {
@@ -1777,6 +1856,7 @@
}
}
+ @Override
public void uncheckCheckbox(String checkBoxName, String value) {
HtmlCheckBoxInput cb = getCheckbox(checkBoxName, value);
if (cb.isChecked()) {
@@ -1807,6 +1887,7 @@
* @param radioGroup name of the radio group.
* @param radioOption value of the option to check for.
*/
+ @Override
public void clickRadioOption(String radioGroup, String radioOption) {
HtmlRadioButtonInput rb = getRadioOption(radioGroup, radioOption);
if (!rb.isChecked()) {
@@ -1825,6 +1906,7 @@
*
* @param anID id of link to be navigated.
*/
+ @Override
public void clickLink(String anID) {
clickElementByXPath("//a[@id=\"" + anID + "\"]");
}
@@ -1864,6 +1946,7 @@
* <tt>"images/my_icon.png"<tt>, you could just pass in
* <tt>"my_icon.png"<tt>.
*/
+ @Override
public void clickLinkWithImage(String imageFileName, int index) {
HtmlAnchor link = getLinkWithImage(imageFileName, index);
if (link == null) {
@@ -1877,14 +1960,17 @@
}
}
+ @Override
public boolean hasElement(String anID) {
return getHtmlElement(anID) != null;
}
+ @Override
public boolean hasElementByXPath(String xpath) {
return getHtmlElementByXPath(xpath) != null;
}
+ @Override
public void clickElementByXPath(String xpath) {
HtmlElement e = getHtmlElementByXPath(xpath);
if (e == null) {
@@ -1898,6 +1984,7 @@
}
}
+ @Override
public String getElementAttributByXPath(String xpath, String attribut) {
HtmlElement e = getHtmlElementByXPath(xpath);
if (e == null) {
@@ -1906,6 +1993,7 @@
return e.getAttribute(attribut);
}
+ @Override
public String getElementTextByXPath(String xpath) {
HtmlElement e = getHtmlElementByXPath(xpath);
if (e == null) {
@@ -1919,6 +2007,7 @@
*
* @param buttonId
*/
+ @Override
public void clickButton(String buttonId) {
HtmlElement btn = getButton(buttonId);
try {
@@ -1934,6 +2023,7 @@
* value attribute. For HTML button tags, this checks the element's
* content by converting it to text. or an HTML <button> tag.
*/
+ @Override
public void clickButtonWithText(String buttonValueText) {
HtmlElement b = getButtonWithText(buttonValueText);
if (b != null) {
@@ -1954,10 +2044,12 @@
* @param radioGroup name of the radio group.
* @param radioOption value of the option to check for.
*/
+ @Override
public boolean hasRadioOption(String radioGroup, String radioOption) {
return getRadioOption(radioGroup, radioOption) != null;
}
+ @Override
public String getSelectedRadio(String radioGroup) {
List<HtmlRadioButtonInput> radios = getForm().getRadioButtonsByName(radioGroup);
for (HtmlRadioButtonInput radio : radios) {
@@ -1974,6 +2066,7 @@
* @param selectName name of the select box.
* @param optionLabel label of the option.
*/
+ @Override
public boolean hasSelectOption(String selectName, String optionLabel) {
String[] opts = getSelectOptionValues(selectName);
for (int i = 0; i < opts.length; i++) {
@@ -1991,6 +2084,7 @@
* @param selectName name of the select box.
* @param optionValue value of the option.
*/
+ @Override
public boolean hasSelectOptionValue(String selectName, String optionValue) {
String[] opts = getSelectOptionValues(selectName);
for (int i = 0; i < opts.length; i++) {
@@ -2007,10 +2101,12 @@
* @param selectName name of the select box
* @param options set of options to select.
*/
+ @Override
public void selectOptions(String selectName, String[] options) {
HtmlSelect sel = getForm().getSelectByName(selectName);
- if (!sel.isMultipleSelectEnabled() && options.length > 1)
+ if (!sel.isMultipleSelectEnabled() && options.length > 1) {
throw new RuntimeException("Multiselect not enabled");
+ }
for (String option : options) {
boolean found = false;
for (HtmlOption opt : sel.getOptions()) {
@@ -2035,6 +2131,7 @@
* select elements are expected.
* @param optionLabel label of the option.
*/
+ @Override
public boolean hasSelectOption(String selectName, int index, String optionLabel) {
String[] opts = getSelectOptionValues(selectName, index);
for (int i = 0; i < opts.length; i++) {
@@ -2054,6 +2151,7 @@
* select elements are expected.
* @param optionValue value of the option.
*/
+ @Override
public boolean hasSelectOptionValue(String selectName, int index, String optionValue) {
String[] opts = getSelectOptionValues(selectName, index);
for (int i = 0; i < opts.length; i++) {
@@ -2072,13 +2170,14 @@
* select elements are expected.
* @param options set of options to select.
*/
+ @Override
public void selectOptions(String selectName, int index, String[] options) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
throw new RuntimeException("Did not find select with name [" + selectName
+ "] at index " + index);
}
- HtmlSelect sel = (HtmlSelect) sels.get(index);
+ HtmlSelect sel = sels.get(index);
if (!sel.isMultipleSelectEnabled() && options.length > 1) {
throw new RuntimeException("Multiselect not enabled");
}
@@ -2098,6 +2197,7 @@
}
}
+ @Override
public void unselectOptions(String selectName, String[] options) {
HtmlSelect sel = getForm().getSelectByName(selectName);
if (!sel.isMultipleSelectEnabled() && options.length > 1) {
@@ -2119,6 +2219,7 @@
}
}
+ @Override
public void unselectOptions(String selectName, int index, String[] options) {
List<HtmlSelect> sels = getForm().getSelectsByName(selectName);
if (sels == null || sels.size() < index + 1) {
@@ -2145,6 +2246,7 @@
}
}
+ @Override
public boolean isTextInElement(String elementID, String text) {
return isTextInElement(getHtmlElement(elementID), text);
}
@@ -2159,6 +2261,7 @@
return element.asText().indexOf(text) >= 0;
}
+ @Override
public boolean isMatchInElement(String elementID, String regexp) {
return isMatchInElement(getHtmlElement(elementID), regexp);
}
@@ -2185,6 +2288,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void gotoRootWindow() {
win = win.getTopWindow();
}
@@ -2231,11 +2335,12 @@
return testContext;
}
+ @Override
public void setExpectedJavaScriptAlert(JavascriptAlert[] alerts)
throws ExpectedJavascriptAlertException {
if (this.expectedJavascriptAlerts.size() > 0) {
throw new ExpectedJavascriptAlertException(
- ((JavascriptAlert) (expectedJavascriptAlerts.get(0)))
+ (expectedJavascriptAlerts.get(0))
.getMessage());
}
for (int i = 0; i < alerts.length; i++) {
@@ -2243,11 +2348,12 @@
}
}
+ @Override
public void setExpectedJavaScriptConfirm(JavascriptConfirm[] confirms)
throws ExpectedJavascriptConfirmException {
if (this.expectedJavascriptConfirms.size() > 0) {
throw new ExpectedJavascriptConfirmException(
- ((JavascriptConfirm) (expectedJavascriptConfirms.get(0)))
+ (expectedJavascriptConf...
[truncated message content] |
|
From: <he...@us...> - 2012-11-27 15:57:15
|
Revision: 964
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=964&view=rev
Author: henryju
Date: 2012-11-27 15:57:02 +0000 (Tue, 27 Nov 2012)
Log Message:
-----------
[3590252] Assert form is present before call of setWorkingForm(nameOrId, index)
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.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-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2012-11-27 15:39:46 UTC (rev 963)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2012-11-27 15:57:02 UTC (rev 964)
@@ -18,6 +18,8 @@
*/
package net.sourceforge.jwebunit.tests;
+import junit.framework.AssertionFailedError;
+
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@@ -32,10 +34,10 @@
/**
* Test form submission related methods of WebTestCase.
- *
+ *
* If there is more than one submit button on a page, WebTestCase / httpunit
* require indication of which button to submit with prior to form submission.
- *
+ *
* @author Jim Weaver
*/
public class FormSubmissionTest extends JWebUnitAPITestCase {
@@ -94,7 +96,7 @@
//The following depend on the browser: IE send full path (i.e. temp.getAbsolutePath()) but FF send only file name.
assertTextPresent("file=[" + temp.getName() + "{abcdefgh}]");
}
-
+
@Test
public void testSubmitImageInput() {
beginAt("/InputImageForm.html");
@@ -158,22 +160,22 @@
submit();
assertTextPresent("color=[blue]");
}
-
+
@Test
public void testRadioSelection() {
- beginAt("/RadioForm.html");
- clickRadioOption("radio", "1");
- assertRadioOptionSelected("radio", "1");
- submit();
- assertTextPresent("radio=[1]");
- clickLink("return");
- clickRadioOption("radio", "2");
- clickRadioOption("radio", "3");
- assertRadioOptionNotSelected("radio", "1");
- assertRadioOptionNotSelected("radio", "2");
- assertRadioOptionSelected("radio", "3");
- submit();
- assertTextPresent("radio=[3]");
+ beginAt("/RadioForm.html");
+ clickRadioOption("radio", "1");
+ assertRadioOptionSelected("radio", "1");
+ submit();
+ assertTextPresent("radio=[1]");
+ clickLink("return");
+ clickRadioOption("radio", "2");
+ clickRadioOption("radio", "3");
+ assertRadioOptionNotSelected("radio", "1");
+ assertRadioOptionNotSelected("radio", "2");
+ assertRadioOptionSelected("radio", "3");
+ submit();
+ assertTextPresent("radio=[3]");
}
@Test
@@ -259,14 +261,20 @@
assertSubmitButtonPresent("myInput2");
}
+ @Test(expected=AssertionError.class)
+ public void testSetWorkingFormWithIndexPresent() {
+ beginAt("/MultiFormPage.html");
+ setWorkingForm("dontExists", 2);
+ }
+
@Test
public void testInvalidButton() {
beginAt("/InvalidActionForm.html");
try {
- submit("button1");
- fail("A TestingEngineResponseException was expected.");
+ submit("button1");
+ fail("A TestingEngineResponseException was expected.");
} catch (TestingEngineResponseException e) {
- assertEquals(404, e.getHttpStatusCode());
+ assertEquals(404, e.getHttpStatusCode());
}
}
@@ -325,7 +333,7 @@
private void gotoMultiButtonPage() {
beginAt("/MultiNamedButtonForm.html");
}
-
+
@Test
public void testCachedForm() {
beginAt("/Submit1.html");
@@ -335,7 +343,7 @@
submit();
assertTextPresent("Page 3");
}
-
+
/**
* Submit input
*/
@@ -347,7 +355,7 @@
assertTextPresent("Submitted parameters");
assertTextPresent("color=[blue]");
}
-
+
@Test
public void testSetHiddenField() {
beginAt("/SingleNamedButtonForm.html");
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 2012-11-27 15:39:46 UTC (rev 963)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/api/ITestingEngine.java 2012-11-27 15:57:02 UTC (rev 964)
@@ -37,7 +37,7 @@
/**
* This is the interface for all communications between JWebUnit and the specific running test engine.
- *
+ *
* @author Julien Henry
* @author Nick Neuberger
*/
@@ -45,7 +45,7 @@
/**
* Open the browser at an initial URL.
- *
+ *
* @param aInitialURL Initial URL
* @param aTestContext Test context
* @throws TestingEngineResponseException If something bad happend (404)
@@ -55,7 +55,7 @@
/**
* Close the browser and check if there is no pending Javascript alert, confirm or prompt.
- *
+ *
* @throws ExpectedJavascriptAlertException If there is pending Javascript alert
* {@link ITestingEngine#setExpectedJavaScriptAlert(JavascriptAlert[])}
* @throws ExpectedJavascriptConfirmException If there is pending Javascript confirm
@@ -69,36 +69,36 @@
/**
* Simulate user typing a new URL in the browser.
- *
+ *
* @param url Full URL of the page.
* @throws TestingEngineResponseException If something bad happend (404)
*/
void gotoPage(URL url) throws TestingEngineResponseException;
-
+
/**
* Enable or disable Javascript support.
- *
+ *
* @param value true to enable Javascript.
*/
void setScriptingEnabled(boolean value);
/**
* Set whether or not to throw an exception on Javascript errors.
- *
+ *
* @param value true to throw an exception on Javascript errors.
*/
void setThrowExceptionOnScriptError(boolean value);
/**
* Get all cookies.
- *
+ *
* @return List of javax.servlet.http.Cookie.
*/
List<?> getCookies();
/**
* Test if the window with the given name is present.
- *
+ *
* @param windowName Name of the window.
* @return true if the Window exists.
*/
@@ -106,7 +106,7 @@
/**
* Test if window with the given title is present.
- *
+ *
* @param windowTitle Title of the window.
* @return true if the Window exists.
*/
@@ -114,21 +114,21 @@
/**
* Make the window with the given name active.
- *
+ *
* @param windowName Name of the window
*/
void gotoWindow(String windowName);
/**
* Goto first window with the given title.
- *
+ *
* @param title Title of the window
*/
void gotoWindowByTitle(String title);
/**
* Goto window with the given Javascript ID.
- *
+ *
* @param windowID Javascript ID of the window
* @deprecated Javascript ID does'nt not exists. Currently this is an index
* in the list of available windows, but this is not portable (and probably not stable).
@@ -139,26 +139,26 @@
/**
* Make the root window active. Used to reset the effect of {@link ITestingEngine#gotoFrame(String)}.
- *
+ *
*/
void gotoRootWindow();
/**
* Get the number of opened Windows.
- *
+ *
* @return Number of opened Windows.
*/
int getWindowCount();
/**
* Close the current window.
- *
+ *
*/
void closeWindow();
/**
* Test if the given frame is present.
- *
+ *
* @param frameNameOrId Name or ID of the frame. ID is checked first.
* @return true if the frame exists.
*/
@@ -166,14 +166,14 @@
/**
* Make the frame with the given name or ID active in the current conversation.
- *
+ *
* @param frameNameOrId Name or ID of the frame. ID is checked first.
*/
void gotoFrame(String frameNameOrId);
/**
* Set the form on the current page that the client wishes to work with explicitly by index in the page.
- *
+ *
* @param index The 0-based index, when more than one form with the same name is expected.
*/
void setWorkingForm(int index);
@@ -181,7 +181,7 @@
/**
* Set the form on the current page that the client wishes to work with explicitly by either the form name or id
* (match by id is attempted first).
- *
+ *
* @param nameOrId name or id of the form to be worked with.
* @param index The 0-based index, when more than one form with the same name is expected.
*/
@@ -189,22 +189,31 @@
/**
* Check whether the current page contains a form.
- *
+ *
* @return true if there is at least a form.
*/
boolean hasForm();
/**
* Return true if the current page contains a specific form.
- *
+ *
* @param nameOrID name of id of the form to check for.
* @return true if there is at least a form.
*/
boolean hasForm(String nameOrID);
/**
+ * Return true if the current page contains a specific form.
+ *
+ * @param nameOrID name of id of the form to check for.
+ * @param index The 0-based index, when more than one form with the same name is expected.
+ * @return true if there is at least a form.
+ */
+ boolean hasForm(String nameOrID, int index);
+
+ /**
* Return true if a form input element is present on the current form.
- *
+ *
* @param paramName name of the input element to check for
* @return true if there is at least a form parameter.
*/
@@ -213,7 +222,7 @@
/**
* Return the current value of a text field with name <code>paramName</code>. Text fields are input text, input
* password and textarea
- *
+ *
* @param paramName name of the text field element.
* @return Text content of the text field.
*/
@@ -221,7 +230,7 @@
/**
* Return the current value of a hidden input element with name <code>paramName</code>.
- *
+ *
* @param paramName name of the hidden input element.
* @return Value of the hidden input.
*/
@@ -229,15 +238,15 @@
/**
* Fill a text, password or textarea field with the provided text.
- *
+ *
* @param inputName name of the text, password or textarea element
* @param text value to type in the field.
*/
void setTextField(String inputName, String text);
-
+
/**
* Fill hidden field with the provided text.
- *
+ *
* @param inputName name of the hidden element
* @param text value to set in the hidden field.
*/
@@ -245,9 +254,9 @@
/**
* Return a string array of select box option values.
- *
+ *
* Exemple: <br/>
- *
+ *
* <code>
* <FORM action="http://my_host/doit" method="post">
* <P>
@@ -263,18 +272,18 @@
* </P>
* </FORM>
* </code>
- *
+ *
* Should return [Component_1_a, Component_1_b, Component_3, Component_4, Component_5]
- *
+ *
* @param selectName name of the select box.
* @return Array of select options values.
*/
String[] getSelectOptionValues(String selectName);
-
+
/**
* Return a string array of option values for the Nth select box
* with the specified name.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index used when more than one select with
* the same name is expected.
@@ -284,7 +293,7 @@
/**
* Return the values of the currently selected items in a select box.
- *
+ *
* @param selectName name of the select box.
*/
String[] getSelectedOptions(String selectName);
@@ -292,17 +301,17 @@
/**
* Return the values of the currently selected items in the Nth select box
* with the provided name.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index used when more than one select with
* the same name is expected.
*/
String[] getSelectedOptions(String selectName, int index);
-
+
/**
* Get the label for a given option of a select box.
- *
+ *
* @param selectName name of the select box.
* @param optionValue label of the option.
*/
@@ -311,7 +320,7 @@
/**
* Get the label for a given option of the Nth select box with the
* specified name.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index used when more than one select with
* the same name is expected.
@@ -319,10 +328,10 @@
*/
String getSelectOptionLabelForValue(String selectName, int index, String optionValue);
-
+
/**
* Get the value for a given option of a select box.
- *
+ *
* @param selectName name of the select box.
* @param optionLabel label of the option.
*/
@@ -331,7 +340,7 @@
/**
* Get the value for a given option of the Nth select box with
* the specified name.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index used when more than one select with
* the same name is expected.
@@ -339,10 +348,10 @@
*/
String getSelectOptionValueForLabel(String selectName, int index, String optionLabel);
-
+
/**
* Select option(s) of a select box by value.
- *
+ *
* @param selectName name of the select box.
* @param optionValues values of the options to select.
*/
@@ -350,18 +359,18 @@
/**
* Select option(s) of the Nth select box by value.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index of the select element when multiple
- * select elements are expected.
+ * select elements are expected.
* @param optionValues values of the options to select.
*/
void selectOptions(String selectName, int index, String[] optionValues);
-
+
/**
* Unselect option(s) of a select box by value.
- *
+ *
* @param selectName name of the select box.
* @param optionValues vaules of the options to unselect.
*/
@@ -370,18 +379,18 @@
/**
* Unselect option(s) of the Nth select box with the specified name
* by value.
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index of the select element when multiple
- * select elements are expected.
+ * select elements are expected.
* @param optionValues vaules of the options to unselect.
*/
void unselectOptions(String selectName, int index, String[] optionValues);
-
+
/**
* Test if a select box has the given option (by label).
- *
+ *
* @param selectName name of the select box.
* @param optionLabel label of the option.
* @return true if a select box has the given option (by label).
@@ -390,7 +399,7 @@
/**
* Test if a select box has the given option (by value).
- *
+ *
* @param selectName name of the select box.
* @param optionValue value of the option.
* @return true if a select box has the given option (by value).
@@ -399,10 +408,10 @@
/**
* Test if the Nth select box has the given option (by label).
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index of the select element when multiple
- * select elements are expected.
+ * select elements are expected.
* @param optionLabel label of the option.
* @return true if a select box has the given option (by label).
*/
@@ -410,19 +419,19 @@
/**
* Test if the Nth select box has the given option (by value).
- *
+ *
* @param selectName name of the select box.
* @param index the 0-based index of the select element when multiple
- * select elements are expected.
+ * select elements are expected.
* @param optionValue value of the option.
* @return true if a select box has the given option (by value).
*/
boolean hasSelectOptionValue(String selectName, int index, String optionValue);
-
+
/**
* Determines if the checkbox is selected.
- *
+ *
* @param checkBoxName name of the checkbox.
* @return true if the first checkbox with given name is selected.
*/
@@ -430,7 +439,7 @@
/**
* Determines if the checkbox is selected.
- *
+ *
* @param checkBoxName name attribut of the checkbox.
* @param checkBoxValue value attribut of the checkbox.
* @return true if the first checkbox with given name and value is selected.
@@ -439,14 +448,14 @@
/**
* Select a specified checkbox. If the checkbox is already checked then the checkbox will stay checked.
- *
+ *
* @param checkBoxName name of checkbox to be selected.
*/
void checkCheckbox(String checkBoxName);
/**
* Select a specified checkbox. If the checkbox is already checked then the checkbox will stay checked.
- *
+ *
* @param checkBoxName name of checkbox to be selected.
* @param checkBoxValue value of the checkbox (to differenciate checkboxes with the same name).
*/
@@ -454,14 +463,14 @@
/**
* Deselect a specified checkbox. If the checkbox is already unchecked then the checkbox will stay unchecked.
- *
+ *
* @param checkBoxName name of checkbox to be deselected.
*/
void uncheckCheckbox(String checkBoxName);
/**
* Deselect a specified checkbox. If the checkbox is already unchecked then the checkbox will stay unchecked.
- *
+ *
* @param checkBoxName name of checkbox to be deselected.
* @param value value of the checkbox (to differenciate checkboxes with the same name).
*/
@@ -469,7 +478,7 @@
/**
* Clicks a radio option. Asserts that the radio option exists first.
- *
+ *
* @param radioGroup name of the radio group.
* @param radioOptionValue value of the option to check for.
*/
@@ -477,12 +486,12 @@
/**
* Checks if a radio group contains the indicated option.
- *
+ *
* @param radioGroup name of the radio group.
* @param radioOptionValue value of the option to check for.
*/
boolean hasRadioOption(String radioGroup, String radioOptionValue);
-
+
/**
* Return the currently selected radio button.
* @param radioGroup name of the radio group.
@@ -492,7 +501,7 @@
/**
* Checks if the current form contains a submit button.
- *
+ *
*/
boolean hasSubmitButton();
@@ -504,7 +513,7 @@
* <li>input type=image
* <li>button type=submit
* </ul>
- *
+ *
* @param nameOrID name or id of the button to check for.
*/
boolean hasSubmitButton(String nameOrID);
@@ -517,7 +526,7 @@
* <li>input type=image
* <li>button type=submit
* </ul>
- *
+ *
* @param nameOrID name of id of the button to check for.
* @param value value of the button
*/
@@ -542,7 +551,7 @@
* <li>input type=image
* <li>button type=submit
* </ul>
- *
+ *
* @param buttonName name of the button to use for submission.
*/
void submit(String buttonName);
@@ -555,7 +564,7 @@
* <li>input type=image
* <li>button type=submit
* </ul>
- *
+ *
* @author Dragos Manolescu
* @param buttonName name of the button to use for submission.
* @param buttonValue value/label of the button to use for submission
@@ -568,7 +577,7 @@
* <li>input type=reset
* <li>button type=reset
* </ul>
- *
+ *
*/
boolean hasResetButton();
@@ -579,7 +588,7 @@
* <li>input type=reset
* <li>button type=reset
* </ul>
- *
+ *
* @param nameOrID name or id of the button to check for.
*/
boolean hasResetButton(String nameOrID);
@@ -600,7 +609,7 @@
* <li>input type=button
* <li>button type=button
* </ul>
- *
+ *
* @param text the text of the button (contents of the value attribute).
* @return <code>true</code> when the button with text could be found.
*/
@@ -612,7 +621,7 @@
* <li>input type=button
* <li>button type=button
* </ul>
- *
+ *
* @param buttonId the ID of the button.
* @return <code>true</code> when the button with text could be found.
*/
@@ -624,7 +633,7 @@
* <li>input type=button
* <li>button type=button
* </ul>
- *
+ *
* @param buttonId the ID of the button.
*/
void clickButton(String buttonId);
@@ -636,7 +645,7 @@
* <li>input type=button
* <li>button type=button
* </ul>
- *
+ *
* @param buttonValueText the text of the button (contents of the value attribute).
*/
void clickButtonWithText(String buttonValueText);
@@ -646,18 +655,18 @@
* @return an URL.
*/
URL getPageURL();
-
+
/**
* Return the string representation of the current page, encoded as specified by the current
* {@link net.sourceforge.jwebunit.util.TestContext}.
- *
+ *
* @return Visible text in the page.
*/
String getPageText();
/**
* Return the source of the current page (like in a browser).
- *
+ *
* @return Source of the page (or HTTP Body as String)
*/
String getPageSource();
@@ -665,28 +674,28 @@
/**
* Return the page title of the current response page, encoded as specified by the current
* {@link net.sourceforge.jwebunit.util.TestContext}.
- *
+ *
* @return Title of the page.
*/
String getPageTitle();
/**
* Return the response of the server for the current page.
- *
+ *
* @return HTTP header & body
*/
String getServerResponse();
/**
* Gets the last server response as input stream.
- *
+ *
*/
InputStream getInputStream();
/**
* Gets the input stream for a given URL - can be used to test images or other resources without changing the current
* navigation context.
- *
+ *
* @param url the url to the resource
*/
InputStream getInputStream(URL url)
@@ -694,7 +703,7 @@
/**
* Check if the Table object representing a specified table exists.
- *
+ *
* @param tableSummaryNameOrId summary, name or id of the table.
* @return true if table exists.
*/
@@ -703,7 +712,7 @@
/**
* Each framework have it's own way to represent a Table. Testing engines are responsible for converting to the unified
* JWebUnit format.
- *
+ *
* @param tableSummaryNameOrId summary, name or id of the table to return.
* @return unified JWebUnit representation of a table.
*/
@@ -711,7 +720,7 @@
/**
* Return true if a link is present in the current response containing the specified text.
- *
+ *
* @param linkText text to check for in links on the response.
* @param index The 0-based index, when more than one link with the same text is expected.
*/
@@ -720,9 +729,9 @@
/**
* Return true if a link is present in the current page containing the exact specified text. Note. This will call
* String.trim() to trim all leading / trailing spaces.
- *
+ *
* RFE 996031...
- *
+ *
* @param linkText text to check for in links on the response.
* @param index The 0-based index, when more than one link with the same text is expected.
*/
@@ -730,7 +739,7 @@
/**
* Return true if a link is present with a given image based on filename of 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>.
@@ -742,7 +751,7 @@
/**
* Return true if a link is present in the current response with the specified id.
- *
+ *
* @param anId link id to check for.
*/
boolean hasLink(String anId);
@@ -750,7 +759,7 @@
/**
* Navigate by submitting a request based on a link containing the specified text. A RuntimeException is thrown if
* no such link can be found.
- *
+ *
* @param linkText text which link to be navigated should contain.
* @param index The 0-based index, when more than one link with the same text is expected.
*/
@@ -759,7 +768,7 @@
/**
* Navigate by clicking a link with the exact specified text. A RuntimeException is thrown if no such link can be
* found.
- *
+ *
* @param linkText exact text which link to be navigated should contain.
* @param index The 0-based index, when more than one link with the same text is expected.
*/
@@ -768,7 +777,7 @@
/**
* Navigate by submitting a request based on a link with a given ID. A RuntimeException is thrown if no such link
* can be found.
- *
+ *
* @param anID id of link to be navigated.
*/
void clickLink(String anID);
@@ -776,7 +785,7 @@
/**
* Navigate by submitting a request based on a link with a given image file name. A RuntimeException is thrown if no
* such link can be found.
- *
+ *
* @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 text is expected.
@@ -785,7 +794,7 @@
/**
* Test if element with given id exists.
- *
+ *
* @param anID id of the element.
* @return true if element was found.
*/
@@ -793,7 +802,7 @@
/**
* Test if element with given xpath exists.
- *
+ *
* @param xpath xpath of the element.
* @return true if element was found.
*/
@@ -801,7 +810,7 @@
/**
* Click element with given xpath.
- *
+ *
* @param xpath xpath of the element.
*/
void clickElementByXPath(String xpath);
@@ -809,7 +818,7 @@
/**
* Get attribut value of the given element. For example, if you have img src="bla.gif" alt="toto",
* getElementAttributByXPath("//img[@src='bla.gif']", "alt") returns "toto"
- *
+ *
* @param xpath xpath of the element.
* @param attribut name of the attribut.
* @return Attribut value or null if the element is not found.
@@ -818,15 +827,15 @@
/**
* Get text of the given element.
- *
+ *
* @param xpath xpath of the element.
*/
String getElementTextByXPath(String xpath);
-
-
+
+
/**
* Return true if a given string is contained within the specified element.
- *
+ *
* @param elementID ID of element to inspect.
* @param text text to check for.
* @return true if text was found.
@@ -835,7 +844,7 @@
/**
* Return true if a given regexp is contained within the specified element.
- *
+ *
* @param elementID Id of element to inspect.
* @param regexp regexp to match.
* @return true if a match is found.
@@ -844,7 +853,7 @@
/**
* Tell the testing engine that the given alert boxes are expected in the given order.
- *
+ *
* @param alerts Expected alerts.
* @throws ExpectedJavascriptAlertException If there are still unconsummed alert since a previous call of this
* method.
@@ -854,7 +863,7 @@
/**
* Tell the testing engine that the given confirm boxes are expected in the given order.
- *
+ *
* @param confirms Expected confirms.
* @throws ExpectedJavascriptConfirmException If there are still unconsummed confirm since a previous call of this
* method.
@@ -864,7 +873,7 @@
/**
* Tell the testing engine that the given prompt boxes are expected in the given order.
- *
+ *
* @param prompts Expected prompts.
* @throws ExpectedJavascriptPromptException If there are still unconsummed prompt since a previous call of this
* method.
@@ -872,82 +881,82 @@
void setExpectedJavaScriptPrompt(JavascriptPrompt[] prompts)
throws ExpectedJavascriptPromptException;
- /**
- * Get an element wrapper for a given xpath.
- *
- * @see #getElementsByXPath(String)
- * @param xpath XPath to evaluate
- * @return The element if found
- */
- IElement getElementByXPath(String xpath);
-
- /**
- * Get an element wrapper for a given ID.
- *
- * @param id element ID to find
- * @return The element if found
- */
- IElement getElementByID(String id);
-
- /**
- * Get a list of all elements that match the given xpath.
- *
- * @see #getElementByXPath(String)
- * @param xpath XPath to evaluate
- * @return List of all elements found
- */
- List<IElement> getElementsByXPath(String xpath);
+ /**
+ * Get an element wrapper for a given xpath.
+ *
+ * @see #getElementsByXPath(String)
+ * @param xpath XPath to evaluate
+ * @return The elem...
[truncated message content] |
|
From: <he...@us...> - 2014-03-17 08:38:33
|
Revision: 966
http://sourceforge.net/p/jwebunit/code/966
Author: henryju
Date: 2014-03-17 08:38:29 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Update to HtmlUnit 2.14
Modified Paths:
--------------
trunk/jwebunit-htmlunit-plugin/pom.xml
trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2012-11-27 16:00:24 UTC (rev 965)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2014-03-17 08:38:29 UTC (rev 966)
@@ -17,18 +17,18 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>2.11</version>
+ <version>2.14</version>
<exclusions>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
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 2012-11-27 16:00:24 UTC (rev 965)
+++ trunk/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java 2014-03-17 08:38:29 UTC (rev 966)
@@ -169,7 +169,7 @@
/**
* The default browser version.
*/
- private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_3_6;
+ private BrowserVersion defaultBrowserVersion = BrowserVersion.FIREFOX_24;
/**
* Should we ignore failing status codes?
@@ -836,12 +836,12 @@
* The user agent string is now provided by default to new test cases.
* It can still be overridden if testContext.getUserAgent() is not
* null (i.e. has been set manually.)
- *
+ *
* @author Jevon
*/
BrowserVersion bv;
if (testContext.getUserAgent() != null) {
- bv = BrowserVersion.FIREFOX_3_6;
+ bv = BrowserVersion.FIREFOX_24;
bv.setUserAgent(testContext.getUserAgent());
} else {
bv = defaultBrowserVersion; // use default (which includes a full UserAgent string)
@@ -2381,7 +2381,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getElementByXPath(java.lang.String)
*/
@Override
@@ -2395,7 +2395,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getElementByID(java.lang.String)
*/
@Override
@@ -2409,7 +2409,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getElementsByXPath(java.lang.String)
*/
@Override
@@ -2425,7 +2425,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getServerResponseCode()
*/
@Override
@@ -2453,7 +2453,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getHeader(java.lang.String)
*/
@Override
@@ -2463,7 +2463,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see net.sourceforge.jwebunit.api.ITestingEngine#getAllHeaders()
*/
@Override
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2012-11-27 16:00:24 UTC (rev 965)
+++ trunk/src/changes/changes.xml 2014-03-17 08:38:29 UTC (rev 966)
@@ -31,6 +31,9 @@
</properties>
<body>
<release version="3.2" date="UNKNOW" description="">
+ <action type="update" dev="henryju">
+ Updated to HtmlUnit 2.14.
+ </action>
<action type="fix" dev="henryju" issue="3590252" due-to="Kenny MacLeod">
Assert form is present before really calling setWorkingForm(String nameOrId, int index).
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2014-03-17 08:41:20
|
Revision: 967
http://sourceforge.net/p/jwebunit/code/967
Author: henryju
Date: 2014-03-17 08:41:12 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Update license header to 2014
Modified Paths:
--------------
trunk/LICENSE.txt
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/ConcurrentJWebUnitTest.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/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/CookiesServlet.java
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/util/HeadersServlet.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-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/FixedHtmlUnitDriver.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverElementImpl.java
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/jwebunit-webdriver-plugin/src/site/site.xml
trunk/jwebunit-webdriver-plugin/src/site/xdoc/index.xml
trunk/jwebunit-webdriver-plugin/src/test/java/net/sourceforge/jwebunit/webdriver/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/LICENSE.txt
===================================================================
--- trunk/LICENSE.txt 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/LICENSE.txt 2014-03-17 08:41:12 UTC (rev 967)
@@ -2,7 +2,7 @@
/********************************************************************************
* JWebUnit, simplified web testing API
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
* http://jwebunit.sourceforge.net
*
* JWebUnit is free software: you can redistribute it and/or modify
@@ -17,5 +17,5 @@
*
* You should have received a copy of the GNU Lesser General Public License
* along with JWebUnit. If not, see <http://www.gnu.org/licenses/>.
-
+
********************************************************************************/
Modified: trunk/jwebunit-code-generator/src/site/site.xml
===================================================================
--- trunk/jwebunit-code-generator/src/site/site.xml 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-code-generator/src/site/site.xml 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2002-2012, JWebUnit team.
+ Copyright (c) 2002-2014, JWebUnit team.
This file is part of JWebUnit.
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ButtonAssertionsTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of 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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ConcurrentJWebUnitTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of 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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsHtmlTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ExpectedTableAssertionsXHtmlTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormAssertionsWithLabelTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of 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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FormSubmissionTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/FramesAndWindowsTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of 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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HelloWorldTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/HtmlParsingTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/IElementTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JWebUnitAPITestCase.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptEventsTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/JavaScriptTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
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 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NavigationTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NonHtmlContentTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NonHtmlContentTest.java 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/NonHtmlContentTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/RedirectionTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/RedirectionTest.java 2014-03-17 08:38:29 UTC (rev 966)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/RedirectionTest.java 2014-03-17 08:41:12 UTC (rev 967)
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2002-2012, JWebUnit team.
+ * Copyright (c) 2002-2014, JWebUnit team.
*
* This file is part of JWebUnit.
*
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ResourceBundleAssertionsTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net...
[truncated message content] |
|
From: <he...@us...> - 2014-03-17 09:56:34
|
Revision: 969
http://sourceforge.net/p/jwebunit/code/969
Author: henryju
Date: 2014-03-17 09:56:31 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Update to JUnit 4.11
Modified Paths:
--------------
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-core/pom.xml
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-htmlunit-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/pom.xml
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-commons-tests/pom.xml 2014-03-17 09:56:31 UTC (rev 969)
@@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit-dep</artifactId>
+ <artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
@@ -38,9 +38,9 @@
<version>2.0.1</version>
</dependency>
<dependency>
- <groupId>com.google.code.tempus-fugit</groupId>
- <artifactId>tempus-fugit</artifactId>
- <version>1.1</version>
+ <groupId>com.google.code.tempus-fugit</groupId>
+ <artifactId>tempus-fugit</artifactId>
+ <version>1.1</version>
</dependency>
</dependencies>
<properties>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-core/pom.xml 2014-03-17 09:56:31 UTC (rev 969)
@@ -1,101 +1,101 @@
<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">
- <parent>
- <artifactId>jwebunit</artifactId>
- <groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jwebunit-core</artifactId>
- <name>Core - API</name>
- <description>
- The core API of JWebUnit. Define how tests should be written and interface for testing engines.
- </description>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit-dep</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>regexp</groupId>
- <artifactId>regexp</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- </dependencies>
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-webtestcase</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>java</goal>
- </goals>
- <configuration>
- <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>
- <sourceRoot>
- ${project.build.directory}/generated-sources/main/java
- </sourceRoot>
- <arguments>
- <argument>${basedir}/src/main/java</argument>
- <argument>
- ${project.build.directory}/generated-sources/main/java
- </argument>
- </arguments>
- <includePluginDependencies>
- true
- </includePluginDependencies>
- <includeProjectDependencies>
- false
- </includeProjectDependencies>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.jwebunit</groupId>
- <artifactId>jwebunit-code-generator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
+ <parent>
+ <artifactId>jwebunit</artifactId>
+ <groupId>net.sourceforge.jwebunit</groupId>
+ <version>3.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jwebunit-core</artifactId>
+ <name>Core - API</name>
+ <description>
+ The core API of JWebUnit. Define how tests should be written and interface for testing engines.
+ </description>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>regexp</groupId>
+ <artifactId>regexp</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <topDirectoryLocation>..</topDirectoryLocation>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-webtestcase</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <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>
+ <sourceRoot>
+ ${project.build.directory}/generated-sources/main/java
+ </sourceRoot>
+ <arguments>
+ <argument>${basedir}/src/main/java</argument>
+ <argument>
+ ${project.build.directory}/generated-sources/main/java
+ </argument>
+ </arguments>
+ <includePluginDependencies>
+ true
+ </includePluginDependencies>
+ <includeProjectDependencies>
+ false
+ </includeProjectDependencies>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.jwebunit</groupId>
+ <artifactId>jwebunit-code-generator</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Cell.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Cell.java 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Cell.java 2014-03-17 09:56:31 UTC (rev 969)
@@ -18,135 +18,134 @@
*/
package net.sourceforge.jwebunit.html;
-import junit.framework.Assert;
-
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
+import org.junit.Assert;
/**
* Represents a cell of an html table - a string value spanning an indicated amount of columns.
- *
+ *
* @author Jim Weaver
* @author Julien Henry
*/
public class Cell {
- private int colspan;
+ private int colspan;
- private int rowspan;
+ private int rowspan;
- private String value;
+ private String value;
- /**
- * Construct a cell with a default colspan/rowspan of 1.
- *
- * @param value text expected within the cell.
- */
- public Cell(String value) {
- this(value, 1, 1);
- }
+ /**
+ * Construct a cell with a default colspan/rowspan of 1.
+ *
+ * @param value text expected within the cell.
+ */
+ public Cell(String value) {
+ this(value, 1, 1);
+ }
- /**
- * Construct a cell with a specified colspan.
- *
- * @param value text expected within the cell.
- * @param colspan number of columns the cell is expected to span.
- * @param rowspan number of rows the cell is expected to span.
- */
- public Cell(String value, int colspan, int rowspan) {
- this.value = value;
- this.colspan = colspan;
- this.rowspan = rowspan;
- }
+ /**
+ * Construct a cell with a specified colspan.
+ *
+ * @param value text expected within the cell.
+ * @param colspan number of columns the cell is expected to span.
+ * @param rowspan number of rows the cell is expected to span.
+ */
+ public Cell(String value, int colspan, int rowspan) {
+ this.value = value;
+ this.colspan = colspan;
+ this.rowspan = rowspan;
+ }
- /**
- * @return the colspan for this cell.
- */
- public int getColspan() {
- return colspan;
- }
+ /**
+ * @return the colspan for this cell.
+ */
+ public int getColspan() {
+ return colspan;
+ }
- /**
- * @return the rowspan for this cell.
- */
- public int getRowspan() {
- return rowspan;
- }
+ /**
+ * @return the rowspan for this cell.
+ */
+ public int getRowspan() {
+ return rowspan;
+ }
- /**
- * @return the text for the cell.
- */
- public final String getValue() {
- return value;
- }
+ /**
+ * @return the text for the cell.
+ */
+ public final String getValue() {
+ return value;
+ }
- /**
- * Assert that the current cell equals given one. Check text, colspan and rowspan.
- *
- * @param c given cell
- */
- public void assertEquals(Cell c) {
- Assert.assertTrue(c.getValue() + " do not equal " + this.getValue(),
- this.getValue().equals(c.getValue()));
- Assert.assertTrue("Expected colspan was " + c.getColspan()
- + " but was " + this.getColspan(), this.getColspan() == c
- .getColspan());
- Assert.assertTrue("Expected rowspan was " + c.getRowspan()
- + " but was " + this.getRowspan(), this.getRowspan() == c
- .getRowspan());
- }
+ /**
+ * Assert that the current cell equals given one. Check text, colspan and rowspan.
+ *
+ * @param c given cell
+ */
+ public void assertEquals(Cell c) {
+ Assert.assertTrue(c.getValue() + " do not equal " + this.getValue(),
+ this.getValue().equals(c.getValue()));
+ Assert.assertTrue("Expected colspan was " + c.getColspan()
+ + " but was " + this.getColspan(), this.getColspan() == c
+ .getColspan());
+ Assert.assertTrue("Expected rowspan was " + c.getRowspan()
+ + " but was " + this.getRowspan(), this.getRowspan() == c
+ .getRowspan());
+ }
- /**
- * Assert that the current cell matches given one. Check colspan and rowspan. Regexp is in text of given cell.
- *
- * @param c given cell
- */
- public void assertMatch(Cell c) {
- RE re = getRE(c.getValue());
- Assert.assertTrue(c.getValue() + " do not match " + this.getValue(), re
- .match(this.getValue()));
- Assert.assertTrue("Expected colspan was " + c.getColspan()
- + " but was " + this.getColspan(), this.getColspan() == c
- .getColspan());
- Assert.assertTrue("Expected rowspan was " + c.getRowspan()
- + " but was " + this.getRowspan(), this.getRowspan() == c
- .getRowspan());
- }
+ /**
+ * Assert that the current cell matches given one. Check colspan and rowspan. Regexp is in text of given cell.
+ *
+ * @param c given cell
+ */
+ public void assertMatch(Cell c) {
+ RE re = getRE(c.getValue());
+ Assert.assertTrue(c.getValue() + " do not match " + this.getValue(), re
+ .match(this.getValue()));
+ Assert.assertTrue("Expected colspan was " + c.getColspan()
+ + " but was " + this.getColspan(), this.getColspan() == c
+ .getColspan());
+ Assert.assertTrue("Expected rowspan was " + c.getRowspan()
+ + " but was " + this.getRowspan(), this.getRowspan() == c
+ .getRowspan());
+ }
- /**
- * Check if the current cell contains given text.
- *
- * @param text given text.
- * @return true if the current cell contains given text.
- */
- public boolean equals(String text) {
- return this.getValue().equals(text);
- }
+ /**
+ * Check if the current cell contains given text.
+ *
+ * @param text given text.
+ * @return true if the current cell contains given text.
+ */
+ public boolean equals(String text) {
+ return this.getValue().equals(text);
+ }
- /**
- * Check if the current cell matches given text.
- *
- * @param regexp given regexp.
- * @return true if the current cell matches given text.
- */
- public boolean match(String regexp) {
- RE re = getRE(regexp);
- return re.match(this.getValue());
- }
+ /**
+ * Check if the current cell matches given text.
+ *
+ * @param regexp given regexp.
+ * @return true if the current cell matches given text.
+ */
+ public boolean match(String regexp) {
+ RE re = getRE(regexp);
+ return re.match(this.getValue());
+ }
- /**
- * Create a regexp.
- *
- * @param regexp regexp pattern
- * @return regexp object
- */
- private RE getRE(String regexp) {
- RE re = null;
- try {
- re = new RE(regexp, RE.MATCH_SINGLELINE);
- } catch (RESyntaxException e) {
- Assert.fail(e.toString());
- }
- return re;
+ /**
+ * Create a regexp.
+ *
+ * @param regexp regexp pattern
+ * @return regexp object
+ */
+ private RE getRE(String regexp) {
+ RE re = null;
+ try {
+ re = new RE(regexp, RE.MATCH_SINGLELINE);
+ } catch (RESyntaxException e) {
+ Assert.fail(e.toString());
}
+ return re;
+ }
}
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Row.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Row.java 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Row.java 2014-03-17 09:56:31 UTC (rev 969)
@@ -18,95 +18,96 @@
*/
package net.sourceforge.jwebunit.html;
+import org.junit.Assert;
+
import java.util.ArrayList;
+import java.util.List;
-import junit.framework.Assert;
-
/**
* Represents a row of an html table.
- *
+ *
* @author Jim Weaver
* @author Julien Henry
*/
public class Row {
- private ArrayList cells = new ArrayList();;
+ private List<Cell> cells = new ArrayList<Cell>();
- public Row() {
- }
+ public Row() {
+ }
- /**
- * Construct a row from an array of objects which specify the cells of the row. If an object in the array is an
- * {@link net.sourceforge.jwebunit.html.Cell}, it is directly added to the cells of the row, otherwise an
- * {@link net.sourceforge.jwebunit.html.Cell} is created from the toString() value of the object and an assumed
- * colspan of 1.
- *
- * @param rowCells objects representing the row's cells.
- */
- public Row(Object[] rowCells) {
- appendCells(rowCells);
- }
+ /**
+ * Construct a row from an array of objects which specify the cells of the row. If an object in the array is an
+ * {@link net.sourceforge.jwebunit.html.Cell}, it is directly added to the cells of the row, otherwise an
+ * {@link net.sourceforge.jwebunit.html.Cell} is created from the toString() value of the object and an assumed
+ * colspan of 1.
+ *
+ * @param rowCells objects representing the row's cells.
+ */
+ public Row(Object[] rowCells) {
+ appendCells(rowCells);
+ }
- public void appendCells(Object[] rowCells) {
- for (int i = 0; i < rowCells.length; i++) {
- Object column = rowCells[i];
- if (column instanceof Cell) {
- this.cells.add((Cell) column);
- } else {
- this.cells.add(new Cell(column.toString()));
- }
- }
+ public void appendCells(Object[] rowCells) {
+ for (int i = 0; i < rowCells.length; i++) {
+ Object column = rowCells[i];
+ if (column instanceof Cell) {
+ this.cells.add((Cell) column);
+ } else {
+ this.cells.add(new Cell(column.toString()));
+ }
}
+ }
- public void appendCell(Cell cell) {
- cells.add(cell);
- }
+ public void appendCell(Cell cell) {
+ cells.add(cell);
+ }
- public void appendCell(String cellText) {
- cells.add(new Cell(cellText));
- }
+ public void appendCell(String cellText) {
+ cells.add(new Cell(cellText));
+ }
- public ArrayList getCells() {
- return cells;
- }
+ public List<Cell> getCells() {
+ return cells;
+ }
- public int getCellCount() {
- return cells.size();
- }
+ public int getCellCount() {
+ return cells.size();
+ }
- public boolean hasText(String text) {
- for (int i = 0; i < getCellCount(); i++) {
- Cell c = (Cell) getCells().get(i);
- if (c.equals(text))
- return true;
- }
- return false;
+ public boolean hasText(String text) {
+ for (int i = 0; i < getCellCount(); i++) {
+ Cell c = (Cell) getCells().get(i);
+ if (c.equals(text))
+ return true;
}
+ return false;
+ }
- public boolean hasMatch(String regexp) {
- for (int i = 0; i < getCellCount(); i++) {
- Cell c = (Cell) getCells().get(i);
- if (c.match(regexp))
- return true;
- }
- return false;
+ public boolean hasMatch(String regexp) {
+ for (int i = 0; i < getCellCount(); i++) {
+ Cell c = (Cell) getCells().get(i);
+ if (c.match(regexp))
+ return true;
}
+ return false;
+ }
- public void assertEquals(Row r) {
- Assert.assertTrue("Cell count are not equal",
- this.getCells().size() == r.getCells().size());
- for (int i = 0; i < this.getCells().size(); i++) {
- ((Cell) this.getCells().get(i)).assertEquals((Cell) r.getCells()
- .get(i));
- }
+ public void assertEquals(Row r) {
+ Assert.assertTrue("Cell count are not equal",
+ this.getCells().size() == r.getCells().size());
+ for (int i = 0; i < this.getCells().size(); i++) {
+ ((Cell) this.getCells().get(i)).assertEquals((Cell) r.getCells()
+ .get(i));
}
+ }
- public void assertMatch(Row r) {
- Assert.assertTrue("Cell count are not equal",
- this.getCells().size() == r.getCells().size());
- for (int i = 0; i < this.getCells().size(); i++) {
- ((Cell) this.getCells().get(i)).assertMatch((Cell) r.getCells()
- .get(i));
- }
+ public void assertMatch(Row r) {
+ Assert.assertTrue("Cell count are not equal",
+ this.getCells().size() == r.getCells().size());
+ for (int i = 0; i < this.getCells().size(); i++) {
+ ((Cell) this.getCells().get(i)).assertMatch((Cell) r.getCells()
+ .get(i));
}
+ }
}
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Table.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Table.java 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/html/Table.java 2014-03-17 09:56:31 UTC (rev 969)
@@ -18,133 +18,134 @@
*/
package net.sourceforge.jwebunit.html;
+import org.junit.Assert;
+
import java.util.ArrayList;
+import java.util.List;
-import junit.framework.Assert;
-
/**
* Represents an expected table for comparison with an actual html table.
- *
+ *
* @author Jim Weaver
* @author Julien Henry
*/
public class Table {
- private ArrayList rows = new ArrayList();
+ private List<Row> rows = new ArrayList<Row>();
- /**
- * Construct a table without providing any contents; they can be appended subsequently.
- */
- public Table() {
- }
+ /**
+ * Construct a table without providing any contents; they can be appended subsequently.
+ */
+ public Table() {
+ }
- /**
- * Construct a table from a two dimensional array of objects. Each object's string value will be used with a colspan
- * of 1, unless an object is an {@link net.sourceforge.jwebunit.html.Cell}, in which case its defined value and
- * colspan are used.
- *
- * @param values two-dimensional array representing table cells.
- */
- public Table(Object[][] values) {
- appendRows(values);
- }
+ /**
+ * Construct a table from a two dimensional array of objects. Each object's string value will be used with a colspan
+ * of 1, unless an object is an {@link net.sourceforge.jwebunit.html.Cell}, in which case its defined value and
+ * colspan are used.
+ *
+ * @param values two-dimensional array representing table cells.
+ */
+ public Table(Object[][] values) {
+ appendRows(values);
+ }
- /**
- * Append any number of rows, represented by a two dimensional array of objects. Each object's string value will be
- * used with a colspan of 1, unless an object is an {@link net.sourceforge.jwebunit.html.Cell}, in which case its
- * defined value and colspan are used.
- *
- * @param newExpectedValues two-dimensional array representing expected table cells.
- */
- public void appendRows(Object[][] newExpectedValues) {
- for (int i = 0; i < newExpectedValues.length; i++) {
- rows.add(new Row(newExpectedValues[i]));
- }
+ /**
+ * Append any number of rows, represented by a two dimensional array of objects. Each object's string value will be
+ * used with a colspan of 1, unless an object is an {@link net.sourceforge.jwebunit.html.Cell}, in which case its
+ * defined value and colspan are used.
+ *
+ * @param newExpectedValues two-dimensional array representing expected table cells.
+ */
+ public void appendRows(Object[][] newExpectedValues) {
+ for (int i = 0; i < newExpectedValues.length; i++) {
+ rows.add(new Row(newExpectedValues[i]));
}
+ }
- /**
- * Append another table's rows.
- *
- * @param table table whose rows are to be appended.
- */
- public void appendRows(Table table) {
- rows.addAll(table.getRows());
- }
+ /**
+ * Append another table's rows.
+ *
+ * @param table table whose rows are to be appended.
+ */
+ public void appendRows(Table table) {
+ rows.addAll(table.getRows());
+ }
- /**
- * Append a single expected row.
- *
- * @param row row to be appended.
- */
- public void appendRow(Row row) {
- rows.add(row);
- }
+ /**
+ * Append a single expected row.
+ *
+ * @param row row to be appended.
+ */
+ public void appendRow(Row row) {
+ rows.add(row);
+ }
- public int getRowCount() {
- return getRows().size();
- }
+ public int getRowCount() {
+ return getRows().size();
+ }
- public ArrayList getRows() {
- return rows;
- }
+ public List<Row> getRows() {
+ return rows;
+ }
- public boolean hasText(String text) {
- for (int i = 0; i < getRowCount(); i++) {
- Row row = (Row) getRows().get(i);
- if (row.hasText(text))
- return true;
- }
- return false;
+ public boolean hasText(String text) {
+ for (int i = 0; i < getRowCount(); i++) {
+ Row row = (Row) getRows().get(i);
+ if (row.hasText(text))
+ return true;
}
+ return false;
+ }
- public boolean hasMatch(String regexp) {
- for (int i = 0; i < getRowCount(); i++) {
- Row row = (Row) getRows().get(i);
- if (row.hasMatch(regexp))
- return true;
- }
- return false;
+ public boolean hasMatch(String regexp) {
+ for (int i = 0; i < getRowCount(); i++) {
+ Row row = (Row) getRows().get(i);
+ if (row.hasMatch(regexp))
+ return true;
}
+ return false;
+ }
- public void assertEquals(Table t) {
- Assert.assertTrue("Row count are not equal", this.getRows().size() == t
- .getRows().size());
- for (int i = 0; i < this.getRows().size(); i++) {
- ((Row) this.getRows().get(i))
- .assertEquals((Row) t.getRows().get(i));
- }
+ public void assertEquals(Table t) {
+ Assert.assertTrue("Row count are not equal", this.getRows().size() == t
+ .getRows().size());
+ for (int i = 0; i < this.getRows().size(); i++) {
+ ((Row) this.getRows().get(i))
+ .assertEquals((Row) t.getRows().get(i));
}
+ }
- public void assertSubTableEquals(int startRow, Table t) {
- Table sub = new Table();
- if (startRow + t.getRowCount() > this.getRowCount())
- Assert.fail("Expected rows [" + t.getRowCount()
- + "] larger than actual rows in range being compared"
- + " [" + (this.getRowCount() - startRow) + "].");
- for (int i = startRow; i < startRow + t.getRowCount(); i++) {
- sub.appendRow((Row) this.getRows().get(i));
- }
- sub.assertEquals(t);
+ public void assertSubTableEquals(int startRow, Table t) {
+ Table sub = new Table();
+ if (startRow + t.getRowCount() > this.getRowCount())
+ Assert.fail("Expected rows [" + t.getRowCount()
+ + "] larger than actual rows in range being compared"
+ + " [" + (this.getRowCount() - startRow) + "].");
+ for (int i = startRow; i < startRow + t.getRowCount(); i++) {
+ sub.appendRow((Row) this.getRows().get(i));
}
+ sub.assertEquals(t);
+ }
- public void assertMatch(Table t) {
- Assert.assertTrue("Row count are not equal", this.getRows().size() == t
- .getRows().size());
- for (int i = 0; i < this.getRows().size(); i++) {
- ((Row) this.getRows().get(i)).assertMatch((Row) t.getRows().get(i));
- }
+ public void assertMatch(Table t) {
+ Assert.assertTrue("Row count are not equal", this.getRows().size() == t
+ .getRows().size());
+ for (int i = 0; i < this.getRows().size(); i++) {
+ ((Row) this.getRows().get(i)).assertMatch((Row) t.getRows().get(i));
}
+ }
- public void assertSubTableMatch(int startRow, Table t) {
- Table sub = new Table();
- if (startRow + t.getRowCount() > this.getRowCount())
- Assert.fail("Expected rows [" + t.getRowCount()
- + "] larger than actual rows in range being compared"
- + " [" + (this.getRowCount() - startRow) + "].");
- for (int i = startRow; i < startRow + t.getRowCount(); i++) {
- sub.appendRow((Row) this.getRows().get(i));
- }
- sub.assertMatch(t);
+ public void assertSubTableMatch(int startRow, Table t) {
+ Table sub = new Table();
+ if (startRow + t.getRowCount() > this.getRowCount())
+ Assert.fail("Expected rows [" + t.getRowCount()
+ + "] larger than actual rows in range being compared"
+ + " [" + (this.getRowCount() - startRow) + "].");
+ for (int i = startRow; i < startRow + t.getRowCount(); i++) {
+ sub.appendRow((Row) this.getRows().get(i));
}
+ sub.assertMatch(t);
+ }
}
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2014-03-17 09:56:31 UTC (rev 969)
@@ -12,7 +12,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit-dep</artifactId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 09:56:31 UTC (rev 969)
@@ -23,7 +23,7 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <artifactId>junit-dep</artifactId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-17 09:47:12 UTC (rev 968)
+++ trunk/pom.xml 2014-03-17 09:56:31 UTC (rev 969)
@@ -363,8 +363,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
- <...
[truncated message content] |
|
From: <he...@us...> - 2014-03-17 10:46:49
|
Revision: 971
http://sourceforge.net/p/jwebunit/code/971
Author: henryju
Date: 2014-03-17 10:46:39 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Prepare release 3.2. Update Webdriver plugin.
Modified Paths:
--------------
trunk/README.txt
trunk/jwebunit-commons-tests/pom.xml
trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml
trunk/jwebunit-webdriver-plugin/pom.xml
trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
trunk/jwebunit-webdriver-plugin/src/site/xdoc/index.xml
trunk/src/changes/changes.xml
trunk/src/site/xdoc/how-to-release.xml
trunk/src/site/xdoc/index.xml
trunk/src/site/xdoc/installation.xml
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2014-03-17 10:00:59 UTC (rev 970)
+++ trunk/README.txt 2014-03-17 10:46:39 UTC (rev 971)
@@ -1,11 +1,11 @@
-The JWebUnit team is pleased to announce the JWebUnit 3.1 release!
+The JWebUnit team is pleased to announce the JWebUnit 3.2 release!
http://jwebunit.sourceforge.net
JWebUnit is a Java framework that facilitates creation of acceptance tests for
-web applications. It evolved from a project where we were using HttpUnit and
-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
+web applications. It evolved from a project where we were using HttpUnit and
+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 using HtmlUnit (htmlunit.sourceforge.net).
@@ -14,4 +14,4 @@
Have fun!
-The JWebUnit team
-
+
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2014-03-17 10:00:59 UTC (rev 970)
+++ trunk/jwebunit-commons-tests/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
@@ -35,7 +35,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.0.1</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>com.google.code.tempus-fugit</groupId>
Modified: trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml 2014-03-17 10:00:59 UTC (rev 970)
+++ trunk/jwebunit-htmlunit-plugin/src/site/xdoc/index.xml 2014-03-17 10:46:39 UTC (rev 971)
@@ -25,9 +25,9 @@
<title>JWebUnit</title>
</properties>
<meta name="keyword" content="jwebunit, java, junit, htmlunit, jacobie, httpunit, integration, test, automated, html, webtest"/>
- <head>
- <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
- </head>
+ <head>
+ <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
+ </head>
<body>
<section name="HtmlUnit plugin">
<p>
@@ -55,7 +55,7 @@
import org.junit.Test;
public class SearchExample {
-
+
@Test
public void testSearch() throws Exception {
final WebClient webClient = new WebClient();
@@ -82,12 +82,12 @@
import static net.sourceforge.jwebunit.junit.JWebUnit.*;
public class SearchExample {
-
+
@Before
public void prepare() {
setBaseUrl("http://www.google.com");
}
-
+
@Test
public void testSearch() {
beginAt("/");
@@ -105,22 +105,22 @@
</p>
</section>
<section name="HowTo manage dependencies with Maven 2">
- <p>
- Just add the following dependency to your pom:
- <source><pre>
+ <p>
+ Just add the following dependency to your pom:
+ <source><pre>
...
<dependencies>
...
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
</dependency>
...
</dependencies>
...
- </pre></source>
- </p>
+ </pre></source>
+ </p>
</section>
-</body>
+</body>
</document>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 10:00:59 UTC (rev 970)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
@@ -34,7 +34,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
- <version>2.26.0</version>
+ <version>2.40.0</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
- <version>2.26.0</version>
+ <version>2.40.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
@@ -75,20 +75,24 @@
<dependency>
<groupId>biz.neustar</groupId>
<artifactId>browsermob-proxy</artifactId>
- <version>2.0-beta-6</version>
+ <version>2.0-beta-7</version>
<exclusions>
<exclusion>
+ <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
</exclusion>
<exclusion>
+ <groupId>commons-io</groupId>
<artifactId>org.apache.commons</artifactId>
- <groupId>commons-io</groupId>
</exclusion>
<exclusion>
+ <groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
- <groupId>org.slf4j</groupId>
</exclusion>
+ <exclusion>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpmime</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
Modified: trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2014-03-17 10:00:59 UTC (rev 970)
+++ trunk/jwebunit-webdriver-plugin/src/main/java/net/sourceforge/jwebunit/webdriver/WebDriverTestingEngineImpl.java 2014-03-17 10:46:39 UTC (rev 971)
@@ -18,19 +18,8 @@
*/
package net.sourceforge.jwebunit.webdriver;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.WebResponse;
import net.sourceforge.jwebunit.api.HttpHeader;
import net.sourceforge.jwebunit.api.IElement;
import net.sourceforge.jwebunit.api.ITestingEngine;
@@ -45,20 +34,16 @@
import net.sourceforge.jwebunit.javascript.JavascriptConfirm;
import net.sourceforge.jwebunit.javascript.JavascriptPrompt;
import net.sourceforge.jwebunit.util.TestContext;
-
import org.apache.commons.lang.StringUtils;
import org.apache.http.Header;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpResponseInterceptor;
import org.apache.http.HttpStatus;
-import org.apache.http.entity.BufferedHttpEntity;
-import org.apache.http.protocol.HttpContext;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
import org.browsermob.proxy.ProxyServer;
+import org.browsermob.proxy.http.BrowserMobHttpRequest;
+import org.browsermob.proxy.http.BrowserMobHttpResponse;
+import org.browsermob.proxy.http.RequestInterceptor;
+import org.browsermob.proxy.http.ResponseInterceptor;
import org.browsermob.proxy.jetty.util.MultiException;
import org.openqa.selenium.By;
import org.openqa.selenium.Cookie;
@@ -75,8 +60,18 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.WebResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
/**
* Acts as the wrapper for Webdriver access. A testing engine is initialized with a given URL, and maintains
@@ -86,1054 +81,1056 @@
*/
public class WebDriverTestingEngineImpl implements ITestingEngine {
- /**
- * Logger for this class.
- */
- private final Logger logger = LoggerFactory.getLogger(WebDriverTestingEngineImpl.class);
- private ProxyServer proxyServer;
- private WebDriver driver;
- private TestContext testContext;
- private static final int TRY_COUNT = 50;
- private static final int DEFAULT_PORT = 8183;
- private static final Random RANDOM = new Random();
- private HttpResponse response;
- // The xpath string that identifie the current form
- // ie : @name='myForm'
- private String formIdent;
- private boolean throwExceptionOnScriptError = true;//TODO
- private boolean ignoreFailingStatusCodes = false;
- /**
- * Is Javascript enabled.
- */
- private boolean jsEnabled = true;
+ /**
+ * Logger for this class.
+ */
+ private final Logger logger = LoggerFactory.getLogger(WebDriverTestingEngineImpl.class);
+ private ProxyServer proxyServer;
+ private WebDriver driver;
+ private TestContext testContext;
+ private static final int TRY_COUNT = 50;
+ private static final int DEFAULT_PORT = 8183;
+ private static final Random RANDOM = new Random();
+ private BrowserMobHttpResponse response;
+ // The xpath string that identifie the current form
+ // ie : @name='myForm'
+ private String formIdent;
+ private boolean throwExceptionOnScriptError = true;// TODO
+ private boolean ignoreFailingStatusCodes = false;
+ /**
+ * Is Javascript enabled.
+ */
+ private boolean jsEnabled = true;
- public WebDriverTestingEngineImpl() {
- }
+ public WebDriverTestingEngineImpl() {
+ }
- public void beginAt(URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException {
- this.setTestContext(aTestContext);
- // start the proxy
- Proxy proxy = startBrowserMobProxy();
+ public void beginAt(URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException {
+ this.setTestContext(aTestContext);
+ // start the proxy
+ Proxy proxy = startBrowserMobProxy();
- DesiredCapabilities capabilities = new DesiredCapabilities();
- capabilities.setCapability(CapabilityType.PROXY, proxy);
- capabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, jsEnabled);
- capabilities.setBrowserName("htmlunit");
- capabilities.setVersion("firefox");
+ DesiredCapabilities capabilities = new DesiredCapabilities();
+ capabilities.setCapability(CapabilityType.PROXY, proxy);
+ capabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, jsEnabled);
+ capabilities.setBrowserName("htmlunit");
+ capabilities.setVersion("firefox");
- driver = new HtmlUnitDriver(capabilities);
+ driver = new HtmlUnitDriver(capabilities);
- //Reset form
- formIdent = null;
+ // Reset form
+ formIdent = null;
- // Deal with cookies
- for (javax.servlet.http.Cookie c : aTestContext.getCookies()) {
- //FIXME Hack for BrowserMob
- String domain = c.getDomain();
- if ("localhost".equals(domain)) {
- domain = null;
- }
- if ("".equals(domain)) {
- domain = null;
- }
- Date expiry = null;
- if (c.getMaxAge() != -1) {
- Calendar cal = Calendar.getInstance();
- cal.add(Calendar.SECOND, c.getMaxAge());
- expiry = cal.getTime();
- }
- driver.manage().addCookie(
- new org.openqa.selenium.Cookie(c
- .getName(), c.getValue(), domain, c.getPath() != null ? c
- .getPath() : "", expiry, c.getSecure()));
- }
- gotoPage(aInitialURL);
+ // Deal with cookies
+ for (javax.servlet.http.Cookie c : aTestContext.getCookies()) {
+ // FIXME Hack for BrowserMob
+ String domain = c.getDomain();
+ if ("localhost".equals(domain)) {
+ domain = null;
+ }
+ if ("".equals(domain)) {
+ domain = null;
+ }
+ Date expiry = null;
+ if (c.getMaxAge() != -1) {
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.SECOND, c.getMaxAge());
+ expiry = cal.getTime();
+ }
+ driver.manage().addCookie(
+ new org.openqa.selenium.Cookie(c
+ .getName(), c.getValue(), domain, c.getPath() != null ? c
+ .getPath() : "", expiry, c.getSecure()));
}
+ gotoPage(aInitialURL);
+ }
- private Proxy startBrowserMobProxy() {
- for (int i = 1; i <= TRY_COUNT; i++) {
- int port = getRandomPort();
- proxyServer = new ProxyServer(port);
- try {
- proxyServer.start();
- proxyServer.addResponseInterceptor(new HttpResponseInterceptor() {
- public void process(HttpResponse response, HttpContext context) throws HttpException, IOException {
- response.setEntity(new BufferedHttpEntity(response.getEntity()));
- WebDriverTestingEngineImpl.this.response = response;
- }
- });
- if (testContext.getRequestHeaders() != null && !testContext.getRequestHeaders().isEmpty()) {
- proxyServer.addRequestInterceptor(new HttpRequestInterceptor() {
- public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
- for (Map.Entry<String, String> requestHeader : testContext.getRequestHeaders().entrySet()) {
- request.addHeader(requestHeader.getKey(), requestHeader.getValue());
- }
- }
- });
- }
- if (StringUtils.isNotBlank(testContext.getUserAgent())) {
- proxyServer.addRequestInterceptor(new HttpRequestInterceptor() {
- public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
- request.removeHeaders("User-Agent");
- request.addHeader("User-Agent", testContext.getUserAgent());
- }
- });
- }
- return proxyServer.seleniumProxy();
+ private Proxy startBrowserMobProxy() {
+ for (int i = 1; i <= TRY_COUNT; i++) {
+ int port = getRandomPort();
+ proxyServer = new ProxyServer(port);
+ try {
+ proxyServer.start();
+ proxyServer.addResponseInterceptor(new ResponseInterceptor() {
+
+ @Override
+ public void process(BrowserMobHttpResponse response) {
+ WebDriverTestingEngineImpl.this.response = response;
+ }
+ });
+ if (testContext.getRequestHeaders() != null && !testContext.getRequestHeaders().isEmpty()) {
+ proxyServer.addRequestInterceptor(new RequestInterceptor() {
+
+ @Override
+ public void process(BrowserMobHttpRequest request) {
+ for (Map.Entry<String, String> requestHeader : testContext.getRequestHeaders().entrySet()) {
+ request.addRequestHeader(requestHeader.getKey(), requestHeader.getValue());
+ }
}
- catch (Exception e) {
- if (i<TRY_COUNT) {
- logger.error("Error while starting BrowserMob proxy on port " + port + ". Retry...: " + e.getMessage(), e);
- if (e instanceof MultiException) {
- Exception e1 = ((MultiException) e).getException(0);
- logger.error("First exception: " + e1.getMessage(), e1);
- }
- continue;
- }
+ });
+ }
+ if (StringUtils.isNotBlank(testContext.getUserAgent())) {
+ proxyServer.addRequestInterceptor(new RequestInterceptor() {
+ @Override
+ public void process(BrowserMobHttpRequest request) {
+ request.getMethod().removeHeaders("User-Agent");
+ request.addRequestHeader("User-Agent", testContext.getUserAgent());
}
+ });
}
- throw new RuntimeException("Unable to start BrowserMob proxy after " + TRY_COUNT + " retries");
- }
-
- private static int getRandomPort() {
- synchronized (RANDOM) {
- return DEFAULT_PORT + RANDOM.nextInt(1000);
+ return proxyServer.seleniumProxy();
+ } catch (Exception e) {
+ if (i < TRY_COUNT) {
+ logger.error("Error while starting BrowserMob proxy on port " + port + ". Retry...: " + e.getMessage(), e);
+ if (e instanceof MultiException) {
+ Exception e1 = ((MultiException) e).getException(0);
+ logger.error("First exception: " + e1.getMessage(), e1);
+ }
+ continue;
}
+ }
}
+ throw new RuntimeException("Unable to start BrowserMob proxy after " + TRY_COUNT + " retries");
+ }
- public void setTestContext(TestContext testContext) {
- this.testContext = testContext;
+ private static int getRandomPort() {
+ synchronized (RANDOM) {
+ return DEFAULT_PORT + RANDOM.nextInt(1000);
}
+ }
- public void closeBrowser() throws ExpectedJavascriptAlertException, ExpectedJavascriptConfirmException, ExpectedJavascriptPromptException {
- formIdent = null;
- if (driver != null) {
- driver.quit();
- driver = null;
- }
- if (proxyServer != null) {
- try {
- proxyServer.stop();
- proxyServer = null;
- }
- catch (Exception e) {
- logger.error("Error while stopping proxy", e);
- throw new RuntimeException("Error while stopping proxy", e);
- }
- }
- }
+ public void setTestContext(TestContext testContext) {
+ this.testContext = testContext;
+ }
- public void gotoPage(URL url) throws TestingEngineResponseException {
- formIdent = null;
- //Big hack for browsermob
- String urlStr = url.toString().replace("http://localhost", "http://127.0.0.1");
- driver.get(urlStr);
- throwFailingHttpStatusCodeExceptionIfNecessary(
- response.getStatusLine().getStatusCode(), urlStr);
+ public void closeBrowser() throws ExpectedJavascriptAlertException, ExpectedJavascriptConfirmException, ExpectedJavascriptPromptException {
+ formIdent = null;
+ if (driver != null) {
+ driver.quit();
+ driver = null;
}
-
- /**
- * Copied from {@link WebClient#throwFailingHttpStatusCodeExceptionIfNecessary(WebResponse)}
- *
- * @param webResponse
- */
- private void throwFailingHttpStatusCodeExceptionIfNecessary(int statusCode, String url) {
- final boolean successful = (statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES)
- || statusCode == HttpStatus.SC_USE_PROXY
- || statusCode == HttpStatus.SC_NOT_MODIFIED;
- if (!this.ignoreFailingStatusCodes && !successful) {
- throw new TestingEngineResponseException(statusCode,
- "unexpected status code [" + statusCode + "] at URL: [" + url + "]");
- }
+ if (proxyServer != null) {
+ try {
+ proxyServer.stop();
+ proxyServer = null;
+ } catch (Exception e) {
+ logger.error("Error while stopping proxy", e);
+ throw new RuntimeException("Error while stopping proxy", e);
+ }
}
+ }
- public void setScriptingEnabled(boolean value) {
- // This variable is used to set Javascript before wc is instancied
- jsEnabled = value;
- if (driver != null && driver instanceof HtmlUnitDriver) {
- ((HtmlUnitDriver) driver).setJavascriptEnabled(value);
- }
- }
+ public void gotoPage(URL url) throws TestingEngineResponseException {
+ formIdent = null;
+ // Big hack for browsermob
+ String urlStr = url.toString().replace("http://localhost", "http://127.0.0.1");
+ driver.get(urlStr);
+ throwFailingHttpStatusCodeExceptionIfNecessary(
+ getServerResponseCode(), urlStr);
+ }
- public void setThrowExceptionOnScriptError(boolean value) {
- this.throwExceptionOnScriptError = true;
+ /**
+ * Copied from {@link WebClient#throwFailingHttpStatusCodeExceptionIfNecessary(WebResponse)}
+ *
+ * @param webResponse
+ */
+ private void throwFailingHttpStatusCodeExceptionIfNecessary(int statusCode, String url) {
+ final boolean successful = (statusCode >= HttpStatus.SC_OK && statusCode < HttpStatus.SC_MULTIPLE_CHOICES)
+ || statusCode == HttpStatus.SC_USE_PROXY
+ || statusCode == HttpStatus.SC_NOT_MODIFIED;
+ if (!this.ignoreFailingStatusCodes && !successful) {
+ throw new TestingEngineResponseException(statusCode,
+ "unexpected status code [" + statusCode + "] at URL: [" + url + "]");
}
+ }
- public List<javax.servlet.http.Cookie> getCookies() {
- List<javax.servlet.http.Cookie> result = new LinkedList<javax.servlet.http.Cookie>();
- Set<Cookie> cookies = driver.manage().getCookies();
- for (Cookie cookie : cookies) {
- javax.servlet.http.Cookie c = new javax.servlet.http.Cookie(
- cookie.getName(), cookie.getValue());
- c.setDomain(cookie.getDomain());
- Date expire = cookie.getExpiry();
- if (expire == null) {
- c.setMaxAge(-1);
- } else {
- Date now = Calendar.getInstance().getTime();
- // Convert milli-second to second
- Long second = Long.valueOf((expire.getTime() - now.getTime()) / 1000);
- c.setMaxAge(second.intValue());
- }
- c.setPath(cookie.getPath());
- c.setSecure(cookie.isSecure());
- result.add(c);
- }
- return result;
+ public void setScriptingEnabled(boolean value) {
+ // This variable is used to set Javascript before wc is instancied
+ jsEnabled = value;
+ if (driver != null && driver instanceof HtmlUnitDriver) {
+ ((HtmlUnitDriver) driver).setJavascriptEnabled(value);
}
+ }
- public boolean hasWindow(String windowName) {
- //Save current handle
- String current = driver.getWindowHandle();
- try {
- driver.switchTo().window(windowName);
- driver.switchTo().window(current);
- return true;
- } catch (NoSuchWindowException e) {
- return false;
- }
- }
+ public void setThrowExceptionOnScriptError(boolean value) {
+ this.throwExceptionOnScriptError = true;
+ }
- public boolean hasWindowByTitle(String windowTitle) {
- //Save current handle
- String current = driver.getWindowHandle();
- for (String handle : driver.getWindowHandles()) {
- driver.switchTo().window(handle);
- if (driver.getTitle().equals(windowTitle)) {
- driver.switchTo().window(current);
- return true;
- }
- }
- driver.switchTo().window(current);
- return false;
+ public List<javax.servlet.http.Cookie> getCookies() {
+ List<javax.servlet.http.Cookie> result = new LinkedList<javax.servlet.http.Cookie>();
+ Set<Cookie> cookies = driver.manage().getCookies();
+ for (Cookie cookie : cookies) {
+ javax.servlet.http.Cookie c = new javax.servlet.http.Cookie(
+ cookie.getName(), cookie.getValue());
+ c.setDomain(cookie.getDomain());
+ Date expire = cookie.getExpiry();
+ if (expire == null) {
+ c.setMaxAge(-1);
+ } else {
+ Date now = Calendar.getInstance().getTime();
+ // Convert milli-second to second
+ Long second = Long.valueOf((expire.getTime() - now.getTime()) / 1000);
+ c.setMaxAge(second.intValue());
+ }
+ c.setPath(cookie.getPath());
+ c.setSecure(cookie.isSecure());
+ result.add(c);
}
+ return result;
+ }
- public void gotoWindow(String windowName) {
- driver.switchTo().window(windowName);
+ public boolean hasWindow(String windowName) {
+ // Save current handle
+ String current = driver.getWindowHandle();
+ try {
+ driver.switchTo().window(windowName);
+ driver.switchTo().window(current);
+ return true;
+ } catch (NoSuchWindowException e) {
+ return false;
}
+ }
- public void gotoWindowByTitle(String title) {
- //Save current handle
- String current = driver.getWindowHandle();
- for (String handle : driver.getWindowHandles()) {
- driver.switchTo().window(handle);
- if (title.equals(driver.getTitle())) {
- return;
- }
- }
+ public boolean hasWindowByTitle(String windowTitle) {
+ // Save current handle
+ String current = driver.getWindowHandle();
+ for (String handle : driver.getWindowHandles()) {
+ driver.switchTo().window(handle);
+ if (driver.getTitle().equals(windowTitle)) {
driver.switchTo().window(current);
- throw new RuntimeException("No window found with title [" + title + "]");
+ return true;
+ }
}
+ driver.switchTo().window(current);
+ return false;
+ }
- public void gotoWindow(int windowID) {
- Set<String> handles = driver.getWindowHandles();
- driver.switchTo().window(handles.toArray(new String[handles.size()])[windowID]);
- }
+ public void gotoWindow(String windowName) {
+ driver.switchTo().window(windowName);
+ }
- public void gotoRootWindow() {
- driver.switchTo().defaultContent();
+ public void gotoWindowByTitle(String title) {
+ // Save current handle
+ String current = driver.getWindowHandle();
+ for (String handle : driver.getWindowHandles()) {
+ driver.switchTo().window(handle);
+ if (title.equals(driver.getTitle())) {
+ return;
+ }
}
+ driver.switchTo().window(current);
+ throw new RuntimeException("No window found with title [" + title + "]");
+ }
- public int getWindowCount() {
- return driver.getWindowHandles().size();
- }
+ public void gotoWindow(int windowID) {
+ Set<String> handles = driver.getWindowHandles();
+ driver.switchTo().window(handles.toArray(new String[handles.size()])[windowID]);
+ }
- public void closeWindow() {
- formIdent = null;
- driver.close();
- //FIXME Issue 1466 & 2834
- if (getWindowCount() > 0) {
- driver.switchTo().window(driver.getWindowHandles().iterator().next());
- }
- }
+ public void gotoRootWindow() {
+ driver.switchTo().defaultContent();
+ }
- public boolean hasFrame(String frameNameOrId) {
- List<WebElement> frameset = driver.findElements(By.tagName("frame"));
- for (WebElement frame : frameset) {
- if (frameNameOrId.equals(frame.getAttribute("name"))
- || frameNameOrId.equals(frame.getAttribute("id"))) {
- return true;
- }
- }
- return false;
- }
+ public int getWindowCount() {
+ return driver.getWindowHandles().size();
+ }
- public void gotoFrame(String frameNameOrId) {
- driver.switchTo().frame(frameNameOrId);
+ public void closeWindow() {
+ formIdent = null;
+ driver.close();
+ // FIXME Issue 1466 & 2834
+ if (getWindowCount() > 0) {
+ driver.switchTo().window(driver.getWindowHandles().iterator().next());
}
+ }
- public void setWorkingForm(int index) {
- formIdent = "position()=" + (index + 1);
+ public boolean hasFrame(String frameNameOrId) {
+ List<WebElement> frameset = driver.findElements(By.tagName("frame"));
+ for (WebElement frame : frameset) {
+ if (frameNameOrId.equals(frame.getAttribute("name"))
+ || frameNameOrId.equals(frame.getAttribute("id"))) {
+ return true;
+ }
}
+ return false;
+ }
- public void setWorkingForm(String nameOrId, int index) {
- if (nameOrId != null) {
- formIdent = "(@name=" + escapeQuotes(nameOrId) + " or @id=" + escapeQuotes(nameOrId) + ")][position()="
- + (index + 1);
- } else {
- formIdent = null;
- }
- }
+ public void gotoFrame(String frameNameOrId) {
+ driver.switchTo().frame(frameNameOrId);
+ }
- protected String formSelector() {
- if (formIdent == null) {
- return "//form";
- }
- return "//form[" + formIdent + "]";
- }
+ public void setWorkingForm(int index) {
+ formIdent = "position()=" + (index + 1);
+ }
- public boolean hasForm() {
- return hasElementByXPath("//form");
+ public void setWorkingForm(String nameOr...
[truncated message content] |
|
From: <he...@us...> - 2014-03-17 10:57:42
|
Revision: 972
http://sourceforge.net/p/jwebunit/code/972
Author: henryju
Date: 2014-03-17 10:57:39 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
[maven-release-plugin] prepare release jwebunit-3.2
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-webdriver-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jwebunit-code-generator/pom.xml
===================================================================
--- trunk/jwebunit-code-generator/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/jwebunit-code-generator/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-commons-tests/pom.xml
===================================================================
--- trunk/jwebunit-commons-tests/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/jwebunit-commons-tests/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/jwebunit-core/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-htmlunit-plugin/pom.xml
===================================================================
--- trunk/jwebunit-htmlunit-plugin/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/jwebunit-htmlunit-plugin/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/jwebunit-webdriver-plugin/pom.xml
===================================================================
--- trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/jwebunit-webdriver-plugin/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -2,7 +2,7 @@
<parent>
<artifactId>jwebunit</artifactId>
<groupId>net.sourceforge.jwebunit</groupId>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-17 10:46:39 UTC (rev 971)
+++ trunk/pom.xml 2014-03-17 10:57:39 UTC (rev 972)
@@ -3,7 +3,7 @@
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit</artifactId>
<name>JWebUnit</name>
- <version>3.2-SNAPSHOT</version>
+ <version>3.2</version>
<packaging>pom</packaging>
<description>
JWebUnit is a Java framework that facilitates creation of
@@ -183,9 +183,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.2</connection>
+ <developerConnection>scm:svn:https://jwebunit.svn.sourceforge.net/svnroot/jwebunit/tags/jwebunit-3.2</developerConnection>
+ <url>http://jwebunit.svn.sourceforge.net/viewvc/jwebunit/tags/jwebunit-3.2</url>
</scm>
<organization>
<name>SourceForge</name>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|