Author: dsvyatobatsko
Date: 2009-03-04 12:11:33 -0500 (Wed, 04 Mar 2009)
New Revision: 12829
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
Log:
RF-6161, RF-6163
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/PickListTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/PickListTestBean.java 2009-03-04
16:59:50 UTC (rev 12828)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/PickListTestBean.java 2009-03-04
17:11:33 UTC (rev 12829)
@@ -36,7 +36,7 @@
private String removeAllLabel = "TAKE ALL AWAY";
- private List<String> items = Arrays.asList("ZHURIK",
"MELESHKO", "LEONTIEV", "KOVAL", "KALYUZHNY",
"DUDIK",
+ public static final List<String> ITEMS = Arrays.asList("ZHURIK",
"MELESHKO", "LEONTIEV", "KOVAL", "KALYUZHNY",
"DUDIK",
"KOSTITSYN", "GRABOVSKI");
private List<SelectItem> options;
@@ -123,13 +123,14 @@
public void reset() {
options = new ArrayList<SelectItem>();
- for (String player : items) {
+ for (String player : ITEMS) {
options.add(new SelectItem(player, player));
}
// preselected items
result = new ArrayList<String>();
- result.add(items.get(0));
- result.add(items.get(1));
+ result.add(ITEMS.get(0));
+ result.add(ITEMS.get(1));
}
+
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListAutoTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-04
16:59:50 UTC (rev 12828)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-04
17:11:33 UTC (rev 12829)
@@ -20,7 +20,9 @@
*/
package org.richfaces.testng;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.ajax4jsf.template.Template;
@@ -28,6 +30,7 @@
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
+import static org.ajax4jsf.bean.PickListTestBean.ITEMS;
public class PickListTest extends SeleniumTestBase {
@@ -125,6 +128,37 @@
}
@Test
+ public void testValueChangeEventFiredAndModelUpdatedOnSubmit(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ String resultId = tester.getClientId("result");
+
+ writeStatus("Check ValueChangeListeners invoked on submit and model binding
is updated on value changed");
+
+ List<String> expected = Arrays.asList("ZHURIK",
"MELESHKO");
+ AssertTextEquals(resultId, expected.toString());
+
+ tester.testSubmit();
+
+ AssertTextEquals(resultId, ITEMS.toString(), "Model binding is not
updated");
+ }
+
+ @Test
+ public void testSubmitWithExternalValidationFailed(Template template ) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component's form submission with an invalid element in
it");
+ String resultId = tester.getClientId("result");
+
+ List<String> expected = Arrays.asList("ZHURIK",
"MELESHKO");
+ AssertTextEquals(resultId, expected.toString());
+
+ tester.testSubmitWithExternalValidationFailed();
+
+ AssertTextEquals(resultId, expected.toString(), "Model has to be
untouched");
+ }
+
+ @Test
public void testRenderedAttribute(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
Show replies by date