summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes')
-rw-r--r--sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/pom.xml4
-rw-r--r--sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java18
2 files changed, 11 insertions, 11 deletions
diff --git a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/pom.xml b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/pom.xml
index 7531f1b7b6..a9f7762fd7 100644
--- a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/pom.xml
+++ b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/pom.xml
@@ -59,9 +59,9 @@
</dependency>
<dependency>
- <groupId>htmlunit</groupId>
+ <groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
- <version>1.9</version>
+ <version>2.6</version>
<scope>test</scope>
</dependency>
diff --git a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
index 743ab054c8..53aaa54aaf 100644
--- a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
+++ b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
@@ -29,6 +29,7 @@ import org.junit.Test;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
@@ -39,15 +40,14 @@ public class HelloworldTestCase {
@Test
public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes");
- Iterator<?> ss = page.getAllHtmlChildElements();
- Object o1= ss.next();
- Object o2= ss.next();
- Object o3= ss.next();
- Object o4= ss.next();
- Object o5= ss.next();
- Object o6= ss.next();
- HtmlParagraph p = (HtmlParagraph)ss.next();
- assertEquals("sayHello returns: Hello world", p.asText());
+ Iterator<?> ss = page.getAllHtmlChildElements().iterator();
+ while(ss.hasNext()) {
+ HtmlElement htmlElement = (HtmlElement) ss.next();
+ if( htmlElement instanceof HtmlParagraph) {
+ assertEquals("sayHello returns: Hello world", htmlElement.asText());
+ break;
+ }
+ }
}
}