[jboss-cvs] JBossAS SVN: r81513 - trunk/testsuite/src/main/org/jboss/test/web/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 24 16:36:20 EST 2008
Author: dimitris at jboss.org
Date: 2008-11-24 16:36:20 -0500 (Mon, 24 Nov 2008)
New Revision: 81513
Modified:
trunk/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java
Log:
re-instantiate the (failing) testJSFAppWithBundledMyFaces test
Modified: trunk/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java 2008-11-24 21:27:33 UTC (rev 81512)
+++ trunk/testsuite/src/main/org/jboss/test/web/test/JSFIntegrationUnitTestCase.java 2008-11-24 21:36:20 UTC (rev 81513)
@@ -34,6 +34,12 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethodBase;
import org.apache.commons.httpclient.methods.GetMethod;
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.SubmitButton;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
/** Tests of JSF integration into the JBoss server. This test
requires than a web container and JSF implementation be integrated
@@ -131,7 +137,25 @@
assertTrue(contains(responseBody, "facelets.viewhandler"));
assertTrue(contains(responseBody, "facelets.tag.meta"));
}
-
+
+ public void testJSFAppWithBundledMyFaces() throws Exception
+ {
+ String baseURL = HttpUtils.getBaseURL();
+ WebConversation webConversation = new WebConversation();
+
+ // Initial JSF request
+ WebRequest req = new GetMethodWebRequest(baseURL + "bundled-myfaces-hellojsf/index.faces");
+ WebResponse webResponse = webConversation.getResponse(req);
+ assertTrue(contains(webResponse.getText(), "Enter your name"));
+
+ // submit data
+ WebForm form = webResponse.getFormWithID("form1");
+ form.setParameter("form1:input_foo_text", "Stan");
+ SubmitButton submitButton = form.getSubmitButtonWithID("form1:submit_button");
+ webResponse = form.submit(submitButton);
+ assertTrue(contains(webResponse.getText(), "Hello Stan"));
+ }
+
private String getResponseBody(String warName) throws Exception
{
HttpClient client = new HttpClient();
@@ -175,9 +199,11 @@
super.setUp();
deploy("jbosstest-jsf.war");
deploy("jbosstest-jsf-facelets.war");
+ deploy("bundled-myfaces-hellojsf.war");
}
protected void tearDown() throws Exception
{
+ undeploy("bundled-myfaces-hellojsf.war");
undeploy("jbosstest-jsf-facelets.war");
undeploy("jbosstest-jsf.war");
super.tearDown();
More information about the jboss-cvs-commits
mailing list