JBoss Rich Faces SVN: r23038 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-12-05 08:28:57 -0500 (Mon, 05 Dec 2011)
New Revision: 23038
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataScroller/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
Log:
3 tests for rich:dataScroller fixed
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataScroller/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataScroller/simple.xhtml 2011-12-02 16:25:48 UTC (rev 23037)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataScroller/simple.xhtml 2011-12-05 13:28:57 UTC (rev 23038)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich">
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich">
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -26,214 +26,218 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
- <ui:param name="componentId" value="richDataTable" />
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richDataTable" />
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
- <ui:define name="head"/>
+ <ui:define name="head" />
- <ui:define name="outOfTemplateBefore">
- <br/>
+ <ui:define name="outOfTemplateBefore">
+ <br />
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richDataScrollerBean.state}">
- <a4j:ajax render="scroller1 #{nestedComponentId}"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- <rich:dataScroller id="scroller1"
- for="#{richDataScrollerBean.attributes['for'].value}"
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richDataScrollerBean.state}">
+ <a4j:ajax render="scroller1 #{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+ <br />
+ <br />
+ <rich:dataScroller id="scroller1" for="#{richDataScrollerBean.attributes['for'].value}"
+ boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
+ data="#{richDataScrollerBean.attributes['data'].value}"
+ execute="#{richDataScrollerBean.attributes['execute'].value}"
+ fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
+ fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
+ lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
+ limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
+ maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
+ onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
+ onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
+ oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
+ page="#{richDataScrollerBean.attributes['page'].value}"
+ render="#{richDataScrollerBean.attributes['render'].value} #{nestedComponentId}"
+ renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
+ rendered="#{richDataScrollerBean.attributes['rendered'].value}"
+ status="#{richDataScrollerBean.attributes['status'].value}"
+ stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
+ style="#{richDataScrollerBean.attributes['style'].value}"
+ styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
+ title="#{richDataScrollerBean.attributes['title'].value}" />
+ </ui:define>
- boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
- data="#{richDataScrollerBean.attributes['data'].value}"
- execute="#{richDataScrollerBean.attributes['execute'].value}"
- fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
- fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
- lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
- limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
- maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
- onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
- onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
- oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
- page="#{richDataScrollerBean.attributes['page'].value}"
- render="#{richDataScrollerBean.attributes['render'].value} #{nestedComponentId}"
- renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
- rendered="#{richDataScrollerBean.attributes['rendered'].value}"
- status="#{richDataScrollerBean.attributes['status'].value}"
- stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
- style="#{richDataScrollerBean.attributes['style'].value}"
- styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
- title="#{richDataScrollerBean.attributes['title'].value}"
- />
- </ui:define>
+ <ui:define name="component">
- <ui:define name="component">
+ <rich:dataTable id="richDataTable" rows="#{richDataScrollerBean.tableAttributes['rows'].value}"
+ value="#{richDataScrollerBean.state ? model.capitals : null}" var="record">
- <rich:dataTable id="richDataTable"
- rows="#{richDataScrollerBean.tableAttributes['rows'].value}"
- value="#{richDataScrollerBean.state ? model.capitals : null}"
- var="record"
- >
+ <f:facet name="noData">
+ <h:outputText value="There is no data." style="color: red;" />
+ </f:facet>
- <f:facet name="noData">
- <h:outputText value="There is no data." style="color: red;"/>
+ <rich:column id="columnState" sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState" value="State" />
</f:facet>
- <rich:column id="columnState" sortBy="#{record.state}">
- <f:facet name="header">
- <h:outputText id="columnHeaderState" value="State" />
- </f:facet>
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState" value="State" />
+ </f:facet>
+ </rich:column>
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State" />
- </f:facet>
- </rich:column>
+ <rich:column id="columnCapital" sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital" value="Capital" />
+ </f:facet>
- <rich:column id="columnCapital" sortBy="#{record.name}">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital" value="Capital" />
- </f:facet>
-
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital" />
- </f:facet>
- </rich:column>
-
+ <h:outputText value="#{record.name}" />
<f:facet name="footer">
- <rich:dataScroller id="scroller2"
-
- boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
- data="#{richDataScrollerBean.attributes['data'].value}"
- execute="#{richDataScrollerBean.attributes['execute'].value}"
- fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
- fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
- first="#{richDataScrollerBean.attributes['first'].value}"
- lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
- limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
- maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
- onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
- onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
- oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
- page="#{richDataScrollerBean.attributes['page'].value}"
- render="#{richDataScrollerBean.attributes['render'].value} scroller1"
- renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
- rendered="#{richDataScrollerBean.attributes['rendered'].value}"
- status="#{richDataScrollerBean.attributes['status'].value}"
- stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
- style="#{richDataScrollerBean.attributes['style'].value}"
- styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
- title="#{richDataScrollerBean.attributes['title'].value}"
- />
+ <h:outputText id="columnFooterCapital" value="Capital" />
</f:facet>
+ </rich:column>
- </rich:dataTable>
- </ui:define>
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
+ boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
+ data="#{richDataScrollerBean.attributes['data'].value}"
+ execute="#{richDataScrollerBean.attributes['execute'].value}"
+ fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
+ fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
+ first="#{richDataScrollerBean.attributes['first'].value}"
+ lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
+ limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
+ maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
+ onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
+ onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
+ oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
+ page="#{richDataScrollerBean.attributes['page'].value}"
+ render="#{richDataScrollerBean.attributes['render'].value} scroller1"
+ renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
+ rendered="#{richDataScrollerBean.attributes['rendered'].value}"
+ status="#{richDataScrollerBean.attributes['status'].value}"
+ stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
+ style="#{richDataScrollerBean.attributes['style'].value}"
+ styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
+ title="#{richDataScrollerBean.attributes['title'].value}" />
+ </f:facet>
- <ui:define name="outOfTemplateAfter">
- <fieldset><legend>JavaScript API - scroller1</legend>
- <h:commandButton id="buttonStpFirst1" value="«« first">
- <rich:componentControl event="click" target="scroller1" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
+ </rich:dataTable>
+ </ui:define>
- <h:commandButton id="buttonStpPrev1" value="« previous">
- <rich:componentControl event="click" target="scroller1" operation="switchToPage">
- <f:param value="fastrewind" />
- </rich:componentControl>
- </h:commandButton>
+ <ui:define name="outOfTemplateAfter">
+ <fieldset>
+ <legend>JavaScript API - scroller1</legend>
+ <h:commandButton id="buttonStpFirst1" value="«« first">
+ <rich:componentControl event="click" target="scroller1" operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpNext1" value="next »">
- <rich:componentControl event="click" target="scroller1" operation="switchToPage">
- <f:param value="fastforward" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpPrev1" value="« previous">
+ <rich:componentControl event="click" target="scroller1" operation="switchToPage">
+ <f:param value="fastrewind" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpLast1" value="last »»">
- <rich:componentControl event="click" target="scroller1" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpNext1" value="next »">
+ <rich:componentControl event="click" target="scroller1" operation="switchToPage">
+ <f:param value="fastforward" />
+ </rich:componentControl>
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonStpLast1" value="last »»">
+ <rich:componentControl event="click" target="scroller1" operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonFirst1" value="«« first">
- <rich:componentControl event="click" target="scroller1" operation="first" />
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonPrev1" value="« previous">
- <rich:componentControl event="click" target="scroller1" operation="previous" />
- </h:commandButton>
+ <h:commandButton id="buttonFirst1" value="«« first">
+ <rich:componentControl event="click" target="scroller1" operation="first" />
+ </h:commandButton>
- <h:commandButton id="buttonNext1" value="next »">
- <rich:componentControl event="click" target="scroller1" operation="next" />
- </h:commandButton>
+ <h:commandButton id="buttonPrev1" value="« previous">
+ <rich:componentControl event="click" target="scroller1" operation="previous" />
+ </h:commandButton>
- <h:commandButton id="buttonLast1" value="last »»">
- <rich:componentControl event="click" target="scroller1" operation="last" />
- </h:commandButton>
- </fieldset>
+ <h:commandButton id="buttonNext1" value="next »">
+ <rich:componentControl event="click" target="scroller1" operation="next" />
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonLast1" value="last »»">
+ <rich:componentControl event="click" target="scroller1" operation="last" />
+ </h:commandButton>
+ </fieldset>
- <fieldset><legend>JavaScript API - scroller2</legend>
- <h:commandButton id="buttonStpFirst2" value="«« first">
- <rich:componentControl event="click" target="scroller2" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonStpPrev2" value="« previous">
- <rich:componentControl event="click" target="scroller2" operation="switchToPage">
- <f:param value="fastrewind" />
- </rich:componentControl>
- </h:commandButton>
+ <fieldset>
+ <legend>JavaScript API - scroller2</legend>
+ <h:commandButton id="buttonStpFirst2" value="«« first">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpNext2" value="next »">
- <rich:componentControl event="click" target="scroller2" operation="switchToPage">
- <f:param value="fastforward" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpPrev2" value="« previous">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="fastrewind" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpLast2" value="last »»">
- <rich:componentControl event="click" target="scroller2" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpNext2" value="next »">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="fastforward" />
+ </rich:componentControl>
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonStpLast2" value="last »»">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonFirst2" value="«« first">
- <rich:componentControl event="click" target="scroller2" operation="first" />
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonPrev2" value="« previous">
- <rich:componentControl event="click" target="scroller2" operation="previous" />
- </h:commandButton>
+ <h:commandButton id="buttonFirst2" value="«« first">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="first" />
+ </h:commandButton>
- <h:commandButton id="buttonNext2" value="next »">
- <rich:componentControl event="click" target="scroller2" operation="next" />
- </h:commandButton>
+ <h:commandButton id="buttonPrev2" value="« previous">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="previous" />
+ </h:commandButton>
- <h:commandButton id="buttonLast2" value="last »»">
- <rich:componentControl event="click" target="scroller2" operation="last" />
- </h:commandButton>
- </fieldset>
+ <h:commandButton id="buttonNext2" value="next »">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="next" />
+ </h:commandButton>
- <br/><br/>
- <h2>Attributes</h2>
- <metamer:attributes value="#{richDataScrollerBean.attributes}" id="attributes" />
- <h2>Table Attributes</h2>
- <metamer:attributes value="#{richDataScrollerBean.tableAttributes}" id="tableAttributes" />
- </ui:define>
+ <h:commandButton id="buttonLast2" value="last »»">
+ <rich:componentControl event="click" target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="last" />
+ </h:commandButton>
+ </fieldset>
- </ui:composition>
+ <br />
+ <br />
+ <h2>Attributes</h2>
+ <metamer:attributes value="#{richDataScrollerBean.attributes}" id="attributes" />
+ <h2>Table Attributes</h2>
+ <metamer:attributes value="#{richDataScrollerBean.tableAttributes}" id="tableAttributes" />
+ </ui:define>
+
+</ui:composition>
</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-12-02 16:25:48 UTC (rev 23037)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-12-05 13:28:57 UTC (rev 23038)
@@ -48,19 +48,20 @@
*
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
-@Use(field = "scroller", value = {"scrollerOutsideTable", "scrollerInsideTable"})
+@Use(field = "scroller", value = { "scrollerOutsideTable", "scrollerInsideTable" })
public class TestDataScrollerAttributes extends AbstractMetamerTest {
- private final Attributes<DataScrollerAttributes> attributes = new Attributes<DataScrollerAttributes>(pjq("table[id$='attributes']"));
- private final Attributes<DataTableAttributes> tableAttributes = new Attributes<DataTableAttributes>(pjq("table[id$='tableAttributes']"));
-
+ private final Attributes<DataScrollerAttributes> attributes = new Attributes<DataScrollerAttributes>(
+ pjq("table[id$='attributes']"));
+ private final Attributes<DataTableAttributes> tableAttributes = new Attributes<DataTableAttributes>(
+ pjq("table[id$='tableAttributes']"));
+
@Inject
private DataScroller scroller;
-
+
private DataScroller scrollerOutsideTable = PaginationTester.DATA_SCROLLER_OUTSIDE_TABLE;
private DataScroller scrollerInsideTable = PaginationTester.DATA_SCROLLER_IN_TABLE_FOOTER;
-
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richDataScroller/simple.xhtml");
@@ -76,7 +77,7 @@
assertFalse(getScroller().isFirstPageButtonPresent(), "The first button shouldn't be present.");
assertFalse(getScroller().isLastPageButtonPresent(), "The last button shouldn't be present.");
}
-
+
@Test
public void testData() {
// attributes
@@ -88,9 +89,9 @@
waitGui.waitForChange(retrieveRequestTime);
// check
String data = selenium.getEval(new JavaScript("window.data"));
- assertEquals(data, "RichFaces", "Data sent with ajax request");
+ assertEquals(data, "RichFaces", "Data sent with ajax request");
}
-
+
@Test
public void testEvents() throws InterruptedException {
// set event attributes
@@ -106,11 +107,14 @@
// check events
String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
assertEquals(events.length, 3, "3 events should be fired, found events are " + Arrays.toString(events) + ".");
- assertEquals(events[0], "begin", "Attribute onbegin doesn't work, found events are " + Arrays.toString(events) + ".");
- assertEquals(events[1], "beforedomupdate", "Attribute onbeforedomupdate doesn't work, found events are " + Arrays.toString(events) + ".");
- assertEquals(events[2], "complete", "Attribute oncomplete doesn't work, found events are " + Arrays.toString(events) + ".");
+ assertEquals(events[0], "begin", "Attribute onbegin doesn't work, found events are " + Arrays.toString(events)
+ + ".");
+ assertEquals(events[1], "beforedomupdate", "Attribute onbeforedomupdate doesn't work, found events are "
+ + Arrays.toString(events) + ".");
+ assertEquals(events[2], "complete",
+ "Attribute oncomplete doesn't work, found events are " + Arrays.toString(events) + ".");
}
-
+
@Test
public void testExecute() {
// attributes
@@ -126,9 +130,9 @@
return;
}
}
- fail("Attribute execute does not work");
+ fail("Attribute execute does not work");
}
-
+
@Test
public void testFastControls() {
// init - show
@@ -137,80 +141,85 @@
// hide
getAttributes().set(DataScrollerAttributes.fastControls, "hide");
assertFalse(getScroller().isFastForwardButtonPresent(), "The fast forward button shouldn't be present.");
- assertFalse(getScroller().isFastRewindButtonPresent(), "The fast rewind button shouldn't be present.");
+ assertFalse(getScroller().isFastRewindButtonPresent(), "The fast rewind button shouldn't be present.");
}
-
+
@Test
public void testFastStep() {
getAttributes().set(DataScrollerAttributes.fastStep, 3);
retrieveRequestTime.initializeValue();
getScroller().clickFastForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 4, "After clicking on the fast forward button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 4,
+ "After clicking on the fast forward button, the current page doesn't match.");
retrieveRequestTime.initializeValue();
getScroller().clickFastRewind();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1, "After clicking on the fast rewind button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 1,
+ "After clicking on the fast rewind button, the current page doesn't match.");
}
-
+
@Test
public void testLastPageMode() {
retrieveRequestTime.initializeValue();
getScroller().clickLastPageButton();
- waitGui.waitForChange(retrieveRequestTime);
+ waitGui.waitForChange(retrieveRequestTime);
// init - short
- assertEquals(getNumberOfRows(), 5, "Attribute lastPageMode doesn't work. The number of rows doesn't match, when the value is set to <short>");
+ assertEquals(getNumberOfRows(), 5,
+ "Attribute lastPageMode doesn't work. The number of rows doesn't match, when the value is set to <short>");
// full
getAttributes().set(DataScrollerAttributes.lastPageMode, "full");
- assertEquals(getNumberOfRows(), 9, "Attribute lastPageMode doesn't work. The number of rows doesn't match, when the value is set to <full>");
+ assertEquals(getNumberOfRows(), 9,
+ "Attribute lastPageMode doesn't work. The number of rows doesn't match, when the value is set to <full>");
}
-
+
@Test
public void testLimitRender() {
// false
- getAttributes().set(DataScrollerAttributes.limitRender, false);
- retrieveRequestTime.initializeValue();
- getScroller().clickFastForward();
- waitGui
- .failWith("The panel hasn't been rerendered despite of the fact the attribute 'limitRender' is set to <false>.")
- .waitForChange(retrieveRequestTime);
- // true
- getAttributes().set(DataScrollerAttributes.limitRender, false);
- String timeBefore = retrieveRequestTime.getValue();
- getScroller().clickFastRewind();
- waitModel
- .until(new SeleniumCondition() {
- @Override
- public boolean isTrue() {
- return getScroller().getCurrentPage() == 1;
- }
- });
- String timeAfter = retrieveRequestTime.getValue();
- assertEquals(timeAfter, timeBefore, "The panel hasn been rerendered despite of the fact the attribute 'limitRender' is set to <true>.");
-
+ getAttributes().set(DataScrollerAttributes.limitRender, false);
+ retrieveRequestTime.initializeValue();
+ getScroller().clickFastForward();
+ waitGui.failWith(
+ "The panel hasn't been rerendered despite of the fact the attribute 'limitRender' is set to <false>.")
+ .waitForChange(retrieveRequestTime);
+ // true
+ getAttributes().set(DataScrollerAttributes.limitRender, false);
+ String timeBefore = retrieveRequestTime.getValue();
+ getScroller().clickFastRewind();
+ waitModel.until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return getScroller().getCurrentPage() == 1;
+ }
+ });
+ String timeAfter = retrieveRequestTime.getValue();
+ assertEquals(timeAfter, timeBefore,
+ "The panel hasn been rerendered despite of the fact the attribute 'limitRender' is set to <true>.");
+
}
-
+
@Test
public void testMaxPages() {
// init - 10
- assertEquals(getScroller().getCountOfVisiblePages(), 6 /* it means - all pages */, "The number of visible pages doesn't match.");
+ assertEquals(getScroller().getCountOfVisiblePages(), 6 /* it means - all pages */,
+ "The number of visible pages doesn't match.");
// smaller number
getAttributes().set(DataScrollerAttributes.maxPages, 3);
assertEquals(getScroller().getCountOfVisiblePages(), 3, "The number of visible pages doesn't match.");
}
-
+
@Test
public void testPage() {
getAttributes().set(DataScrollerAttributes.page, 4);
assertEquals(getScroller().getCurrentPage(), 4, "The number of current page doesn't match.");
}
-
+
@Test
public void testRendered() {
getAttributes().set(DataScrollerAttributes.rendered, false);
assertFalse(getScroller().isPresent(), "The data scroller shouldn't be present.");
}
-
+
@Test
public void testRenderIfSinglePage() {
// prepare
@@ -221,7 +230,7 @@
getAttributes().set(DataScrollerAttributes.renderIfSinglePage, false);
assertFalse(getScroller().isPresent(), "The attribute 'renderIfSinglePage' doesn't work.");
}
-
+
@Test
public void testStatus() {
// prepare
@@ -231,11 +240,11 @@
retrieveRequestTime.initializeValue();
getScroller().clickFastForward();
waitGui.waitForChange(retrieveRequestTime);
- // check
+ // check
String statusAfter = selenium.getText(statusChecker);
assertNotEquals(statusAfter, statusBefore, "The status attribute doesn't work.");
}
-
+
@Test
public void testStepControls() {
// init - show
@@ -246,7 +255,7 @@
assertFalse(getScroller().isNextButtonPresent(), "The next button shouldn't be present.");
assertFalse(getScroller().isPreviousButtonPresent(), "The previous button shouldn't be present.");
}
-
+
/**
* Test simple step forward and step back buttons on dataScroller
*/
@@ -256,29 +265,33 @@
// 2 times move forward by basic step
getScroller().clickStepForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step next button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 2,
+ "After clicking on the step next button, the current page doesn't match.");
getScroller().clickStepForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3, "After clicking on the step next button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 3,
+ "After clicking on the step next button, the current page doesn't match.");
// then move backward by basic step back
retrieveRequestTime.initializeValue();
getScroller().clickStepPrevious();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step previous button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 2,
+ "After clicking on the step previous button, the current page doesn't match.");
getScroller().clickStepPrevious();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1, "After clicking on the step previous button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 1,
+ "After clicking on the step previous button, the current page doesn't match.");
}
-
+
/**
* Test buttons with scroller JS API binding
*/
@Test
public void testJsApi() {
verifyJsApi(1);
- verifyJsApi(2);
+ verifyJsApi(2);
}
-
+
/**
* Test buttons with scroller JS API binding, using switchToPage operation
*/
@@ -287,7 +300,7 @@
verifyJsApiStp(1);
verifyJsApiStp(2);
}
-
+
@Test
public void testStyle() {
super.testStyle(getScroller());
@@ -297,71 +310,71 @@
public void testStyleClass() {
super.testStyleClass(getScroller());
}
-
+
@Test
public void testTitle() {
super.testTitle(getScroller());
}
-
+
private Attributes<DataScrollerAttributes> getAttributes() {
return attributes;
}
-
+
private int getNumberOfRows() {
- return selenium.getCount(pjq("*.rf-dt tbody tr.rf-dt-r"));
+ return selenium.getCount(pjq("table[id$=richDataTable].rf-dt tbody tr.rf-dt-r"));
}
-
+
private DataScroller getScroller() {
return scroller;
}
-
+
private Attributes<DataTableAttributes> getTableAttributes() {
return tableAttributes;
}
-
+
private void verifyJsApi(int scrollerNo) {
retrieveRequestTime.initializeValue();
getScroller().clickJsApiLast(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 6,
+ assertEquals(getScroller().getCurrentPage(), 6,
"After clicking on the step last button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiFirst(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1,
+ assertEquals(getScroller().getCurrentPage(), 1,
"After clicking on the step first button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2,
+ assertEquals(getScroller().getCurrentPage(), 2,
"After clicking on the step next button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3,
+ assertEquals(getScroller().getCurrentPage(), 3,
"After clicking on the step next button (JS API), the current page doesn't match.");
}
-
+
private void verifyJsApiStp(int scrollerNo) {
retrieveRequestTime.initializeValue();
getScroller().clickJsApiStpLast(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 6,
+ assertEquals(getScroller().getCurrentPage(), 6,
"After clicking on the step last button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiStpFirst(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1,
+ assertEquals(getScroller().getCurrentPage(), 1,
"After clicking on the step first button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiStpNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2,
+ assertEquals(getScroller().getCurrentPage(), 2,
"After clicking on the step next button (JS API), the current page doesn't match.");
-
+
getScroller().clickJsApiStpNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3,
+ assertEquals(getScroller().getCurrentPage(), 3,
"After clicking on the step next button (JS API), the current page doesn't match.");
}
}