Author: lfryc(a)redhat.com
Date: 2010-09-02 23:07:09 -0400 (Thu, 02 Sep 2010)
New Revision: 19102
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
Log:
fixed tests for iteration components which can't be controlled by scroller outside of
another iteration component (rich:dataScroller tests)
Modified:
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/AbstractScrollerTest.java 2010-09-03
02:51:06 UTC (rev 19101)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-09-03
03:07:09 UTC (rev 19102)
@@ -39,7 +39,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-@Uses({ @Use(field = "elements", ints = 7), @Use(field =
"dataScroller", value = "dataScroller2") })
+@Use(field = "elements", ints = 7)
public abstract class AbstractScrollerTest extends AbstractDataGridTest {
@Inject
@@ -79,26 +79,18 @@
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 })
+ @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 })
- @Use(field = "elements", ints = { 3 })
+ @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
- // })
- @Use(field = "first", ints = { 3 })
+ @Use(field = "first", ints = { 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL -
1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
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)
Copied:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
(from rev 19087,
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java)
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java 2010-09-03
03:07:09 UTC (rev 19102)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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.richDataScroller;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
+import static org.jboss.test.selenium.locator.LocatorFactory.id;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+
+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.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.DataScroller;
+import org.richfaces.tests.metamer.ftest.model.DataTable;
+import org.testng.annotations.BeforeMethod;
+
+/**
+ * Test the functionality of switching pages using DataScroller bound to DataTable.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public abstract class AbstractScrollerTest extends AbstractMetamerTest {
+
+ @Inject
+ @Use(ints = { 2, 3 })
+ int fastStep;
+
+ @Inject
+ @Use(ints = { 3, 4 })
+ int maxPages;
+
+ @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() {
+ tableText = dataTable.getTableText();
+ }
+
+ @Override
+ protected void verifyAfterScrolling() {
+ assertFalse(tableText.equals(dataTable.getTableText()));
+ assertEquals(maxPages, dataScroller.getCountOfVisiblePages());
+ }
+ };
+
+ IdLocator attributeFastStep = id("form:attributes:fastStepInput");
+ IdLocator attributeMaxPages = id("form:attributes:maxPagesInput");
+
+ DataTable dataTable = new
DataTable(pjq("table.rf-dt[id$=richDataTable]"));
+
+ String tableText;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richDataScroller/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void prepareComponent() {
+ guardHttp(selenium).type(attributeFastStep, String.valueOf(fastStep));
+ guardHttp(selenium).type(attributeMaxPages, String.valueOf(maxPages));
+
+ paginationTester.setDataScroller(dataScroller);
+ dataScroller.setFastStep(fastStep);
+
+ int lastPage = dataScroller.obtainLastPage();
+ dataScroller.setLastPage(lastPage);
+ paginationTester.initializeTestedPages(lastPage);
+ }
+
+ public void testNumberedPages() {
+ paginationTester.testNumberedPages();
+ }
+}
Deleted:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-09-03
02:51:06 UTC (rev 19101)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestPagination.java 2010-09-03
03:07:09 UTC (rev 19102)
@@ -1,106 +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.richDataScroller;
-
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
-import static org.jboss.test.selenium.locator.LocatorFactory.id;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-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.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.model.DataScroller;
-import org.richfaces.tests.metamer.ftest.model.DataTable;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-/**
- * Test the functionality of switching pages using DataScroller bound to DataTable.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestPagination extends AbstractMetamerTest {
-
- @Inject
- @Use(ints = { 2, 3 })
- int fastStep;
-
- @Inject
- @Use(ints = { 3, 4 })
- int maxPages;
-
- @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() {
- tableText = dataTable.getTableText();
- }
-
- @Override
- protected void verifyAfterScrolling() {
- assertFalse(tableText.equals(dataTable.getTableText()));
- assertEquals(maxPages, dataScroller.getCountOfVisiblePages());
- }
- };
-
- IdLocator attributeFastStep = id("form:attributes:fastStepInput");
- IdLocator attributeMaxPages = id("form:attributes:maxPagesInput");
-
- DataTable dataTable = new
DataTable(pjq("table.rf-dt[id$=richDataTable]"));
-
- String tableText;
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath,
"faces/components/richDataScroller/simple.xhtml");
- }
-
- @BeforeMethod
- public void prepareComponent() {
- guardHttp(selenium).type(attributeFastStep, String.valueOf(fastStep));
- guardHttp(selenium).type(attributeMaxPages, String.valueOf(maxPages));
-
- paginationTester.setDataScroller(dataScroller);
- dataScroller.setFastStep(fastStep);
-
- int lastPage = dataScroller.obtainLastPage();
- dataScroller.setLastPage(lastPage);
- paginationTester.initializeTestedPages(lastPage);
- }
-
- @Test
- public void testNumberedPages() {
- paginationTester.testNumberedPages();
- }
-}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java 2010-09-03
03:07:09 UTC (rev 19102)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.richDataScroller;
+
+import javax.xml.bind.JAXBException;
+
+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
+ public void testNumberedPages() {
+ super.testNumberedPages();
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java 2010-09-03
03:07:09 UTC (rev 19102)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.richDataScroller;
+
+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;
+
+/**
+ * <p>
+ * Templates: doesn't work inside iteration components.
+ * </p>
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@Use(field = "dataScroller", value = "dataScroller1")
+@Templates(exclude = { "a4jRepeat1", "a4jRepeat2",
"hDataTable1", "hDataTable2", "richDataTable1,redDiv",
+ "richDataTable2,redDiv", "uiRepeat1", "uiRepeat2" })
+public class TestScrollerOutsideTable extends AbstractScrollerTest {
+
+ public TestScrollerOutsideTable() throws JAXBException {
+ }
+
+ @Test
+ @Override
+ public void testNumberedPages() {
+ super.testNumberedPages();
+ }
+}