Author: dsvyatobatsko
Date: 2009-03-10 13:07:03 -0400 (Tue, 10 Mar 2009)
New Revision: 12910
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
Log:
RF-6240, RF-6241, RF-6242, RF-6243, RF-6244, RF-6245, RF-6253
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java 2009-03-10
15:58:41 UTC (rev 12909)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java 2009-03-10
17:07:03 UTC (rev 12910)
@@ -57,6 +57,10 @@
return retVal;
}
+ public void reset() {
+ this.countryName = "";
+ }
+
/**
* Country
*/
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
===================================================================
(Binary files differ)
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-03-10
15:58:41 UTC (rev 12909)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-03-10
17:07:03 UTC (rev 12910)
@@ -237,13 +237,19 @@
}
public void testBypassUpdate() {
+ testBypassUpdate(true);
+ }
+
+ public void testBypassUpdate(boolean checkListener) {
reset();
setupControl(TestSetupEntry.bypassUpdate, Boolean.TRUE);
clickLoad();
base.sendAjax();
- checkActionListener(true);
+ if (checkListener) {
+ checkActionListener(true);
+ }
checkUpdateModel(false);
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-03-10
15:58:41 UTC (rev 12909)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-03-10
17:07:03 UTC (rev 12910)
@@ -12,6 +12,8 @@
private static Map<String, String> params = new HashMap<String,
String>();
+ private final static String RESET_METHOD = "#{suggestionBean.reset}";
+
static {
params.put("parameter1", "value1");
params.put("parameter2", "value2");
@@ -21,7 +23,7 @@
@Test
public void testRenderedAttribute(Template template) {
AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
+ tester.renderPage(template, RESET_METHOD);
writeStatus("Test component with rendered = false is not present on the
page");
tester.testRendered();
}
@@ -29,15 +31,95 @@
@Test
public void testNestedParams(Template template) {
AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
+ tester.renderPage(template, RESET_METHOD);
writeStatus("Test component encodes nested f:param tags and their values are
present as request parameters");
tester.testRequestParameters(params);
}
+ @Test
+ public void testReRenderAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component re-renders another components");
+ tester.testReRender();
+ }
+
+ @Test
+ public void testOncomplete(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test oncomplete attribute");
+ tester.testOncomplete();
+ }
+
+ @Test
+ public void testWithExternalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+ writeStatus("Check component in case of external validation failure:
listeners are not invoked, model is not updated");
+ autoTester.testExtrenalValidationFailure();
+ }
+
+ @Test
+ public void testLimitToListAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with limitToList = true skips ajaxRendered areas
update");
+ tester.testLimitToList();
+ }
+
+ @Test
+ public void testBypassUpdatesAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with bypassUpdates = true skips update model
values phase");
+ tester.testBypassUpdate(false);
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute");
+ tester.testImmediate(false);
+ }
+
+ @Test
+ public void testImmediateWithExternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute with external validation
failed");
+ tester.testImmediateWithExternalValidationFailed(false);
+ }
+
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute");
+ tester.testAjaxSingle(false);
+ }
+
+ @Test
+ public void testAjaxSingleWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute in case of invalid children
state");
+ tester.testAjaxSingleWithInternalValidationFailed();
+ }
+
+ @Test
+ public void testAjaxSingleWithProcessExternalValidation(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ tester.testAjaxSingleWithProcesExternalValidation(false);
+ }
+
@Override
public void sendAjax() {
type(getAutoTester(this).getClientId("suggestion"), "Bel");
waitForAjaxCompletion();
+ selenium.click("//table[@id='" +
getAutoTester(this).getClientId(AutoTester.COMPONENT_ID +
":suggest']/tbody/tr[1]"));
}
@Override
Show replies by date