[richfaces-svn-commits] JBoss Rich Faces SVN: r11795 - in trunk/test-applications/seleniumTest/richfaces/src: main/java/org/ajax4jsf/listener and 3 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Tue Dec 16 05:43:14 EST 2008
Author: alevkovsky
Date: 2008-12-16 05:43:14 -0500 (Tue, 16 Dec 2008)
New Revision: 11795
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
Log:
RF-5314, RF-5315, RF-5316, RF-5317
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JSupport.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -26,6 +26,12 @@
private String data = null;
+ private boolean checkboxValue1;
+
+ private boolean checkboxValue2;
+
+ private String status = Messages.IDLE_STATUS;
+
/** property for testUpdatingValue */
private String inputValue = A4JSupport.Messages.INPUT_VALUE;
@@ -49,14 +55,20 @@
public static final String VALID_MESSAGE = "field is required";
public static final String INPUT_VALUE = "test";
+
+ public static final String IDLE_STATUS = "idle";
+
+ public static final String PROCESSING_STATUS = "process";
}
public void linkListener (ActionEvent event) {
data = Messages.TEST_PASSED;
+ status = Messages.PROCESSING_STATUS;
}
public void checkBoxListener (ActionEvent event) {
data = Messages.TEST_PASSED;
+ status = Messages.PROCESSING_STATUS;
}
public void commandListener (ActionEvent event) {
@@ -93,4 +105,48 @@
this.inputValue = inputValue;
}
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @param status the status to set
+ */
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ /**
+ * @return the checkboxValue1
+ */
+ public boolean isCheckboxValue1() {
+ return checkboxValue1;
+ }
+
+ /**
+ * @param checkboxValue1 the checkboxValue1 to set
+ */
+ public void setCheckboxValue1(boolean checkboxValue1) {
+ this.checkboxValue1 = checkboxValue1;
+ }
+
+ /**
+ * @return the checkboxValue2
+ */
+ public boolean isCheckboxValue2() {
+ return checkboxValue2;
+ }
+
+ /**
+ * @param checkboxValue2 the checkboxValue2 to set
+ */
+ public void setCheckboxValue2(boolean checkboxValue2) {
+ this.checkboxValue2 = checkboxValue2;
+ }
+
+
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/listener/AjaxSupportActionListener.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -43,6 +43,7 @@
A4JSupport bean = (A4JSupport) FacesUtils.getFacesBean(A4JSupport.BEAN_NAME);
if (bean != null) {
bean.setData(str);
+ bean.setStatus(Messages.PROCESSING_STATUS);
}
}
}
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 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-12-16 10:43:14 UTC (rev 11795)
@@ -306,4 +306,11 @@
<to-view-id>/pages/ajaxInclude/step1.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>navigate</from-outcome>
+ <to-view-id>/pages/ajaxSupport/successNavigation.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
</faces-config>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/successNavigation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testAjaxSingleAttribute3.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testByPassList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testEvents.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testLimitToList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxSupport/testTemplate.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-12-16 10:33:32 UTC (rev 11794)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxSupportTest.java 2008-12-16 10:43:14 UTC (rev 11795)
@@ -20,7 +20,11 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.List;
+
import org.ajax4jsf.bean.A4JSupport;
+import org.ajax4jsf.bean.A4JSupport.Messages;
import org.ajax4jsf.template.Template;
import org.bouncycastle.asn1.pkcs.KeyDerivationFunc;
import org.richfaces.SeleniumTestBase;
@@ -50,6 +54,8 @@
private static final String AJAXSINGLE_ATTRIBUTE2_PAGE = "testAjaxSingleAttribute2.xhtml";
+ private static final String AJAXSINGLE_ATTRIBUTE3_PAGE = "testAjaxSingleAttribute3.xhtml";
+
private static final String RERENDER_ATTRIBUTE_PAGE = "testRerenderFunctionality.xhtml";
private static final String ENABLED_ATTRIBUTE_PAGE = "testEnabledAttribute.xhtml";
@@ -58,6 +64,12 @@
private static final String UPDATING_VALUE = "testUpdatingValue.xhtml";
+ private static final String EVENTS_PAGE = "testEvents.xhtml";
+
+ private static final String LIMIT_TO_LIST_ATTRIBUTE_PAGE = "testLimitToList.xhtml";
+
+ private static final String BY_PASS_UPDATES_ATTRIBUTE_PAGE = "testByPassList.xhtml";
+
private static final String DEFAULT_BEHAVIOUR_ID_PREFIX = "_db";
private static final String VALIDATION_FAILED_ID_PREFIX = "_vf";
@@ -196,20 +208,32 @@
//
// }
//
-// /** component with bypassUpdates = true skips update model values phase */
-// @Test
-// public void testByPassAttribute() {
-//
-// }
-//
-//
-//
-// /** component with limitToList = true skips ajaxRendered areas update */
-// @Test
-// public void testLimitToListAttribute() {
-//
-// }
-//
+ /** component with bypassUpdates = true skips update model values phase */
+ @Test
+ public void testByPassAttribute(Template template) {
+ setTestUrl(BY_PASS_UPDATES_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ processingElement(checkboxId, dataId2, false);
+ AssertTextEquals(dataId2 + "_ch", "false", "By pass updates attribute not work" );
+ processingElement(checkboxId + COMMON_ALISTENER_PREFIX, dataId2 + COMMON_ALISTENER_PREFIX, false);
+ AssertTextEquals(dataId2 + COMMON_ALISTENER_PREFIX + "_ch", "false", "By pass updates attribute not work" );
+
+ }
+
+
+
+ /** component with limitToList = true skips ajaxRendered areas update */
+ @Test
+ public void testLimitToListAttribute(Template template) {
+ setTestUrl(LIMIT_TO_LIST_ATTRIBUTE_PAGE);
+ init(template);
+ passExternalValidation();
+ checkBasicFunctionality(template, "", false);
+ AssertTextEquals(parentFormId + "ajax_status", Messages.IDLE_STATUS,
+ "Limit to list attribute not work");
+ }
+
/** component with rendered = false is not present on the page */
@Test
public void testRenderedAttribute(Template template) {
@@ -221,15 +245,35 @@
checkOnclickAttr(checkboxId + RENDERED_ATTRIBUTE_ID_PREFIX);
checkOnclickAttr(checkboxId + COMMON_ALISTENER_PREFIX + RENDERED_ATTRIBUTE_ID_PREFIX);
}
-//
-// /**
-// * onsubmit event fires on component activation then
-// * oncomplete with proper request data
-// */
-// @Test
-// public void testOnSubmitEvent1() {
-//
-// }
+
+ /**
+ * onsubmit event fires on component activation then
+ * oncomplete with proper request data
+ */
+ @Test
+ public void testOnSubmitAndOnCOmpleteEvents(Template template) {
+ setTestUrl(EVENTS_PAGE);
+ init(template);
+ passExternalValidation();
+ processingElement(linkId, dataId1, false);
+ assertEvents();
+ processingElement(linkId + COMMON_ALISTENER_PREFIX, dataId1 + COMMON_ALISTENER_PREFIX, false);
+ assertEvents();
+ processingElement(checkboxId, dataId2, false);
+ assertEvents();
+ processingElement(checkboxId + COMMON_ALISTENER_PREFIX, dataId2 + COMMON_ALISTENER_PREFIX, false);
+ assertEvents();
+
+ }
+
+ private void assertEvents(){
+ List<String> eventsExpected = new ArrayList<String>();
+
+ eventsExpected.add("onsubmit");
+ eventsExpected.add("oncomplete");
+ assertEvents(eventsExpected);
+ }
+
/** component with disabled = true do not fire ajax requests */
@Test
public void testEnabledAttribute(Template template) {
@@ -257,17 +301,21 @@
writeStatus(CommonUtils.getSuccessfulTestMessage(iid));
}
-// /**
-// * @see #testAjaxSupportComponent()
-// *
-// * the same for ajaxSingle = true component for the case
-// * of external validation failure + process for validation failed
-// * field - listeners and navigation do not work
-// */
-// @Test
-// public void testAjaxSingleAttribute3() {
-//
-// }
+ /**
+ * @see #testAjaxSupportComponent()
+ *
+ * the same for ajaxSingle = true component for the case
+ * of external validation failure + process for validation failed
+ * field - listeners and navigation do not work
+ */
+ @Test
+ public void testAjaxSingleAttribute3(Template template) {
+ setTestUrl(AJAXSINGLE_ATTRIBUTE3_PAGE);
+ init(template);
+ breakExternalValidation();
+ checkBasicFunctionality(template, "", false);
+ AssertNotPresent(getParentId() + "successNavigationTextId", "Navigation shouldn't work");
+ }
private void checkOnclickAttr(String elementId) {
More information about the richfaces-svn-commits
mailing list