Author: amarkhel
Date: 2010-12-08 07:55:29 -0500 (Wed, 08 Dec 2010)
New Revision: 20458
Added:
trunk/ui/output/ui/src/test/java/org/richfaces/component/DropDownMenuBean.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIDropDownMenuTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuGroupTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuItemTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuSeparatorTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
trunk/ui/output/ui/src/test/resources/org/richfaces/component/
trunk/ui/output/ui/src/test/resources/org/richfaces/component/faces-config.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xhtml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml
Log:
RF-9788 Dropdown menu component: unit tests for server-side code.
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/DropDownMenuBean.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/DropDownMenuBean.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/DropDownMenuBean.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,22 @@
+package org.richfaces.component;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean
+@SessionScoped
+public class DropDownMenuBean {
+ private static String _current = "none";
+
+ public void doAction() {
+ _current = "action";
+ }
+
+ public static String getCurrent() {
+ return _current;
+ }
+
+ public static void setCurrent(String current) {
+ _current = current;
+ }
+}
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIDropDownMenuTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIDropDownMenuTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIDropDownMenuTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UIDropDownMenuTest {
+ private UIDropDownMenu dropDownMenu;
+
+ @Before
+ public void setUp () {
+ dropDownMenu = new UIDropDownMenu();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(dropDownMenu);
+ }
+}
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuGroupTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuGroupTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuGroupTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UIMenuGroupTest {
+ private UIMenuGroup menuGroup;
+
+ @Before
+ public void setUp () {
+ menuGroup = new UIMenuGroup();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(menuGroup);
+ }
+}
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuItemTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuItemTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuItemTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UIMenuItemTest {
+ private UIMenuItem menuItem;
+
+ @Before
+ public void setUp () {
+ menuItem = new UIMenuItem();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(menuItem);
+ }
+}
Added: trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuSeparatorTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuSeparatorTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/component/UIMenuSeparatorTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class UIMenuSeparatorTest {
+ private UIMenuSeparator menuSeparator;
+
+ @Before
+ public void setUp () {
+ menuSeparator = new UIMenuSeparator();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(menuSeparator);
+ }
+}
Added:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit.html;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Test;
+import org.richfaces.component.DropDownMenuBean;
+import org.xml.sax.SAXException;
+
+import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class DrowDownMenuRendererTest extends RendererTestBase {
+
+ @Override
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/component/faces-config.xml");
+ environment.start();
+ }
+
+ @Test
+ public void testDoEncodeServerMode() throws IOException, SAXException {
+ doTest("dropDownMenu_serverMode", "form:ddmenu");
+ }
+
+ @Test
+ public void testDoEncodeAjaxMode() throws IOException, SAXException {
+ doTest("dropDownMenu_ajaxMode", "form:ddmenu");
+ }
+
+ @Test
+ public void testServerClick() throws IOException, SAXException {
+ HtmlPage page = environment.getPage("/dropDownMenu_serverMode.jsf");
+ HtmlDivision item = (HtmlDivision)
page.getElementById("form:saveAll");
+ assertNotNull(item);
+ DropDownMenuBean.setCurrent("none");
+ item.click();
+
+ item = (HtmlDivision) page.getElementById("form:saveAll");
+ assertNotNull(item);
+ assertEquals("action", DropDownMenuBean.getCurrent());
+ }
+
+ @Test
+ public void testAjaxClick() throws IOException, SAXException {
+ HtmlPage page = environment.getPage("/dropDownMenu_ajaxMode.jsf");
+
+ HtmlDivision item = (HtmlDivision)
page.getElementById("form:saveAll");
+ assertNotNull(item);
+ DropDownMenuBean.setCurrent("none");
+ item.click();
+
+ item = (HtmlDivision) page.getElementById("form:saveAll");
+ assertNotNull(item);
+ assertEquals("action", DropDownMenuBean.getCurrent());
+ }
+}
Added:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
(rev 0)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit.html;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Test;
+import org.richfaces.component.DropDownMenuBean;
+import org.xml.sax.SAXException;
+
+import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class MenuItemRendererTest extends RendererTestBase {
+
+ @Override
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/component/faces-config.xml");
+ environment.start();
+ }
+
+ @Test
+ public void testDoEncodeServerMode() throws IOException, SAXException {
+ doTest("menuItem_serverMode", "form:menuItem");
+ }
+
+ @Test
+ public void testServerClick() throws IOException, SAXException {
+ HtmlPage page = environment.getPage("/menuItem_serverMode.jsf");
+
+ HtmlDivision item = (HtmlDivision)
page.getElementById("form:menuItem");
+ assertNotNull(item);
+ DropDownMenuBean.setCurrent("none");
+ item.click();
+
+ item = (HtmlDivision) page.getElementById("form:menuItem");
+ assertNotNull(item);
+ assertEquals("action", DropDownMenuBean.getCurrent());
+ }
+
+ @Test
+ public void testDoEncodeAjaxMode() throws IOException, SAXException {
+ doTest("menuItem_ajaxMode", "form:menuItem");
+ }
+
+ @Test
+ public void testAjaxClick() throws IOException, SAXException {
+ HtmlPage page = environment.getPage("/menuItem_ajaxMode.jsf");
+ HtmlDivision item = (HtmlDivision)
page.getElementById("form:menuItem");
+ assertNotNull(item);
+ DropDownMenuBean.setCurrent("none");
+ item.click();
+
+ item = (HtmlDivision) page.getElementById("form:menuItem");
+ assertNotNull(item);
+ assertEquals("action", DropDownMenuBean.getCurrent());
+ }
+
+ @Test
+ public void testDoEncodeClientMode() throws IOException, SAXException {
+ doTest("menuItem_clientMode", "form:menuItem");
+ }
+
+ @Test
+ public void testClientClick() throws IOException, SAXException {
+ HtmlPage page = environment.getPage("/menuItem_clientMode.jsf");
+ HtmlDivision item = (HtmlDivision)
page.getElementById("form:menuItem");
+ assertNotNull(item);
+ DropDownMenuBean.setCurrent("none");
+ item.click();
+
+ item = (HtmlDivision) page.getElementById("form:menuItem");
+ assertNotNull(item);
+ assertEquals("none", DropDownMenuBean.getCurrent());
+ }
+}
Added: trunk/ui/output/ui/src/test/resources/org/richfaces/component/faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/component/faces-config.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/component/faces-config.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <managed-bean>
+ <managed-bean-name>ddmBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.component.DropDownMenuBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xhtml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+
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:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces MenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="form">
+ <pn:dropDownMenu id="ddmenu" mode="ajax">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="/images/ddmenu/copy.gif"
styleClass="pic"/>
+ <h:outputText value="File"/>
+ </h:panelGroup>
+ </f:facet>
+ <pn:menuItem label="Open" id="open"/>
+ <pn:menuGroup label="Save As..." id="group">
+ <pn:menuItem label="Save" id="save">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ddmenu/save.gif" />
+ </f:facet>
+ </pn:menuItem>
+ <pn:menuSeparator id="menuSeparator1" />
+ <pn:menuItem id="saveAll" label="SaveAll"
action="#{ddmBean.doAction}"/>
+ </pn:menuGroup>
+ </pn:dropDownMenu>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,60 @@
+ <div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
+ <div class="rf-ddm-lbl-dec">
+ <img src="/images/ddmenu/copy.gif" class="pic"/>
+ File
+ </div>
+ <div class="rf-ddm-pos">
+ <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst-bg">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open"
onclick="RichFaces.ajax("form:open",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Open
+ </span>
+ </div>
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel'" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Save As...
+ </span>
+ <div class="rf-ddm-nd">
+ <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst-bg">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save"
onclick="RichFaces.ajax("form:save",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <span class="rf-ddm-itm-ic ">
+ <img src="/images/ddmenu/save.gif"/>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Save
+ </span>
+ </div>
+ <div class="rf-ddm-sep">
+ </div>
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll"
onclick="RichFaces.ajax("form:saveAll",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ SaveAll
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Menu("form:ddmenu",{"mode":"ajax"}
).initiateGroups([{"id":"form:group","horizontalOffset":"0","verticalOffset":"0","direction":"auto"}
] );
+//]]>
+ </script>
+ </div>
\ No newline at end of file
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xhtml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+
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:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces MenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="form">
+ <pn:dropDownMenu id="ddmenu">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="/images/ddmenu/copy.gif"
styleClass="pic"/>
+ <h:outputText value="File"/>
+ </h:panelGroup>
+ </f:facet>
+ <pn:menuItem label="Open" id="open"/>
+ <pn:menuGroup label="Save As..." id="group">
+ <pn:menuItem label="Save" id="save">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ddmenu/save.gif" />
+ </f:facet>
+ </pn:menuItem>
+ <pn:menuSeparator id="menuSeparator1" />
+ <pn:menuItem id="saveAll" label="SaveAll"
action="#{ddmBean.doAction}"/>
+ </pn:menuGroup>
+ </pn:dropDownMenu>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,60 @@
+ <div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
+ <div class="rf-ddm-lbl-dec">
+ <img src="/images/ddmenu/copy.gif" class="pic"/>
+ File
+ </div>
+ <div class="rf-ddm-pos">
+ <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst-bg">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open"
onclick="RichFaces.submitForm("form",{"form:open":"form:open"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Open
+ </span>
+ </div>
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel'" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Save As...
+ </span>
+ <div class="rf-ddm-nd">
+ <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst-bg">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save"
onclick="RichFaces.submitForm("form",{"form:save":"form:save"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <img src="/images/ddmenu/save.gif"/>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Save
+ </span>
+ </div>
+ <div class="rf-ddm-sep">
+ </div>
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll"
onclick="RichFaces.submitForm("form",{"form:saveAll":"form:saveAll"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ SaveAll
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.Menu("form:ddmenu").initiateGroups([{"id":"form:group","horizontalOffset":"0","verticalOffset":"0","direction":"auto"}
] );
+//]]>
+ </script>
+ </div>
\ No newline at end of file
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xhtml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+
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:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces MenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="form">
+ <pn:menuItem id="menuItem" label="Test"
action="#{ddmBean.doAction}" mode="ajax"/>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,12 @@
+ <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
+
onclick="RichFaces.ajax("form:menuItem",event,{"incId":"1"}
);return false;"
+ onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
+ onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Test
+ </span>
+ </div>
\ No newline at end of file
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xhtml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+
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:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces MenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="form">
+ <pn:menuItem id="menuItem" label="Test"
action="#{ddmBean.doAction}" mode="client"/>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,11 @@
+ <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
+ onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
+ onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Test
+ </span>
+ </div>
\ No newline at end of file
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xhtml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xhtml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,45 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!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:fn="http://java.sun.com/jsp/jstl/functions"
+
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:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces MenuItem Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="form">
+ <pn:menuItem id="menuItem" label="Test"
action="#{ddmBean.doAction}" mode="server"/>
+ </h:form>
+</h:body>
+</html>
+
+
Added:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml
(rev 0)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml 2010-12-08
12:55:29 UTC (rev 20458)
@@ -0,0 +1,12 @@
+ <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
+
onclick="RichFaces.submitForm("form",{"form:menuItem":"form:menuItem"}
)"
+ onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
+ onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Test
+ </span>
+ </div>
\ No newline at end of file