JBoss Rich Faces SVN: r22601 - modules/tests/metamer/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-08-08 05:44:21 -0400 (Mon, 08 Aug 2011)
New Revision: 22601
Modified:
modules/tests/metamer/trunk/pom.xml
Log:
RichFaces upgraded to 4.1.0.20110805-M1
Modified: modules/tests/metamer/trunk/pom.xml
===================================================================
--- modules/tests/metamer/trunk/pom.xml 2011-08-08 08:31:37 UTC (rev 22600)
+++ modules/tests/metamer/trunk/pom.xml 2011-08-08 09:44:21 UTC (rev 22601)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.1.0.20110805-M1</version>
</parent>
<groupId>org.richfaces.tests</groupId>
@@ -125,7 +125,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<richfaces.checkstyle.version>2</richfaces.checkstyle.version>
- <version.richfaces>4.1.0-SNAPSHOT</version.richfaces>
+ <version.richfaces>4.1.0.20110805-M1</version.richfaces>
</properties>
<dependencyManagement>
13 years, 4 months
JBoss Rich Faces SVN: r22600 - modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-08 04:31:37 -0400 (Mon, 08 Aug 2011)
New Revision: 22600
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.properties
Log:
added values of some rich:notify attributes to the properties file
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.properties 2011-08-08 08:31:37 UTC (rev 22600)
@@ -0,0 +1,6 @@
+attr.direction.vertical=vertical
+attr.direction.horizontal=horizontal
+attr.position.bottomLeft=bottomLeft
+attr.poisition.bottomRight=bottomRight
+attr.position.topLeft=topLeft
+attr.position.topRight=topRight
13 years, 4 months
JBoss Rich Faces SVN: r22599 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richPickList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-08-08 04:27:22 -0400 (Mon, 08 Aug 2011)
New Revision: 22599
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
Log:
Add initial tests for rich:pickList component
There are prepared methods for testing all attributes, but much of them are still not implemented.
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-08-08 08:27:22 UTC (rev 22599)
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richPickList;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * Rich Pick List component attributes bean
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public class RichPickListComponentAttribute extends AbstractComponentAttributes {
+
+ public void setAddAllText(String addAllText) {
+ setProperty("addAllText", addAllText);
+ }
+
+ public void setAddText(String addText) {
+ setProperty("addText", addText);
+ }
+
+ public void setColumnClasses(String columnClasses) {
+ setProperty("columnClasses", columnClasses);
+ }
+
+ public void setColumnVar(String columnVar) {
+ setProperty("columnVar", columnVar);
+ }
+
+ public void setDefaultLabel(String defaultLabel) {
+ setProperty("defaultLabel", defaultLabel);
+ }
+
+ public void setDisabled(Boolean disabled) {
+ setProperty("disabled", disabled);
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ setProperty("disabledClass", disabledClass);
+ }
+
+ public void setHeaderClass(String headerClass) {
+ setProperty("headerClass", headerClass);
+ }
+
+ public void setImmediate(String immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setItemClass(String itemClass) {
+ setProperty("itemClass", itemClass);
+ }
+
+ public void setListHeight(String listHeight) {
+ setProperty("listHeight", listHeight);
+ }
+
+ public void setListWidth(String listWidth) {
+ setProperty("listWidth", listWidth);
+ }
+
+ public void setMaxListHeight(String maxListHeight) {
+ setProperty("maxListHeight", maxListHeight);
+ }
+
+ public void setMinListHeight(String minListHeight) {
+ setProperty("minListHeight", minListHeight);
+ }
+
+ public void setOnadditem(String onadditem) {
+ setProperty("onadditem", onadditem);
+ }
+
+ public void setOnblur(String onblur) {
+ setProperty("onblur", onblur);
+ }
+
+ public void setOnchange(String onchange) {
+ setProperty("onchange", onchange);
+ }
+
+ public void setOnclick(String onclick) {
+ setProperty("onclick", onclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ setProperty("ondblclick", ondblclick);
+ }
+
+ public void setOnfocus(String onfocus) {
+ setProperty("onfocus", onfocus);
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ setProperty("onkeydown", onkeydown);
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ setProperty("onkeypress", onkeypress);
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ setProperty("onkeyup", onkeyup);
+ }
+
+ public void setOnlistclick(String onlistclick) {
+ setProperty("onlistclick", onlistclick);
+ }
+
+ public void setOnlistdblclick(String onlistdblclick) {
+ setProperty("onlistdblclick", onlistdblclick);
+ }
+
+ public void setOnlistkeydown(String onlistkeydown) {
+ setProperty("onlistkeydown", onlistkeydown);
+ }
+
+ public void setOnlistkeypress(String onlistkeypress) {
+ setProperty("onlistkeypress", onlistkeypress);
+ }
+
+ public void setOnlistkeyup(String onlistkeyup) {
+ setProperty("onlistkeyup", onlistkeyup);
+ }
+
+ public void setOnlistmousedown(String onlistmousedown) {
+ setProperty("onlistmousedown", onlistmousedown);
+ }
+
+ public void setOnlistmousemove(String onlistmousemove) {
+ setProperty("onlistmousemove", onlistmousemove);
+ }
+
+ public void setOnlistmouseout(String onlistmouseout) {
+ setProperty("onlistmouseout", onlistmouseout);
+ }
+
+ public void setOnlistmouseover(String onlistmouseover) {
+ setProperty("onlistmouseover", onlistmouseover);
+ }
+
+ public void setOnlistmouseup(String onlistmouseup) {
+ setProperty("onlistmouseup", onlistmouseup);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ setProperty("onmousedown", onmousedown);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ setProperty("onmousemove", onmousemove);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ setProperty("onmouseout", onmouseout);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ setProperty("onmouseover", onmouseover);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ setProperty("onmouseup", onmouseup);
+ }
+
+ public void setOnremoveitem(String onremoveitem) {
+ setProperty("onremoveitem", onremoveitem);
+ }
+
+ public void setOnsourceclick(String onsourceclick) {
+ setProperty("onsourceclick", onsourceclick);
+ }
+
+ public void setOnsourcedblclick(String onsourcedblclick) {
+ setProperty("onsourcedblclick", onsourcedblclick);
+ }
+
+ public void setOnsourcekeydown(String onsourcekeydown) {
+ setProperty("onsourcekeydown", onsourcekeydown);
+ }
+
+ public void setOnsourcekeypress(String onsourcekeypress) {
+ setProperty("onsourcekeypress", onsourcekeypress);
+ }
+
+ public void setOnsourcekeyup(String onsourcekeyup) {
+ setProperty("onsourcekeyup", onsourcekeyup);
+ }
+
+ public void setOnsourcemousedown(String onsourcemousedown) {
+ setProperty("onsourcemousedown", onsourcemousedown);
+ }
+
+ public void setOnsourcemousemove(String onsourcemousemove) {
+ setProperty("onsourcemousemove", onsourcemousemove);
+ }
+
+ public void setOnsourcemouseout(String onsourcemouseout) {
+ setProperty("onsourcemouseout", onsourcemouseout);
+ }
+
+ public void setOnsourcemouseover(String onsourcemouseover) {
+ setProperty("onsourcemouseover", onsourcemouseover);
+ }
+
+ public void setOnsourcemouseup(String onsourcemouseup) {
+ setProperty("onsourcemouseup", onsourcemouseup);
+ }
+
+ public void setOntargetclick(String ontargetclick) {
+ setProperty("ontargetclick", ontargetclick);
+ }
+
+ public void setOntargetdblclick(String ontargetdblclick) {
+ setProperty("ontargetdblclick", ontargetdblclick);
+ }
+
+ public void setOntargetkeydown(String ontargetkeydown) {
+ setProperty("ontargetkeydown", ontargetkeydown);
+ }
+
+ public void setOntargetkeypress(String ontargetkeypress) {
+ setProperty("ontargetkeypress", ontargetkeypress);
+ }
+
+ public void setOntargetkeyup(String ontargetkeyup) {
+ setProperty("ontargetkeyup", ontargetkeyup);
+ }
+
+ public void setOntargetmousedown(String ontargetmousedown) {
+ setProperty("ontargetmousedown", ontargetmousedown);
+ }
+
+ public void setOntargetmousemove(String ontargetmousemove) {
+ setProperty("ontargetmousemove", ontargetmousemove);
+ }
+
+ public void setOntargetmouseout(String ontargetmouseout) {
+ setProperty("ontargetmouseout", ontargetmouseout);
+ }
+
+ public void setOntargetmouseover(String ontargetmouseover) {
+ setProperty("ontargetmouseover", ontargetmouseover);
+ }
+
+ public void setOntargetmouseup(String ontargetmouseup) {
+ setProperty("ontargetmouseup", ontargetmouseup);
+ }
+
+ public void setRemoveAllText(String removeAllText) {
+ setProperty("removeAllText", removeAllText);
+ }
+
+ public void setRemoveText(String removeText) {
+ setProperty("removeText", removeText);
+ }
+
+ public void setRendered(String rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setRequired(String required) {
+ setProperty("required", required);
+ }
+
+ public void setRequiredMessage(String requiredMessage) {
+ setProperty("requiredMessage", requiredMessage);
+ }
+
+ public void setSelectItemClass(String selectItemClass) {
+ setProperty("selectItemClass", selectItemClass);
+ }
+
+ public void setShowButton(String showButton) {
+ setProperty("showButton", showButton);
+ }
+
+ public void setSourceCaption(String sourceCaption) {
+ setProperty("sourceCaption", sourceCaption);
+ }
+
+ public void setStyle(String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+
+ public void setTargetCaption(String targetCaption) {
+ setProperty("targetCaption", targetCaption);
+ }
+
+ public void setValidator(String validator) {
+ setProperty("validator", validator);
+ }
+
+ public void setValidatorMessage(String validatorMessage) {
+ setProperty("validatorMessage", validatorMessage);
+ }
+
+ public void setValue(String value) {
+ setProperty("value", value);
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ setProperty("valueChangeListener", valueChangeListener);
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-08-08 08:27:22 UTC (rev 22599)
@@ -0,0 +1,629 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richPickList;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
+
+import java.net.URL;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.testng.annotations.Test;
+
+/**
+ * Test for rich:pickList on page faces/components/richPickList/simple.xhtml.
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public class TestPickList extends AbstractMetamerTest {
+
+ private RichPickListComponentAttribute attributes = new RichPickListComponentAttribute();
+ private JQueryLocator hSubmit = pjq("input[id$=hButton]");
+ private JQueryLocator a4jSubmit = pjq("input[id$=a4jButton]");
+
+ private JQueryLocator pickListSourceItems = pjq("div[id$=pickListSourceItems]");
+ private JQueryLocator pickListSourceItem = pickListSourceItems.getChild(jq("div[id$=pickListItem{0}]"));
+
+ private JQueryLocator pickListTargetItems = pjq("div[id$=pickListTargetItems]");
+ private JQueryLocator pickListTargetItem = pickListTargetItems.getChild(jq("div[id$=pickListItem{0}]"));
+
+ // after click on 'add' button, item is moved to 'staging' container (not child of #pickListTargetItems)
+ private JQueryLocator pickListTargetItemsStage = pjq("div[id$=pickListTargetList] div.rf-pick-lst-scrl");
+ private JQueryLocator pickListTargetItemStage = pickListTargetItemsStage.getChild(jq("div[id$=pickListItem{0}]"));
+
+ private JQueryLocator addBtn = pjq("button.rf-pick-add");
+ private JQueryLocator addAllBtn = pjq("button.rf-pick-add-all");
+ private JQueryLocator removeBtn = pjq("button.rf-pick-rem");
+ private JQueryLocator removeAllBtn = pjq("button.rf-pick-rem-all");
+
+ private Attribute classAttr = new Attribute("class");
+ private Attribute disabledAttr = new Attribute("disabled");
+
+ private String STYLE_CLASS_ITEM_DISABLED = "rf-pick-opt-dis";
+ private String STYLE_CLASS_BTN_DISABLED = "rf-pick-btn-dis";
+ private String STYLE_CLASS_ITEM_SELECTED = "rf-pick-sel";
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath, "faces/components/richPickList/simple.xhtml");
+ }
+
+ private void addItem(int id) {
+ selenium.click(pickListSourceItem.format(id));
+ selenium.click(addBtn);
+ }
+
+ private void removeItem(int id) {
+ selenium.click(pickListTargetItem.format(id));
+ selenium.click(removeBtn);
+ }
+
+ private void addAllItems() {
+ selenium.click(addAllBtn);
+ }
+
+ private void removeAllItems(){
+ selenium.click(removeAllBtn);
+ }
+
+ @Test
+ public void testAddAllText() {
+ attributes.setAddAllText("addAll");
+ assertEquals(selenium.getText(addAllBtn), "addAll");
+ }
+
+ @Test
+ public void testAddText() {
+ attributes.setAddText("add");
+ assertEquals(selenium.getText(addBtn), "add");
+ }
+
+ // @Test
+ public void testColumnClasses() {
+ // TODO JJa 2011-08-05: ask Brian about this attr:
+ // attributes.setColumnClasses(columnClasses);
+ }
+
+ // @Test
+ public void testColumnVar() {
+ // TODO JJa 2011-08-05: ask Brian about this attr:
+ // attributes.setColumnVar(columnVar);
+ }
+
+ // @Test
+ public void testDefaultLabel() {
+ // TODO JJa 2011-08-05: ask Brian about this attr:
+ // attributes.setDefaultLabel(defaultLabel);
+ }
+
+ @Test
+ public void testDisabled() {
+
+ // add first item [idx=0], then submit and disable
+ addItem(0);
+ selenium.click(hSubmit);
+
+ attributes.setDisabled(Boolean.TRUE);
+
+ // check if source items are disabled (check second - first item after 0 item added)
+ String pickListSourceItemClass = selenium.getAttribute(
+ pickListSourceItem.format(1).getAttribute(classAttr));
+ assertTrue(pickListSourceItemClass.contains(STYLE_CLASS_ITEM_DISABLED));
+
+ // all buttons should be disabled
+ assertTrue(selenium.getAttribute(addBtn.getAttribute(classAttr)).contains(STYLE_CLASS_BTN_DISABLED));
+ assertTrue("disabled".equals(selenium.getAttribute(addBtn.getAttribute(disabledAttr))));
+
+ assertTrue(selenium.getAttribute(addAllBtn.getAttribute(classAttr)).contains(STYLE_CLASS_BTN_DISABLED));
+ assertTrue("disabled".equals(selenium.getAttribute(addAllBtn.getAttribute(disabledAttr))));
+
+ assertTrue(selenium.getAttribute(removeBtn.getAttribute(classAttr)).contains(STYLE_CLASS_BTN_DISABLED));
+ assertTrue("disabled".equals(selenium.getAttribute(removeBtn.getAttribute(disabledAttr))));
+
+ assertTrue(selenium.getAttribute(removeAllBtn.getAttribute(classAttr)).contains(STYLE_CLASS_BTN_DISABLED));
+ assertTrue("disabled".equals(selenium.getAttribute(removeAllBtn.getAttribute(disabledAttr))));
+
+ // check item added to target list if disabled (remember - item index in id didn't change)
+ assertTrue(selenium.getAttribute(pickListTargetItem.format(0).getAttribute(classAttr))
+ .contains(STYLE_CLASS_ITEM_DISABLED));
+
+ }
+
+ // @Test
+ public void testDisabledClass() {
+ // TODO JJa 2011-08-05: ask Brian about this attr:
+ // attributes.setDisabledClass(disabledClass);
+ }
+
+ // @Test
+ public void testHeaderClass() {
+ // attributes.setHeaderClass(headerClass);
+ }
+
+ // @Test
+ public void testImmediate() {
+ // attributes.setImmediate(immediate);
+ }
+
+ // @Test
+ public void testItemClass() {
+ // attributes.setItemClass(itemClass);
+ }
+
+ // @Test
+ public void testListHeight() {
+ // attributes.setListHeight(listHeight);
+ }
+
+ // @Test
+ public void testListWidth() {
+ // attributes.setListWidth(listWidth)setMaxListHeight(maxListHeight);
+ }
+
+ // @Test
+ public void testMaxListHeight() {
+ // attributes.setMaxListHeight(maxListHeight);
+ }
+
+ // @Test
+ public void testMinListHeight() {
+ // attributes.setMinListHeight(minListHeight);
+ }
+
+ // @Test
+ public void testOnadditem() {
+ // attributes.setOnadditem(onadditem);
+ }
+
+ // @Test
+ public void testOnblur() {
+ // attributes.setOnblur(onblur);
+ }
+
+ // @Test
+ public void testOnchange() {
+ // attributes.setOnchange(onchange);
+ }
+
+ // @Test
+ public void testOnclick() {
+ // attributes.setOnclick(onclick);
+ }
+
+ // @Test
+ public void testOndblclick() {
+ // attributes.setOndblclick(ondblclick);
+ }
+
+ // @Test
+ public void testOnfocus() {
+ // attributes.setOnfocus(onfocus);
+ }
+
+ // @Test
+ public void testOnkeydown() {
+ // attributes.setOnkeydown(onkeydown);
+ }
+
+ // @Test
+ public void testOnkeypress() {
+ // attributes.setOnkeypress(onkeypress);
+ }
+
+ // @Test
+ public void testOnkeyup() {
+ // attributes.setOnkeyup(onkeyup);
+ }
+
+ // @Test
+ public void testOnlistclick() {
+ // attributes.setOnlistclick(onlistclick);
+ }
+
+ // @Test
+ public void testOnlistdblclick() {
+ // attributes.setOnlistdblclick(onlistdblclick);
+ }
+
+ // @Test
+ public void testOnlistkeydown() {
+ // attributes.setOnlistkeydown(onlistkeydown);
+ }
+
+ // @Test
+ public void testOnlistkeypress() {
+ // attributes.setOnlistkeypress(onlistkeypress);
+ }
+
+ // @Test
+ public void testOnlistkeyup() {
+ // attributes.setOnlistkeyup(onlistkeyup);
+ }
+
+ // @Test
+ public void testOnlistmousedown() {
+ // attributes.setOnlistmousedown(onlistmousedown);
+ }
+
+ // @Test
+ public void testOnlistmousemove() {
+ // attributes.setOnlistmousemove(onlistmousemove);
+ }
+
+ // @Test
+ public void testOnlistmouseout() {
+ // attributes.setOnlistmouseout(onlistmouseout);
+ }
+
+ // @Test
+ public void testOnlistmouseover() {
+ // attributes.setOnlistmouseover(onlistmouseover);
+ }
+
+ // @Test
+ public void testOnlistmouseup() {
+ // attributes.setOnlistmouseup(onlistmouseup);
+ }
+
+ // @Test
+ public void testOnmousedown() {
+ // attributes.setOnmousedown(onmousedown);
+ }
+
+ // @Test
+ public void testOnmousemove() {
+ // attributes.setOnmousemove(onmousemove);
+ }
+
+ // @Test
+ public void testOnmouseout() {
+ // attributes.setOnmouseout(onmouseout);
+ }
+
+ // @Test
+ public void testOnmouseover() {
+ // attributes.setOnmouseover(onmouseover);
+ }
+
+ // @Test
+ public void testOnmouseup() {
+ // attributes.setOnmouseup(onmouseup);
+ }
+
+ // @Test
+ public void testOnremoveitem() {
+ // attributes.setOnremoveitem(onremoveitem);
+ }
+
+ // @Test
+ public void testOnsourceclick() {
+ // attributes.setOnsourceclick(onsourceclick);
+ }
+
+ // @Test
+ public void testOnsourcedblclick() {
+ // attributes.setOnsourcedblclick(onsourcedblclick);
+ }
+
+ // @Test
+ public void testOnsourcekeydown() {
+ // attributes.setOnsourcekeydown(onsourcekeydown);
+ }
+
+ // @Test
+ public void testOnsourcekeypress() {
+ // attributes.setOnsourcekeypress(onsourcekeypress);
+ }
+
+ // @Test
+ public void testOnsourcekeyup() {
+ // attributes.setOnsourcekeyup(onsourcekeyup);
+ }
+
+ // @Test
+ public void testOnsourcemousedown() {
+ // attributes.setOnsourcemousedown(onsourcemousedown);
+ }
+
+ // @Test
+ public void testOnsourcemousemove() {
+ // attributes.setOnsourcemousemove(onsourcemousemove);
+ }
+
+ // @Test
+ public void testOnsourcemouseout() {
+ // attributes.setOnsourcemouseout(onsourcemouseout);
+ }
+
+ // @Test
+ public void testOnsourcemouseover() {
+ // attributes.setOnsourcemouseover(onsourcemouseover);
+ }
+
+ // @Test
+ public void testOnsourcemouseup() {
+ // attributes.setOnsourcemouseup(onsourcemouseup);
+ }
+
+ // @Test
+ public void testOntargetclick() {
+ // attributes.setOntargetclick(ontargetclick);
+ }
+
+ // @Test
+ public void testOntargetdblclick() {
+ // attributes.setOntargetdblclick(ontargetdblclick);
+ }
+
+ // @Test
+ public void testOntargetkeydown() {
+ // attributes.setOntargetkeydown(ontargetkeydown);
+ }
+
+ // @Test
+ public void testOntargetkeypress() {
+ // attributes.setOntargetkeypress(ontargetkeypress);
+ }
+
+ // @Test
+ public void testOntargetkeyup() {
+ // attributes.setOntargetkeyup(ontargetkeyup);
+ }
+
+ // @Test
+ public void testOntargetmousedown() {
+ // attributes.setOntargetmousedown(ontargetmousedown);
+ }
+
+ // @Test
+ public void testOntargetmousemove() {
+ // attributes.setOntargetmousemove(ontargetmousemove);
+ }
+
+ // @Test
+ public void testOntargetmouseout() {
+ // attributes.setOntargetmouseout(ontargetmouseout);
+ }
+
+ // @Test
+ public void testOntargetmouseover() {
+ // attributes.setOntargetmouseover(ontargetmouseover);
+ }
+
+ // @Test
+ public void testOntargetmouseup() {
+ // attributes.setOntargetmouseup(ontargetmouseup);
+ }
+
+ // @Test
+ public void testRemoveAllText() {
+ // attributes.setRemoveAllText(removeAllText);
+ }
+
+ // @Test
+ public void testRemoveText() {
+ // attributes.setRemoveText(removeText);
+ }
+
+ // @Test
+ public void testRendered() {
+ // attributes.setRendered(rendered);
+ }
+
+ // @Test
+ public void testRequired() {
+ // attributes.setRequired(required);
+ }
+
+ // @Test
+ public void testRequiredMessage() {
+ // attributes.setRequiredMessage(requiredMessage);
+ }
+
+ // @Test
+ public void testSelectItemClass() {
+ // attributes.setSelectItemClass(selectItemClass);
+ }
+
+ // @Test
+ public void testShowButton() {
+ // TODO JJa 2011-08-05: create JIRA for this attribute: its not working
+ }
+
+ // @Test
+ public void testSourceCaption() {
+ // attributes.setSourceCaption(sourceCaption);
+ }
+
+ // @Test
+ public void testStyle() {
+ // attributes.setStyle(style);
+ }
+
+ // @Test
+ public void testStyleClass() {
+ // attributes.setStyleClass(styleClass);
+ }
+
+ // @Test
+ public void testTargetCaption() {
+ // attributes.setTargetCaption(targetCaption);
+ }
+
+ // @Test
+ public void testValidator() {
+
+ // verify difference between submit incorrect value by h and a4j btn.
+ // Seems that while h submit cause incorrect value removed from target list, a4j don't do it
+
+ // attributes.setValidator(validator);
+ }
+
+ // @Test
+ public void testValidatorMessage() {
+ // attributes.setValidatorMessage(validatorMessage);
+ }
+
+ // @Test
+ public void testValue() {
+ // attributes.setValue(value);
+ }
+
+ // @Test
+ public void testValueChangeListener() {
+
+ }
+
+ /**
+ * Verify that addBtn is disabled until item from source items picked
+ */
+ // @Test
+ public void testDisableAddBtn() {
+
+ }
+
+ /**
+ * Verify that removeBtn is disabled until item from target items picked
+ */
+ // @Test
+ public void testDisableRemoveBtn() {
+
+ }
+
+ /**
+ * Verify addAll button working correctly
+ */
+ // @Test
+ public void testAddAllBtn(){
+
+ }
+
+ /**
+ * Verify removeAll button working correctly
+ */
+ // @Test
+ public void testRemoveAllBtn() {
+
+ }
+
+ /**
+ * Verify submit by JSF submit button
+ */
+ // @Test
+ public void testSaveJSF() {
+
+ }
+
+ /**
+ * Verify submit by ajax button
+ */
+ // @Test
+ public void testSaveAjax() {
+
+ }
+
+ /**
+ * Verify that item keep selected even moved from source to target,
+ * or back. If selected Alaska from sources, and then added to target,
+ * it should remain selected in target list
+ * @return
+ */
+ @Test
+ public void testKeepSelected() {
+ int itemIdx = 0;
+
+ String classBeforeSelect = selenium.getAttribute(pickListSourceItem.format(itemIdx).getAttribute(classAttr));
+ assertFalse(classBeforeSelect.contains(STYLE_CLASS_ITEM_SELECTED),
+ "pickList item shouldn't be selected before any click made! Current class(es) found: " + classBeforeSelect);
+
+ selenium.click(pickListSourceItem.format(itemIdx));
+
+ String pickedItemText = selenium.getText(pickListSourceItem.format(itemIdx));
+
+ String classAfterSelect = selenium.getAttribute(pickListSourceItem.format(itemIdx).getAttribute(classAttr));
+ assertTrue(classAfterSelect.contains(STYLE_CLASS_ITEM_SELECTED),
+ "pickList item should be selected after click on item was made. Current class(es) found: " + classAfterSelect);
+
+ // now move selected item to target list
+ selenium.click(addBtn);
+
+ waitGui.until(elementPresent.locator(jq("div[id$=pickListTargetList] div.rf-pick-lst-scrl > div[id$=pickListItem0]")));
+
+ // and check if item remain selected
+ String classAfterMove = selenium.getAttribute(pickListTargetItemStage.format(itemIdx).getAttribute(classAttr));
+ assertTrue(classAfterMove.contains(STYLE_CLASS_ITEM_SELECTED),
+ "pickList item should keep selected after move to target list. Current class(es) found: " + classAfterMove);
+
+ // verify that the same text is within item with the same ID index
+ assertEquals(selenium.getText(pickListTargetItemStage.format(itemIdx)), pickedItemText);
+ }
+
+ /**
+ * Verify that selected item is moved to appropriate list
+ * after click on add/remove button
+ */
+ @Test
+ public void testMoveItem() {
+ int itemIdx = 5;
+
+ // select item
+ selenium.click(pickListSourceItem.format(itemIdx));
+
+ String pickedItemText = selenium.getText(pickListSourceItem.format(itemIdx));
+
+ // add item to target list
+ selenium.click(addBtn);
+
+ // item index doesn't change when moved to target list
+ assertTrue(selenium.isElementPresent(pickListTargetItemStage.format(itemIdx)));
+ // verify that the same text is within item with the same ID index
+ assertEquals(selenium.getText(pickListTargetItemStage.format(itemIdx)), pickedItemText);
+ }
+
+ /**
+ * Verify that item get selected when click on it
+ */
+ @Test
+ public void testGetSelected() {
+ // this item will be selected and verified appropriate class change/add
+ int itemIdx = 0;
+
+ String classBeforeSelect = selenium.getAttribute(pickListSourceItem.format(itemIdx).getAttribute(classAttr));
+ assertFalse(classBeforeSelect.contains(STYLE_CLASS_ITEM_SELECTED),
+ "pickList item shouldn't be selected before any click made! Current class(es) found: " + classBeforeSelect);
+
+ selenium.click(pickListSourceItem.format(itemIdx));
+
+ String classAfterSelect = selenium.getAttribute(pickListSourceItem.format(itemIdx).getAttribute(classAttr));
+ assertTrue(classAfterSelect.contains(STYLE_CLASS_ITEM_SELECTED),
+ "pickList item should be selected after click on item was made. Current class(es) found: " + classAfterSelect);
+
+ }
+
+
+}
13 years, 4 months
JBoss Rich Faces SVN: r22598 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-08-08 04:26:45 -0400 (Mon, 08 Aug 2011)
New Revision: 22598
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
Remove unused property (locator) declaration
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-08-08 08:23:10 UTC (rev 22597)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-08-08 08:26:45 UTC (rev 22598)
@@ -46,8 +46,6 @@
private JQueryLocator editorToolbarGroup = jq("span.cke_toolgroup");
private JQueryLocator editorToolbarContainer = jq("td.cke_toolgroup");
- private JQueryLocator editorToolsGroupFormat =
- editorToolbarContainer.getDescendant(jq("span#cke_{0}.cke_toolbar"));
public enum toolbarGroup {
FILE_SAVE(7),
13 years, 4 months
JBoss Rich Faces SVN: r22597 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org: richfaces/tests/metamer/ftest and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-08 04:23:10 -0400 (Mon, 08 Aug 2011)
New Revision: 22597
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/NegationCondition.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyValidation.java
Log:
selenium tests for rich:notify (containing some unstable tests)
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/NegationCondition.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/NegationCondition.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/NegationCondition.java 2011-08-08 08:23:10 UTC (rev 22597)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.jboss.test.selenium.waiting;
+
+import org.apache.commons.lang.Validate;
+import org.jboss.test.selenium.encapsulated.JavaScript;
+import org.jboss.test.selenium.waiting.ajax.JavaScriptCondition;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
+
+/**
+ * Condition that verifies that the given condition doesn't hold.
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class NegationCondition implements SeleniumCondition, JavaScriptCondition{
+
+ private SeleniumCondition condition;
+
+ /**
+ * Factory method.
+ *
+ * @return single instance of NegationCondition
+ */
+ public static NegationCondition getInstance() {
+ return new NegationCondition();
+ }
+
+ public NegationCondition condition(SeleniumCondition condition) {
+ Validate.notNull(condition);
+ NegationCondition copy = new NegationCondition();
+ copy.condition = condition;
+ return copy;
+ }
+
+ @Override
+ public JavaScript getJavaScriptCondition() {
+ if (!(condition instanceof JavaScriptCondition)) {
+ throw new IllegalStateException("The given condition doesn't implement JavaScriptCondition so its negation can't be converted to the JavaScript.");
+ }
+ return new JavaScript("!(" + ((JavaScriptCondition) condition).getJavaScriptCondition().getAsString() + ")");
+ }
+
+ @Override
+ public boolean isTrue() {
+ return !condition.isTrue();
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java 2011-08-08 08:23:10 UTC (rev 22597)
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richNotify;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+
+/**
+ * Abstract test case for pages faces/components/notify/
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public abstract class AbstractRichNotifyTest extends AbstractMetamerTest {
+
+ /**
+ * notify locator which matches on all notifies and messages
+ */
+ protected final JQueryLocator notify = jq("div.rf-ntf");
+
+ /**
+ * error message locator
+ */
+ protected final JQueryLocator notifyError = jq("div.rf-ntf-error");
+
+ /**
+ * fatal message locator
+ */
+ protected final JQueryLocator notifyFatal = jq("div.rf-ntf-fatal");
+
+ /**
+ * history of notifies and notify messages
+ */
+ protected final JQueryLocator notifyHistory = jq("div.rf-ntf-hstr-hdr");
+
+ /**
+ * 'all' button in the history menu
+ */
+ protected final JQueryLocator notifyHistoryAll = jq("button.rf-ntf-hstr-all");
+
+ /**
+ * 'last' button in the history menu
+ */
+ protected final JQueryLocator notifyHistoryLast = jq("button.rf-ntf-hstr-last");
+
+ /**
+ * info message locator
+ */
+ protected final JQueryLocator notifyInfo = jq("div.rf-ntf-info");
+
+ /**
+ * warn message locator
+ */
+ protected final JQueryLocator notifyWarn = jq("div.rf-ntf-warn");
+
+ /**
+ * It closes a message defined by the given locator
+ *
+ * @param locator the message locator
+ */
+ protected void close(final JQueryLocator locator) {
+ final int before = selenium.getCount(locator);
+ selenium.click(getFirstCloseButton(locator));
+ waitGui
+ .failWith("Message " + locator.getRawLocator() + " can't be closed.")
+ .until(countEquals.locator(locator).count(before - 1));
+ }
+
+ /**
+ * It closes all message defined by the given locator
+ *
+ * @param locator the message locator
+ */
+ protected void closeAll(final JQueryLocator locator) {
+ while(selenium.isElementPresent(locator)) {
+ close(locator);
+ }
+ }
+
+ /**
+ * It delays for the given number of ms. If there is any exception thrown, it's logged by logger of this class.
+ *
+ * @param ms number of miliseconds
+ */
+ protected void delay(int ms) {
+ try {
+ Thread.sleep(ms);
+ } catch (InterruptedException e) {
+ Logger.getLogger(getClass().getName()).log(Level.WARNING, e.toString());
+ }
+ }
+
+ /**
+ * It returns a close button of a message defined by the given locator
+ *
+ * @param message the message locator
+ * @return the close button locator
+ */
+ protected JQueryLocator getCloseButton(JQueryLocator message) {
+ return jq(message.getRawLocator() + " > div.rf-ntf-cnt > div.rf-ntf-cls > span.rf-ntf-cls-ico");
+ }
+
+ /**
+ * It returns a detail element of a message defined by the given locator
+ *
+ * @param message the message locator
+ * @return the detail locator
+ */
+ protected JQueryLocator getDetail(JQueryLocator message) {
+ return jq(notify.getRawLocator() + " > div.rf-ntf-cnt > div.rf-ntf-txt");
+ }
+
+ /**
+ * It returns the first available close button of a message defined by the given locator
+ *
+ * @param message the message locator
+ * @return the close button locator
+ */
+ protected JQueryLocator getFirstCloseButton(JQueryLocator message) {
+ return jq(getCloseButton(message).getRawLocator() + ":first");
+ }
+
+ /**
+ * It returns a number of notifes (only notifies, not messages) in the given stack.
+ *
+ * @return number of notifies
+ */
+ protected int getNumberOfNotifies() {
+ return selenium.getCount(notify) - (selenium.getCount(notifyError) + selenium.getCount(notifyFatal) + selenium.getCount(notifyInfo) + selenium.getCount(notifyWarn));
+ }
+
+ /**
+ * It returns a summary element of a message defined by the given locator
+ *
+ * @param message the message locator
+ * @return the summary locator
+ */
+ protected JQueryLocator getSummary(JQueryLocator message) {
+ return jq(notify.getRawLocator() + " > div.rf-ntf-cnt > div.rf-ntf-tl");
+ }
+
+ /**
+ * It produces a message defined by the given message locator and the given type.
+ * It waits until the <expected> number of message is produced.
+ *
+ * @param message the message locator
+ * @param type the name of the message type (started with capital letter)
+ * @param expected expected number of produced messages
+ */
+ protected void produceMessage(final JQueryLocator message, String type, final int expected) {
+ final int before = selenium.getCount(message);
+ selenium.click(pjq("input[id$=produce" + type + "]"));
+ waitGui
+ .failWith("Number of produced messages has been set to <" + expected + "> but <" + selenium.getCount(message) + "> " + type + " messages is present.")
+ .until(countEquals.locator(message).count(expected + before));
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java 2011-08-08 08:23:10 UTC (rev 22597)
@@ -0,0 +1,441 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richNotify;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertEquals;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.NegationCondition;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
+import org.richfaces.tests.metamer.bean.rich.RichNotifyBean;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for pages faces/components/notify/simple.xhtml
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestRichNotify extends AbstractRichNotifyTest {
+
+ /**
+ * notify stack locator
+ */
+ private JQueryLocator notifyStack = jq("div.rf-ntf");
+
+ /**
+ * Map containing locators of all tested messages. Type of the message is a key in the map.
+ */
+ private Map<String, JQueryLocator> messages = new HashMap<String, JQueryLocator>();
+
+ @BeforeClass
+ public void init() {
+ messages.put("Error", notifyError);
+ messages.put("Fatal", notifyFatal);
+ messages.put("Info", notifyInfo);
+ messages.put("Warn", notifyWarn);
+ }
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richNotify/simple.xhtml");
+ }
+
+ @Test
+ public void testAttributeDelay() {
+ // set the delay to <1000>
+ JQueryLocator attribute = pjq("input[id$='attributesNotify:delayInput']");
+ selenium.type(attribute, "1000");
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ // wait for <500>
+ delay(500);
+ assertFalse(selenium.isElementPresent(notify), "The delay is set to 1000 and after some little waiting the notify shouldn't be present.");
+ // wait for <1000>
+ delay(1000);
+ assertTrue(selenium.isElementPresent(notify), "The delay is set to 1000 and after some waiting the notify should be present.");
+ }
+
+ @Test
+ public void testAttributeRendered() {
+ // set the rendered to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotify:rendered'][value=false]"));
+ selenium.waitForPageToLoad();
+ assertFalse(selenium.isElementPresent(notify), "The attribute rendered is set to <false> but the notify is still present.");
+ }
+
+ @Test
+ public void testAttributeShowCloseButton() {
+ // set the showCloseButton to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotify:showCloseButtonInput'][value=false]"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.getStyle(getCloseButton(notify), new CssProperty("visibility")).contains("hidden"), "The showCloseButton is set to <false> and therefore the close button shouldn't be displayed.");
+ }
+
+ @Test
+ public void testAttributeShowHistory() {
+ // check whether the history is not present (showHistory is set to <false>)
+ assertFalse(selenium.isElementPresent(notifyHistory), "The showHistory is set to <false> and there shouldn't be any history menu.");
+ // set the showHistory to <true>
+ selenium.click(pjq("input[type=radio][name*='attributesNotify:showHistory'][value=true]"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.isElementPresent(notifyHistory), "The showHistory is set to <true> and one notify is present, but there is no history menu.");
+ close(notify);
+ produceMessage(notifyError, "Error", 1);
+ close(notify);
+ close(notify);
+ // click on the All button in history menu
+ selenium.click(notifyHistoryAll);
+ waitModel
+ .failWith("After clicking on <All> in history menu there should be all notifies. Expected <2>, found <" + getNumberOfNotifies() + ">")
+ .until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return getNumberOfNotifies() == 2;
+ }
+ });
+ close(notify);
+ close(notify);
+ // click on the Last button in the history menu
+ selenium.click(notifyHistoryLast);
+ waitModel
+ .failWith("After clicking on <Last> in history menu there should be last notify. Expected <1>, found <" + getNumberOfNotifies() + ">")
+ .until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return getNumberOfNotifies() == 1;
+ }
+ });
+ }
+
+ @Test
+ public void testAttributesStayTime() {
+ // stayTime is set to a very high number
+ close(notify);
+ produceMessage(notifyError, "Error", 1);
+ close(notifyError);
+ delay(1000);
+ assertTrue(selenium.isElementPresent(notify), "The stayTime is set to very high number and after some little delay the notify is not present.");
+ // set the stayTime to <500>
+ JQueryLocator attribute = pjq("input[name*='attributesNotify:stayTime']");
+ selenium.type(attribute, "500");
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ produceMessage(notifyError, "Error", 1);
+ close(notifyError);
+ // wait for <1000>
+ delay(1000);
+ assertFalse(selenium.isElementPresent(notify), "The stayTime is set to 500 but after some delay the notify is still present.");
+ }
+
+ @Test
+ public void testAttributeSticky() {
+ // set the stayTime to <0>
+ JQueryLocator stayTime = pjq("input[name*='attributesNotify:stayTime']");
+ selenium.type(stayTime, "0");
+ selenium.fireEvent(stayTime, Event.BLUR);
+ selenium.waitForPageToLoad();
+ // set the sticky to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotify:sticky'][value=false]"));
+ selenium.waitForPageToLoad();
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <false>, so the notify shouldn't be present.")
+ .until(NegationCondition.getInstance().condition(elementPresent.locator(notify)));
+ // produce messages and notifies and close messages
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ close(messages.get(type));
+ }
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <false>, so the notify shouldn't be present.")
+ .until(NegationCondition.getInstance().condition(elementPresent.locator(notify)));
+ // set the sticky to <true>
+ selenium.click(pjq("input[type=radio][name*='attributesNotify:sticky'][value=true]"));
+ selenium.waitForPageToLoad();
+ delay(500);
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <true>, so the notify should be present.")
+ .until(elementPresent.locator(notify));
+ closeAll(notify);
+ // produce messages and notifies and close messages
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ close(messages.get(type));
+ }
+ waitModel
+ .failWith("The stayTime is set to <0> and sticky to <true>, so the notify shouldn't be present.")
+ .until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return selenium.getCount(notify) == messages.size();
+ }
+ });
+ }
+
+ @Test
+ public void testAttributeStyleClass() {
+ selenium.type(pjq("input[name*='attributesNotify:styleClassInput']"), "someStyleClass");
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(notify, "someStyleClass"), "The cssStyle has been set but notify doesn't belong to the set class.");
+ }
+
+ @Test
+ public void testAttributeMessagesDelay() {
+ // set the delay to <1000>
+ JQueryLocator attribute = pjq("input[id$='attributesNotifyMessages:delayInput']");
+ selenium.type(attribute, "1000");
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ // check the delay for each message type
+ for(String type : messages.keySet()) {
+ selenium.click(pjq("input[id$=produce" + type + "]"));
+ delay(500);
+ assertFalse(selenium.isElementPresent(messages.get(type)), "The delay is set to 1000 and after some little waiting the " + type + " message shouldn't be present.");
+ delay(1000);
+ assertTrue(selenium.isElementPresent(messages.get(type)), "The delay is set to 1000 and after some waiting the " + type + " message should be present.");
+ }
+ }
+
+ @Test
+ public void testAttributeMessagesRendered() {
+ // set the rendered to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:rendered'][value=false]"));
+ selenium.waitForPageToLoad();
+ // check the message isn't displayed for each message type
+ for(String type : messages.keySet()) {
+ String before = selenium.getText(jq("span[id=requestTime]"));
+ selenium.click(pjq("input[id$=produce" + type + "]"));
+ waitGui.until(NegationCondition.getInstance().condition(textEquals.locator(jq("span[id=requestTime]")).text(before)));
+ assertFalse(selenium.isElementPresent(messages.get(type)), "The attribute rendered is set to <false> but the " + type + " message is still present.");
+ }
+ }
+
+ @Test(enabled=false)
+ public void testAttributeMessagesShowCloseButton() {
+ // set the showCloseButton to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:showCloseButtonInput'][value=false]"));
+ selenium.waitForPageToLoad();
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ assertTrue(selenium.getStyle(jq(messages.get(type) + " > div.rf-ntf-co > div.rf-ntf-cls"), new CssProperty("visibility")).contains("hidden"), "The showCloseButton is set to <false> and therefore the close button shouldn't be displayed.");
+ }
+ }
+
+ @Test(enabled=false)
+ public void testAttributeMessagesShowDetail() {
+ // produce messages and check whether the detail isn't displayed (showDetail is set to <false>)
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ // FIXME:
+ assertTrue(selenium.getStyle(jq(messages.get(type) + " > div.rf-ny-co > div.rf-ny-te"), new CssProperty("display")).contains("none"));
+ }
+ // set showDetail to <true>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:showDetail'][value=true]"));
+ selenium.waitForPageToLoad();
+ for(String type : messages.keySet()) {
+ // FIXME:
+ assertFalse(selenium.getStyle(jq(messages.get(type) + " > div.rf-ny-co > div.rf-ny-te"), new CssProperty("display")).contains("none"));
+ }
+ }
+
+ @Test
+ public void testAttributeMessagesShowHistory() {
+ // check whether the history isn't present (showHistory is set to <false>)
+ close(notify);
+ assertFalse(selenium.isElementPresent(notifyHistory), "The showHistory is set to <false> and there shouldn't be any history menu.");
+ // set the showHistory to <true>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:showHistory'][value=true]"));
+ selenium.waitForPageToLoad();
+ // check whether the history isn't displayed (there is no message in the history)
+ assertFalse(selenium.isElementPresent(notifyHistory), "The showHistory is set to <true>, but there is no message, so there shouldn't be any history menu.");
+ // produce messages and close them
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ close(notify);
+ close(notify);
+ }
+ // click on All button in the history menu
+ selenium.click(notifyHistoryAll);
+ final int expected = messages.size();
+ waitModel
+ .failWith("After clicking on <All> in history menu there should be all messages. Expected <" + expected + ">, found <" + selenium.getCount(notify) + ">")
+ .until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return selenium.getCount(notify) == expected;
+ }
+ });
+ for(int i=0; i<expected; i++) {
+ close(notify);
+ }
+ // click on Last button in the history menu
+ selenium.click(notifyHistoryLast);
+ waitModel
+ .failWith("After clicking on <Last> in history menu there should be last message. Expected <1>, found <" + selenium.getCount(notify) + ">")
+ .until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return selenium.getCount(notify) == 1;
+ }
+ });
+ }
+
+ @Test
+ public void testAttributeMessagesStayTime() {
+ // produce messages and check whether the stay at least 1000 ms (stayTime is set to a very high number)
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ delay(1000);
+ assertTrue(selenium.isElementPresent(messages.get(type)), "The stayTime is set to very high number and after some little delay the " + type + " message is not present.");
+ close(messages.get(type));
+ }
+ // set the stayTime to <500>
+ JQueryLocator attribute = pjq("input[name*='attributesNotifyMessages:stayTime']");
+ selenium.type(attribute, "500");
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ // produce messages and check whether the stay less then 1000 ms
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ delay(1000);
+ assertFalse(selenium.isElementPresent(messages.get(type)), "The stayTime is set to 500 but after some delay the " + type + " message is still present.");
+ }
+ }
+
+ @Test
+ public void testAttributeMessagesSticky() {
+ // set the stayTime to <0>
+ JQueryLocator stayTime = pjq("input[name*='attributesNotifyMessages:stayTime']");
+ selenium.type(stayTime, "0");
+ selenium.fireEvent(stayTime, Event.BLUR);
+ selenium.waitForPageToLoad();
+ // set the sticky to <false>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:sticky'][value=false]"));
+ selenium.waitForPageToLoad();
+ // produce messages and check whether they disappear quickly
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <false>, so the " + type + " message shouldn't be present.")
+ .until(NegationCondition.getInstance().condition(elementPresent.locator(messages.get(type))));
+ closeAll(notify);
+ }
+ // set the sticky to <true>
+ selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:sticky'][value=true]"));
+ selenium.waitForPageToLoad();
+ // produce messages
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ }
+ // check whether the messages are still present
+ delay(500);
+ for(String type : messages.keySet()) {
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <true>, so the " + type + " message should be present.")
+ .until(elementPresent.locator(messages.get(type)));
+ }
+ }
+
+ @Test
+ public void testAttributeMessagesStyleClass() {
+ selenium.type(pjq("input[name*='attributesNotifyMessages:styleClassInput']"), "someStyleClass");
+ selenium.waitForPageToLoad();
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ assertTrue(selenium.belongsClass(messages.get(type), "someStyleClass"), "The cssStyle has been set but " + type + " message doesn't belong to the set class.");
+ }
+ }
+
+ @Test
+ public void testAttributeStackStyleClass() {
+ JQueryLocator attribute = pjq("input[name*='attributesNotifyStack:styleClass']");
+ selenium.type(attribute, "someNiceStyleClass");
+ selenium.fireEvent(attribute, Event.BLUR);
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(notifyStack, "someNiceStyleClass"));
+ }
+
+ @Test
+ public void testAttributeStackRendered() {
+ // set the rendered to <false>
+ selenium.click(pjq("input[name*='attributesNotifyStack:rendered']"));
+ selenium.waitForPageToLoad();
+ assertFalse(selenium.isElementPresent(notifyStack), "The attribute rendered is set to <false> but messages in the notify stack are still present.");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(notify), "There is no notify message after page is loaded.");
+ assertEquals(selenium.getText(getDetail(notify)), RichNotifyBean.DEFAULT_DETAIL, "The notify detail doesn't match.");
+ assertEquals(selenium.getText(getSummary(notify)), RichNotifyBean.DEFAULT_SUMMARY, "The notify summary doesn't match.");
+ }
+
+ @Test
+ public void testCloseAndProduceNotify() {
+ // check closing the notify
+ close(notify);
+ waitGui
+ .failWith("After closing notify message the message is stil present.")
+ .until(NegationCondition.getInstance().condition(elementPresent.locator(notify)));
+ // check producing notifies
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ close(messages.get(type));
+ }
+ waitGui
+ .failWith("After producing messages the correct number of notifies isn't present. Expected <" + messages.size() + ">, was <" + selenium.getCount(notify) + ">")
+ .until(countEquals.locator(notify).count(messages.size()));
+ }
+
+ @Test
+ public void testProduceAndCloseMessages() {
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, 1);
+ close(messages.get(type));
+ }
+ }
+
+ @Test
+ public void testProduceMoreMessages() {
+ // set the messageCount to <testedNumber>
+ int testedNumber = 3;
+ selenium.type(pjq("input[name*=messageCountInput]"), testedNumber + "");
+ selenium.fireEvent(pjq("input[name*=messageCountInput]"), Event.BLUR);
+ selenium.waitForPageToLoad();
+ close(notify);
+ for(String type : messages.keySet()) {
+ produceMessage(messages.get(type), type, testedNumber);
+ assertEquals(getNumberOfNotifies(), 1, "Number of produced messages has been set to <" + testedNumber + "> but number of notifies should be still <1>.");
+ closeAll(messages.get(type));
+ close(notify);
+ }
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java 2011-08-08 08:23:10 UTC (rev 22597)
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richNotify;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertEquals;
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.testng.annotations.Test;
+
+
+/**
+ * Test case for pages faces/components/notify/moreStacks.xhtml
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestRichNotifyMoreStacks extends AbstractRichNotifyTest {
+
+ /**
+ * locator of the first stack
+ */
+ private final JQueryLocator stack1 = jq("div.topRight");
+
+ /**
+ * locator of the second stack
+ */
+ private final JQueryLocator stack2 = jq("div.bottomRight");
+
+ /**
+ * locater of the input which is associated with messages for the first stack
+ */
+ private final JQueryLocator number1 = pjq("input[id$=number1]");
+
+ /**
+ * locater of the input which is associated with messages for the second stack
+ */
+ private final JQueryLocator number2 = pjq("input[id$=number2]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richNotify/moreStacks.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(stack1), "The first stack is not present.");
+ assertTrue(selenium.isElementPresent(stack2), "The second stack is not present.");
+ assertTrue(selenium.isElementPresent(inStack(stack1, notify)), "The notify in the first stack is not present.");
+ assertTrue(selenium.isElementPresent(inStack(stack2, notify)), "The notify in the second stack is not present.");
+ assertEquals(1, getNumberOfNotifies(stack1), "The initial number of notifies in the first stack should be <1>, found <" + getNumberOfNotifies(stack1) + ">.");
+ assertEquals(1, getNumberOfNotifies(stack2), "The initial number of notifies in the second stack should be <1>, found <" + getNumberOfNotifies(stack2) + ">.");
+ }
+
+ @Test
+ public void testValidationErrorInTwoStacks() {
+ // notify in stacks
+ JQueryLocator message1 = inStack(stack1, notify);
+ JQueryLocator message2 = inStack(stack2, notify);
+ // close notifes in both stacks
+ close(message1);
+ close(message2);
+ // try to fill the number 1 field (wrong)
+ selenium.type(number1, "1");
+ selenium.fireEvent(number1, Event.BLUR);
+ delay(1000);
+ waitGui
+ .failWith("After wrong filling the first form field the number of messages in the first stack should be <1>, found <" + selenium.getCount(message1) + ">")
+ .until(countEquals.locator(message1).count(1));
+ waitGui
+ .failWith("After wrong filling the first form field the number of messages in the second stack should be <0>, found <" + selenium.getCount(message2) + ">")
+ .until(countEquals.locator(message1).count(0));
+
+ // close produced notifies
+ close(message1);
+ close(message2);
+ // try to fill the number 2 field (wrong)
+ selenium.type(number2, "1");
+ selenium.fireEvent(number2, Event.BLUR);
+ delay(1000);
+ waitGui
+ .failWith("After wrong filling the second form field the number of messages in the second stack should be <1>, found <" + selenium.getCount(message2) + ">")
+ .until(countEquals.locator(message1).count(1));
+ waitGui
+ .failWith("After wrong filling the second form field the number of messages in the first stack should be <0>, found <" + selenium.getCount(message1) + ">")
+ .until(countEquals.locator(message1).count(0));
+ }
+
+ /**
+ * It returns a number of notifes (only notifies, not messages) in the given stack
+ *
+ * @param stack the stack where the notifies should be present
+ * @return number of notifies
+ */
+ private int getNumberOfNotifies(JQueryLocator stack) {
+ return selenium.getCount(inStack(stack, notify)) - (selenium.getCount(inStack(stack, notifyError)) + selenium.getCount(inStack(stack, notifyFatal)) + selenium.getCount(inStack(stack, notifyInfo)) + selenium.getCount(inStack(stack, notifyWarn)));
+ }
+
+ /**
+ * It returns a new locator of the given message in the given stack
+ * @param stack
+ * @param message
+ * @return a new locator of the given message in the given stack
+ */
+ private JQueryLocator inStack(JQueryLocator stack, JQueryLocator message) {
+ String[] splittedMessageLocator = message.getAsString().split("\\.");
+ String[] splittedStackLocator = stack.getAsString().split("\\.");
+ String locator = "div[class*=" + splittedStackLocator[splittedStackLocator.length - 1] + "][class*=" + splittedMessageLocator[splittedMessageLocator.length - 1] + "]";
+ return jq(locator);
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyValidation.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyValidation.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyValidation.java 2011-08-08 08:23:10 UTC (rev 22597)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richNotify;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.NegationCondition;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for pages faces/components/notify/validation.xhtml
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TestRichNotifyValidation extends AbstractRichNotifyTest {
+
+ private JQueryLocator number = pjq("input[id$=number]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richNotify/validation.xhtml");
+ }
+
+ @Test
+ public void testAttributeMessagesGlobalOnly() {
+
+ }
+
+ @Test
+ public void testValidationMessageAppear() {
+ closeAll(notify);
+ selenium.type(number, "4");
+ selenium.fireEvent(number, Event.BLUR);
+ waitGui
+ .failWith("After typing <4> into the number field, the error should appear.")
+ .until(elementPresent.locator(notifyError));
+ }
+
+ @Test
+ public void testValidationMessageNotAppear() {
+ closeAll(notify);
+ selenium.type(number, "5");
+ selenium.fireEvent(number, Event.BLUR);
+ waitGui
+ .failWith("After typing <5> into the number field, the error should appear.")
+ .until(NegationCondition.getInstance().condition(elementPresent.locator(notifyError)));
+ }
+
+}
13 years, 4 months
JBoss Rich Faces SVN: r22596 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/bean and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-05 09:31:32 -0400 (Fri, 05 Aug 2011)
New Revision: 22596
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml
Log:
added notify component to metamer (merged from branch 'sandbox-components')
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2011-08-05 12:07:57 UTC (rev 22595)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2011-08-05 13:31:32 UTC (rev 22596)
@@ -160,6 +160,18 @@
* Factory method for creating instances of class Attributes. Attributes are loaded from class.
*
* @param clazz
+ * general class object whose attributes will be stored
+ * @param beanClass
+ * class object of a managed bean
+ */
+ public static Attributes getAttributesFromClass(Class<?> interfaze, Class<?> beanClass) {
+ return new Attributes(interfaze, beanClass, true);
+ }
+
+ /**
+ * Factory method for creating instances of class Attributes. Attributes are loaded from class.
+ *
+ * @param clazz
* class object of a JSF component whose attributes will be stored
* @param beanClass
* class object of a managed bean
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-08-05 12:07:57 UTC (rev 22595)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-08-05 13:31:32 UTC (rev 22596)
@@ -156,6 +156,7 @@
richComponents.put("richMenuSeparator", "Rich Menu Separator");
richComponents.put("richMessage", "Rich Message");
richComponents.put("richMessages", "Rich Messages");
+ richComponents.put("richNotify", "Rich Notify");
richComponents.put("richOrderingList", "Rich Ordering List");
richComponents.put("richPanel", "Rich Panel");
richComponents.put("richPanelMenu", "Rich Panel Menu");
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java 2011-08-05 13:31:32 UTC (rev 22596)
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.AbstractNotify;
+import org.richfaces.component.AbstractNotifyMessages;
+import org.richfaces.component.AbstractNotifyStack;
+import org.richfaces.component.NotifyAttributes;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for notify:notify
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+@ManagedBean(name = "notifyBean")
+@ViewScoped
+public class RichNotifyBean implements Serializable {
+
+ public static final String DEFAULT_DETAIL = "Message detail";
+ public static final String DEFAULT_SUMMARY = "Message summary";
+ private static final long serialVersionUID = 8408544368608166106L;
+ private static Logger logger;
+ private Attributes attributesNotify;
+ private Attributes attributesNotifyMessages;
+ private Attributes attributesNotifyStackFirst;
+ private Attributes attributesNotifyStackSecond;
+ private Attributes attributesBean;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+ attributesNotify = Attributes.getComponentAttributesFromClass(AbstractNotify.class, getClass());
+ attributesNotifyMessages = Attributes.getComponentAttributesFromClass(AbstractNotifyMessages.class, getClass());
+ attributesNotifyStackFirst = Attributes.getComponentAttributesFromClass(AbstractNotifyStack.class, getClass());
+ attributesNotifyStackSecond = Attributes.getComponentAttributesFromClass(AbstractNotifyStack.class, getClass());
+ attributesBean = Attributes.getEmptyAttributes(getClass());
+
+ attributesNotify.putAll(getGeneralAttributes());
+ attributesNotify.setAttribute("detail", DEFAULT_DETAIL);
+ attributesNotify.setAttribute("rendered", true);
+ attributesNotify.setAttribute("summary", DEFAULT_SUMMARY);
+
+ attributesNotifyMessages.putAll(getGeneralAttributes());
+ attributesNotifyMessages.setAttribute("interval", 800);
+ attributesNotifyMessages.setAttribute("showSummary", true);
+ attributesNotifyMessages.setAttribute("rendered", true);
+ attributesNotifyMessages.remove("for");
+ attributesNotifyMessages.remove("ajaxRendered");
+
+ attributesNotifyStackFirst.setAttribute("direction", "vertical");
+ attributesNotifyStackFirst.setAttribute("method", "first");
+ attributesNotifyStackFirst.setAttribute("position", "topRight");
+ attributesNotifyStackFirst.setAttribute("rendered", true);
+ attributesNotifyStackFirst.setAttribute("styleClass", "topRight");
+
+ attributesNotifyStackSecond.setAttribute("direction", "vertical");
+ attributesNotifyStackSecond.setAttribute("method", "first");
+ attributesNotifyStackSecond.setAttribute("position", "bottomRight");
+ attributesNotifyStackSecond.setAttribute("rendered", true);
+ attributesNotifyStackSecond.setAttribute("styleClass", "bottomRight");
+
+ attributesBean.setAttribute("messageCount", "1");
+ attributesBean.setAttribute("messageDetail", DEFAULT_DETAIL);
+ attributesBean.setAttribute("messageText", DEFAULT_SUMMARY);
+ }
+
+ /**
+ * Produces error message which is handled by notify:notifyMessages component.
+ */
+ public void produceError() {
+ produceMessage(FacesMessage.SEVERITY_ERROR);
+ }
+
+ /**
+ * Produces fatal message which is handled by notify:notifyMessages component.
+ */
+ public void produceFatal() {
+ produceMessage(FacesMessage.SEVERITY_FATAL);
+ }
+
+ /**
+ * Produces info message which is handled by notify:notifyMessages component.
+ */
+ public void produceInfo() {
+ produceMessage(FacesMessage.SEVERITY_INFO);
+ }
+
+ /**
+ * Produces warn message which is handled by notify:notifyMessages component.
+ */
+ public void produceWarn() {
+ produceMessage(FacesMessage.SEVERITY_WARN);
+ }
+
+ /**
+ * General attributes for this bean
+ */
+ public Attributes getAttributesBean() {
+ return attributesBean;
+ }
+
+ /**
+ * Attributes for notify:notify component
+ *
+ * @return A map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public Attributes getAttributesNotify() {
+ return attributesNotify;
+ }
+
+ /**
+ * Attributes for notify:notifyMessages component
+ *
+ * @return A map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public Attributes getAttributesNotifyMessages() {
+ return attributesNotifyMessages;
+ }
+
+ /**
+ * Attributes for notify:notifyStack (1) component
+ *
+ * @return A map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public Attributes getAttributesNotifyStackFirst() {
+ return attributesNotifyStackFirst;
+ }
+
+ /**
+ * Attributes for notify:notifyStack (2) component
+ *
+ * @return A map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public Attributes getAttributesNotifyStackSecond() {
+ return attributesNotifyStackSecond;
+ }
+ /**
+ * General attributes for this bean
+ *
+ * @param attributesBean
+ * map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public void setAttributesBean(Attributes attributesBean) {
+ this.attributesBean = attributesBean;
+ }
+
+ /**
+ * Attributes for notify:notify component
+ *
+ * @param attributesNotify
+ * map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public void setAttributesNotify(Attributes attributesNotify) {
+ this.attributesNotify = attributesNotify;
+ }
+
+ /**
+ * Attributes for notify:notifyMessages component
+ *
+ * @param attributesNotifyMessages
+ * map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public void setAttributesNotifyMessages(Attributes attributesNotifyMessages) {
+ this.attributesNotifyMessages = attributesNotifyMessages;
+ }
+
+ /**
+ * Attributes for notify:notifyStack (1) component
+ *
+ * @param attributesNotifyStack
+ * map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public void setAttributesNotifyStackFirst(Attributes attributesNotifyStack) {
+ this.attributesNotifyStackFirst = attributesNotifyStack;
+ }
+
+ /**
+ * Attributes for notify:notifyStack (2) component
+ *
+ * @param attributesNotifyStack
+ * map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ public void setAttributesNotifyStackSecond(Attributes attributesNotifyStack) {
+ this.attributesNotifyStackSecond = attributesNotifyStack;
+ }
+
+ /**
+ * Produces a message which is handled by notify:notifyMessages component.
+ *
+ * @param severity the severity
+ */
+ private void produceMessage(FacesMessage.Severity severity) {
+ int messageCount = Integer.valueOf((String)attributesBean.get("messageCount").getValue());
+ String text = (String) attributesBean.get("messageText").getValue();
+ String detail = (String) attributesBean.get("messageDetail").getValue();
+ for(int i=0; i<messageCount; i++) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity, text, detail));
+ }
+ }
+
+ /**
+ * It returns attributes shared by AbstractNotify and AbstractNotifyMessages (NotifyAttributes)
+ *
+ * @return map containing all attributes of tested component. Name of the component is key in the map.
+ */
+ private Attributes getGeneralAttributes() {
+ Attributes attributes = Attributes.getAttributesFromClass(NotifyAttributes.class, getClass());
+ attributes.setAttribute("animationSpeed", 100);
+ attributes.setAttribute("appearAnimation", "fade");
+ attributes.setAttribute("hideAnimation", "show");
+ attributes.setAttribute("showCloseButton", true);
+ attributes.setAttribute("stayTime", 100000);
+ attributes.remove("stack");
+ return attributes;
+ }
+}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml
===================================================================
--- modules/tests/metamer/branches/sandbox-components/application/src/main/webapp/components/notify/moreStacks.xhtml 2011-08-04 15:43:59 UTC (rev 22594)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml 2011-08-05 13:31:32 UTC (rev 22596)
@@ -1,8 +1,8 @@
<?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:notify="http://richfaces.org/sandbox/notify"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j">
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">>
<!--
JBoss, Home of Professional Open Source
@@ -29,6 +29,7 @@
<ui:composition template="/templates/template.xhtml">
<ui:define name="head">
+<!--
<style>
.topLeft {
bottom: auto;
@@ -58,107 +59,108 @@
left: auto;
}
</style>
+ -->
</ui:define>
<ui:define name="component">
<h:form>
- <notify:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number1"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="topRightStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
- <notify:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number2"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="bottomRightStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
+ <rich:notifyMessages ajaxRendered="true"
+ animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ execute="{@form}"
+ for="number1"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
+ stack="topRightStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
+ />
+ <rich:notifyMessages ajaxRendered="true"
+ animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ execute="{@form}"
+ for="number2"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
+ stack="bottomRightStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
+ />
- <notify:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="topRightStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- text="Stack 1 - #{notifyBean.attributesNotify['text'].value}"
- title="Stack 1 - #{notifyBean.attributesNotify['title'].value}"
- />
- <notify:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="bottomRightStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- text="Stack 2 - #{notifyBean.attributesNotify['text'].value}"
- title="Stack 2 - #{notifyBean.attributesNotify['title'].value}"
- />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
+ stack="topRightStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}"
+ />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
+ stack="bottomRightStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}"
+ />
- <notify:notifyStack id="topRightStack"
- push="#{notifyBean.attributesNotifyStackFirst['push'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- stackDir1="#{notifyBean.attributesNotifyStackFirst['stackDir1'].value}"
- stackDir2="#{notifyBean.attributesNotifyStackFirst['stackDir2'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
- />
+ <rich:notifyStack id="topRightStack"
+ direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
+ />
- <notify:notifyStack id="bottomRightStack"
- push="#{notifyBean.attributesNotifyStackSecond['push'].value}"
- rendered="#{notifyBean.attributesNotifyStackSecond['rendered'].value}"
- stackDir1="#{notifyBean.attributesNotifyStackSecond['stackDir1'].value}"
- stackDir2="#{notifyBean.attributesNotifyStackSecond['stackDir2'].value}"
- styleClass="#{notifyBean.attributesNotifyStackSecond['styleClass'].value}"
- />
+ <rich:notifyStack id="bottomRightStack"
+ direction="#{notifyBean.attributesNotifyStackSecond['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackSecond['method'].value}"
+ position="#{notifyBean.attributesNotifyStackSecond['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackSecond['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackSecond['styleClass'].value}"
+ />
<h:outputLabel for="number1" value="Number for Stack 1 (from 5 to 10)"/>
<h:inputText id="number1" required="true">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml
===================================================================
--- modules/tests/metamer/branches/sandbox-components/application/src/main/webapp/components/notify/simple.xhtml 2011-08-04 15:43:59 UTC (rev 22594)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml 2011-08-05 13:31:32 UTC (rev 22596)
@@ -2,7 +2,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:notify="http://richfaces.org/sandbox/notify"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j">
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
<!--
JBoss, Home of Professional Open Source
@@ -31,52 +32,53 @@
<ui:define name="component">
<h:form>
<a4j:outputPanel ajaxRendered="true">
- <notify:notifyStack id="exampleNotifyStack"
- push="#{notifyBean.attributesNotifyStackFirst['push'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- stackDir1="#{notifyBean.attributesNotifyStackFirst['stackDir1'].value}"
- stackDir2="#{notifyBean.attributesNotifyStackFirst['stackDir2'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
- />
- <notify:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- text="#{notifyBean.attributesNotify['text'].value}"
- title="#{notifyBean.attributesNotify['title'].value}"
- />
- <notify:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="#{notifyBean.attributesNotifyMessages['for'].value}"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
+
+ <rich:notifyStack id="exampleNotifyStack"
+ direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
+ />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ detail="#{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
+ stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="#{notifyBean.attributesNotify['summary'].value}"
+ />
+ <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ execute="{@form}"
+ for="#{notifyBean.attributesNotifyMessages['for'].value}"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
+ stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
+ />
</a4j:outputPanel>
<a4j:commandButton id="produceError" value="Produce Error" action="#{notifyBean.produceError}" execute="@form"/>
<a4j:commandButton id="produceFatal" value="Produce Fatal" action="#{notifyBean.produceFatal}" execute="@form"/>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml
===================================================================
--- modules/tests/metamer/branches/sandbox-components/application/src/main/webapp/components/notify/validation.xhtml 2011-08-04 15:43:59 UTC (rev 22594)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml 2011-08-05 13:31:32 UTC (rev 22596)
@@ -1,7 +1,7 @@
<?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:notify="http://richfaces.org/sandbox/notify"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j">
<!--
@@ -30,55 +30,54 @@
<ui:define name="component">
<h:form>
- <notify:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
+ <rich:notifyMessages ajaxRendered="true"
+ animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ execute="{@form}"
+ for="number"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
+ stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
+ />
- <notify:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- text="#{notifyBean.attributesNotify['text'].value}"
- title=" #{notifyBean.attributesNotify['title'].value}"
- />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ detail="#{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
+ stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary=" #{notifyBean.attributesNotify['title'].value}"
+ />
- <notify:notifyStack id="exampleNotifyStack"
- push="#{notifyBean.attributesNotifyStackFirst['push'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- stackDir1="#{notifyBean.attributesNotifyStackFirst['stackDir1'].value}"
- stackDir2="#{notifyBean.attributesNotifyStackFirst['stackDir2'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
- />
+ <rich:notifyStack id="exampleNotifyStack"
+ direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}" />
<h:outputLabel for="number" value="Number (from 5 to 10)"/>
<h:inputText id="number" required="true">
13 years, 5 months
JBoss Rich Faces SVN: r22595 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/bean/rich and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-05 08:07:57 -0400 (Fri, 05 Aug 2011)
New Revision: 22595
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-1547: added page with rich:orderingList to Metamer
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-08-04 15:43:59 UTC (rev 22594)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-08-05 12:07:57 UTC (rev 22595)
@@ -156,6 +156,7 @@
richComponents.put("richMenuSeparator", "Rich Menu Separator");
richComponents.put("richMessage", "Rich Message");
richComponents.put("richMessages", "Rich Messages");
+ richComponents.put("richOrderingList", "Rich Ordering List");
richComponents.put("richPanel", "Rich Panel");
richComponents.put("richPanelMenu", "Rich Panel Menu");
richComponents.put("richPanelMenuGroup", "Rich Panel Menu Group");
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichOrderingListBean.java 2011-08-05 12:07:57 UTC (rev 22595)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.bean.rich;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.ViewScoped;
+import javax.faces.convert.Converter;
+
+import org.richfaces.component.UIOrderingList;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple bean for rich:orderingList component example.
+ *
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+@ManagedBean(name = "richOrderingListBean")
+@ViewScoped
+public class RichOrderingListBean implements Serializable {
+
+ private static final long serialVersionUID = 5868941019675985273L;
+ private static Logger logger;
+ //FIXME: @ManagedProperty(value="#{model.capitals}")
+ private List<Capital> capitals;
+ private Attributes attributes;
+ @ManagedProperty(value="#{capitalConverter}")
+ private Converter converter;
+
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.info("initializing bean " + getClass().getName());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIOrderingList.class, getClass());
+
+ attributes.setAttribute("columnVar", "capital");
+ attributes.setAttribute("converter", getConverter());
+ attributes.setAttribute("downText", "Down");
+ attributes.setAttribute("downBottomText", "Last");
+ attributes.setAttribute("listWidth", 300);
+ attributes.setAttribute("listHeight", 500);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("showButton", true);
+ attributes.setAttribute("var", "capital");
+ attributes.setAttribute("upText", "Up");
+ attributes.setAttribute("upTopText", "First");
+
+ // FIXME
+ capitals = Model.unmarshallCapitals();
+ }
+
+ public List<Capital> getCapitals() {
+ logger.info("size of returned capitals is <" + capitals.size() + ">");
+ return capitals;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ logger.info("size of set capitals is <" + capitals.size() + ">");
+ this.capitals = capitals;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Converter getConverter() {
+ return converter;
+ }
+
+ public void setConverter(Converter converter) {
+ this.converter = converter;
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/converter/CapitalConverter.java 2011-08-05 12:07:57 UTC (rev 22595)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.converter;
+
+import java.util.List;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+@FacesConverter(value = "capitalConverter")
+public class CapitalConverter implements Converter {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CapitalConverter.class);
+ // FIXME: @ManagedProperty(value="#{model.capitals}")
+ private List<Capital> capitals = Model.unmarshallCapitals();
+
+
+ @Override
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ LOGGER.info(value);
+ for(Capital capital : capitals) {
+ if (capitalAsString(capital).equals(value)) {
+ Capital toReturn = new Capital();
+ toReturn.setName(capital.getName());
+ toReturn.setState(capital.getState());
+ toReturn.setTimeZone(capital.getTimeZone());
+ return toReturn;
+ }
+ }
+ throw new FacesException("Cannot convert parameter \"" + value + "\" to the Capital.");
+ }
+
+ @Override
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ if (!(value instanceof Capital)) {
+ throw new FacesException("Cannot convert parameter \"" + value + "\" to the String.");
+ }
+ return capitalAsString((Capital) value);
+ }
+
+ public List<Capital> getCapitals() {
+ return capitals;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+
+ private String capitalAsString(Capital capital) {
+ return capital.getName();
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/list.xhtml 2011-08-05 12:07:57 UTC (rev 22595)
@@ -0,0 +1,41 @@
+<?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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Ordering List</ui:define>
+
+ <ui:define name="links">
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ Simple page that contains <b>rich:panel</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richOrderingList/simple.xhtml 2011-08-05 12:07:57 UTC (rev 22595)
@@ -0,0 +1,121 @@
+<?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" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:it="http://richfaces.org/iteration">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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="component">
+ <h:form>
+ <h:commandButton value="submit">
+ <f:ajax execute="@form" render="orderingList output" />
+ </h:commandButton>
+ <br />
+ <rich:orderingList columnClasses="#{richOrderingListBean.attributes['columnClasses'].value}"
+ columnVar="#{richOrderingListBean.attributes['columnVar'].value}"
+ converter="#{richOrderingListBean.attributes['converter'].value}"
+ converterMessage="#{richOrderingListBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richOrderingListBean.attributes['defaultLabel'].value}"
+ disabled="#{richOrderingListBean.attributes['disabled'].value}"
+ disabledClass="#{richOrderingListBean.attributes['disabledClass'].value}"
+ downBottomText="#{richOrderingListBean.attributes['downBottomText'].value}"
+ downText="#{richOrderingListBean.attributes['downText'].value}"
+ headerClass="#{richOrderingListBean.attributes['headerClass'].value}"
+ id="orderingList"
+ immediate="#{richOrderingListBean.attributes['immediate'].value}"
+ itemClass="#{richOrderingListBean.attributes['itemClass'].value}"
+ itemLabel="#{richOrderingListBean.attributes['itemlabel'].value}"
+ itemValue="#{capital}"
+ itemValues="#{richOrderingListBean.attributes['itemValues'].value}"
+ listHeight="#{richOrderingListBean.attributes['listHeight'].value}"
+ listWidth="#{richOrderingListBean.attributes['listWidth'].value}"
+ maxListHeight="#{richOrderingListBean.attributes['maxListHeight'].value}"
+ minListHeight="#{richOrderingListBean.attributes['minListHeight'].value}"
+ onadditem="#{richOrderingListBean.attributes['onadditem'].value}"
+ onblur="#{richOrderingListBean.attributes['onblur'].value}"
+ onchange="#{richOrderingListBean.attributes['onchange'].value}"
+ onclick="#{richOrderingListBean.attributes['onclick'].value}"
+ ondblclick="#{richOrderingListBean.attributes['ondbclick'].value}"
+ onfocus="#{richOrderingListBean.attributes['onfocus'].value}"
+ onkeydown="#{richOrderingListBean.attributes['onkeydown'].value}"
+ onkeypress="#{richOrderingListBean.attributes['onkeypress'].value}"
+ onkeyup="#{richOrderingListBean.attributes['onkeyup'].value}"
+ onlistclick="#{richOrderingListBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richOrderingListBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richOrderingListBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richOrderingListBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richOrderingListBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richOrderingListBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richOrderingListBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richOrderingListBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richOrderingListBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richOrderingListBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richOrderingListBean.attributes['onmousedown'].value}"
+ onmousemove="#{richOrderingListBean.attributes['onmousemove'].value}"
+ onmouseout="#{richOrderingListBean.attributes['onmouseout'].value}"
+ onmouseover="#{richOrderingListBean.attributes['onmouseover'].value}"
+ onmouseup="#{richOrderingListBean.attributes['onmouseup'].value}"
+ onremoveitem="#{richOrderingListBean.attributes['onremoveitem'].value}"
+ rendered="#{richOrderingListBean.attributes['rendered'].value}"
+ required="#{richOrderingListBean.attributes['required'].value}"
+ requiredMessage="#{richOrderingListBean.attributes['requiredMessage'].value}"
+ selectItemClass="#{richOrderingListBean.attributes['selectItemClass'].value}"
+ showButton="#{richOrderingListBean.attributes['showButton'].value}"
+ style="#{richOrderingListBean.attributes['style'].value}"
+ styleClass="#{richOrderingListBean.attributes['styleClass'].value}"
+ upText="#{richOrderingListBean.attributes['upText'].value}"
+ upTopText="#{richOrderingListBean.attributes['upTopText'].value}"
+ validator="#{richOrderingListBean.attributes['validator'].value}"
+ validatorMessage="#{richOrderingListBean.attributes['validatorMessage'].value}"
+ value="#{richOrderingListBean.capitals}"
+ valueChangeListener="#{richOrderingListBean.attributes['valueChangeListener'].value}"
+ var="#{richOrderingListBean.attributes['var'].value}"
+ >
+ <f:converter converterId="capitalConverter" />
+ <rich:column>
+ <f:facet name="header">State</f:facet>
+ #{capital.state}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Name</f:facet>
+ #{capital.name}
+ </rich:column>
+ </rich:orderingList>
+ <br />
+ <rich:list id="output" value="#{richOrderingListBean.capitals}" var="capital">
+ <h:outputText value="#{capital.state}, #{capital.name}" />
+ </rich:list>
+ </h:form>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richOrderingListBean.attributes}" id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
13 years, 5 months
JBoss Rich Faces SVN: r22594 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-08-04 11:43:59 -0400 (Thu, 04 Aug 2011)
New Revision: 22594
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
Log:
Add selenium test for rich:editor's toolbar attribute
Add selenium test for toolbar attribute, and fix empty attrbitute setter for width
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-08-04 13:19:06 UTC (rev 22593)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/RichEditorComponentAttribute.java 2011-08-04 15:43:59 UTC (rev 22594)
@@ -73,6 +73,7 @@
}
public void setWidth(String width) {
+ setProperty("width", width);
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-08-04 13:19:06 UTC (rev 22593)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-08-04 15:43:59 UTC (rev 22594)
@@ -43,6 +43,35 @@
private JQueryLocator a4jSubmit = pjq("input[id$=a4jButton]");
private JQueryLocator validationMsgLoc = pjq("span.rf-msgs-sum");
+ private JQueryLocator editorToolbarGroup = jq("span.cke_toolgroup");
+
+ private JQueryLocator editorToolbarContainer = jq("td.cke_toolgroup");
+ private JQueryLocator editorToolsGroupFormat =
+ editorToolbarContainer.getDescendant(jq("span#cke_{0}.cke_toolbar"));
+
+ public enum toolbarGroup {
+ FILE_SAVE(7),
+ CLIPBOARD(14),
+ SEARCH_REPLACE(22),
+ FORM(28),
+ LISTS_ALIGNS(46),
+ BASIC_FONT_CTRL(38),
+ LINK(59),
+ RESOURCES(63),
+ STYLES_FONTS(73),
+ TEXT_BG_COLOR(77),
+ MISC(80);
+
+ int code;
+
+ toolbarGroup(int code) {
+ this.code = code;
+ }
+ int id(){
+ return code;
+ }
+ }
+
private RichEditorComponentAttribute attributes = new RichEditorComponentAttribute();
private String text1 = "text1";
@@ -229,7 +258,18 @@
@Test
public void testToolbar() {
- // TODO jjamrich 2011-08-03: implement test when realize what this attr should do :)
+
+ attributes.setToolbar("basic");
+
+ /* for basic configuration of editor's toolbar there should be only one toolgroup
+ (toolgroup is group of buttons, while span.toolbar is his container)
+ Since there are not id's for toolbar based on toolbar name, it is not possible
+ check exact toolbar present (all id's changes - for buttons as well as for toolbars)
+ */
+ assertEquals(selenium.getCount(editorToolbarGroup), 1);
+
+ attributes.setToolbar("full");
+ assertEquals(selenium.getCount(editorToolbarGroup), 11);
}
@Test
13 years, 5 months
JBoss Rich Faces SVN: r22593 - in modules/tests/metamer/branches/push-from-showcase/application/src/main: java/org/richfaces/tests/metamer/push and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-04 09:19:06 -0400 (Thu, 04 Aug 2011)
New Revision: 22593
Added:
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/AbstractMessageProducer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/CapabilityInitializer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSCounterMessageProducer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSInitializer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProduceInitializer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducerRunnable.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsContextMessageProducer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsInitializer.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS6MessagingProviderManagement.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS7MessagingProviderManagement.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/CustomMessagingServerManagement.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/InitializationFailedException.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/MessagingProviderManagement.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/topicsContext.xhtml
Log:
RFPL-1572: forgotten files
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/AbstractMessageProducer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/AbstractMessageProducer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/AbstractMessageProducer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,54 @@
+/**
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ *
+ */
+public abstract class AbstractMessageProducer implements MessageProducer {
+
+ private AtomicBoolean enabled;
+
+ public AbstractMessageProducer() {
+ this(false);
+ }
+
+ public AbstractMessageProducer(boolean enabled) {
+ this.enabled = new AtomicBoolean(enabled);
+ }
+
+ public void disable() {
+ this.enabled.set(false);
+ }
+
+ public void enable() {
+ this.enabled.set(true);
+ }
+
+ public boolean isEnabled() {
+
+ return this.enabled.get();
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/CapabilityInitializer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/CapabilityInitializer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/CapabilityInitializer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+/**
+ * Initialize and finalize capability.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public interface CapabilityInitializer {
+ /**
+ * Initializes provided capability.
+ *
+ * @throws Exception
+ */
+ void initializeCapability() throws Exception;
+
+ /**
+ * Finalizes provided capability and frees allocated resources.
+ *
+ * @throws Exception
+ */
+ void finalizeCapability() throws Exception;
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSCounterMessageProducer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSCounterMessageProducer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSCounterMessageProducer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,109 @@
+/**
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import java.io.Serializable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+import org.apache.commons.lang.Validate;
+
+/**
+ * Sends message to JMS topic.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class JMSCounterMessageProducer extends AbstractMessageProducer {
+
+ private static final Logger LOGGER = Logger.getLogger(JMSCounterMessageProducer.class.getName());
+ private Topic topic;
+ private String topicName;
+ private TopicConnection connection = null;
+ private TopicSession session = null;
+ private TopicPublisher publisher = null;
+ private int counter = 0;
+
+ public JMSCounterMessageProducer(String topicName) {
+ Validate.notNull(topicName);
+ this.topicName = topicName;
+ }
+
+ public void sendMessage() throws Exception {
+ try {
+ initializeMessaging();
+ ObjectMessage message = session.createObjectMessage(createMessage());
+ publisher.publish(message);
+ } catch (NameNotFoundException e) {
+ LOGGER.fine(e.getMessage());
+ } catch (JMSException e) {
+ LOGGER.log(Level.SEVERE, e.getMessage(), e);
+ }
+ }
+
+ private Serializable createMessage() {
+ return counter++;
+ }
+
+ private void initializeMessaging() throws JMSException, NamingException {
+ if (connection == null) {
+ TopicConnectionFactory tcf = getTopicConnectionFactory();
+ connection = tcf.createTopicConnection();
+ }
+ if (session == null) {
+ session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+ }
+ if (topic == null) {
+ topic = InitialContext.doLookup("topic/" + topicName);
+ }
+ if (publisher == null) {
+ publisher = session.createPublisher(topic);
+ }
+ }
+
+ public int getInterval() {
+ return 5000;
+ }
+
+ private TopicConnectionFactory getTopicConnectionFactory() {
+ try {
+ return (TopicConnectionFactory) InitialContext.doLookup("java:/ConnectionFactory");
+ } catch (NamingException e) {
+ try {
+ return (TopicConnectionFactory) InitialContext.doLookup("ConnectionFactory");
+ } catch (NamingException e2) {
+ throw new IllegalStateException("Can't find registered ConnectionFactory");
+ }
+ }
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSInitializer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSInitializer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/JMSInitializer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+
+import org.apache.commons.lang.Validate;
+import org.richfaces.tests.metamer.push.provider.AS6MessagingProviderManagement;
+import org.richfaces.tests.metamer.push.provider.AS7MessagingProviderManagement;
+import org.richfaces.tests.metamer.push.provider.CustomMessagingServerManagement;
+import org.richfaces.tests.metamer.push.provider.InitializationFailedException;
+import org.richfaces.tests.metamer.push.provider.MessagingProviderManagement;
+
+
+/**
+ * Initializes JMS server and creates requested topics.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class JMSInitializer implements CapabilityInitializer {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(JMSInitializer.class);
+ private MessagingProviderManagement provider;
+ private String[] topics;
+
+ public JMSInitializer(String[] topics) {
+ Validate.notNull(topics);
+ this.topics = topics;
+ }
+
+ public void initializeCapability() throws Exception {
+ LOGGER.info("starting initializing capabality");
+ provider = initializeCurrentProvider();
+ for (String topic : topics) {
+ LOGGER.info("creating topic <" + topic + ">.");
+ provider.createTopic(topic, "/topic/" + topic);
+ }
+ LOGGER.info("finishing initializing capabality");
+ }
+
+ public void finalizeCapability() throws Exception {
+ provider.finalizeProvider();
+ }
+
+ /**
+ * Returns all providers which are available from current context
+ *
+ * @return all providers which are available from current context
+ */
+ @SuppressWarnings("unchecked")
+ private Class<? extends MessagingProviderManagement>[] getAvailableProviders() {
+ if (isConnectionFactoryRegistered()) {
+ return new Class[] { AS7MessagingProviderManagement.class, AS6MessagingProviderManagement.class };
+ } else {
+ return new Class[] { CustomMessagingServerManagement.class };
+ }
+ }
+
+ /**
+ * Returns one of providers available from current context which are able to initialize successfully
+ *
+ * @return one of providers available from current context which are able to initialize successfully
+ */
+ private MessagingProviderManagement initializeCurrentProvider() {
+ for (Class<? extends MessagingProviderManagement> c : getAvailableProviders()) {
+ try {
+ MessagingProviderManagement provider = c.newInstance();
+ provider.initializeProvider();
+ return provider;
+ } catch (InitializationFailedException e) {
+ LOGGER.warn("initailizing failed", e);
+ // TODO
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ throw new IllegalStateException("no management provider has been successfully initialized");
+ }
+
+ /**
+ * Returns true if ConnectionFactory is already registered
+ *
+ * @return true if ConnectionFactory is already registered
+ */
+ private boolean isConnectionFactoryRegistered() {
+ try {
+ return null != InitialContext.doLookup("java:/ConnectionFactory");
+ } catch (NamingException e) {
+ if (!(e instanceof NameNotFoundException)) {
+ LOGGER.error("Can't access naming context", e);
+ }
+ return false;
+ }
+ }
+}
\ No newline at end of file
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProduceInitializer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProduceInitializer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProduceInitializer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,73 @@
+/**
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.commons.lang.Validate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MessageProduceInitializer implements CapabilityInitializer {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(MessageProduceInitializer.class);
+ private MessageProducer[] messageProducers;
+ private Collection<MessageProducerRunnable> messageProducersRunnable;
+ private Collection<Thread> threads = new ArrayList<Thread>();
+ private int interval;
+
+ public MessageProduceInitializer(MessageProducer[] messageProducers, int interval) {
+ Validate.notNull(messageProducers);
+ this.messageProducers = messageProducers;
+ this.interval = interval;
+ }
+
+ @Override
+ public void initializeCapability() throws Exception {
+ LOGGER.info("starting initializing <" + getMessageProducuersRunnable().size() + "> message producers.");
+ for(Runnable runnable : getMessageProducuersRunnable()) {
+ Thread thread = new Thread(runnable);
+ thread.setDaemon(true);
+ thread.start();
+ threads.add(thread);
+ }
+ LOGGER.info("finishing initializing");
+ }
+
+ @Override
+ public void finalizeCapability() throws Exception {
+ for(MessageProducerRunnable messageProducerRunnable : getMessageProducuersRunnable()) {
+ messageProducerRunnable.stop();
+ }
+ }
+
+ private Collection<MessageProducerRunnable> getMessageProducuersRunnable() {
+ if (messageProducersRunnable == null) {
+ messageProducersRunnable = new ArrayList<MessageProducerRunnable>();
+ for(MessageProducer messageProducer : messageProducers) {
+ messageProducersRunnable.add(new MessageProducerRunnable(messageProducer, interval));
+ }
+ }
+ return messageProducersRunnable;
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+/**
+ * Interface for implementations producing messages.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public interface MessageProducer {
+
+ /**
+ * Disables the message producing
+ */
+ void disable();
+
+ /**
+ * Enables the message producing
+ */
+ void enable();
+
+ /**
+ * Checks whether the message producing is enabled
+ * @return true if the message producing is enabled, false otherwise
+ */
+ boolean isEnabled();
+
+ /**
+ * Sends a message.
+ *
+ * @throws Exception any exception which was thrown when trying to send message.
+ */
+ void sendMessage() throws Exception;
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducerRunnable.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducerRunnable.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/MessageProducerRunnable.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Runnable which are periodically sending messages until it is stopped or underlying thread is interrupted.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class MessageProducerRunnable implements Runnable {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(MessageProducerRunnable.class);
+
+ private AtomicBoolean runFlag = new AtomicBoolean(true);
+ private AtomicInteger interval;
+ private MessageProducer messageProducer;
+
+ /**
+ * Creates runnable with associated message producer.
+ *
+ * @param messageProducer will be associated with this runnable
+ */
+ public MessageProducerRunnable(MessageProducer messageProducer, int interval) {
+ this.messageProducer = messageProducer;
+ this.interval = new AtomicInteger(interval);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ while (runFlag.get()) {
+ try {
+ if (messageProducer.isEnabled()) {
+ LOGGER.info("Message has beean sent.");
+ messageProducer.sendMessage();
+ }
+ } catch (Exception e) {
+ LOGGER.info(e.getMessage(), e);
+ }
+
+ try {
+ Thread.sleep(getInterval());
+ } catch (InterruptedException e) {
+ LOGGER.error("MessageProducer has been interrupted", e);
+ break;
+ }
+ }
+ }
+
+ /**
+ * Interval which will be producer sleeping after last message sent before start of sending of next message.
+ *
+ * @return interval in miliseconds
+ */
+ public int getInterval() {
+ return interval.get();
+ }
+
+ public void setInterval(int interval) {
+ this.interval.set(interval);
+ }
+
+ /**
+ * Stops the cycle with body sending messages.
+ */
+ public void stop() {
+ runFlag.set(false);
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsContextMessageProducer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsContextMessageProducer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsContextMessageProducer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,61 @@
+/**
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+import org.apache.commons.lang.Validate;
+import org.richfaces.application.push.MessageException;
+import org.richfaces.application.push.TopicKey;
+import org.richfaces.application.push.TopicsContext;
+
+/**
+ * Sends message to topic using TopicsContext.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TopicsContextMessageProducer extends AbstractMessageProducer {
+
+ public static final String DEFAULT_DATA = "message";
+ private String topic;
+
+ public TopicsContextMessageProducer(String topic) {
+ Validate.notNull(topic);
+ this.topic = topic;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#sendMessage()
+ */
+ public void sendMessage() throws Exception {
+ try {
+ TopicKey topicKey = new TopicKey(topic);
+ TopicsContext topicsContext = TopicsContext.lookup();
+ topicsContext.publish(topicKey, DEFAULT_DATA);
+ } catch (MessageException e) {
+ if (!e.getMessage().matches("^Topic .* not found$")) {
+ throw e;
+ }
+ }
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsInitializer.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsInitializer.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/TopicsInitializer.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+import org.apache.commons.lang.Validate;
+import org.richfaces.application.push.Topic;
+import org.richfaces.application.push.TopicKey;
+import org.richfaces.application.push.TopicsContext;
+import org.richfaces.application.push.impl.DefaultMessageDataSerializer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Registers topics in RichFaces subsytem.
+ *
+ * @author Nick Belaevski
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class TopicsInitializer implements CapabilityInitializer {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(TopicsInitializer.class.getName());
+ private String[] topics;
+ private Collection<Thread> threads = new ArrayList<Thread>();
+
+ public TopicsInitializer(String[] topics) {
+ Validate.notNull(topics);
+ this.topics = topics;
+ }
+
+ public void initializeCapability() throws Exception {
+ LOGGER.info("starting initializing");
+ TopicsContext.lookup();
+ for (String topic : topics) {
+ Thread thread = new RegisterTopicThread(topic);
+ threads.add(thread);
+ thread.setDaemon(true);
+ thread.start();
+ LOGGER.info("register thread for topic <" + topic + "> started.");
+ }
+ }
+
+ @Override
+ public void finalizeCapability() throws Exception {
+ for (Thread thread : threads) {
+ thread.interrupt();
+ }
+ }
+
+ private class RegisterTopicThread extends Thread {
+
+ public RegisterTopicThread(final String topicName) {
+ super(new Runnable() {
+
+ public void run() {
+ waitForJmsTopicReady();
+
+ TopicsContext topicsContext = TopicsContext.lookup();
+ Topic pushJmsTopic = topicsContext.getOrCreateTopic(new TopicKey(topicName));
+ pushJmsTopic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
+ }
+
+ private void waitForJmsTopicReady() {
+ while (!isJmsTopicReady()) {
+ try {
+ LOGGER.warn("topic " + topicName + " not ready yet, sleeping");
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ }
+
+ private boolean isJmsTopicReady() {
+ try {
+ InitialContext.doLookup("topic/" + topicName);
+ return true;
+ } catch (NameNotFoundException e) {
+ return false;
+ } catch (NamingException e) {
+ LOGGER.warn(e.getMessage());
+ }
+ return false;
+ }
+ }, "RegisterTopicThread");
+ }
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS6MessagingProviderManagement.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS6MessagingProviderManagement.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS6MessagingProviderManagement.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push.provider;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.hornetq.api.core.management.ObjectNameBuilder;
+import org.hornetq.api.jms.management.JMSServerControl;
+
+/**
+ * Connects to JMS RMI interface and creates topics using {@link JMSServerControl}.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class AS6MessagingProviderManagement implements MessagingProviderManagement {
+
+ private static final Logger LOGGER = Logger.getLogger(AS7MessagingProviderManagement.class.getName());
+ private JMSServerControl serverControl;
+
+ public void initializeProvider() throws InitializationFailedException {
+ try {
+ LOGGER.info("starting initializing");
+ ObjectName on = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();
+ JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(
+ "service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi"), new HashMap<String, Object>());
+ MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+ serverControl = (JMSServerControl) MBeanServerInvocationHandler.newProxyInstance(mbsc, on,
+ JMSServerControl.class, false);
+ LOGGER.info("successfully initialized");
+ } catch (Exception e) {
+ throw new InitializationFailedException();
+ }
+ }
+
+ public void finalizeProvider() {
+ }
+
+ public void createTopic(String topicName, String jndiName) throws Exception {
+ if (getAvailableTopics().contains(topicName)) {
+ serverControl.createTopic(topicName, jndiName);
+ }
+ }
+
+ private Set<String> getAvailableTopics() {
+ String[] topicNames = serverControl.getTopicNames();
+ return new HashSet<String>(Arrays.asList(topicNames));
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS7MessagingProviderManagement.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS7MessagingProviderManagement.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/AS7MessagingProviderManagement.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push.provider;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * Manages AS7 to create JMS topics using ModelControllerClient.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class AS7MessagingProviderManagement implements MessagingProviderManagement {
+
+ private static final Logger LOGGER = Logger.getLogger(AS7MessagingProviderManagement.class.getName());
+
+ private ModelControllerClient client;
+
+ public void initializeProvider() throws InitializationFailedException {
+ LOGGER.info("starting initializing");
+ try {
+ client = ModelControllerClient.Factory.create("127.0.0.1", 9999);
+ } catch (Exception e) {
+ throw new InitializationFailedException("The initialization of the messaging provider failed.", e);
+ } catch (NoClassDefFoundError e) {
+ throw new InitializationFailedException("The initialization of the messaging provider failed.", e);
+ }
+ LOGGER.info("successfully initialized");
+ }
+
+ public void finalizeProvider() {
+ try {
+ client.close();
+ } catch (IOException e) {
+ LOGGER.log(Level.SEVERE, "wasn't able to finalize AS7 messaging management");
+ }
+ }
+
+ public void createTopic(String topicName, String jndiName) throws Exception {
+ jndiName = jndiName.replaceFirst("/", "");
+
+ ModelNode operation = new ModelNode();
+ operation.get("operation").set("read-resource");
+ operation.get("address").add("subsystem", "messaging");
+ ModelNode result = client.execute(operation, null);
+
+ if (!result.get("result").get("jms-topic").toString().contains("\"" + topicName + "\"")) {
+ operation = new ModelNode();
+ operation.get("operation").set("add");
+ operation.get("address").add("subsystem", "messaging");
+ operation.get("address").add("jms-topic", topicName);
+ operation.get("entries").add("topic/" + topicName);
+ client.executeAsync(operation, null);
+ }
+ }
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/CustomMessagingServerManagement.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/CustomMessagingServerManagement.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/CustomMessagingServerManagement.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push.provider;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.HornetQServers;
+import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;
+import org.hornetq.jms.server.impl.JMSServerManagerImpl;
+
+/**
+ * Starts HornetQ, binds ConnectionFactory to the context and create topics.
+ *
+ * @author Nick Belaevski
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class CustomMessagingServerManagement implements MessagingProviderManagement {
+
+ private static final Logger LOGGER = Logger.getLogger(CustomMessagingServerManagement.class.getName());
+
+ private HornetQServer jmsServer;
+ private JMSServerManager jmsServerManager;
+
+ public void initializeProvider() throws InitializationFailedException {
+ try {
+ LOGGER.info("starting initializing");
+ startJMSServer();
+ startJMSServerManager();
+ createJMSConnectionFactory();
+ LOGGER.info("successfully initialized");
+ } catch (Exception e) {
+ throw new InitializationFailedException(e);
+ }
+ }
+
+ public void createTopic(String topicName, String jndiName) throws Exception {
+ jmsServerManager.createTopic(false, topicName, jndiName);
+ }
+
+ public void finalizeProvider() {
+ try {
+ stopJMSServerManager();
+ stopJMSServer();
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, "wasn't able to finalize custom messaging");
+ }
+ }
+
+ private void startJMSServer() throws Exception {
+ jmsServer = HornetQServers.newHornetQServer(createHornetQConfiguration());
+ }
+
+ private void startJMSServerManager() throws Exception {
+ jmsServerManager = new JMSServerManagerImpl(jmsServer);
+
+ InitialContext context = new InitialContext();
+ jmsServerManager.setContext(context);
+ jmsServerManager.start();
+ }
+
+ private void createJMSConnectionFactory() throws Exception {
+ List<String> connectors = Arrays.asList(new String[] { "netty" });
+
+ ConnectionFactoryConfiguration connectionFactoryConfiguration = new ConnectionFactoryConfigurationImpl(
+ "ConnectionFactory", false, connectors, (String) null);
+ connectionFactoryConfiguration.setUseGlobalPools(false);
+
+ jmsServerManager.createConnectionFactory(false, connectionFactoryConfiguration, "ConnectionFactory");
+ }
+
+ private void stopJMSServer() throws Exception {
+ jmsServer.stop();
+ jmsServer = null;
+ }
+
+ private void stopJMSServerManager() throws Exception {
+ jmsServerManager.stop();
+ jmsServerManager = null;
+ }
+
+ private Configuration createHornetQConfiguration() {
+ Configuration configuration = new ConfigurationImpl();
+ configuration.setPersistenceEnabled(false);
+ configuration.setSecurityEnabled(false);
+
+ TransportConfiguration transportationConfiguration = new TransportConfiguration(
+ NettyAcceptorFactory.class.getName());
+ HashSet<TransportConfiguration> setTransp = new HashSet<TransportConfiguration>();
+ setTransp.add(transportationConfiguration);
+ configuration.setAcceptorConfigurations(setTransp);
+ configuration.getConnectorConfigurations().put("netty",
+ new TransportConfiguration(NettyConnectorFactory.class.getName()));
+
+ return configuration;
+ }
+
+}
\ No newline at end of file
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/InitializationFailedException.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/InitializationFailedException.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/InitializationFailedException.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push.provider;
+
+/**
+ * Thrown when messaging provider management initialization fails.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class InitializationFailedException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public InitializationFailedException() {
+ super();
+ }
+
+ public InitializationFailedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InitializationFailedException(String message) {
+ super(message);
+ }
+
+ public InitializationFailedException(Throwable cause) {
+ super(cause);
+ }
+
+}
\ No newline at end of file
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/MessagingProviderManagement.java
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/MessagingProviderManagement.java (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/push/provider/MessagingProviderManagement.java 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.push.provider;
+
+/**
+ * Interface for management of messaging provider.
+ *
+ * Is able to initialize, createTopic and finalize.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public interface MessagingProviderManagement {
+ /**
+ * Initializes messaging management, called at application startup.
+ *
+ * @throws InitializationFailedException
+ * when initialize of provider fails
+ */
+ void initializeProvider() throws InitializationFailedException;
+
+ /**
+ * Creates JMS topic using this provider
+ *
+ * @param topicName
+ * the name of the topic
+ * @param jndiName
+ * the JNDI binding to use for given topic
+ * @throws Exception
+ * when creating of topic fails
+ */
+ void createTopic(String topicName, String jndiName) throws Exception;
+
+ /**
+ * Finalizes messaging provider management at on application tear down.
+ */
+ void finalizeProvider();
+}
Added: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/topicsContext.xhtml
===================================================================
--- modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/topicsContext.xhtml (rev 0)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/topicsContext.xhtml 2011-08-04 13:19:06 UTC (rev 22593)
@@ -0,0 +1,59 @@
+<?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:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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="component">
+ <a4j:push address="#{a4jPushBean.attributes['address'].value}"
+ id="pushJms"
+ onerror="#{a4jPushBean.attributes['onerror'].value}"
+ >
+ <a4j:ajax event="dataavailable" render="output" />
+ </a4j:push>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Output:" />
+ <h:outputText value="#{a4jPushBean.counter}" id="output"/>
+ </h:panelGrid>
+
+ <h:panelGrid rendered="#{!a4jPushBean.messageProducingEnabled}">
+ <h:commandButton id="startMessageProducing" action="#{a4jPushBean.startMessageProducing}" value="Start" />
+ </h:panelGrid>
+ <h:panelGrid rendered="#{a4jPushBean.messageProducingEnabled}">
+ <h:commandButton id="stopMessageProducing" action="#{a4jPushBean.stopMessageProducing}" value="Stop" />
+ </h:panelGrid>
+
+ The attribute <strong>ondataavailable</strong> is not used here.
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <h2>A4J Push Attributes</h2>
+ <metamer:attributes value="#{a4jPushBean.attributes}" id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
13 years, 5 months
JBoss Rich Faces SVN: r22592 - in modules/tests/metamer/branches: push-from-showcase and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-08-04 09:17:50 -0400 (Thu, 04 Aug 2011)
New Revision: 22592
Added:
modules/tests/metamer/branches/push-from-showcase/
Removed:
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/listener/
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/simple.xhtml
Modified:
modules/tests/metamer/branches/push-from-showcase/application/pom.xml
modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/faces-config.xml
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/web.xml
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/list.xhtml
modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/messageProducer.xhtml
modules/tests/metamer/branches/push-from-showcase/build.sh
Log:
RFPL-1572: the first version of a new page with a4j:push component - can be deployed only to JBoas AS 7 (mvn profile 'war-jbas7')
Modified: modules/tests/metamer/branches/push-from-showcase/application/pom.xml
===================================================================
--- modules/tests/metamer/trunk/application/pom.xml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/pom.xml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -44,10 +44,17 @@
<properties>
<jetty.port>8080</jetty.port>
- <hornetq.version>2.1.2.Final</hornetq.version>
+ <hornetq.version>2.2.6.Final</hornetq.version>
</properties>
<dependencies>
+ <!-- JBoss AS7 management -->
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller-client</artifactId>
+ <version>7.0.0.CR1</version>
+ <scope>provided</scope>
+ </dependency>
<!-- RichFaces 4 -->
<dependency>
<groupId>org.richfaces.ui</groupId>
@@ -91,6 +98,7 @@
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
+ <version>1.1</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
@@ -337,6 +345,38 @@
</build>
</profile>
<profile>
+ <id>war-jbas7</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller-client</artifactId>
+ <version>7.0.0.CR1</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jbas7</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <classifier>jbas7</classifier>
+ <packagingExcludes>WEB-INF/lib/jsf-api-*,WEB-INF/lib/jsf-impl-*,WEB-INF/lib/myfaces-api-*,WEB-INF/lib/myfaces-impl-*,WEB-INF/lib/validation-api-*,WEB-INF/lib/hibernate-validator-*,WEB-INF/lib/jsp-api*,WEB-INF/lib/slf4j*,WEB-INF/lib/log4j*</packagingExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>war-jee6-bundled-mojarra</id>
<build>
<plugins>
Modified: modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java 2011-08-04 13:17:50 UTC (rev 22592)
@@ -22,40 +22,45 @@
package org.richfaces.tests.metamer.bean.a4j;
import java.io.Serializable;
-import java.util.Date;
-
import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
-import org.richfaces.application.push.MessageException;
-import org.richfaces.application.push.TopicKey;
-
-import org.richfaces.application.push.TopicsContext;
import org.richfaces.component.UIPush;
import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.Message;
-import org.richfaces.tests.metamer.listener.HornetQInitializer;
-import org.richfaces.tests.metamer.listener.TopicsInitializer;
+import org.richfaces.tests.metamer.push.CapabilityInitializer;
+import org.richfaces.tests.metamer.push.JMSCounterMessageProducer;
+import org.richfaces.tests.metamer.push.JMSInitializer;
+import org.richfaces.tests.metamer.push.MessageProduceInitializer;
+import org.richfaces.tests.metamer.push.MessageProducer;
+import org.richfaces.tests.metamer.push.TopicsContextMessageProducer;
+import org.richfaces.tests.metamer.push.TopicsInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Managed bean for a4j:push.
*
- * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
+ * @author Nick Belaevski
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
@ManagedBean(name = "a4jPushBean")
@SessionScoped
public class A4JPushBean implements Serializable {
- private static final long serialVersionUID = 4810889475400649809L;
+
+ public static final int PUSH_INTERVAL = 2000;
+ public static final String PUSH_JMS_TOPIC = "metamerPushJms";
+ public static final String PUSH_TOPICS_CONTEXT_TOPIC = "meatmerPushTopicsContext";
+ private static final long serialVersionUID = -164870535795309594L;
private static Logger logger;
- private transient TopicsContext topicsContext;
private Attributes attributes;
- private String username;
- private String message;
-
+ private int counter;
+ private CapabilityInitializer[] initializers;
+ private boolean messageProducingEnabled = false;
+ private MessageProducer[] messageProducers;
+
/**
* Initializes the managed bean.
*/
@@ -63,25 +68,31 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
-
- // TODO refactor
- // set up messaging
- new HornetQInitializer().processEvent(null);
- new TopicsInitializer().processEvent(null);
-
- topicsContext = TopicsContext.lookup();
-
+ try {
+ for (CapabilityInitializer initializer : getInitializers()) {
+ initializer.initializeCapability();
+ }
+ } catch(Exception e) {
+ logger.error("The initializing of the " + getClass().getName() + " failed.", e);
+ }
attributes = Attributes.getComponentAttributesFromClass(UIPush.class, getClass());
-// attributes.setAttribute("interval", 1000);
-// attributes.setAttribute("action", "increaseCounterAction");
-// attributes.setAttribute("actionListener", "increaseCounterActionListener");
-// attributes.setAttribute("rendered", true);
-// attributes.setAttribute("enabled", true);
-//
-// // will be set on page and cannot be changed
-// attributes.remove("eventProducer");
+ attributes.setAttribute("address", PUSH_JMS_TOPIC);
+ attributes.setAttribute("ondataavailable", "$('span[id$=output]').text(event.rf.data)");
+ attributes.setAttribute("rendered", true);
}
+ @PreDestroy
+ public void destroy() {
+ logger.debug("destroying bean " + getClass().getName());
+ try {
+ for (CapabilityInitializer initializer : getInitializers()) {
+ initializer.finalizeCapability();
+ }
+ } catch(Exception e) {
+ logger.error("The finalizing of the " + getClass().getName() + " failed.", e);
+ }
+ }
+
/**
* Getter for attributes.
*
@@ -91,6 +102,14 @@
return attributes;
}
+ public int getCounter() {
+ return counter++;
+ }
+
+ public boolean getMessageProducingEnabled() {
+ return messageProducingEnabled;
+ }
+
/**
* Setter for attributes.
*
@@ -100,41 +119,48 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
-
- public String getUsername() {
- return username;
+
+ public void startMessageProducing() {
+ logger.info("starting message producing");
+ for (MessageProducer producer : getMessageProducers()) {
+ producer.enable();
+ }
+ this.messageProducingEnabled = true;
}
-
- public void setUsername(String username) {
- this.username = username;
+
+ public void stopMessageProducing() {
+ logger.info("stopping message producing");
+ for (MessageProducer producer : getMessageProducers()) {
+ producer.disable();
+ }
+ this.messageProducingEnabled = false;
}
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public void setTopicsContext(TopicsContext topicsContext) {
- this.topicsContext = topicsContext;
- }
-
- private TopicsContext getTopicsContext() {
- if (topicsContext == null) {
- topicsContext = TopicsContext.lookup();
+
+ private CapabilityInitializer[] getInitializers() {
+ if (initializers == null) {
+ initializers = new CapabilityInitializer[] {
+ new JMSInitializer(getTopics()),
+ new TopicsInitializer(getTopics()),
+ new MessageProduceInitializer(getMessageProducers(), PUSH_INTERVAL)
+ };
}
- return topicsContext;
+ return initializers;
}
-
- public void send() {
- try {
- logger.info("sending message \"" + message + "\" by user " + username);
- Message msg = new Message(message, username, new Date().toString());
- getTopicsContext().publish(new TopicKey("metamer", "xxx"), msg);
- } catch (MessageException messageException) {
- logger.error("Could not send message \"" + message + "\" by user " + username + ".", messageException);
+
+ private MessageProducer[] getMessageProducers() {
+ if (messageProducers == null) {
+ messageProducers = new MessageProducer[] {
+ new JMSCounterMessageProducer(PUSH_JMS_TOPIC),
+ new TopicsContextMessageProducer(PUSH_TOPICS_CONTEXT_TOPIC)
+ };
+ for (MessageProducer producer : messageProducers) {
+ producer.disable();
+ }
}
+ return messageProducers;
}
+
+ private String[] getTopics() {
+ return new String[] {PUSH_JMS_TOPIC, PUSH_TOPICS_CONTEXT_TOPIC};
+ }
}
Modified: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/faces-config.xml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/faces-config.xml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -1,21 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude"
- 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">
-
- <application>
- <!--
- <system-event-listener>
- <system-event-listener-class>org.richfaces.tests.metamer.listener.HornetQInitializer</system-event-listener-class>
- <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
- </system-event-listener>
- <system-event-listener>
- <system-event-listener-class>org.richfaces.tests.metamer.listener.TopicsInitializer</system-event-listener-class>
- <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
- </system-event-listener>
- -->
- </application>
-
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude"
+ 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">
<lifecycle>
<phase-listener>org.richfaces.tests.metamer.RichPhaseListener</phase-listener>
</lifecycle>
Modified: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/WEB-INF/web.xml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.0" 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-app_3_0.xsd">
-
+<web-app version="3.0" 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-app_3_0.xsd">
+
<display-name>metamer</display-name>
-
+
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
-
+
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
@@ -36,7 +36,7 @@
<param-name>org.richfaces.push.jms.connectionPassword</param-name>
<param-value>guest</param-value>
</context-param>
-
+
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
@@ -51,6 +51,7 @@
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
+ <!-- START: registers push -->
<filter>
<filter-name>PushFilter</filter-name>
<filter-class>org.richfaces.webapp.PushFilter</filter-class>
@@ -60,6 +61,8 @@
<filter-name>PushFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
+ <!-- END: registers push -->
+
<filter>
<filter-name>Test Identity Filter</filter-name>
<filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
@@ -69,5 +72,5 @@
<filter-name>Test Identity Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
-
+
</web-app>
Modified: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPush/list.xhtml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/list.xhtml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -30,15 +30,13 @@
<ui:define name="pageTitle">A4J Push</ui:define>
<ui:define name="links">
-
- <metamer:testPageLink id="simple" outcome="simple" value="Simple">
- Simple page that contains <b>a4j:push</b> and input boxes for all its attributes.
- </metamer:testPageLink>
-
<metamer:testPageLink id="messageProducer" outcome="messageProducer" value="Message Producer">
- Page that is bind to application bean producing messages catched by a4j:push.
+ Page that is bind to JMS message producer whose messages are catched by <b>a4j:push</b>.
</metamer:testPageLink>
-
+ <metamer:testPageLink id="topicsContext" outcome="topicsContext" value="Topic Context">
+ Page that is bind to topic context message producer whose message are catched by <b>a4j:push</b>
+ containing <b>a4j:ajax</b> which rerenders output with counter from an application bean.
+ </metamer:testPageLink>
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/messageProducer.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPush/messageProducer.xhtml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/messageProducer.xhtml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -1,9 +1,10 @@
<?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:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -25,28 +26,31 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
+<ui:composition template="/templates/template.xhtml">
- <ui:define name="head">
- </ui:define>
+ <ui:define name="component">
+ <a4j:push address="#{a4jPushBean.attributes['address'].value}"
+ id="pushJms"
+ ondataavailable="#{a4jPushBean.attributes['ondataavailable'].value}"
+ onerror="#{a4jPushBean.attributes['onerror'].value}"
+ />
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Output:" />
+ <h:outputText value="waiting for event" id="output"/>
+ </h:panelGrid>
+
+ <h:panelGrid rendered="#{!a4jPushBean.messageProducingEnabled}">
+ <h:commandButton id="startMessageProducing" action="#{a4jPushBean.startMessageProducing}" value="Start" />
+ </h:panelGrid>
+ <h:panelGrid rendered="#{a4jPushBean.messageProducingEnabled}">
+ <h:commandButton id="stopMessageProducing" action="#{a4jPushBean.stopMessageProducing}" value="Stop" />
+ </h:panelGrid>
+ </ui:define>
- <ui:define name="outOfTemplateBefore">
- </ui:define>
+ <ui:define name="outOfTemplateAfter">
+ <h2>A4J Push Attributes</h2>
+ <metamer:attributes value="#{a4jPushBean.attributes}" id="attributes" />
+ </ui:define>
- <ui:define name="component">
- <h:panelGrid id="inputs" columns="2">
- <h:outputLabel id="nameLabel" value="Your name:" for="nameInput"/>
- <h:inputText id="nameInput" value="#{a4jPushBean.username}" />
- <h:outputLabel id="messageLabel" value="Your message:" for="messageInput"/>
- <h:inputText id="messageInput" value="#{a4jPushBean.message}" />
- </h:panelGrid>
-
- <br/>
- <h:commandButton id="submitButton" value="Send Message" action="#{a4jPushBean.send}" />
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- </ui:define>
-
- </ui:composition>
+</ui:composition>
</html>
\ No newline at end of file
Deleted: modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPush/simple.xhtml 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/application/src/main/webapp/components/a4jPush/simple.xhtml 2011-08-04 13:17:50 UTC (rev 22592)
@@ -1,59 +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:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:h="http://java.sun.com/jsf/html">
-
- <!--
-JBoss, Home of Professional Open Source
-Copyright 2010-2011, 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="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
-
- <ui:define name="head">
- <h:outputScript library="script" name="push.js"/>
- </ui:define>
-
- <ui:define name="component">
-
- <ul class="push-list"></ul>
-
- <a4j:push address="xxx@metamer" onerror="alert('Error: ' + event.rf.data)"
- ondataavailable="updateList(event.rf.data)" >
- </a4j:push>
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <ui:remove><metamer:attributes value="#{a4jPushBean.attributes}" id="attributes" /></ui:remove>
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file
Modified: modules/tests/metamer/branches/push-from-showcase/build.sh
===================================================================
--- modules/tests/metamer/trunk/build.sh 2011-08-02 04:23:57 UTC (rev 22583)
+++ modules/tests/metamer/branches/push-from-showcase/build.sh 2011-08-04 13:17:50 UTC (rev 22592)
@@ -1,2 +1,2 @@
#!/bin/bash
-mvn clean install -Pmyfaces,war-myfaces,war-jee6-bundled-mojarra,war-jee6-bundled-myfaces -Dselenium.server.skip=true -Dselenium.test.skip=true $*
+mvn clean install -Pmyfaces,war-myfaces,war-jee6-bundled-mojarra,war-jee6-bundled-myfaces,war-jbas7 -Dselenium.server.skip=true -Dselenium.test.skip=true $*
13 years, 5 months