Author: lfryc(a)redhat.com
Date: 2010-09-02 11:13:52 -0400 (Thu, 02 Sep 2010)
New Revision: 19099
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestPagination.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java
Log:
fixed rich:dataGrid tests (incl. RFPL-752)
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java 2010-09-02
15:12:44 UTC (rev 19098)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java 2010-09-02
15:13:52 UTC (rev 19099)
@@ -158,7 +158,7 @@
}
expectedRows = ceil((float) expectedElements / columns);
- expectedColumns = columns;
+ expectedColumns = Math.min(columns, expectedElements);
}
private Iterator<Capital> getExpectedCapitalsIterator() {
Copied:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
(from rev 19087,
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestPagination.java)
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-09-02
15:13:52 UTC (rev 19099)
@@ -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.richDataGrid;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import javax.xml.bind.JAXBException;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.annotations.Uses;
+import org.richfaces.tests.metamer.ftest.model.DataScroller;
+import org.richfaces.tests.metamer.ftest.richDataScroller.PaginationTester;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Uses({ @Use(field = "elements", ints = 7), @Use(field =
"dataScroller", value = "dataScroller2") })
+public abstract class AbstractScrollerTest extends AbstractDataGridTest {
+
+ @Inject
+ DataScroller dataScroller;
+ DataScroller dataScroller1 = PaginationTester.DATA_SCROLLER_OUTSIDE_TABLE;
+ DataScroller dataScroller2 = PaginationTester.DATA_SCROLLER_IN_TABLE_FOOTER;
+
+ PaginationTester paginationTester = new PaginationTester() {
+
+ @Override
+ protected void verifyBeforeScrolling() {
+ }
+
+ @Override
+ protected void verifyAfterScrolling() {
+ page = dataScroller.getCurrentPage();
+ lastPage = dataScroller.getLastPage();
+ verifyGrid();
+ }
+ };
+
+ public AbstractScrollerTest() throws JAXBException {
+ super();
+ }
+
+ @BeforeMethod
+ public void setupDataScroller() {
+ paginationTester.setDataScroller(dataScroller);
+
+ int lastPage = dataScroller.obtainLastPage();
+ dataScroller.setLastPage(lastPage);
+ paginationTester.initializeTestedPages(lastPage);
+ }
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richDataGrid/scroller.xhtml");
+ }
+
+ // @Test
+ // @Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
+ // ELEMENTS_TOTAL + 1 })
+ @Use(field = "columns", ints = { 3 })
+ public void testColumnsAttribute() {
+ paginationTester.testNumberedPages();
+ }
+
+ // @Test
+ // @Use(field = "elements", ints = { 0, 1, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL +
+ // 1 })
+ @Use(field = "elements", ints = { 3 })
+ public void testElementsAttribute() {
+ paginationTester.testNumberedPages();
+ }
+
+ // @Test
+ // @Use(field = "first", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL
- 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1
+ // })
+ @Use(field = "first", ints = { 3 })
+ public void testFirstAttributeDoesntInfluentScroller() {
+ // the attribute for component was already set, now verify that this attribute
doesn't influent rendering (it
+ // means dataGrid with scroller ignores this attribute, it means it is always
equal to zero)
+ first = 0;
+ paginationTester.testNumberedPages();
+ }
+}
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestPagination.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestPagination.java 2010-09-02
15:12:44 UTC (rev 19098)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestPagination.java 2010-09-02
15:13:52 UTC (rev 19099)
@@ -1,100 +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.richDataGrid;
-
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-
-import java.net.URL;
-
-import javax.xml.bind.JAXBException;
-
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.model.DataScroller;
-import org.richfaces.tests.metamer.ftest.richDataScroller.PaginationTester;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@Use(field = "elements", ints = 7)
-public class TestPagination extends AbstractDataGridTest {
-
- @Inject
- @Use("dataScroller*")
- DataScroller dataScroller;
- DataScroller dataScroller1 = PaginationTester.DATA_SCROLLER_OUTSIDE_TABLE;
- DataScroller dataScroller2 = PaginationTester.DATA_SCROLLER_IN_TABLE_FOOTER;
-
- PaginationTester paginationTester = new PaginationTester() {
-
- @Override
- protected void verifyBeforeScrolling() {
- }
-
- @Override
- protected void verifyAfterScrolling() {
- page = dataScroller.getCurrentPage();
- lastPage = dataScroller.getLastPage();
- verifyGrid();
- }
- };
-
- public TestPagination() throws JAXBException {
- super();
- }
-
- @BeforeMethod
- public void setupDataScroller() {
- paginationTester.setDataScroller(dataScroller);
-
- int lastPage = dataScroller.obtainLastPage();
- dataScroller.setLastPage(lastPage);
- paginationTester.initializeTestedPages(lastPage);
- }
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richDataGrid/scroller.xhtml");
- }
-
- @Test
- @Use(field = "columns", ints = { 1, 3, 11, ELEMENTS_TOTAL / 2,
ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
- ELEMENTS_TOTAL + 1 })
- public void testColumnsAttribute() {
- paginationTester.testNumberedPages();
- }
-
- @Test
- @Use(field = "elements", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL
- 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
- public void testElementsAttribute() {
- paginationTester.testNumberedPages();
- }
-
- @Test
- @Use(field = "first", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL -
1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
- public void testFirstAttribute() {
- paginationTester.testNumberedPages();
- }
-}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java 2010-09-02
15:13:52 UTC (rev 19099)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.richDataGrid;
+
+import javax.xml.bind.JAXBException;
+
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Use(field = "dataScroller", value = "dataScroller2")
+public class TestScrollerInTableFooter extends AbstractScrollerTest {
+
+ public TestScrollerInTableFooter() throws JAXBException {
+ }
+
+ @Test
+ @Override
+ public void testColumnsAttribute() {
+ super.testColumnsAttribute();
+ }
+
+ @Test
+ @Override
+ public void testElementsAttribute() {
+ super.testElementsAttribute();
+ }
+
+ @Test
+ @Override
+ public void testFirstAttributeDoesntInfluentScroller() {
+ super.testFirstAttributeDoesntInfluentScroller();
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java 2010-09-02
15:13:52 UTC (rev 19099)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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.richDataGrid;
+
+import javax.xml.bind.JAXBException;
+
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Use(field = "dataScroller", value = "dataScroller1")
+@Templates(value = "plain")
+public class TestScrollerOutsideTable extends AbstractScrollerTest {
+
+ public TestScrollerOutsideTable() throws JAXBException {
+ }
+
+ @Test
+ @Override
+ public void testColumnsAttribute() {
+ super.testColumnsAttribute();
+ }
+
+ @Test
+ @Override
+ public void testElementsAttribute() {
+ super.testElementsAttribute();
+ }
+
+ @Test
+ @Override
+ public void testFirstAttributeDoesntInfluentScroller() {
+ super.testFirstAttributeDoesntInfluentScroller();
+ }
+}