Author: ppitonak(a)redhat.com
Date: 2010-12-02 09:57:21 -0500 (Thu, 02 Dec 2010)
New Revision: 20311
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/accordion.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/tabPanel.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/togglePanel.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTabPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTogglePanel.java
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
Log:
https://jira.jboss.org/browse/RFPL-742
* added 2 new samples for rich:toggleControl - with accordion and tab panel
* added 12 tests for toggle control
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/accordion.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/accordion.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/accordion.xhtml 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,118 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:panelGrid id="panel1Controls" columns="6">
+ panel1:
+ <h:commandButton id="tc11" value="Item 1">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc12" value="Item 2">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc13" value="Item 3">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ <h:panelGrid id="panel2Controls" columns="6">
+ panel2:
+ <h:commandButton id="tc21" value="Item 1">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc22" value="Item 2">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc23" value="Item 3">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ universal toggle control (settings below)
+ <h:commandButton id="tcCustom"
value="#{richToggleControlBean.attributes['targetPanel'].value}
#{richToggleControlBean.attributes['targetItem'].value}">
+ <rich:toggleControl
targetPanel="#{richToggleControlBean.attributes['targetPanel'].value}"
+
targetItem="#{richToggleControlBean.attributes['targetItem'].value}"
+ />
+ </h:commandButton>
+
+ <br/><br/>
+
+ <rich:accordion id="panel1" activeItem="item1">
+ <rich:accordionItem id="item11" name="item1">
+ <p>content of item 1</p>
+ </rich:accordionItem>
+ <rich:accordionItem id="item12" name="item2">
+ <p>content of item 2</p>
+ </rich:accordionItem>
+ <rich:accordionItem id="item13" name="item3">
+ <p>content of item 3</p>
+ </rich:accordionItem>
+ </rich:accordion>
+
+ <br/>
+
+ <rich:accordion id="panel2" activeItem="item1">
+ <rich:accordionItem id="item21" name="item1">
+ <p>content of item 1</p>
+ </rich:accordionItem>
+ <rich:accordionItem id="item22" name="item2">
+ <p>content of item 2</p>
+ </rich:accordionItem>
+ <rich:accordionItem id="item23" name="item3">
+ <p>content of item 3</p>
+ </rich:accordionItem>
+ </rich:accordion>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <br/>
+ Attributes for the first toggle control:
+ <br/><br/>
+ <metamer:attributes value="#{richToggleControlBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml 2010-12-02
14:47:41 UTC (rev 20310)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml 2010-12-02
14:57:21 UTC (rev 20311)
@@ -31,10 +31,18 @@
<ui:define name="links">
- <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
- Page containing a toggle panel, three
<b>rich:toggleControl</b>s and inputs for all attributes.
+ <metamer:testPageLink id="accordion"
outcome="accordion" value="Accordion">
+ Page containing two accordions, three
<b>rich:toggleControl</b>s for each and inputs for all toggle control's
attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="tabPanel" outcome="tabPanel"
value="Tab Panel">
+ Page containing two tab panels, three
<b>rich:toggleControl</b>s for each and inputs for all toggle control's
attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="togglePanel"
outcome="togglePanel" value="Toggle Panel">
+ Page containing two toggle panels, three
<b>rich:toggleControl</b>s for each and inputs for all toggle control's
attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Deleted:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml 2010-12-02
14:47:41 UTC (rev 20310)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml 2010-12-02
14:57:21 UTC (rev 20311)
@@ -1,125 +0,0 @@
-<?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:metamer="http://java.sun.com/jsf/composite/metamer"
-
xmlns:rich="http://richfaces.org/rich">
-
- <!--
-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.
- -->
-
- <ui:composition template="/templates/template.xhtml">
-
- <ui:define name="head">
- <f:metadata>
- <f:viewParam name="templates"
value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- </ui:define>
-
- <ui:define name="component">
-
- <h:panelGrid id="panel1Controls" columns="6">
- panel1:
- <h:commandLink id="tcLink11" value="Toggle Panel Item
1">
- <rich:toggleControl targetPanel="panel1"
targetItem="item1" />
- </h:commandLink>
- <h:outputText value=" | " />
- <h:commandLink id="tcLink12" value="Toggle Panel Item
2">
- <rich:toggleControl targetPanel="panel1"
targetItem="item2" />
- </h:commandLink>
- <h:outputText value=" | " />
- <h:commandLink id="tcLink13" value="Toggle Panel Item
3">
- <rich:toggleControl targetPanel="panel1"
targetItem="item3" />
- </h:commandLink>
- </h:panelGrid>
-
- <h:panelGrid id="panel2Controls" columns="6">
- panel2:
- <h:commandLink id="tcLink21" value="Toggle Panel Item
1">
- <rich:toggleControl targetPanel="panel2"
targetItem="item1" />
- </h:commandLink>
- <h:outputText value=" | " />
- <h:commandLink id="tcLink22" value="Toggle Panel Item
2">
- <rich:toggleControl targetPanel="panel2"
targetItem="item2" />
- </h:commandLink>
- <h:outputText value=" | " />
- <h:commandLink id="tcLink23" value="Toggle Panel Item
3">
- <rich:toggleControl targetPanel="panel2"
targetItem="item3" />
- </h:commandLink>
- </h:panelGrid>
-
- universal toggle control (settings below)
- <h:commandLink id="toggleControlLink" value="Toggle Panel
Item">
- <rich:toggleControl
targetPanel="#{richToggleControlBean.attributes['targetPanel'].value}"
-
targetItem="#{richToggleControlBean.attributes['targetItem'].value}"
- />
- </h:commandLink>
-
- <br/><br/>
-
- <fieldset>
- <legend>panel1</legend>
- <rich:togglePanel id="panel1"
activeItem="item1">
- <rich:togglePanelItem id="item11"
name="item1">
- <p>content of panel 1</p>
- </rich:togglePanelItem>
- <rich:togglePanelItem id="item12"
name="item2">
- <p>content of panel 2</p>
- </rich:togglePanelItem>
- <rich:togglePanelItem id="item13"
name="item3">
- <p>content of panel 3</p>
- </rich:togglePanelItem>
- </rich:togglePanel>
- </fieldset>
-
- <br/>
-
- <fieldset>
- <legend>panel2</legend>
- <rich:togglePanel id="panel2"
activeItem="item1">
- <rich:togglePanelItem id="item21"
name="item1">
- <p>content of panel 1</p>
- </rich:togglePanelItem>
- <rich:togglePanelItem id="item22"
name="item2">
- <p>content of panel 2</p>
- </rich:togglePanelItem>
- <rich:togglePanelItem id="item23"
name="item3">
- <p>content of panel 3</p>
- </rich:togglePanelItem>
- </rich:togglePanel>
- </fieldset>
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <br/>
- Attributes for the first toggle control:
- <br/><br/>
- <metamer:attributes value="#{richToggleControlBean.attributes}"
id="attributes" />
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/tabPanel.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/tabPanel.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/tabPanel.xhtml 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,118 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:panelGrid id="panel1Controls" columns="6">
+ panel1:
+ <h:commandButton id="tc11" value="Item 1">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc12" value="Item 2">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc13" value="Item 3">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ <h:panelGrid id="panel2Controls" columns="6">
+ panel2:
+ <h:commandButton id="tc21" value="Item 1">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc22" value="Item 2">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc23" value="Item 3">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ universal toggle control (settings below)
+ <h:commandButton id="tcCustom"
value="#{richToggleControlBean.attributes['targetPanel'].value}
#{richToggleControlBean.attributes['targetItem'].value}">
+ <rich:toggleControl
targetPanel="#{richToggleControlBean.attributes['targetPanel'].value}"
+
targetItem="#{richToggleControlBean.attributes['targetItem'].value}"
+ />
+ </h:commandButton>
+
+ <br/><br/>
+
+ <rich:tabPanel id="panel1" activeItem="item1">
+ <rich:tab id="item11" name="item1">
+ <p>content of item 1</p>
+ </rich:tab>
+ <rich:tab id="item12" name="item2">
+ <p>content of item 2</p>
+ </rich:tab>
+ <rich:tab id="item13" name="item3">
+ <p>content of item 3</p>
+ </rich:tab>
+ </rich:tabPanel>
+
+ <br/>
+
+ <rich:tabPanel id="panel2" activeItem="item1">
+ <rich:tab id="item21" name="item1">
+ <p>content of item 1</p>
+ </rich:tab>
+ <rich:tab id="item22" name="item2">
+ <p>content of item 2</p>
+ </rich:tab>
+ <rich:tab id="item23" name="item3">
+ <p>content of item 3</p>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <br/>
+ Attributes for the first toggle control:
+ <br/><br/>
+ <metamer:attributes value="#{richToggleControlBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/togglePanel.xhtml
(from rev 20284,
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/togglePanel.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/togglePanel.xhtml 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,125 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <h:panelGrid id="panel1Controls" columns="6">
+ panel1:
+ <h:commandButton id="tc11" value="Item 1">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc12" value="Item 2">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc13" value="Item 3">
+ <rich:toggleControl targetPanel="panel1"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ <h:panelGrid id="panel2Controls" columns="6">
+ panel2:
+ <h:commandButton id="tc21" value="Item 1">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item1" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc22" value="Item 2">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item2" />
+ </h:commandButton>
+ <h:outputText value=" | " />
+ <h:commandButton id="tc23" value="Item 3">
+ <rich:toggleControl targetPanel="panel2"
targetItem="item3" />
+ </h:commandButton>
+ </h:panelGrid>
+
+ universal toggle control (settings below)
+ <h:commandButton id="tcCustom"
value="#{richToggleControlBean.attributes['targetPanel'].value}
#{richToggleControlBean.attributes['targetItem'].value}">
+ <rich:toggleControl
targetPanel="#{richToggleControlBean.attributes['targetPanel'].value}"
+
targetItem="#{richToggleControlBean.attributes['targetItem'].value}"
+ />
+ </h:commandButton>
+
+ <br/><br/>
+
+ <fieldset>
+ <legend>panel1</legend>
+ <rich:togglePanel id="panel1"
activeItem="item1">
+ <rich:togglePanelItem id="item11"
name="item1">
+ <p>content of item 1</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item12"
name="item2">
+ <p>content of item 2</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item13"
name="item3">
+ <p>content of item 3</p>
+ </rich:togglePanelItem>
+ </rich:togglePanel>
+ </fieldset>
+
+ <br/>
+
+ <fieldset>
+ <legend>panel2</legend>
+ <rich:togglePanel id="panel2"
activeItem="item1">
+ <rich:togglePanelItem id="item21"
name="item1">
+ <p>content of item 1</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item22"
name="item2">
+ <p>content of item 2</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item23"
name="item3">
+ <p>content of item 3</p>
+ </rich:togglePanelItem>
+ </rich:togglePanel>
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <br/>
+ Attributes for the first toggle control:
+ <br/><br/>
+ <metamer:attributes value="#{richToggleControlBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * 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.richToggleControl;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.testng.Assert.assertFalse;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * Abstract test case for rich:toggleControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public abstract class AbstractTestToggleControl extends AbstractMetamerTest {
+
+ private JQueryLocator[] buttons1 = {pjq("input[id$=tc11]"),
pjq("input[id$=tc12]"), pjq("input[id$=tc13]")};
+ private JQueryLocator[] buttons2 = {pjq("input[id$=tc21]"),
pjq("input[id$=tc22]"), pjq("input[id$=tc23]")};
+ private JQueryLocator customButton = pjq("input[id$=tcCustom]");
+
+ public void testSwitchFirstPanel(JQueryLocator[] items) {
+ testSwitching(buttons1, items);
+ }
+
+ public void testSwitchSecondPanel(JQueryLocator[] items) {
+ testSwitching(buttons2, items);
+ }
+
+ public void testTargetItem(JQueryLocator[] items) {
+ selenium.click(pjq("input[name$=targetItemInput][value=item2]"));
+ selenium.waitForPageToLoad();
+
+ guardXhr(selenium).click(buttons1[2]);
+ waitGui.failWith("Item 3 is not
displayed.").until(isDisplayed.locator(items[2]));
+ assertFalse(selenium.isVisible(items[0]), "Item 1 should not be
visible.");
+ assertFalse(selenium.isVisible(items[1]), "Item 2 should not be
visible.");
+
+ guardXhr(selenium).click(customButton);
+ waitGui.failWith("Item 2 is not
displayed.").until(isDisplayed.locator(items[1]));
+ assertFalse(selenium.isVisible(items[0]), "Item 1 should not be
visible.");
+ assertFalse(selenium.isVisible(items[2]), "Item 3 should not be
visible.");
+ }
+
+ public void testTargetPanel(JQueryLocator[] items) {
+ selenium.click(pjq("input[name$=targetPanelInput][value=panel2]"));
+ selenium.waitForPageToLoad();
+
+ guardXhr(selenium).click(buttons2[2]);
+ waitGui.failWith("Item 3 is not
displayed.").until(isDisplayed.locator(items[2]));
+ assertFalse(selenium.isVisible(items[0]), "Item 1 should not be
visible.");
+ assertFalse(selenium.isVisible(items[1]), "Item 2 should not be
visible.");
+
+ guardXhr(selenium).click(customButton);
+ waitGui.failWith("Item 1 is not
displayed.").until(isDisplayed.locator(items[0]));
+ assertFalse(selenium.isVisible(items[1]), "Item 2 should not be
visible.");
+ assertFalse(selenium.isVisible(items[2]), "Item 3 should not be
visible.");
+ }
+
+ private void testSwitching(JQueryLocator[] buttons, JQueryLocator[] items) {
+ guardXhr(selenium).click(buttons[2]);
+ waitGui.failWith("Item 3 is not
displayed.").until(isDisplayed.locator(items[2]));
+ assertFalse(selenium.isVisible(items[0]), "Item 1 should not be
visible.");
+ assertFalse(selenium.isVisible(items[1]), "Item 2 should not be
visible.");
+
+ guardXhr(selenium).click(buttons[1]);
+ waitGui.failWith("Item 2 is not
displayed.").until(isDisplayed.locator(items[1]));
+ assertFalse(selenium.isVisible(items[0]), "Item 1 should not be
visible.");
+ assertFalse(selenium.isVisible(items[2]), "Item 3 should not be
visible.");
+
+ guardXhr(selenium).click(buttons[0]);
+ waitGui.failWith("Item 1 is not
displayed.").until(isDisplayed.locator(items[0]));
+ assertFalse(selenium.isVisible(items[1]), "Item 2 should not be
visible.");
+ assertFalse(selenium.isVisible(items[2]), "Item 3 should not be
visible.");
+ }
+}
Property changes on:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCAccordion.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCAccordion.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCAccordion.java 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.richToggleControl;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richToggleControl/accordion.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichTCAccordion extends AbstractTestToggleControl {
+
+ JQueryLocator[] items1 = {pjq("div[id$=item11:content]"),
pjq("div[id$=item12:content]"), pjq("div[id$=item13:content]")};
+ JQueryLocator[] items2 = {pjq("div[id$=item21:content]"),
pjq("div[id$=item22:content]"), pjq("div[id$=item23:content]")};
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richToggleControl/accordion.xhtml");
+ }
+
+ @Test
+ public void testSwitchFirstPanel() {
+ testSwitchFirstPanel(items1);
+ }
+
+ @Test
+ public void testSwitchSecondPanel() {
+ testSwitchSecondPanel(items2);
+ }
+
+ @Test
+ public void testTargetItem() {
+ testTargetItem(items1);
+ }
+
+ @Test
+ public void testTargetPanel() {
+ testTargetPanel(items2);
+ }
+}
Property changes on:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCAccordion.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTabPanel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTabPanel.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTabPanel.java 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.richToggleControl;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richToggleControl/tabPanel.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichTCTabPanel extends AbstractTestToggleControl {
+
+ JQueryLocator[] items1 = {pjq("div[id$=item11:content]"),
pjq("div[id$=item12:content]"), pjq("div[id$=item13:content]")};
+ JQueryLocator[] items2 = {pjq("div[id$=item21:content]"),
pjq("div[id$=item22:content]"), pjq("div[id$=item23:content]")};
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richToggleControl/tabPanel.xhtml");
+ }
+
+ @Test
+ public void testSwitchFirstPanel() {
+ testSwitchFirstPanel(items1);
+ }
+
+ @Test
+ public void testSwitchSecondPanel() {
+ testSwitchSecondPanel(items2);
+ }
+
+ @Test
+ public void testTargetItem() {
+ testTargetItem(items1);
+ }
+
+ @Test
+ public void testTargetPanel() {
+ testTargetPanel(items2);
+ }
+}
Property changes on:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTabPanel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTogglePanel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTogglePanel.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTogglePanel.java 2010-12-02
14:57:21 UTC (rev 20311)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.richToggleControl;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richToggleControl/togglePanel.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichTCTogglePanel extends AbstractTestToggleControl {
+
+ JQueryLocator[] items1 = {pjq("div[id$=item11]"),
pjq("div[id$=item12]"), pjq("div[id$=item13]")};
+ JQueryLocator[] items2 = {pjq("div[id$=item21]"),
pjq("div[id$=item22]"), pjq("div[id$=item23]")};
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richToggleControl/togglePanel.xhtml");
+ }
+
+ @Test
+ public void testSwitchFirstPanel() {
+ testSwitchFirstPanel(items1);
+ }
+
+ @Test
+ public void testSwitchSecondPanel() {
+ testSwitchSecondPanel(items2);
+ }
+
+ @Test
+ public void testTargetItem() {
+ testTargetItem(items1);
+ }
+
+ @Test
+ public void testTargetPanel() {
+ testTargetPanel(items2);
+ }
+}
Property changes on:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/TestRichTCTogglePanel.java
___________________________________________________________________
Name: svn:keywords
+ Revision