summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-02-22 20:44:24 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-02-22 20:44:24 +0000
commit0f560ae9c35c5a9f3b65cd95130b316d40c687c8 (patch)
tree532fc7435d29f23f65feb53218a463a1be54d255 /sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java
parent97a82f0659ad3a6f4e51d5c6fb2b675e036e360a (diff)
Moving to most recent release of HtmlUnit (2.6) and adjusting tests based on api changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@915053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java/itest/HelloworldTestCase.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
index bed840b44a..61d722da1f 100644
--- a/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
+++ b/sca-java-2.x/trunk/itest/distribution/webapp-helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
@@ -26,7 +26,6 @@ import java.net.MalformedURLException;
import org.junit.Test;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.UnexpectedPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
@@ -48,13 +47,9 @@ public class HelloworldTestCase {
HtmlButton button = (HtmlButton) form.getButtonsByName("submit").get(0);
- Object foo = button.click();
+ HtmlPage pageResponse = (HtmlPage) button.click();
- // TODO: something up with getting the response but this works:
- UnexpectedPage p = (UnexpectedPage) foo;
- String s = new String(p.getWebResponse().getResponseBody());
-
- assertTrue(s.endsWith("</strong>Hello petra</body></html>"));
+ assertTrue(pageResponse.getWebResponse().getContentAsString().endsWith("</strong>Hello petra</body></html>"));
}
}