Author: lfryc(a)redhat.com
Date: 2010-12-06 13:00:33 -0500 (Mon, 06 Dec 2010)
New Revision: 20418
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFiltering.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingColumn.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableSimpleTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java
Log:
rich:extendedDataTable - 74 tests for simple, facets, filtering and sorting (RFPL-918)
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2010-12-06
18:00:33 UTC (rev 20418)
@@ -125,16 +125,16 @@
<h:inputText id="headerInput"
value="#{richExtendedDataTableBean.facets['header']}" />
<h:outputLabel value="State Column Header:" />
- <h:inputText id="columnStateHeaderInput"
value="#{richExtendedDataTableBean.facets['columnStateHeader']}" />
+ <h:inputText id="stateHeaderInput"
value="#{richExtendedDataTableBean.facets['columnStateHeader']}" />
<h:outputLabel value="State Column Footer:" />
- <h:inputText id="columnStateFooterInput"
value="#{richExtendedDataTableBean.facets['columnStateFooter']}" />
+ <h:inputText id="stateFooterInput"
value="#{richExtendedDataTableBean.facets['columnStateFooter']}" />
<h:outputLabel value="Capital Column Header:" />
- <h:inputText id="columnCapitalHeaderInput"
value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}"
/>
+ <h:inputText id="capitalHeaderInput"
value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}"
/>
<h:outputLabel value="Capital Column Footer:" />
- <h:inputText id="columnCapitalFooterInput"
value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}"
/>
+ <h:inputText id="capitalFooterInput"
value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}"
/>
</h:panelGrid>
</a4j:ajax>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-06
18:00:33 UTC (rev 20418)
@@ -79,14 +79,14 @@
<br/>
<h:outputText value="Show data in table: " />
<h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richExtendedDataTableBean.state}">
- <a4j:ajax render="richDataTable scroller1"/>
+ <a4j:ajax render="richEDT scroller1"/>
</h:selectBooleanCheckbox>
<br/><br/>
- <rich:dataScroller id="scroller1" for="richDataTable"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="richDataTable"/>
+ <rich:dataScroller id="scroller1" for="richEDT"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="richEDT"/>
</ui:define>
<ui:define name="component">
- <rich:extendedDataTable id="richDataTable"
+ <rich:extendedDataTable id="richEDT"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
@@ -138,7 +138,7 @@
</h:panelGroup>
</f:facet>
- <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}"
alt="#{record.sex}" />
<f:facet name="footer">
<h:outputText id="columnFooterSex"
value="Sex" />
@@ -217,7 +217,7 @@
</rich:column>
<f:facet name="footer">
- <rich:dataScroller id="scroller2"
for="richDataTable" page="#{richExtendedDataTableBean.page}"
maxPages="7" render="richDataTable" />
+ <rich:dataScroller id="scroller2"
for="richEDT" page="#{richExtendedDataTableBean.page}"
maxPages="7" render="richEDT" />
</f:facet>
</rich:extendedDataTable>
</ui:define>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-06
18:00:33 UTC (rev 20418)
@@ -113,7 +113,7 @@
<f:facet name="header">
<a4j:commandLink id="sortBySex"
value="Sex" render="richEDT"
action="#{richExtendedDataTableBean.sorting['columnSex'].reverseOrder}"
/>
</f:facet>
- <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}"
alt="#{record.sex}" />
</rich:column>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-06
18:00:33 UTC (rev 20418)
@@ -117,7 +117,7 @@
</rich:componentControl>
</h:commandLink>
</f:facet>
- <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}"
alt="#{record.sex}" />
</rich:column>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableSimpleTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableSimpleTest.java 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/abstractions/DataTableSimpleTest.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -82,6 +82,8 @@
}
public void testRendered() {
+ assertTrue(model.isVisible());
+
attributes.setRendered(false);
assertFalse(model.isVisible());
@@ -91,6 +93,9 @@
}
public void testNoDataLabel() {
+ assertTrue(model.isVisible());
+ assertFalse(model.isNoData());
+
attributes.setNoDataLabel(NO_DATA);
attributes.setShowData(false);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -25,7 +25,9 @@
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.richfaces.tests.metamer.ftest.abstractions.DataTable;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.*;
/**
@@ -34,25 +36,78 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class ExtendedDataTable extends AbstractModel<JQueryLocator> {
+public class ExtendedDataTable extends AbstractModel<JQueryLocator> implements
DataTable {
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- ReferencedLocator<JQueryLocator> tableRows = ref(root, "> div.rf-edt-b
table table tr");
+ ReferencedLocator<JQueryLocator> tbody = ref(root, "> div.rf-edt-b >
div > table > tbody > tr > td > div.rf-edt-cnt > table >
tbody");
+ ReferencedLocator<JQueryLocator> firstColumnRows = ref(tbody, "> tr
> td:nth-child(1) > div.rf-edt-c > div.rf-edt-c-cnt");
+ ReferencedLocator<JQueryLocator> firstRowColumns = ref(tbody, ">
tr:eq(0) > td > div.rf-edt-c > div.rf-edt-c-cnt");
+ ReferencedLocator<JQueryLocator> body = ref(root, ">
div.rf-edt-b");
+ ReferencedLocator<JQueryLocator> columns = ref(tbody, "> tr");
+ JQueryLocator columnToElement = jq("td");
+ JQueryLocator elementToContent = jq("div.rf-edt-c > div.rf-edt-c-cnt");
+ ReferencedLocator<JQueryLocator> tableHeader = ref(root, ">
div.rf-edt-tbl-hdr");
+ ReferencedLocator<JQueryLocator> columnHeader = ref(root, ">
div.rf-edt-hdr > table > tbody > tr > td > div.rf-edt-cnt > table >
tbody > tr > td");
+ JQueryLocator columnHeaderToContent = jq("div.rf-edt-hdr-c >
div.rf-edt-hdr-c-cnt");
+ ReferencedLocator<JQueryLocator> columnFooter = ref(root, ">
div.rf-edt-ftr > table > tbody > tr > td > div.rf-edt-cnt > table >
tbody > tr > td");
+ JQueryLocator columnFooterToContent = jq("div.rf-edt-ftr-c >
div.rf-edt-ftr-c-cnt");
+
public ExtendedDataTable(JQueryLocator root) {
super(root);
}
-
+
public ExtendedDataTable(String name, JQueryLocator root) {
super(name, root);
}
- public int getCountOfTableRows() {
- return selenium.getCount(tableRows);
- }
-
public String getTableText() {
return selenium.getText(root.getLocator());
}
+
+ @Override
+ public int getRows() {
+ return selenium.getCount(firstColumnRows);
+ }
+
+ @Override
+ public int getColumns() {
+ return selenium.getCount(firstRowColumns);
+ }
+
+ @Override
+ public boolean isVisible() {
+ return selenium.isElementPresent(root.getLocator()) &&
selenium.isVisible(root.getLocator());
+ }
+
+ @Override
+ public boolean isNoData() {
+ return selenium.isElementPresent(body) && getRows() == 0;
+ }
+
+ @Override
+ public JQueryLocator getNoData() {
+ return body.getReferenced();
+ }
+
+ @Override
+ public JQueryLocator getElement(int column, int row) {
+ return
columns.getNthOccurence(row).getChild(columnToElement).getNthChildElement(column).getChild(elementToContent);
+ }
+
+ @Override
+ public JQueryLocator getColumnHeader(int column) {
+ return columnHeader.getNthOccurence(column).getChild(columnHeaderToContent);
+ }
+
+ @Override
+ public JQueryLocator getColumnFooter(int column) {
+ return columnFooter.getNthOccurence(column).getChild(columnFooterToContent);
+ }
+
+ @Override
+ public JQueryLocator getHeader() {
+ return tableHeader.getReferenced();
+ }
}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFacets.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFacets.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFacets.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableFacetsTest;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableFacets extends DataTableFacetsTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/facets.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ public void testNoDataInstantChange() {
+ super.testNoDataInstantChange();
+ }
+
+ @Test
+ public void testNoDataEmpty() {
+ super.testNoDataEmpty();
+ }
+
+ @Test
+ public void testNoDataLabelWithEmptyNoDataFacet() {
+ super.testNoDataLabelWithEmptyNoDataFacet();
+ }
+
+ @Test
+ public void testHeaderInstantChange() {
+ super.testHeaderInstantChange();
+ }
+
+ @Test
+ public void testHeaderEmpty() {
+ super.testHeaderEmpty();
+ }
+
+ @Test
+ public void testStateHeaderInstantChange() {
+ super.testStateHeaderInstantChange();
+ }
+
+ @Test
+ public void testStateHeaderEmpty() {
+ super.testStateHeaderEmpty();
+ }
+
+ @Test
+ public void testStateFooterInstantChange() {
+ super.testStateFooterInstantChange();
+ }
+
+ @Test
+ public void testStateFooterEmpty() {
+ super.testStateFooterEmpty();
+ }
+
+ @Test
+ public void testCapitalHeaderInstantChange() {
+ super.testCapitalHeaderInstantChange();
+ }
+
+ @Test
+ public void testCapitalHeaderEmpty() {
+ super.testCapitalHeaderEmpty();
+ }
+
+ @Test
+ public void testCapitalFooterInstantChange() {
+ super.testCapitalFooterInstantChange();
+ }
+
+ @Test
+ public void testCapitalFooterEmpty() {
+ super.testCapitalFooterEmpty();
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFiltering.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFiltering.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableFiltering.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableFilteringTest;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableFiltering extends DataTableFilteringTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/filtering.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ @Override
+ public void testFilterSex() {
+ super.testFilterSex();
+ }
+
+ @Test
+ @Override
+ public void testFilterName() {
+ super.testFilterName();
+ }
+
+ @Test
+ @Override
+ public void testFilterTitle() {
+ super.testFilterTitle();
+ }
+
+ @Test
+ @Override
+ public void testFilterNumberOfKids1() {
+ super.testFilterNumberOfKids1();
+ }
+
+ @Test
+ @Override
+ public void testFilterCombinations() {
+ super.testFilterCombinations();
+ }
+
+ @Test
+ @Override
+ public void testRerenderAll() {
+ super.testRerenderAll();
+ }
+
+ @Test
+ @Override
+ public void testFullPageRefresh() {
+ super.testFullPageRefresh();
+ }
+}
Copied:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableScroller.java
(from rev 20417,
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java)
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableScroller.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableScroller.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableScrollerTest;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableScroller extends DataTableScrollerTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/scroller.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ @Override
+ public void testRowCountFooterScroller() {
+ super.testRowCountFooterScroller();
+ }
+
+ @Test
+ @Override
+ public void testRowCountOutsideTable() {
+ super.testRowCountOutsideTable();
+ }
+}
Copied:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSimple.java
(from rev 20417,
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/ExtendedDataTable.java)
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSimple.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSimple.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableSimpleTest;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableSimple extends DataTableSimpleTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/simple.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ public void testRendered() {
+ super.testRendered();
+ }
+
+ @Test
+ public void testNoDataLabel() {
+ super.testNoDataLabel();
+ }
+
+ @Test
+ @Use(field = "first", value = "COUNTS")
+ public void testFirst() {
+ super.testFirst();
+ }
+
+ @Test
+ @Use(field = "rows", value = "COUNTS")
+ public void testRows() {
+ super.testRows();
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingColumn.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingColumn.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingColumn.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableSortingTest;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableSortingUsingColumn extends DataTableSortingTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/sorting-using-column.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingle() {
+ super.testSortModeSingle();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleReverse() {
+ super.testSortModeSingleReverse();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleDoesntRememberOrder() {
+ super.testSortModeSingleDoesntRememberOrder();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleRerenderAll() {
+ super.testSortModeSingleRerenderAll();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleFullPageRefresh() {
+ super.testSortModeSingleFullPageRefresh();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMulti() {
+ super.testSortModeMulti();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiReverse() {
+ super.testSortModeMultiReverse();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiReplacingOldOccurences() {
+ super.testSortModeMultiReplacingOldOccurences();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiRerenderAll() {
+ super.testSortModeMultiRerenderAll();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiFullPageRefresh() {
+ super.testSortModeMultiFullPageRefresh();
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSortingUsingComponentControl.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.abstractions.DataTableSortingTest;
+import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestExtendedDataTableSortingUsingComponentControl extends
DataTableSortingTest {
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richExtendedDataTable/sorting-using-component-control.xhtml");
+ }
+
+ @BeforeClass
+ public void setupModel() {
+ model = new ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingle() {
+ super.testSortModeSingle();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleReverse() {
+ super.testSortModeSingleReverse();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleDoesntRememberOrder() {
+ super.testSortModeSingleDoesntRememberOrder();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleRerenderAll() {
+ super.testSortModeSingleRerenderAll();
+ }
+
+ @Test
+ @Override
+ public void testSortModeSingleFullPageRefresh() {
+ super.testSortModeSingleFullPageRefresh();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMulti() {
+ super.testSortModeMulti();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiReverse() {
+ super.testSortModeMultiReverse();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiReplacingOldOccurences() {
+ super.testSortModeMultiReplacingOldOccurences();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiRerenderAll() {
+ super.testSortModeMultiRerenderAll();
+ }
+
+ @Test
+ @Override
+ public void testSortModeMultiFullPageRefresh() {
+ super.testSortModeMultiFullPageRefresh();
+ }
+}
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java 2010-12-06
17:58:49 UTC (rev 20417)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java 2010-12-06
18:00:33 UTC (rev 20418)
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richExtendedDataTable;
-
-import static org.jboss.test.selenium.locator.LocatorFactory.*;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URL;
-
-import org.jboss.test.selenium.locator.IdLocator;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.Templates;
-import org.richfaces.tests.metamer.ftest.model.AssertingDataScroller;
-import org.richfaces.tests.metamer.ftest.model.DataScroller;
-import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
-import org.testng.annotations.Test;
-
-/**
- * Test of DataScroller tied to Extended Data Table
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestScroller extends AbstractMetamerTest {
-
- private static final int TOTAL_ROW_COUNT = 50;
- private static final Integer[] ROW_COUNT_VALUES = new Integer[] { null, 10, 1,
TOTAL_ROW_COUNT, 13, 9, 17,
- TOTAL_ROW_COUNT + 1, 2 * TOTAL_ROW_COUNT };
- DataScroller dataScroller1 = new AssertingDataScroller("outside-table",
pjq("span.rf-ds[id$=scroller1]"));
- DataScroller dataScroller2 = new
AssertingDataScroller("inside-table-footer",
pjq("span.rf-ds[id$=scroller2]"));
- ExtendedDataTable table = new
ExtendedDataTable(pjq("div.rf-edt[id$=richEDT]"));
- IdLocator attributeRowsInput = id("form:attributes:rowsInput");
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richExtendedDataTable/scroller.xhtml");
- }
-
- /**
- * Tests row count for scroller in footer of the EDT.
- *
- * @see {@link #testRowCount(DataScroller)}
- */
- @Test(groups = "client-side-perf")
- public void testRowCountFooterScroller() {
- testRowCount(dataScroller2);
- }
-
- /**
- * <p>
- * Tests row count for scroller outside of the EDT.
- * </p>
- *
- * <p>
- * Templates: doesn't work inside iteration components.
- * </p>
- *
- * @see {@link #testRowCount(DataScroller)}
- */
- @Test
- @Templates(exclude = { "a4jRepeat1", "a4jRepeat2",
"hDataTable1", "hDataTable2", "richDataTable1,redDiv",
- "richDataTable2,redDiv", "uiRepeat1", "uiRepeat2"
})
- public void testRowCountOutsideTable() {
- testRowCount(dataScroller1);
- }
-
- /**
- * <p>
- * Test the data scroller functionality for different values of row count
- * </p>
- *
- * <p>
- * If desired, sets the value of 'rows' first for each iteration.
- * </p>
- *
- * <p>
- * Then goes to first page and verifies that there is valid number of rows.
- * </p>
- *
- * <p>
- * Verifies that on the first page is less than total number of rows if the scroller
has several pages.
- * </p>
- *
- * <p>
- * If the scroller has pages enabled, goes to last page and verifies that this is
valid number of pages visible in
- * scroller and the number of rows is valid.
- * </p>
- *
- * <p>
- */
- private void testRowCount(DataScroller dataScroller) {
- for (Integer rowsPerPage : ROW_COUNT_VALUES) {
- if (rowsPerPage != null) {
- selenium.type(attributeRowsInput, String.valueOf(rowsPerPage));
- selenium.waitForPageToLoad();
- }
-
- dataScroller.gotoFirstPage();
- int rowCountPreset = Integer.valueOf(selenium.getValue(attributeRowsInput));
- int rowCountActual = table.getCountOfTableRows();
- assertEquals(rowCountActual, Math.min(TOTAL_ROW_COUNT, rowCountPreset));
-
- assertEquals(dataScroller.hasPages(), rowCountActual < TOTAL_ROW_COUNT);
- if (dataScroller.hasPages()) {
- dataScroller.gotoLastPage();
-
- int pagesExpected = pageCountActualExpected(rowCountActual);
- int countOfVisiblePages = dataScroller.getCountOfVisiblePages();
-
- if (countOfVisiblePages < pagesExpected) {
- int lastVisiblePage = dataScroller.getLastVisiblePage();
- assertEquals(lastVisiblePage,
pageCountActualExpected(rowCountActual));
- } else {
- assertEquals(countOfVisiblePages, pagesExpected);
- }
-
- int rowCountExpected = rowCountLastPageExpected(rowCountPreset);
- rowCountActual = table.getCountOfTableRows();
- assertEquals(rowCountActual, rowCountExpected);
- }
- }
- }
-
- private int pageCountActualExpected(int rowCountActual) {
- return Double.valueOf(Math.ceil((double) TOTAL_ROW_COUNT /
rowCountActual)).intValue();
- }
-
- private int rowCountLastPageExpected(int rowCountPreset) {
- int result = TOTAL_ROW_COUNT % rowCountPreset;
- return (result == 0) ? rowCountPreset : result;
- }
-}