Author: ppitonak(a)redhat.com
Date: 2010-12-17 11:48:59 -0500 (Fri, 17 Dec 2010)
New Revision: 20661
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
Log:
* fixed tests for slider
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2010-12-17
16:47:39 UTC (rev 20660)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2010-12-17
16:48:59 UTC (rev 20661)
@@ -58,6 +58,7 @@
attributes.setAttribute("enableManualInput", true);
attributes.setAttribute("inputSize", 3);
+ attributes.setAttribute("maxlength", 10);
attributes.setAttribute("maxValue", 10);
attributes.setAttribute("minValue", -10);
attributes.setAttribute("rendered", true);
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml 2010-12-17
16:47:39 UTC (rev 20660)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richInputNumberSlider/simple.xhtml 2010-12-17
16:48:59 UTC (rev 20661)
@@ -75,9 +75,10 @@
trackClass="#{richInputNumberSliderBean.attributes['trackClass'].value}"
validatorMessage="#{richInputNumberSliderBean.attributes['validatorMessage'].value}"
value="#{richInputNumberSliderBean.attributes['value'].value}"
+
valueChangeListener="#{richBean.valueChangeListener}"
- <a4j:ajax render="output"/>
+ <a4j:ajax event="change" render="output"/>
</rich:inputNumberSlider>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2010-12-17
16:47:39 UTC (rev 20660)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2010-12-17
16:48:59 UTC (rev 20661)
@@ -233,7 +233,7 @@
}
@Test
- @Use(field = "delay", ints = {200, 500, 3700})
+ @Use(field = "delay", ints = {300, 500, 3700})
public void testDelay() {
selenium.type(pjq("input[type=text][id$=delayInput]"),
delay.toString());
selenium.waitForPageToLoad();
@@ -293,17 +293,17 @@
@Test
public void testImmediate() {
- JQueryLocator immediateInput =
pjq("input[type=radio][name$=immediateInput][value=true]");
- selenium.click(immediateInput);
+
selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- guardXhr(selenium).type(input, "4");
+ guardXhr(selenium).mouseDownAt(track, new Point(0, 0));
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
- assertEquals(selenium.getText(output), "4", "Output was not
updated.");
- assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES,
PhaseId.PROCESS_VALIDATIONS, PhaseId.UPDATE_MODEL_VALUES,
- PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES,
PhaseId.PROCESS_VALIDATIONS,
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION,
PhaseId.RENDER_RESPONSE);
+ String listenerText = selenium.getText(jq("div#phasesPanel
li:eq(2)"));
+ assertEquals(listenerText, "* value changed: 2 -> -10", "Value
change listener was not invoked.");
}
@Test
@@ -564,8 +564,8 @@
}
@Test
- public void testShowToolTip() {
-
selenium.click(pjq("input[type=radio][name$=showToolTipInput][value=true]"));
+ public void testShowTooltip() {
+
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
selenium.waitForPageToLoad();
assertTrue(selenium.isElementPresent(tooltip), "Tooltip should be present on
the page.");
@@ -604,11 +604,11 @@
}
@Test
- public void testToolTipClass() {
-
selenium.click(pjq("input[type=radio][name$=showToolTipInput][value=true]"));
+ public void testTooltipClass() {
+
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
selenium.waitForPageToLoad();
- testStyleClass(tooltip, "toolTipClass");
+ testStyleClass(tooltip, "tooltipClass");
}
@Test
@@ -688,7 +688,7 @@
timesArray[i] = sdf.parse(timesList.get(i));
}
- delta = (long) (delay * 0.2);
+ delta = (long) (delay * 0.5);
for (int i = 1; i < timesArray.length - 1; i++) {
long diff = timesArray[i + 1].getTime() - timesArray[i].getTime();
assertTrue(Math.abs(diff - delay) < delta, "Delay " + diff +
" is too far from set value (" + delay + ")");