Author: dsvyatobatsko
Date: 2009-02-17 07:24:01 -0500 (Tue, 17 Feb 2009)
New Revision: 12682
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataFilterSliderBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5986
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataFilterSliderBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataFilterSliderBean.java 2009-02-17
12:17:44 UTC (rev 12681)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataFilterSliderBean.java 2009-02-17
12:24:01 UTC (rev 12682)
@@ -56,6 +56,8 @@
private Integer increment = 1;
+ private boolean storeResults = true;
+
private Integer handleValue = 20;
public DataFilterSliderBean() {
@@ -151,6 +153,22 @@
this.increment = increment;
}
+ /**
+ * Gets value of storeResults field.
+ * @return value of storeResults field
+ */
+ public boolean isStoreResults() {
+ return storeResults;
+ }
+
+ /**
+ * Set a new value for storeResults field.
+ * @param storeResults a new value for storeResults field
+ */
+ public void setStoreResults(boolean storeResults) {
+ this.storeResults = storeResults;
+ }
+
public String action() {
return null;
}
@@ -160,10 +178,16 @@
increment = 5;
}
+ public void initStoreResultsTest() {
+ reset();
+ storeResults = false;
+ }
+
public String reset() {
eventSnapshot = "";
handleValue = 20;
increment = 1;
+ storeResults = true;
return null;
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-17
12:17:44 UTC (rev 12681)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-17
12:24:01 UTC (rev 12682)
@@ -50,6 +50,8 @@
private static final String INIT_INCREMENT_TEST =
"#{dataFilterSliderBean.initIncrementTest}";
+ private static final String INIT_STORE_RESULTS_TEST =
"#{dataFilterSliderBean.initStoreResultsTest}";
+
private static final String FORM_ID = "autoTestForm:";
@Test
@@ -172,6 +174,34 @@
}
@Test
+ public void testStoreResultsAttribute(Template template) {
+ renderPage(template, INIT_STORE_RESULTS_TEST);
+
+ String parentId = getParentId() + FORM_ID;
+ String tableId = parentId + TABLE;
+ String submittedValueId = parentId + "submittedValue";
+
+ writeStatus("Check 'storeResults' attributes");
+
+ writeStatus("Check that if storeResults set to false dataFilterSlider has no
effect on result dataTable");
+
+ writeStatus("All planets are shown at every turn");
+
+ clickSlider(1);
+ assertRowsCount(PLANETS_ALL, tableId);
+ AssertTextEquals(submittedValueId, "1");
+ checkDataFilterSliderEventFired(20, 1);
+
+ clickSlider(2);
+ assertRowsCount(PLANETS_ALL, tableId);
+ checkDataFilterSliderEventFired(1, 2);
+
+ clickSlider(5);
+ assertRowsCount(PLANETS_ALL, tableId);
+ checkDataFilterSliderEventFired(2, 5);
+ }
+
+ @Test
public void testRenderedAttribute(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);