From richfaces-svn-commits at lists.jboss.org Thu Sep 2 23:07:10 2010 Content-Type: multipart/mixed; boundary="===============0509048623439315467==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r19102 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDataScroller and 1 other directory. Date: Thu, 02 Sep 2010 23:07:10 -0400 Message-ID: <201009030307.o8337A3t004740@svn01.web.mwc.hst.phx2.redhat.com> --===============0509048623439315467== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/tes= ts/metamer/ftest/richDataScroller/AbstractScrollerTest.java modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java Removed: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richDataScroller/TestPagination.java Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/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/richfa= ces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-09-03 02:51:0= 6 UTC (rev 19101) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-09-03 03:07:0= 9 UTC (rev 19102) @@ -39,7 +39,7 @@ * @author Lukas Fryc * @version $Revision$ */ -(a)Uses({ @Use(field =3D "elements", ints =3D 7), @Use(field =3D "dataScro= ller", value =3D "dataScroller2") }) +(a)Use(field =3D "elements", ints =3D 7) public abstract class AbstractScrollerTest extends AbstractDataGridTest { = @Inject @@ -79,26 +79,18 @@ return buildUrl(contextPath, "faces/components/richDataGrid/scroll= er.xhtml"); } = - // @Test - // @Use(field =3D "columns", ints =3D { 1, 3, 11, ELEMENTS_TOTAL / 2, = ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL, - // ELEMENTS_TOTAL + 1 }) - @Use(field =3D "columns", ints =3D { 3 }) + @Use(field =3D "columns", ints =3D { 1, 3, 11, ELEMENTS_TOTAL / 2, ELE= MENTS_TOTAL - 1, ELEMENTS_TOTAL, + ELEMENTS_TOTAL + 1 }) public void testColumnsAttribute() { paginationTester.testNumberedPages(); } = - // @Test - // @Use(field =3D "elements", ints =3D { 0, 1, ELEMENTS_TOTAL / 2, ELE= MENTS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + - // 1 }) - @Use(field =3D "elements", ints =3D { 3 }) + @Use(field =3D "elements", ints =3D { 0, 1, ELEMENTS_TOTAL / 2, ELEMEN= TS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 }) public void testElementsAttribute() { paginationTester.testNumberedPages(); } = - // @Test - // @Use(field =3D "first", ints =3D { 0, 1, ELEMENTS_TOTAL / 2, ELEMEN= TS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 - // }) - @Use(field =3D "first", ints =3D { 3 }) + @Use(field =3D "first", ints =3D { 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 th= is attribute doesn't influent rendering (it // means dataGrid with scroller ignores this attribute, it means i= t is always equal to zero) Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richface= s/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) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataScroller/AbstractScrollerTest.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/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.RequestTypeGuardFactor= y.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 D= ataTable. + * = + * @author Lukas Fryc + * @version $Revision$ + */ +public abstract class AbstractScrollerTest extends AbstractMetamerTest { + + @Inject + @Use(ints =3D { 2, 3 }) + int fastStep; + + @Inject + @Use(ints =3D { 3, 4 }) + int maxPages; + + @Inject + DataScroller dataScroller; + DataScroller dataScroller1 =3D PaginationTester.DATA_SCROLLER_OUTSIDE_= TABLE; + DataScroller dataScroller2 =3D PaginationTester.DATA_SCROLLER_IN_TABLE= _FOOTER; + + PaginationTester paginationTester =3D new PaginationTester() { + + @Override + protected void verifyBeforeScrolling() { + tableText =3D dataTable.getTableText(); + } + + @Override + protected void verifyAfterScrolling() { + assertFalse(tableText.equals(dataTable.getTableText())); + assertEquals(maxPages, dataScroller.getCountOfVisiblePages()); + } + }; + + IdLocator attributeFastStep =3D id("form:attributes:fastStepInput"); + IdLocator attributeMaxPages =3D id("form:attributes:maxPagesInput"); + + DataTable dataTable =3D new DataTable(pjq("table.rf-dt[id$=3DrichDataT= able]")); + + String tableText; + + @Override + public URL getTestUrl() { + return buildUrl(contextPath, "faces/components/richDataScroller/si= mple.xhtml"); + } + + @BeforeMethod + public void prepareComponent() { + guardHttp(selenium).type(attributeFastStep, String.valueOf(fastSte= p)); + guardHttp(selenium).type(attributeMaxPages, String.valueOf(maxPage= s)); + + paginationTester.setDataScroller(dataScroller); + dataScroller.setFastStep(fastStep); + + int lastPage =3D dataScroller.obtainLastPage(); + dataScroller.setLastPage(lastPage); + paginationTester.initializeTestedPages(lastPage); + } + + public void testNumberedPages() { + paginationTester.testNumberedPages(); + } +} Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfac= es/tests/metamer/ftest/richDataScroller/TestPagination.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/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/te= sts/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.RequestTypeGuardFactor= y.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 D= ataTable. - * = - * @author Lukas Fryc - * @version $Revision$ - */ -public class TestPagination extends AbstractMetamerTest { - - @Inject - @Use(ints =3D { 2, 3 }) - int fastStep; - - @Inject - @Use(ints =3D { 3, 4 }) - int maxPages; - - @Inject - @Use("dataScroller*") - DataScroller dataScroller; - DataScroller dataScroller1 =3D PaginationTester.DATA_SCROLLER_OUTSIDE_= TABLE; - DataScroller dataScroller2 =3D PaginationTester.DATA_SCROLLER_IN_TABLE= _FOOTER; - - PaginationTester paginationTester =3D new PaginationTester() { - - @Override - protected void verifyBeforeScrolling() { - tableText =3D dataTable.getTableText(); - } - - @Override - protected void verifyAfterScrolling() { - assertFalse(tableText.equals(dataTable.getTableText())); - assertEquals(maxPages, dataScroller.getCountOfVisiblePages()); - } - }; - - IdLocator attributeFastStep =3D id("form:attributes:fastStepInput"); - IdLocator attributeMaxPages =3D id("form:attributes:maxPagesInput"); - = - DataTable dataTable =3D new DataTable(pjq("table.rf-dt[id$=3DrichDataT= able]")); - - String tableText; - - @Override - public URL getTestUrl() { - return buildUrl(contextPath, "faces/components/richDataScroller/si= mple.xhtml"); - } - - @BeforeMethod - public void prepareComponent() { - guardHttp(selenium).type(attributeFastStep, String.valueOf(fastSte= p)); - guardHttp(selenium).type(attributeMaxPages, String.valueOf(maxPage= s)); - - paginationTester.setDataScroller(dataScroller); - dataScroller.setFastStep(fastStep); - - int lastPage =3D 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java 2010-09-0= 3 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 Lukas Fryc + * @version $Revision$ + */ +(a)Use(field =3D "dataScroller", value =3D "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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/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; + +/** + *
+ * Templates: doesn't work inside iteration components. + *
+ * = + * @author Lukas Fryc + * @version $Revision$ + */ +(a)Use(field =3D "dataScroller", value =3D "dataScroller1") +(a)Templates(exclude =3D { "a4jRepeat1", "a4jRepeat2", "hDataTable1", "hDa= taTable2", "richDataTable1,redDiv", + "richDataTable2,redDiv", "uiRepeat1", "uiRepeat2" }) +public class TestScrollerOutsideTable extends AbstractScrollerTest { + + public TestScrollerOutsideTable() throws JAXBException { + } + + @Test + @Override + public void testNumberedPages() { + super.testNumberedPages(); + } +} --===============0509048623439315467==--