Author: dsvyatobatsko
Date: 2009-02-19 13:16:20 -0500 (Thu, 19 Feb 2009)
New Revision: 12696
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/RequestBean.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
Log:
https://jira.jboss.org/jira/browse/RF-6207
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/RequestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/RequestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/RequestBean.java 2009-02-19
18:16:20 UTC (rev 12696)
@@ -0,0 +1,26 @@
+package org.ajax4jsf.autotest.bean;
+
+/**
+ * Used for fetching request parameters to further examination.
+ */
+public class RequestBean {
+
+ private String paramString;
+
+ /**
+ * Gets value of paramString field.
+ * @return value of paramString field
+ */
+ public String getParamString() {
+ return paramString;
+ }
+
+ /**
+ * Set a new value for paramString field.
+ * @param paramString a new value for paramString field
+ */
+ public void setParamString(String paramString) {
+ this.paramString = paramString;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/RequestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-02-19
18:13:16 UTC (rev 12695)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2009-02-19
18:16:20 UTC (rev 12696)
@@ -309,6 +309,15 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>requestBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.autotest.bean.RequestBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>paramString</property-name>
+ <value>#{param}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>treeBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.tree.TreeTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2009-02-19
18:13:16 UTC (rev 12695)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2009-02-19
18:16:20 UTC (rev 12696)
@@ -5,6 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:inputHidden id="_auto_input" value="#{autoTestBean.input}"
required="true"></h:inputHidden>
+ <h:outputText id="_auto_request_params" style="display: none;"
value="#{requestBean.paramString}" />
<h:inputHidden id="_auto_process_input"
value="#{autoTestBean.processInput}"
valueChangeListener="#{autoTestBean.processInputChangeListener}"></h:inputHidden>
<a4j:outputPanel ajaxRendered="true">
<h:outputText id="_auto_status" style="display: none;"
value="#{autoTestBean.status}"></h:outputText>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-19
18:13:16 UTC (rev 12695)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-19
18:16:20 UTC (rev 12696)
@@ -50,7 +50,9 @@
public static final String VALUE_ID = "_auto_value";
private static final String TIME_ID = "_auto_time";
-
+
+ private static final String REQ_PARAMS_ID = "_auto_request_params";
+
private static final String MESSAGE_FOR_ID = "_auto_messageId";
public static final String COMPONENT_ID = "componentId";
@@ -62,13 +64,9 @@
private static final String AJAX_SUBMIT = "_auto_ajax_submit";
private static final String AJAX_RESET = "_auto_ajax_reset";
-
- private
- // /private String componentName;
+ private SeleniumTestBase base;
- SeleniumTestBase base;
-
public AutoTester(SeleniumTestBase base) {
this.base = base;
}
@@ -386,6 +384,21 @@
checkUpdateModel(false);
}
+ public void testASRequestParameters(Map<String, String> params) {
+ reset();
+ clickLoad();
+
+ base.sendAction();
+
+ String paramString = base.getTextById(base.getParentId() + AUTOTEST_FORM_ID +
REQ_PARAMS_ID);
+
+ for (Map.Entry<String, String> entry : params.entrySet()) {
+ if (!paramString.contains(entry.toString())) {
+ Assert.fail("Request parameter [" + entry.toString() + "]
is expected");
+ }
+ }
+ }
+
//
// EditableValueHolder test methods
//
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2009-02-19
18:13:16 UTC (rev 12695)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxHTMLCommandLinkTest.java 2009-02-19
18:16:20 UTC (rev 12696)
@@ -20,6 +20,9 @@
*/
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
@@ -33,6 +36,14 @@
private final static String SUBMITTED_VALUE = "_form:_submittedValue";
+ private static Map<String, String> params = new HashMap<String,
String>();
+
+ static {
+ params.put("parameter1", "value1");
+ params.put("parameter2", "value2");
+ params.put("parameter3", "value3");
+ }
+
@Test
public void testAjaxHTMLCommandLinkComponent(Template template) {
renderPage(template);
@@ -110,6 +121,14 @@
tester.testRendered();
}
+ @Test
+ public void testNestedParams(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test component encodes nested f:param tags and their values are
present as request parameters");
+ tester.testASRequestParameters(params);
+ }
+
@Override
public void sendAction() {
clickCommandAndWait(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));