Author: ppitonak(a)redhat.com
Date: 2011-12-12 08:51:30 -0500 (Mon, 12 Dec 2011)
New Revision: 23068
Added:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/context.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_1.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_2.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/lazyLoading.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/value.xhtml
Removed:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/HornetQInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
Modified:
modules/tests/metamer/branches/wfk2-product-branch/
modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/validation/SizeBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/MANIFEST.MF
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/faces-config.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jPush/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataScroller/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components1.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components2.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/facets.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/filtering.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/scroller.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/list.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/columnLayout.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/list.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/list.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/resources/script/push.js
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSelection.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestScroller.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/pom.xml
Log:
merged with trunk
Property changes on: modules/tests/metamer/branches/wfk2-product-branch
___________________________________________________________________
Modified: svn:mergeinfo
- /modules/tests/metamer/trunk:22762-22826,22828-22843,22845-23029
+ /modules/tests/metamer/trunk:22762-22826,22828-22843,22845-23029,23033-23067
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2011-12-12
11:04:27 UTC (rev 23067)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -19,7 +19,7 @@
<parent>
<groupId>org.richfaces.tests</groupId>
<artifactId>metamer-root</artifactId>
- <version>4.1.0-CR1-redhat-1</version>
+ <version>4.1.0.CR2-redhat-1</version>
</parent>
<groupId>org.richfaces.tests</groupId>
@@ -43,7 +43,7 @@
<properties>
<jetty.port>8080</jetty.port>
- <hornetq.version>2.1.2.Final</hornetq.version>
+ <hornetq.version>2.2.6.Final</hornetq.version>
</properties>
<dependencies>
@@ -197,7 +197,7 @@
<SCM-Revision>${buildNumber}</SCM-Revision>
<SCM-Timestamp>${timestamp}</SCM-Timestamp>
<!-- define SLF4J dependency in JBoss AS 7 -->
-
<Dependencies>org.slf4j,org.jboss.as.process-controller,org.jboss.as.controller-client</Dependencies>
+
<Dependencies>org.slf4j,org.jboss.as.process-controller,org.jboss.as.controller-client,org.jboss.dmr</Dependencies>
</manifestEntries>
</archive>
</configuration>
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,129 +0,0 @@
-/*
- * 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.demo.push;
-
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.PostConstructApplicationEvent;
-import javax.faces.event.PreDestroyApplicationEvent;
-import javax.faces.event.SystemEvent;
-import javax.faces.event.SystemEventListener;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-/**
- * <p>
- * Abstract initializater and finalizer listening for JSF PostConstructApplicationEvent
(needs to be registered explicitly in
- * faces-config.xml).
- * </p>
- *
- * <p>
- * After observing PostConstructApplicationEvent, it registers to
PreDestroyApplicationEvent to observe finalization phase.
- * </p>
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public abstract class AbstractCapabilityInitializer implements CapabilityInitializer,
SystemEventListener,
- ServletContextListener {
-
- private boolean correctlyInitialized = false;
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.
SystemEvent)
- */
- public void processEvent(SystemEvent event) throws AbortProcessingException {
- if (isCapabilityEnabled()) {
- if (event instanceof PostConstructApplicationEvent) {
- Application application =
FacesContext.getCurrentInstance().getApplication();
- application.subscribeToEvent(PreDestroyApplicationEvent.class, this);
-
- try {
- initializeCapability();
- correctlyInitialized = true;
- } catch (Exception e) {
- throw new RuntimeException("Capability " +
this.getClass().getName() + " was not correctly initialized", e);
- }
- } else {
- try {
- finalizeCapability();
- } catch (Exception e) {
- throw new RuntimeException("Capability " +
this.getClass().getName() + " was not correctly finalized", e);
- }
- }
- }
- }
-
- public void contextInitialized(ServletContextEvent sce) {
- try {
- initializeCapability();
- correctlyInitialized = true;
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void contextDestroyed(ServletContextEvent sce) {
- try {
- finalizeCapability();
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Returns true if initialization method has been processed without errors.
- *
- * @return true if initialization method has been processed without errors.
- */
- protected boolean isCorrentlyInitialized() {
- return correctlyInitialized;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.SystemEventListener#isListenerForSource(java.lang.Object )
- */
- public boolean isListenerForSource(Object source) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#unload()
- */
- public void finalizeCapability() throws Exception {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.CapabilityInitializer#isCapabilityEnabled()
- */
- public boolean isCapabilityEnabled() {
- return true;
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractCapabilityInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,129 @@
+/*
+ * 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.demo.push;
+
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.PostConstructApplicationEvent;
+import javax.faces.event.PreDestroyApplicationEvent;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * <p>
+ * Abstract initializater and finalizer listening for JSF PostConstructApplicationEvent
(needs to be registered explicitly in
+ * faces-config.xml).
+ * </p>
+ *
+ * <p>
+ * After observing PostConstructApplicationEvent, it registers to
PreDestroyApplicationEvent to observe finalization phase.
+ * </p>
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public abstract class AbstractCapabilityInitializer implements CapabilityInitializer,
SystemEventListener,
+ ServletContextListener {
+
+ private boolean correctlyInitialized = false;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.
SystemEvent)
+ */
+ public void processEvent(SystemEvent event) throws AbortProcessingException {
+ if (isCapabilityEnabled()) {
+ if (event instanceof PostConstructApplicationEvent) {
+ Application application =
FacesContext.getCurrentInstance().getApplication();
+ application.subscribeToEvent(PreDestroyApplicationEvent.class, this);
+
+ try {
+ initializeCapability();
+ correctlyInitialized = true;
+ } catch (Exception e) {
+ throw new RuntimeException("Capability " +
this.getClass().getName() + " was not correctly initialized", e);
+ }
+ } else {
+ try {
+ finalizeCapability();
+ } catch (Exception e) {
+ throw new RuntimeException("Capability " +
this.getClass().getName() + " was not correctly finalized", e);
+ }
+ }
+ }
+ }
+
+ public void contextInitialized(ServletContextEvent sce) {
+ try {
+ initializeCapability();
+ correctlyInitialized = true;
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void contextDestroyed(ServletContextEvent sce) {
+ try {
+ finalizeCapability();
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ /**
+ * Returns true if initialization method has been processed without errors.
+ *
+ * @return true if initialization method has been processed without errors.
+ */
+ protected boolean isCorrentlyInitialized() {
+ return correctlyInitialized;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.SystemEventListener#isListenerForSource(java.lang.Object )
+ */
+ public boolean isListenerForSource(Object source) {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#unload()
+ */
+ public void finalizeCapability() throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.CapabilityInitializer#isCapabilityEnabled()
+ */
+ public boolean isCapabilityEnabled() {
+ return true;
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,68 +0,0 @@
-/*
- * 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.demo.push;
-
-/**
- * Initializer which manages start of associated MessageProducer.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- *
- */
-public abstract class AbstractMessageProducerInitializer extends
AbstractCapabilityInitializer {
-
- private Thread messageProducerThread;
- private MessageProducer messageProducer;
- private MessageProducerRunnable messageProducerRunnable;
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#initialize()
- */
- public void initializeCapability() throws Exception {
- messageProducer = createMessageProducer();
- messageProducerRunnable = new MessageProducerRunnable(messageProducer);
- messageProducerThread = new Thread(messageProducerRunnable,
"MessageProducerThread");
- messageProducerThread.setDaemon(false);
- messageProducerThread.start();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#unload()
- */
- @Override
- public void finalizeCapability() throws Exception {
- if (messageProducer != null) {
- messageProducer.finalizeProducer();
- }
- if (messageProducerRunnable != null) {
- messageProducerRunnable.stop();
- }
- if (messageProducerThread != null) {
- messageProducerThread.interrupt();
- }
- }
-
- public abstract MessageProducer createMessageProducer();
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/AbstractMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,68 @@
+/*
+ * 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.demo.push;
+
+/**
+ * Initializer which manages start of associated MessageProducer.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ *
+ */
+public abstract class AbstractMessageProducerInitializer extends
AbstractCapabilityInitializer {
+
+ private Thread messageProducerThread;
+ private MessageProducer messageProducer;
+ private MessageProducerRunnable messageProducerRunnable;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#initialize()
+ */
+ public void initializeCapability() throws Exception {
+ messageProducer = createMessageProducer();
+ messageProducerRunnable = new MessageProducerRunnable(messageProducer);
+ messageProducerThread = new Thread(messageProducerRunnable,
"MessageProducerThread");
+ messageProducerThread.setDaemon(false);
+ messageProducerThread.start();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#unload()
+ */
+ @Override
+ public void finalizeCapability() throws Exception {
+ if (messageProducer != null) {
+ messageProducer.finalizeProducer();
+ }
+ if (messageProducerRunnable != null) {
+ messageProducerRunnable.stop();
+ }
+ if (messageProducerThread != null) {
+ messageProducerThread.interrupt();
+ }
+ }
+
+ public abstract MessageProducer createMessageProducer();
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,50 +0,0 @@
-/*
- * 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.demo.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;
-
- /**
- * Returns true when capability should be initialized.
- *
- * @return true when capability should be initialized.
- */
- boolean isCapabilityEnabled();
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/CapabilityInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,50 @@
+/*
+ * 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.demo.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;
+
+ /**
+ * Returns true when capability should be initialized.
+ *
+ * @return true when capability should be initialized.
+ */
+ boolean isCapabilityEnabled();
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,166 +0,0 @@
-/*
- * 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.demo.push;
-
-import static org.richfaces.demo.push.JMSMessageProducer.PUSH_JMS_TOPIC;
-import static
org.richfaces.demo.push.TopicsContextMessageProducer.PUSH_TOPICS_CONTEXT_TOPIC;
-
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
-import org.richfaces.demo.push.provider.AS6MessagingProviderManagement;
-import org.richfaces.demo.push.provider.AS7MessagingProviderManagement;
-import org.richfaces.demo.push.provider.CustomMessagingServerManagement;
-import org.richfaces.demo.push.provider.InitializationFailedException;
-import org.richfaces.demo.push.provider.MessagingProviderManagement;
-
-/**
- * Initializes JMS server and creates requested topics.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class JMSInitializer extends AbstractCapabilityInitializer {
-
- private static final Logger LOGGER =
Logger.getLogger(JMSInitializer.class.getName());
- private static final AtomicReference<Boolean> JMS_ENABLED = new
AtomicReference<Boolean>(null);
-
- private MessagingProviderManagement provider;
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#initialize()
- */
- public void initializeCapability() throws Exception {
- initializeJMS();
- }
-
- @Override
- public boolean isCapabilityEnabled() {
- return isJmsEnabled();
- }
-
- private void initializeJMS() throws Exception {
- provider = initializeCurrentProvider();
-
- if (provider != null) {
- createTopic(PUSH_JMS_TOPIC, "/topic/" + PUSH_JMS_TOPIC);
- createTopic(PUSH_TOPICS_CONTEXT_TOPIC, "/topic/" +
PUSH_TOPICS_CONTEXT_TOPIC);
- }
- }
-
- private void createTopic(String topicName, String jndiName) throws Exception {
- try {
- LOGGER.info("creating topic " + topicName);
- provider.createTopic(topicName, jndiName);
- } catch (Exception e) {
- throw new RuntimeException("Unable to create topic '" +
topicName + "' (JNDI: " + jndiName + ")", e);
- }
- }
-
- protected static boolean isJmsEnabled() {
- if (null == JMS_ENABLED.get()) {
- boolean isJmsEnabled = isConnectionFactoryRegistered() || isTomcat();
- JMS_ENABLED.compareAndSet(null, isJmsEnabled);
- }
- return JMS_ENABLED.get();
- }
-
- private static boolean isTomcat() {
- try {
- Class<?> clazz =
Class.forName("org.apache.catalina.util.ServerInfo");
- String serverInfo = (String)
clazz.getMethod("getServerInfo").invoke(null);
- return serverInfo.contains("Tomcat");
- } catch (Exception e) {
- return false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#unload()
- */
- public void finalizeCapability() throws Exception {
- if (provider != null) {
- 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 {
- LOGGER.info("initializing");
- MessagingProviderManagement provider = c.newInstance();
- provider.initializeProvider();
- LOGGER.info(c.getSimpleName() + " initialized");
- return provider;
- } catch (InitializationFailedException e) {
- LOGGER.severe(c.getSimpleName() + " initialization failed");
- } 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 static boolean isConnectionFactoryRegistered() {
- try {
- return null != InitialContext.doLookup("java:/ConnectionFactory");
- } catch (NamingException e) {
- if (!(e instanceof NameNotFoundException)) {
- LOGGER.log(Level.SEVERE, "Can't access naming context",
e);
- }
- return false;
- }
- }
-
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,166 @@
+/*
+ * 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.demo.push;
+
+import static org.richfaces.demo.push.JMSMessageProducer.PUSH_JMS_TOPIC;
+import static
org.richfaces.demo.push.TopicsContextMessageProducer.PUSH_TOPICS_CONTEXT_TOPIC;
+
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+import org.richfaces.demo.push.provider.AS6MessagingProviderManagement;
+import org.richfaces.demo.push.provider.AS7MessagingProviderManagement;
+import org.richfaces.demo.push.provider.CustomMessagingServerManagement;
+import org.richfaces.demo.push.provider.InitializationFailedException;
+import org.richfaces.demo.push.provider.MessagingProviderManagement;
+
+/**
+ * Initializes JMS server and creates requested topics.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class JMSInitializer extends AbstractCapabilityInitializer {
+
+ private static final Logger LOGGER =
Logger.getLogger(JMSInitializer.class.getName());
+ private static final AtomicReference<Boolean> JMS_ENABLED = new
AtomicReference<Boolean>(null);
+
+ private MessagingProviderManagement provider;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#initialize()
+ */
+ public void initializeCapability() throws Exception {
+ initializeJMS();
+ }
+
+ @Override
+ public boolean isCapabilityEnabled() {
+ return isJmsEnabled();
+ }
+
+ private void initializeJMS() throws Exception {
+ provider = initializeCurrentProvider();
+
+ if (provider != null) {
+ createTopic(PUSH_JMS_TOPIC, "/topic/" + PUSH_JMS_TOPIC);
+ createTopic(PUSH_TOPICS_CONTEXT_TOPIC, "/topic/" +
PUSH_TOPICS_CONTEXT_TOPIC);
+ }
+ }
+
+ private void createTopic(String topicName, String jndiName) throws Exception {
+ try {
+ LOGGER.info("creating topic " + topicName);
+ provider.createTopic(topicName, jndiName);
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to create topic '" +
topicName + "' (JNDI: " + jndiName + ")", e);
+ }
+ }
+
+ protected static boolean isJmsEnabled() {
+ if (null == JMS_ENABLED.get()) {
+ boolean isJmsEnabled = isConnectionFactoryRegistered() || isTomcat();
+ JMS_ENABLED.compareAndSet(null, isJmsEnabled);
+ }
+ return JMS_ENABLED.get();
+ }
+
+ private static boolean isTomcat() {
+ try {
+ Class<?> clazz =
Class.forName("org.apache.catalina.util.ServerInfo");
+ String serverInfo = (String)
clazz.getMethod("getServerInfo").invoke(null);
+ return serverInfo.contains("Tomcat");
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#unload()
+ */
+ public void finalizeCapability() throws Exception {
+ if (provider != null) {
+ 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 {
+ LOGGER.info("initializing");
+ MessagingProviderManagement provider = c.newInstance();
+ provider.initializeProvider();
+ LOGGER.info(c.getSimpleName() + " initialized");
+ return provider;
+ } catch (InitializationFailedException e) {
+ LOGGER.severe(c.getSimpleName() + " initialization failed");
+ } 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 static boolean isConnectionFactoryRegistered() {
+ try {
+ return null != InitialContext.doLookup("java:/ConnectionFactory");
+ } catch (NamingException e) {
+ if (!(e instanceof NameNotFoundException)) {
+ LOGGER.log(Level.SEVERE, "Can't access naming context",
e);
+ }
+ return false;
+ }
+ }
+
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,148 +0,0 @@
-/**
- * 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.demo.push;
-
-import java.io.Serializable;
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-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;
-
-/**
- * Sends message to JMS topic.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class JMSMessageProducer implements MessageProducer {
-
- public static final String PUSH_JMS_TOPIC = "pushJms";
-
- private static final Logger LOGGER =
Logger.getLogger(JMSMessageProducer.class.getName());
-
- private Topic topic;
- private TopicConnection connection = null;
- private TopicSession session = null;
- private TopicPublisher publisher = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#sendMessage()
- */
- 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() {
- DateFormat dateFormat = DateFormat.getDateTimeInstance();
- dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
- String dateMessage = dateFormat.format(new Date());
- return dateMessage;
- }
-
- 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/" + PUSH_JMS_TOPIC);
- }
- if (publisher == null) {
- publisher = session.createPublisher(topic);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#getInterval()
- */
- public int getInterval() {
- return 5000;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#finalizeProducer()
- */
- public void finalizeProducer() {
- if (publisher != null) {
- try {
- publisher.close();
- } catch (JMSException e) {
- LOGGER.severe("unable to close publisher");
- }
- }
- if (session != null) {
- try {
- session.close();
- } catch (JMSException e) {
- LOGGER.severe("unable to close session");
- }
- }
- if (connection != null) {
- try {
- connection.close();
- } catch (JMSException e) {
- LOGGER.severe("unable to close connection");
- }
- }
- }
-
- 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");
- }
- }
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,148 @@
+/**
+ * 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.demo.push;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+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;
+
+/**
+ * Sends message to JMS topic.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class JMSMessageProducer implements MessageProducer {
+
+ public static final String PUSH_JMS_TOPIC = "pushJms";
+
+ private static final Logger LOGGER =
Logger.getLogger(JMSMessageProducer.class.getName());
+
+ private Topic topic;
+ private TopicConnection connection = null;
+ private TopicSession session = null;
+ private TopicPublisher publisher = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#sendMessage()
+ */
+ 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() {
+ DateFormat dateFormat = DateFormat.getDateTimeInstance();
+ dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+ String dateMessage = dateFormat.format(new Date());
+ return dateMessage;
+ }
+
+ 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/" + PUSH_JMS_TOPIC);
+ }
+ if (publisher == null) {
+ publisher = session.createPublisher(topic);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#getInterval()
+ */
+ public int getInterval() {
+ return 5000;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#finalizeProducer()
+ */
+ public void finalizeProducer() {
+ if (publisher != null) {
+ try {
+ publisher.close();
+ } catch (JMSException e) {
+ LOGGER.severe("unable to close publisher");
+ }
+ }
+ if (session != null) {
+ try {
+ session.close();
+ } catch (JMSException e) {
+ LOGGER.severe("unable to close session");
+ }
+ }
+ if (connection != null) {
+ try {
+ connection.close();
+ } catch (JMSException e) {
+ LOGGER.severe("unable to close connection");
+ }
+ }
+ }
+
+ 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");
+ }
+ }
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,45 +0,0 @@
-/*
- * 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.demo.push;
-
-/**
- * Starts the thread with JMS message producer.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class JMSMessageProducerInitializer extends AbstractMessageProducerInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see
org.richfaces.demo.push.AbstractMessageProducerInitializer#createMessageProducer()
- */
- @Override
- public MessageProducer createMessageProducer() {
- return new JMSMessageProducer();
- }
-
- @Override
- public boolean isCapabilityEnabled() {
- return JMSInitializer.isJmsEnabled();
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/JMSMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,45 @@
+/*
+ * 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.demo.push;
+
+/**
+ * Starts the thread with JMS message producer.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class JMSMessageProducerInitializer extends AbstractMessageProducerInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.richfaces.demo.push.AbstractMessageProducerInitializer#createMessageProducer()
+ */
+ @Override
+ public MessageProducer createMessageProducer() {
+ return new JMSMessageProducer();
+ }
+
+ @Override
+ public boolean isCapabilityEnabled() {
+ return JMSInitializer.isJmsEnabled();
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/MessageProducer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,49 +0,0 @@
-/*
- * 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.demo.push;
-
-/**
- * Interface for implementations producing messages.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public interface MessageProducer {
-
- /**
- * Sends a message.
- *
- * @throws Exception any exception which was thrown when trying to send message.
- */
- void sendMessage() throws Exception;
-
- /**
- * Interval which will be producer sleeping after last message sent before start of
sending of next message.
- *
- * @return interval in miliseconds
- */
- int getInterval();
-
- /**
- * Finalizes the producer (frees all associated resources)
- */
- void finalizeProducer();
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/MessageProducer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,49 @@
+/*
+ * 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.demo.push;
+
+/**
+ * Interface for implementations producing messages.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public interface MessageProducer {
+
+ /**
+ * Sends a message.
+ *
+ * @throws Exception any exception which was thrown when trying to send message.
+ */
+ void sendMessage() throws Exception;
+
+ /**
+ * Interval which will be producer sleeping after last message sent before start of
sending of next message.
+ *
+ * @return interval in miliseconds
+ */
+ int getInterval();
+
+ /**
+ * Finalizes the producer (frees all associated resources)
+ */
+ void finalizeProducer();
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,77 +0,0 @@
-/*
- * 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.demo.push;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * 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>
- */
-public class MessageProducerRunnable implements Runnable {
-
- private static final Logger LOGGER =
Logger.getLogger(MessageProducerRunnable.class.getName());
-
- private AtomicBoolean runFlag = new AtomicBoolean(true);
- private MessageProducer messageProducer;
-
- /**
- * Creates runnable with associated message producer.
- *
- * @param messageProducer will be associated with this runnable
- */
- public MessageProducerRunnable(MessageProducer messageProducer) {
- this.messageProducer = messageProducer;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- while (runFlag.get()) {
- try {
- messageProducer.sendMessage();
- } catch (Exception e) {
- LOGGER.log(Level.SEVERE, e.getMessage(), e);
- }
-
- try {
- Thread.sleep(messageProducer.getInterval());
- } catch (InterruptedException e) {
- LOGGER.log(Level.INFO, "MessageProducer has been
interrupted");
- break;
- }
- }
- }
-
- /**
- * Stops the cycle with body sending messages.
- */
- public void stop() {
- runFlag.set(false);
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/MessageProducerRunnable.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,77 @@
+/*
+ * 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.demo.push;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * 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>
+ */
+public class MessageProducerRunnable implements Runnable {
+
+ private static final Logger LOGGER =
Logger.getLogger(MessageProducerRunnable.class.getName());
+
+ private AtomicBoolean runFlag = new AtomicBoolean(true);
+ private MessageProducer messageProducer;
+
+ /**
+ * Creates runnable with associated message producer.
+ *
+ * @param messageProducer will be associated with this runnable
+ */
+ public MessageProducerRunnable(MessageProducer messageProducer) {
+ this.messageProducer = messageProducer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ while (runFlag.get()) {
+ try {
+ messageProducer.sendMessage();
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, e.getMessage(), e);
+ }
+
+ try {
+ Thread.sleep(messageProducer.getInterval());
+ } catch (InterruptedException e) {
+ LOGGER.log(Level.INFO, "MessageProducer has been
interrupted");
+ break;
+ }
+ }
+ }
+
+ /**
+ * Stops the cycle with body sending messages.
+ */
+ public void stop() {
+ runFlag.set(false);
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,49 +0,0 @@
-/*
- * 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.demo.push;
-
-import javax.faces.bean.ApplicationScoped;
-import javax.faces.bean.ManagedBean;
-import javax.faces.context.FacesContext;
-import javax.servlet.ServletContext;
-
-/**
- * Initializes JMS server and creates requested topics.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-@ApplicationScoped
-@ManagedBean
-public class PushConfiguration {
-
- public boolean isJmsEnabled() {
- return JMSInitializer.isJmsEnabled();
- }
-
- public boolean isPushEnabled() {
- ServletContext servletContext = (ServletContext)
FacesContext.getCurrentInstance().getExternalContext().getContext();
- String pushDisabled =
servletContext.getInitParameter("org.richfaces.showcase.pushDisabled");
- if (pushDisabled == null) {
- return true;
- }
- return Boolean.valueOf(pushDisabled);
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/PushConfiguration.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,49 @@
+/*
+ * 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.demo.push;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+/**
+ * Initializes JMS server and creates requested topics.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+@ApplicationScoped
+@ManagedBean
+public class PushConfiguration {
+
+ public boolean isJmsEnabled() {
+ return JMSInitializer.isJmsEnabled();
+ }
+
+ public boolean isPushEnabled() {
+ ServletContext servletContext = (ServletContext)
FacesContext.getCurrentInstance().getExternalContext().getContext();
+ String pushDisabled =
servletContext.getInitParameter("org.richfaces.showcase.pushDisabled");
+ if (pushDisabled == null) {
+ return true;
+ }
+ return Boolean.valueOf(pushDisabled);
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,99 +0,0 @@
-/**
- * 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.demo.push;
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.richfaces.application.push.MessageException;
-import org.richfaces.application.push.TopicKey;
-import org.richfaces.application.push.TopicsContext;
-import org.richfaces.tests.metamer.Message;
-
-/**
- * Sends message to topic using TopicsContext.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class TopicsContextMessageProducer implements MessageProducer {
-
- public static final String PUSH_TOPICS_CONTEXT_TOPIC =
"pushTopicsContext";
-
- private String text = "Servus!";
- private String author = "Janko Hrasko";
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#sendMessage()
- */
- public void sendMessage() throws Exception {
- try {
- TopicKey topicKey = new TopicKey(PUSH_TOPICS_CONTEXT_TOPIC,
"xxx");
- TopicsContext topicsContext = TopicsContext.lookup();
-
- DateFormat dateFormat = DateFormat.getDateTimeInstance();
- dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
- String dateMessage = dateFormat.format(new Date());
-
- topicsContext.publish(topicKey, new Message(text, author, dateMessage));
- } catch (MessageException e) {
- if (!e.getMessage().matches("^Topic .* not found$")) {
- throw e;
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#getInterval()
- */
- public int getInterval() {
- return 5000;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.MessageProducer#finalizeProducer()
- */
- public void finalizeProducer() {
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,99 @@
+/**
+ * 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.demo.push;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.richfaces.application.push.MessageException;
+import org.richfaces.application.push.TopicKey;
+import org.richfaces.application.push.TopicsContext;
+import org.richfaces.tests.metamer.Message;
+
+/**
+ * Sends message to topic using TopicsContext.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class TopicsContextMessageProducer implements MessageProducer {
+
+ public static final String PUSH_TOPICS_CONTEXT_TOPIC =
"pushTopicsContext";
+
+ private String text = "Servus!";
+ private String author = "Janko Hrasko";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#sendMessage()
+ */
+ public void sendMessage() throws Exception {
+ try {
+ TopicKey topicKey = new TopicKey(PUSH_TOPICS_CONTEXT_TOPIC,
"xxx");
+ TopicsContext topicsContext = TopicsContext.lookup();
+
+ DateFormat dateFormat = DateFormat.getDateTimeInstance();
+ dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+ String dateMessage = dateFormat.format(new Date());
+
+ topicsContext.publish(topicKey, new Message(text, author, dateMessage));
+ } catch (MessageException e) {
+ if (!e.getMessage().matches("^Topic .* not found$")) {
+ throw e;
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#getInterval()
+ */
+ public int getInterval() {
+ return 5000;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.MessageProducer#finalizeProducer()
+ */
+ public void finalizeProducer() {
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,39 +0,0 @@
-/*
- * 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.demo.push;
-
-/**
- * Starts the thread with TopicsContext message producer.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class TopicsContextMessageProducerInitializer extends
AbstractMessageProducerInitializer {
- /*
- * (non-Javadoc)
- *
- * @see
org.richfaces.demo.push.AbstractMessageProducerInitializer#createMessageProducer()
- */
- @Override
- public MessageProducer createMessageProducer() {
- return new TopicsContextMessageProducer();
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsContextMessageProducerInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,39 @@
+/*
+ * 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.demo.push;
+
+/**
+ * Starts the thread with TopicsContext message producer.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class TopicsContextMessageProducerInitializer extends
AbstractMessageProducerInitializer {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.richfaces.demo.push.AbstractMessageProducerInitializer#createMessageProducer()
+ */
+ @Override
+ public MessageProducer createMessageProducer() {
+ return new TopicsContextMessageProducer();
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,100 +0,0 @@
-/*
- * 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.demo.push;
-
-import static org.richfaces.demo.push.JMSMessageProducer.PUSH_JMS_TOPIC;
-import static
org.richfaces.demo.push.TopicsContextMessageProducer.PUSH_TOPICS_CONTEXT_TOPIC;
-
-import java.util.logging.Logger;
-
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
-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;
-
-/**
- * Registers topics in RichFaces subsytem.
- *
- * @author Nick Belaevski
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- */
-public class TopicsInitializer extends AbstractCapabilityInitializer {
-
- private static final Logger LOGGER =
Logger.getLogger(TopicsInitializer.class.getName());
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.demo.push.Initializer#initialize()
- */
- public void initializeCapability() throws Exception {
- TopicsContext.lookup();
-
- new RegisterTopicThread(PUSH_JMS_TOPIC).start();
- new RegisterTopicThread(PUSH_TOPICS_CONTEXT_TOPIC).start();
- }
-
- private class RegisterTopicThread extends Thread {
-
- public RegisterTopicThread(final String topicName) {
- super(new Runnable() {
-
- public void run() {
- if (JMSInitializer.isJmsEnabled()) {
- waitForJmsTopicReady();
- }
-
- TopicsContext topicsContext = TopicsContext.lookup();
- Topic pushJmsTopic = topicsContext.getOrCreateTopic(new
TopicKey(topicName));
-
pushJmsTopic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
- }
-
- private void waitForJmsTopicReady() {
- while (!isJmsTopicReady()) {
- try {
- LOGGER.severe("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.severe(e.getMessage());
- }
- return false;
- }
- }, "RegisterTopicThread");
- }
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/TopicsInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,100 @@
+/*
+ * 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.demo.push;
+
+import static org.richfaces.demo.push.JMSMessageProducer.PUSH_JMS_TOPIC;
+import static
org.richfaces.demo.push.TopicsContextMessageProducer.PUSH_TOPICS_CONTEXT_TOPIC;
+
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+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;
+
+/**
+ * Registers topics in RichFaces subsytem.
+ *
+ * @author Nick Belaevski
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ */
+public class TopicsInitializer extends AbstractCapabilityInitializer {
+
+ private static final Logger LOGGER =
Logger.getLogger(TopicsInitializer.class.getName());
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.demo.push.Initializer#initialize()
+ */
+ public void initializeCapability() throws Exception {
+ TopicsContext.lookup();
+
+ new RegisterTopicThread(PUSH_JMS_TOPIC).start();
+ new RegisterTopicThread(PUSH_TOPICS_CONTEXT_TOPIC).start();
+ }
+
+ private class RegisterTopicThread extends Thread {
+
+ public RegisterTopicThread(final String topicName) {
+ super(new Runnable() {
+
+ public void run() {
+ if (JMSInitializer.isJmsEnabled()) {
+ waitForJmsTopicReady();
+ }
+
+ TopicsContext topicsContext = TopicsContext.lookup();
+ Topic pushJmsTopic = topicsContext.getOrCreateTopic(new
TopicKey(topicName));
+
pushJmsTopic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
+ }
+
+ private void waitForJmsTopicReady() {
+ while (!isJmsTopicReady()) {
+ try {
+ LOGGER.severe("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.severe(e.getMessage());
+ }
+ return false;
+ }
+ }, "RegisterTopicThread");
+ }
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,84 +0,0 @@
-/*
- * 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.demo.push.provider;
-
-import java.io.UnsupportedEncodingException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-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 JMSServerControl serverControl;
-
- public void initializeProvider() throws InitializationFailedException {
- //determine bound IP address
- String ipAddr = System.getProperty("jboss.bind.address");
-
- if(ipAddr.isEmpty()){
- ipAddr = "localhost";
- }
-
- try {
- ObjectName on = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();
- JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(
- "service:jmx:rmi:///jndi/rmi://" + ipAddr +
":1090/jmxrmi"), new HashMap<String, Object>());
- MBeanServerConnection mbsc = connector.getMBeanServerConnection();
- serverControl = (JMSServerControl)
MBeanServerInvocationHandler.newProxyInstance(mbsc, on,
- JMSServerControl.class, false);
- } 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));
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS6MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,84 @@
+/*
+ * 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.demo.push.provider;
+
+import java.io.UnsupportedEncodingException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+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 JMSServerControl serverControl;
+
+ public void initializeProvider() throws InitializationFailedException {
+ //determine bound IP address
+ String ipAddr = System.getProperty("jboss.bind.address");
+
+ if(ipAddr.isEmpty()){
+ ipAddr = "localhost";
+ }
+
+ try {
+ ObjectName on = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();
+ JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(
+ "service:jmx:rmi:///jndi/rmi://" + ipAddr +
":1090/jmxrmi"), new HashMap<String, Object>());
+ MBeanServerConnection mbsc = connector.getMBeanServerConnection();
+ serverControl = (JMSServerControl)
MBeanServerInvocationHandler.newProxyInstance(mbsc, on,
+ JMSServerControl.class, false);
+ } 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));
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,107 +0,0 @@
-/*
- * 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.demo.push.provider;
-
-import java.io.IOException;
-import java.net.UnknownHostException;
-import java.util.LinkedList;
-import java.util.List;
-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 List<ModelControllerClient> clients = new
LinkedList<ModelControllerClient>();
-
- public void initializeProvider() throws InitializationFailedException {
- try {
- // tries to connect - when creating topic, own client will be created
(RF-11695)
- createClient().close();
- } catch (Exception e) {
- throw new InitializationFailedException();
- } catch (NoClassDefFoundError e) {
- throw new InitializationFailedException();
- }
- }
-
- private ModelControllerClient createClient() throws UnknownHostException {
- return ModelControllerClient.Factory.create("127.0.0.1", 9999);
- }
-
- public void finalizeProvider() {
- try {
- for (ModelControllerClient client : clients) {
- 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 {
-
- // create own client for each topic creation (RF-11695)
- ModelControllerClient client = createClient();
- clients.add(client);
-
- boolean as71 = false;
-
- 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);
-
- // AS 7.1 or higher (hornetq-server=default address node added)
- if
(result.get("result").toString().contains("hornetq-server")) {
- as71 = true;
- operation = new ModelNode();
- operation.get("operation").set("read-resource");
- operation.get("address").add("subsystem",
"messaging");
- operation.get("address").add("hornetq-server",
"default");
- 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");
- if (as71) {
- operation.get("address").add("hornetq-server",
"default");
- }
- operation.get("address").add("jms-topic", topicName);
- operation.get("entries").add("topic/" + topicName);
- client.executeAsync(operation, null);
- }
- }
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/AS7MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,107 @@
+/*
+ * 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.demo.push.provider;
+
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.util.LinkedList;
+import java.util.List;
+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 List<ModelControllerClient> clients = new
LinkedList<ModelControllerClient>();
+
+ public void initializeProvider() throws InitializationFailedException {
+ try {
+ // tries to connect - when creating topic, own client will be created
(RF-11695)
+ createClient().close();
+ } catch (Exception e) {
+ throw new InitializationFailedException();
+ } catch (NoClassDefFoundError e) {
+ throw new InitializationFailedException();
+ }
+ }
+
+ private ModelControllerClient createClient() throws UnknownHostException {
+ return ModelControllerClient.Factory.create("127.0.0.1", 9999);
+ }
+
+ public void finalizeProvider() {
+ try {
+ for (ModelControllerClient client : clients) {
+ 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 {
+
+ // create own client for each topic creation (RF-11695)
+ ModelControllerClient client = createClient();
+ clients.add(client);
+
+ boolean as71 = false;
+
+ 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);
+
+ // AS 7.1 or higher (hornetq-server=default address node added)
+ if
(result.get("result").toString().contains("hornetq-server")) {
+ as71 = true;
+ operation = new ModelNode();
+ operation.get("operation").set("read-resource");
+ operation.get("address").add("subsystem",
"messaging");
+ operation.get("address").add("hornetq-server",
"default");
+ 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");
+ if (as71) {
+ operation.get("address").add("hornetq-server",
"default");
+ }
+ operation.get("address").add("jms-topic", topicName);
+ operation.get("entries").add("topic/" + topicName);
+ client.executeAsync(operation, null);
+ }
+ }
+}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,128 +0,0 @@
-/*
- * 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.demo.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 {
- startJMSServer();
- startJMSServerManager();
- createJMSConnectionFactory();
- } catch (Exception e) {
- throw new InitializationFailedException();
- }
- }
-
- 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
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/CustomMessagingServerManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,128 @@
+/*
+ * 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.demo.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 {
+ startJMSServer();
+ startJMSServerManager();
+ createJMSConnectionFactory();
+ } catch (Exception e) {
+ throw new InitializationFailedException();
+ }
+ }
+
+ 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
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,31 +0,0 @@
-/*
- * 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.demo.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;
-}
\ No newline at end of file
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/InitializationFailedException.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,31 @@
+/*
+ * 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.demo.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;
+}
\ No newline at end of file
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,56 +0,0 @@
-/*
- * 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.demo.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();
-}
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/demo/push/provider/MessagingProviderManagement.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -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.demo.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();
+}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -34,11 +34,11 @@
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static
org.richfaces.demo.push.TopicsContextMessageProducer.PUSH_TOPICS_CONTEXT_TOPIC;
+
/**
* Managed bean for a4j:push.
*
@@ -50,6 +50,8 @@
public class A4JPushBean implements Serializable {
private static final long serialVersionUID = 4810889475400649809L;
+ public static final String METAMER_SUBTOPIC = "xxx";
+
private static Logger logger;
private transient TopicsContext topicsContext;
private Attributes attributes;
@@ -64,11 +66,9 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- // TODO refactor
// set up messaging
- new HornetQInitializer().processEvent(null);
- new TopicsInitializer().processEvent(null);
-
+ // TODO JJa 2011-12-07: make sure if initialization is required even use
initialization mechanism from showcase
+
topicsContext = TopicsContext.lookup();
attributes = Attributes.getComponentAttributesFromClass(UIPush.class,
getClass());
@@ -132,7 +132,7 @@
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);
+ getTopicsContext().publish(new TopicKey(PUSH_TOPICS_CONTEXT_TOPIC,
METAMER_SUBTOPIC), msg);
} catch (MessageException messageException) {
logger.error("Could not send message \"" + message +
"\" by user " + username + ".", messageException);
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -25,7 +25,7 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import org.richfaces.component.UIColumnGroup;
import org.richfaces.tests.metamer.Attributes;
@@ -34,12 +34,12 @@
/**
* Managed bean for rich:columnGroup.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@ManagedBean(name = "richColumnGroupBean")
-@SessionScoped
+@ViewScoped
public class RichColumnGroupBean implements Serializable {
private static final long serialVersionUID = -1L;
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -22,9 +22,15 @@
package org.richfaces.tests.metamer.bean.rich;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+import javax.faces.model.SelectItem;
+import javax.faces.model.SelectItemGroup;
+
import org.richfaces.component.UIDropDownMenu;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
@@ -44,6 +50,8 @@
private static Logger logger;
private Attributes attributes;
private String current;
+
+ private List<SelectItemGroup> dynamicMenuGroups = new
ArrayList<SelectItemGroup>();
/**
* Initializes the managed bean.
@@ -57,8 +65,24 @@
attributes.setAttribute("mode", "ajax");
attributes.setAttribute("rendered", true);
-
+ initializeDynamicMenuGroups();
}
+
+ /**
+ * This method/actionListener change list of available tabs (from empty to
initialized and back)
+ */
+ public void changeTabList() {
+ if (dynamicMenuGroups.isEmpty()) {
+ initializeDynamicMenuGroups();
+ } else {
+ dynamicMenuGroups = new ArrayList<SelectItemGroup>();
+ }
+ }
+
+ private void initializeDynamicMenuGroups() {
+ dynamicMenuGroups.add(new SelectItemGroup("Group1", "Menu Group
1", false, new SelectItem[] {}));
+ dynamicMenuGroups.add(new SelectItemGroup("Group2", "Menu Group
2", false, new SelectItem[] {}));
+ }
public Attributes getAttributes() {
return attributes;
@@ -105,4 +129,12 @@
this.current = "Exit";
return null;
}
+
+ public List<SelectItemGroup> getDynamicMenuGroups() {
+ return dynamicMenuGroups;
+ }
+
+ public void setDynamicMenuGroups(List<SelectItemGroup> dynamicMenuGroups) {
+ this.dynamicMenuGroups = dynamicMenuGroups;
+ }
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -38,7 +38,7 @@
/**
* Managed bean for rich:tabPanel.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -49,7 +49,7 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
-
+
private List<UITab> tabs = new ArrayList<UITab>();
private List<TabBean> tabBeans = new ArrayList<TabBean>();
@@ -74,47 +74,46 @@
attributes.setAttribute("bypassUpdates", null);
attributes.get("bypassUpdates").setType(Boolean.class);
}
-
+
public void createNewTab() {
-
+
UITab tab = new UITab();
int index = tabs.size() + 6; // there is already 5 tabs
-
+
tab.setHeader("tab" + index + " header");
tab.setId("tab" + index);
tab.setName("tab" + index);
tab.setRender("tab" + index);
-
+
tabs.add(tab);
}
-
+
public void generateNewTab() {
-
+
System.out.println(" ###### adding new tabBean... ");
-
+
int i = tabBeans.size();
String idBase = "tab" + (i + 6); // there is already 5 tabs
- tabBeans.add(new TabBean(idBase, idBase, idBase + " header",
- "Content of dynamicaly created " + idBase));
-
+ tabBeans.add(new TabBean(idBase, idBase, idBase + " header",
"Content of dynamicaly created " + idBase));
+
System.out.println(" Now is tabBeans list " + tabBeans.size() + "
long");
}
-
+
public void removeTab() throws Exception {
// setActiveTabId("TAB1");
-
- String tabIdToRemove = FacesContext.getCurrentInstance().getExternalContext()
- .getRequestParameterMap().get("removeTabId");
-
+
+ String tabIdToRemove =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap()
+ .get("removeTabId");
+
TabBean currentTab = getTabById(tabIdToRemove);
-
+
if (currentTab != null) {
tabBeans.remove(currentTab);
} else {
throw new Exception("Tab Id parameter is null");
}
}
-
+
private TabBean getTabById(String tabId) {
System.out.println(" #tabId to remove: '" + tabId +
"'");
for (TabBean currentTab : tabBeans) {
@@ -140,21 +139,20 @@
public void setTabs(List<UITab> tabs) {
this.tabs = tabs;
}
-
+
public class TabBean {
private String tabId;
private String tabName;
private String tabHeader;
private String tabContentText;
private boolean closable;
-
- public TabBean(String tabId, String tabName, String tabHeader,
- String tabContentText){
+
+ public TabBean(String tabId, String tabName, String tabHeader, String
tabContentText) {
this.tabId = tabId;
this.tabName = tabName;
this.tabHeader = tabHeader;
this.tabContentText = tabContentText;
-
+
// default is closable
this.closable = true;
}
@@ -198,7 +196,7 @@
public void setClosable(boolean closable) {
this.closable = closable;
}
-
+
}
public List<TabBean> getTabBeans() {
@@ -208,4 +206,28 @@
public void setTabBeans(List<TabBean> tabBeans) {
this.tabBeans = tabBeans;
}
+
+ public List<String> getTestListA() {
+ logger.info("getTestListA");
+
+ List<String> listA = new ArrayList<String>(4);
+ listA.add("Hyundai i30");
+ listA.add("Renault Megane");
+ listA.add("Renault Clio");
+ listA.add("Toyota Auris");
+
+ return listA;
+ }
+
+ public List<String> getTestListB() {
+ logger.info("getTestListB");
+
+ List<String> listB = new ArrayList<String>(4);
+ listB.add("pineapple");
+ listB.add("banana");
+ listB.add("strawberry");
+ listB.add("blueberry");
+
+ return listB;
+ }
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -70,13 +70,13 @@
attributes.setAttribute("showEvent", "mouseenter");
attributes.setAttribute("hideEvent", "mouseleave");
attributes.setAttribute("target", "panel");
+ attributes.setAttribute("value", "Tooltip content");
// attributes that needs to be tested in other way
attributes.remove("converter");
// intentionally hidden attributes
attributes.remove("localValue");
- attributes.remove("value");
}
public Attributes getAttributes() {
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/HornetQInitializer.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/HornetQInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/HornetQInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * 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.listener;
-
-import java.util.HashSet;
-
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.PreDestroyApplicationEvent;
-import javax.faces.event.SystemEvent;
-import javax.faces.event.SystemEventListener;
-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;
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.application.push.PushContextFactory;
-import org.richfaces.tests.metamer.bean.VersionBean;
-import org.richfaces.tests.metamer.bean.VersionBean.FailToRetrieveInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Listener that initializes HornetQ in Tomcat.
- *
- * @author Nick Belaevski
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-public class HornetQInitializer implements SystemEventListener {
-
- private static Logger logger;
- private JMSServerManager serverManager;
-
- public HornetQInitializer() {
- logger = LoggerFactory.getLogger(getClass());
- }
-
- public void processEvent(SystemEvent event) throws AbortProcessingException {
- String serverType = null;
-
- try {
- serverType = VersionBean.getTomcatVersionInfo();
- } catch (FailToRetrieveInfo e) {
- serverType = e.getMessage();
- }
-
- if (serverType != null && serverType.contains("Tomcat")) {
- try {
- startHornetQ();
- } catch (Exception e) {
- throw new AbortProcessingException(e);
- }
-
- //force push context initialization so that its PreDestroyApplicationevent
listener is added before HornetQ stopper
- ServiceTracker.getService(PushContextFactory.class).getPushContext();
-
- Application application =
FacesContext.getCurrentInstance().getApplication();
- application.subscribeToEvent(PreDestroyApplicationEvent.class, this);
- } else {
- try {
- stopHornetQ();
- } catch (Exception e) {
- throw new AbortProcessingException(e);
- }
- }
- }
-
- private void stopHornetQ() throws Exception {
- if (serverManager != null) {
- logger.info("stopping HornetQ");
- serverManager.stop();
- serverManager = null;
- }
- }
-
- private void startHornetQ() throws Exception {
- logger.info("starting HornetQ");
-
- // create the Configuration and set the properties accordingly
- Configuration configuration = new ConfigurationImpl();
- configuration.setPersistenceEnabled(false);
- configuration.setSecurityEnabled(false);
-
- TransportConfiguration transpConf = new
TransportConfiguration(NettyAcceptorFactory.class.getName());
-
- HashSet<TransportConfiguration> setTransp = new
HashSet<TransportConfiguration>();
- setTransp.add(transpConf);
-
- configuration.setAcceptorConfigurations(setTransp);
-
- // create and start the server
- HornetQServer server = HornetQServers.newHornetQServer(configuration);
-
- serverManager = new JMSServerManagerImpl(server);
-
- //if you want to use JNDI, simple inject a context here or don't call this
method and make sure the JNDI parameters are set.
- InitialContext context = new InitialContext();
- serverManager.setContext(context);
- serverManager.start();
-
- ConnectionFactoryConfiguration connectionFactoryConfiguration = new
ConnectionFactoryConfigurationImpl("ConnectionFactory",
- new TransportConfiguration(NettyConnectorFactory.class.getName()),
(String) null);
- connectionFactoryConfiguration.setUseGlobalPools(false);
-
- serverManager.createConnectionFactory(false, connectionFactoryConfiguration,
"ConnectionFactory");
-
- serverManager.createTopic(false, "metamer",
"/topic/metamer");
- }
-
- public boolean isListenerForSource(Object source) {
- return true;
- }
-}
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * 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.listener;
-
-import java.text.MessageFormat;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.SystemEvent;
-import javax.faces.event.SystemEventListener;
-import javax.servlet.http.HttpServletRequest;
-
-import org.richfaces.application.push.Session;
-import org.richfaces.application.push.SessionPreSubscriptionEvent;
-import org.richfaces.application.push.SessionSubscriptionEvent;
-import org.richfaces.application.push.SessionTopicListener;
-import org.richfaces.application.push.SessionUnsubscriptionEvent;
-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;
-
-/**
- * Listener that subscribes to JMS topics.
- *
- * @author Nick Belaevski
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-public class TopicsInitializer implements SystemEventListener {
-
- private static Logger logger;
-
- public TopicsInitializer() {
- logger = LoggerFactory.getLogger(getClass());
- }
-
- public void processEvent(SystemEvent event) throws AbortProcessingException {
- TopicsContext topicsContext = TopicsContext.lookup();
-
- Topic topic = topicsContext.getOrCreateTopic(new TopicKey("metamer",
"xxx"));
-
- topic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
-
- topic.addTopicListener(new SessionTopicListener() {
-
- public void processUnsubscriptionEvent(SessionUnsubscriptionEvent event) {
- logger.info("unsubscibe from JMS topic");
- TopicKey topicKey = event.getTopicKey();
- Session session = event.getSession();
- System.out.println(MessageFormat.format("Session {0} disconnected
from {1}", session.getId(),
- topicKey.getTopicAddress()));
- }
-
- public void processSubscriptionEvent(SessionSubscriptionEvent event) {
- logger.info("subscibe to JMS topic");
- TopicKey topicKey = event.getTopicKey();
- Session session = event.getSession();
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- HttpServletRequest hsr = (HttpServletRequest)
facesContext.getExternalContext().getRequest();
-
- System.out.println(MessageFormat.format("Session {0} connected to
{1} from {2}", session.getId(),
- topicKey.getTopicAddress(), hsr.getRemoteAddr()));
- }
-
- public void processPreSubscriptionEvent(SessionPreSubscriptionEvent event) {
- logger.info("presubscription to JMS topic");
- ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
- }
- });
- }
-
- public boolean isListenerForSource(Object source) {
- return true;
- }
-}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/validation/SizeBean.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/validation/SizeBean.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/validation/SizeBean.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -28,13 +28,20 @@
/**
* Helper bean for testing JSR-303.
+ *
+ * This bean doesn't extend the {@link
org.richfaces.tests.metamer.validation.Validable}
+ * because of the {@link
https://issues.jboss.org/browse/RF-11710}.
*
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
* @version $Revision$
+ *
*/
@ManagedBean
-public class SizeBean extends Validable<List<String>> {
+public class SizeBean {
+ private List<String> value;
+
public SizeBean() {
value = new ArrayList<String>();
value.add("A");
@@ -42,22 +49,18 @@
}
@Size(min = 2, max = 4)
- @Override
public List<String> getValue() {
return value;
}
- @Override
public void setValue(List<String> intValue) {
this.value = intValue;
}
- @Override
public String getDescription() {
return "Selection size, from 2 to 4";
}
- @Override
public String getLabel() {
return "size";
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/MANIFEST.MF 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/MANIFEST.MF 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Class-Path:
-Dependencies: org.slf4j,org.jboss.as.process-controller
+Dependencies:
org.slf4j,org.jboss.as.process-controller,org.jboss.as.controller-client,org.jboss.dmr
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/context.xml
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/webapp/META-INF/context.xml)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/context.xml
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/META-INF/context.xml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/metamer"
useHttpOnly="false"/>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/faces-config.xml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/faces-config.xml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -4,18 +4,25 @@
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-listener-class>org.richfaces.demo.push.JMSInitializer</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-listener-class>org.richfaces.demo.push.TopicsInitializer</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.demo.push.JMSMessageProducerInitializer</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.demo.push.TopicsContextMessageProducerInitializer</system-event-listener-class>
+
<system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
+ </system-event-listener>
</application>
-
+
<lifecycle>
<phase-listener>org.richfaces.tests.metamer.RichPhaseListener</phase-listener>
</lifecycle>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -53,21 +53,12 @@
</context-param>
<filter>
- <filter-name>PushFilter</filter-name>
- <filter-class>org.richfaces.webapp.PushFilter</filter-class>
- <async-supported>true</async-supported>
- </filter>
- <filter>
<filter-name>Test Identity Filter</filter-name>
<filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
- <filter-name>PushFilter</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
- <filter-mapping>
<filter-name>Test Identity Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
@@ -109,4 +100,6 @@
<location>/faces/error/404.xhtml</location>
</error-page>
+
+
</web-app>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jPush/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jPush/simple.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jPush/simple.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -45,7 +45,7 @@
<ul class="push-list"></ul>
- <a4j:push address="xxx@metamer" onerror="alert('Error:
' + event.rf.data)"
+ <a4j:push address="xxx@pushTopicsContext"
onerror="alert('Error: ' + event.rf.data)"
ondataavailable="updateList(event.rf.data)" >
</a4j:push>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataScroller/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataScroller/simple.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataScroller/simple.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,10 +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:a4j="http://richfaces.org/a4j"
-
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
- <!--
+<!--
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
@@ -26,214 +26,218 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
- <ui:param name="componentId" value="richDataTable" />
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richDataTable" />
- <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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
- <ui:define name="head"/>
+ <ui:define name="head" />
- <ui:define name="outOfTemplateBefore">
- <br/>
+ <ui:define name="outOfTemplateBefore">
+ <br />
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataScrollerBean.state}">
- <a4j:ajax render="scroller1 #{nestedComponentId}"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- <rich:dataScroller id="scroller1"
-
for="#{richDataScrollerBean.attributes['for'].value}"
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richDataScrollerBean.state}">
+ <a4j:ajax render="scroller1 #{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+ <br />
+ <br />
+ <rich:dataScroller id="scroller1"
for="#{richDataScrollerBean.attributes['for'].value}"
+
boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
+ data="#{richDataScrollerBean.attributes['data'].value}"
+
execute="#{richDataScrollerBean.attributes['execute'].value}"
+
fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
+
fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
+
lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
+
limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
+
maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
+
onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
+
onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
+
oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
+ page="#{richDataScrollerBean.attributes['page'].value}"
+ render="#{richDataScrollerBean.attributes['render'].value}
#{nestedComponentId}"
+
renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
+
rendered="#{richDataScrollerBean.attributes['rendered'].value}"
+
status="#{richDataScrollerBean.attributes['status'].value}"
+
stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
+ style="#{richDataScrollerBean.attributes['style'].value}"
+
styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
+ title="#{richDataScrollerBean.attributes['title'].value}"
/>
+ </ui:define>
-
boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
-
data="#{richDataScrollerBean.attributes['data'].value}"
-
execute="#{richDataScrollerBean.attributes['execute'].value}"
-
fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
-
fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
-
lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
-
limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
-
maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
-
onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
-
onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
-
oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
-
page="#{richDataScrollerBean.attributes['page'].value}"
-
render="#{richDataScrollerBean.attributes['render'].value}
#{nestedComponentId}"
-
renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
-
rendered="#{richDataScrollerBean.attributes['rendered'].value}"
-
status="#{richDataScrollerBean.attributes['status'].value}"
-
stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
-
style="#{richDataScrollerBean.attributes['style'].value}"
-
styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
-
title="#{richDataScrollerBean.attributes['title'].value}"
- />
- </ui:define>
+ <ui:define name="component">
- <ui:define name="component">
+ <rich:dataTable id="richDataTable"
rows="#{richDataScrollerBean.tableAttributes['rows'].value}"
+ value="#{richDataScrollerBean.state ? model.capitals : null}"
var="record">
- <rich:dataTable id="richDataTable"
-
rows="#{richDataScrollerBean.tableAttributes['rows'].value}"
- value="#{richDataScrollerBean.state ? model.capitals :
null}"
- var="record"
- >
+ <f:facet name="noData">
+ <h:outputText value="There is no data." style="color:
red;" />
+ </f:facet>
- <f:facet name="noData">
- <h:outputText value="There is no data."
style="color: red;"/>
+ <rich:column id="columnState"
sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="State" />
</f:facet>
- <rich:column id="columnState"
sortBy="#{record.state}">
- <f:facet name="header">
- <h:outputText id="columnHeaderState"
value="State" />
- </f:facet>
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State" />
+ </f:facet>
+ </rich:column>
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState"
value="State" />
- </f:facet>
- </rich:column>
+ <rich:column id="columnCapital"
sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital"
value="Capital" />
+ </f:facet>
- <rich:column id="columnCapital"
sortBy="#{record.name}">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital"
value="Capital" />
- </f:facet>
-
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital"
value="Capital" />
- </f:facet>
- </rich:column>
-
+ <h:outputText value="#{record.name}" />
<f:facet name="footer">
- <rich:dataScroller id="scroller2"
-
-
boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
-
data="#{richDataScrollerBean.attributes['data'].value}"
-
execute="#{richDataScrollerBean.attributes['execute'].value}"
-
fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
-
fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
-
first="#{richDataScrollerBean.attributes['first'].value}"
-
lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
-
limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
-
maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
-
onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
-
onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
-
oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
-
page="#{richDataScrollerBean.attributes['page'].value}"
-
render="#{richDataScrollerBean.attributes['render'].value} scroller1"
-
renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
-
rendered="#{richDataScrollerBean.attributes['rendered'].value}"
-
status="#{richDataScrollerBean.attributes['status'].value}"
-
stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
-
style="#{richDataScrollerBean.attributes['style'].value}"
-
styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
-
title="#{richDataScrollerBean.attributes['title'].value}"
- />
+ <h:outputText id="columnFooterCapital"
value="Capital" />
</f:facet>
+ </rich:column>
- </rich:dataTable>
- </ui:define>
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
+
boundaryControls="#{richDataScrollerBean.attributes['boundaryControls'].value}"
+
data="#{richDataScrollerBean.attributes['data'].value}"
+
execute="#{richDataScrollerBean.attributes['execute'].value}"
+
fastControls="#{richDataScrollerBean.attributes['fastControls'].value}"
+
fastStep="#{richDataScrollerBean.attributes['fastStep'].value}"
+
first="#{richDataScrollerBean.attributes['first'].value}"
+
lastPageMode="#{richDataScrollerBean.attributes['lastPageMode'].value}"
+
limitRender="#{richDataScrollerBean.attributes['limitRender'].value}"
+
maxPages="#{richDataScrollerBean.attributes['maxPages'].value}"
+
onbegin="#{richDataScrollerBean.attributes['onbegin'].value}"
+
onbeforedomupdate="#{richDataScrollerBean.attributes['onbeforedomupdate'].value}"
+
oncomplete="#{richDataScrollerBean.attributes['oncomplete'].value}"
+
page="#{richDataScrollerBean.attributes['page'].value}"
+
render="#{richDataScrollerBean.attributes['render'].value} scroller1"
+
renderIfSinglePage="#{richDataScrollerBean.attributes['renderIfSinglePage'].value}"
+
rendered="#{richDataScrollerBean.attributes['rendered'].value}"
+
status="#{richDataScrollerBean.attributes['status'].value}"
+
stepControls="#{richDataScrollerBean.attributes['stepControls'].value}"
+
style="#{richDataScrollerBean.attributes['style'].value}"
+
styleClass="#{richDataScrollerBean.attributes['styleClass'].value}"
+
title="#{richDataScrollerBean.attributes['title'].value}" />
+ </f:facet>
- <ui:define name="outOfTemplateAfter">
- <fieldset><legend>JavaScript API - scroller1</legend>
- <h:commandButton id="buttonStpFirst1" value="««
first">
- <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
+ </rich:dataTable>
+ </ui:define>
- <h:commandButton id="buttonStpPrev1" value="«
previous">
- <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
- <f:param value="fastrewind" />
- </rich:componentControl>
- </h:commandButton>
+ <ui:define name="outOfTemplateAfter">
+ <fieldset>
+ <legend>JavaScript API - scroller1</legend>
+ <h:commandButton id="buttonStpFirst1" value="««
first">
+ <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpNext1" value="next
»">
- <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
- <f:param value="fastforward" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpPrev1" value="«
previous">
+ <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
+ <f:param value="fastrewind" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpLast1" value="last
»»">
- <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpNext1" value="next
»">
+ <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
+ <f:param value="fastforward" />
+ </rich:componentControl>
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonStpLast1" value="last
»»">
+ <rich:componentControl event="click"
target="scroller1" operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonFirst1" value="««
first">
- <rich:componentControl event="click"
target="scroller1" operation="first" />
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonPrev1" value="«
previous">
- <rich:componentControl event="click"
target="scroller1" operation="previous" />
- </h:commandButton>
+ <h:commandButton id="buttonFirst1" value="««
first">
+ <rich:componentControl event="click"
target="scroller1" operation="first" />
+ </h:commandButton>
- <h:commandButton id="buttonNext1" value="next
»">
- <rich:componentControl event="click"
target="scroller1" operation="next" />
- </h:commandButton>
+ <h:commandButton id="buttonPrev1" value="«
previous">
+ <rich:componentControl event="click"
target="scroller1" operation="previous" />
+ </h:commandButton>
- <h:commandButton id="buttonLast1" value="last
»»">
- <rich:componentControl event="click"
target="scroller1" operation="last" />
- </h:commandButton>
- </fieldset>
+ <h:commandButton id="buttonNext1" value="next »">
+ <rich:componentControl event="click"
target="scroller1" operation="next" />
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonLast1" value="last »»">
+ <rich:componentControl event="click"
target="scroller1" operation="last" />
+ </h:commandButton>
+ </fieldset>
- <fieldset><legend>JavaScript API - scroller2</legend>
- <h:commandButton id="buttonStpFirst2" value="««
first">
- <rich:componentControl event="click"
target="scroller2" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonStpPrev2" value="«
previous">
- <rich:componentControl event="click"
target="scroller2" operation="switchToPage">
- <f:param value="fastrewind" />
- </rich:componentControl>
- </h:commandButton>
+ <fieldset>
+ <legend>JavaScript API - scroller2</legend>
+ <h:commandButton id="buttonStpFirst2" value="««
first">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpNext2" value="next
»">
- <rich:componentControl event="click"
target="scroller2" operation="switchToPage">
- <f:param value="fastforward" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpPrev2" value="«
previous">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="fastrewind" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonStpLast2" value="last
»»">
- <rich:componentControl event="click"
target="scroller2" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
+ <h:commandButton id="buttonStpNext2" value="next
»">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="fastforward" />
+ </rich:componentControl>
+ </h:commandButton>
- <br/>
+ <h:commandButton id="buttonStpLast2" value="last
»»">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
- <h:commandButton id="buttonFirst2" value="««
first">
- <rich:componentControl event="click"
target="scroller2" operation="first" />
- </h:commandButton>
+ <br />
- <h:commandButton id="buttonPrev2" value="«
previous">
- <rich:componentControl event="click"
target="scroller2" operation="previous" />
- </h:commandButton>
+ <h:commandButton id="buttonFirst2" value="««
first">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="first" />
+ </h:commandButton>
- <h:commandButton id="buttonNext2" value="next
»">
- <rich:componentControl event="click"
target="scroller2" operation="next" />
- </h:commandButton>
+ <h:commandButton id="buttonPrev2" value="«
previous">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="previous" />
+ </h:commandButton>
- <h:commandButton id="buttonLast2" value="last
»»">
- <rich:componentControl event="click"
target="scroller2" operation="last" />
- </h:commandButton>
- </fieldset>
+ <h:commandButton id="buttonNext2" value="next »">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="next" />
+ </h:commandButton>
- <br/><br/>
- <h2>Attributes</h2>
- <metamer:attributes value="#{richDataScrollerBean.attributes}"
id="attributes" />
- <h2>Table Attributes</h2>
- <metamer:attributes
value="#{richDataScrollerBean.tableAttributes}" id="tableAttributes"
/>
- </ui:define>
+ <h:commandButton id="buttonLast2" value="last »»">
+ <rich:componentControl event="click"
target="#{templateBean.componentPrefix}richDataTable:scroller2"
+ operation="last" />
+ </h:commandButton>
+ </fieldset>
- </ui:composition>
+ <br />
+ <br />
+ <h2>Attributes</h2>
+ <metamer:attributes value="#{richDataScrollerBean.attributes}"
id="attributes" />
+ <h2>Table Attributes</h2>
+ <metamer:attributes value="#{richDataScrollerBean.tableAttributes}"
id="tableAttributes" />
+ </ui:define>
+
+</ui:composition>
</html>
\ No newline at end of file
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components1.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components1.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -54,8 +54,6 @@
<ui:define name="component">
<rich:dataTable id="richDataTable"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components2.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components2.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/components2.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -55,8 +55,6 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/facets.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/facets.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/facets.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -54,8 +54,6 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/filtering.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/filtering.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/filtering.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -55,8 +55,6 @@
<ui:define name="component">
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/scroller.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/scroller.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/scroller.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -58,8 +58,6 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/simple.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/simple.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -54,8 +54,6 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -56,8 +56,6 @@
<rich:dataTable id="richDataTable"
binding="#{richDataTableBean.binding}"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -55,8 +55,6 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
-
cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_1.xhtml
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/RF-11730_1.xhtml)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_1.xhtml
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_1.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,133 @@
+<?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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head">
+ <style type="text/css">
+ .rf-ddm-lbl-unsel {
+ border:1px solid #{a4jSkin.panelBorderColor} !important;
+ }
+
+ .optionList {
+ height: 22px;
+ }
+
+ .vertical-menu-cell {
+ padding: 0px 4px 0px 4px;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <i>This menu contains conditionally rendered menu item (labeled
'Menu group 1,2 or Empty Menu Group')
+ placed after item labeled 'Print'<br/>
+ Using ui:fragment with @rendered causes error, and this option is not
displayed, even condition is met.
+ </i>
+ <br/>
+ <br/>
+
+ <!-- component -->
+ <rich:toolbar id="toolbar" height="26px">
+ <rich:toolbarGroup id="openedTabs"
location="left">
+ <rich:dropDownMenu id="menu-opened-tabs">
+ <f:facet name="label">
+ <h:graphicImage library="images/icons"
name="copy.gif" styleClass="pic" />
+ </f:facet>
+
+ <rich:menuItem id="menuItem1" label="New"
action="#{richDropDownMenuBean.doNew}"
icon="/resources/images/icons/create_doc.gif"/>
+
+ <rich:menuItem id="menuItem2" label="Open"
action="#{richDropDownMenuBean.doOpen}"
icon="/resources/images/icons/open.gif" />
+
+ <rich:menuGroup id="menuGroup3" label="Open
Recent..." disabled="true">
+ <rich:menuItem id="menuItem31"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem32" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ </rich:menuGroup>
+
+ <rich:menuSeparator id="menuSeparator11" />
+
+ <rich:menuGroup id="menuGroup4" label="Save
As...">
+ <rich:menuItem id="menuItem41"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem42" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem id="menuItem43" label="Send
Online" icon="/resources/images/icons/save.gif" disabled="true"
/>
+ </rich:menuGroup>
+
+ <rich:menuItem id="menuItem5"
label="Print" action="#{richDropDownMenuBean.doPrint}"
disabled="true"/>
+
+ <ui:fragment rendered="${empty
richDropDownMenuBean.dynamicMenuGroups}" >
+ <rich:menuItem label="Empty Menu Group" />
+ </ui:fragment>
+
+ <ui:fragment rendered="${not empty
richDropDownMenuBean.dynamicMenuGroups}" >
+ <c:forEach
items="#{richDropDownMenuBean.dynamicMenuGroups}" var="tab">
+ <rich:menuGroup id="menu-group-#{tab.label}"
label="#{tab.description}">
+ <rich:menuItem label="Sub Item 1"
/>
+ <rich:menuItem label="Sub Item 2"
/>
+ </rich:menuGroup>
+ </c:forEach>
+ </ui:fragment>
+
+ <rich:menuSeparator id="menuSeparator12" />
+ <rich:menuItem id="menuItem7" label="Exit"
action="#{richDropDownMenuBean.doExit}" />
+
+ </rich:dropDownMenu>
+ </rich:toolbarGroup>
+ </rich:toolbar>
+
+ <br/>
+ <a4j:commandButton id="a4jButton" value="[a4j] Change list
of tabs" render="menu-opened-tabs"
+ actionListener="${richDropDownMenuBean.changeTabList}" />
+
+ <br/><br/>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_2.xhtml
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/RF-11730_2.xhtml)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_2.xhtml
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/RF-11730_2.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,133 @@
+<?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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head">
+ <style type="text/css">
+ .rf-ddm-lbl-unsel {
+ border:1px solid #{a4jSkin.panelBorderColor} !important;
+ }
+
+ .optionList {
+ height: 22px;
+ }
+
+ .vertical-menu-cell {
+ padding: 0px 4px 0px 4px;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <i>This menu contains conditionally rendered menu item (labeled
'Menu group 1,2 or Empty Menu Group')
+ placed after item labeled 'Print'<br/>
+ In this example is c:if with @test used and everything should work as
expected.
+ </i>
+ <br/>
+ <br/>
+
+ <!-- component -->
+ <rich:toolbar id="toolbar" height="26px">
+ <rich:toolbarGroup id="openedTabs"
location="left">
+ <rich:dropDownMenu id="menu-opened-tabs">
+ <f:facet name="label">
+ <h:graphicImage library="images/icons"
name="copy.gif" styleClass="pic" />
+ </f:facet>
+
+ <rich:menuItem id="menuItem1" label="New"
action="#{richDropDownMenuBean.doNew}"
icon="/resources/images/icons/create_doc.gif"/>
+
+ <rich:menuItem id="menuItem2" label="Open"
action="#{richDropDownMenuBean.doOpen}"
icon="/resources/images/icons/open.gif" />
+
+ <rich:menuGroup id="menuGroup3" label="Open
Recent..." disabled="true">
+ <rich:menuItem id="menuItem31"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem32" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ </rich:menuGroup>
+
+ <rich:menuSeparator id="menuSeparator11" />
+
+ <rich:menuGroup id="menuGroup4" label="Save
As...">
+ <rich:menuItem id="menuItem41"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem42" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem id="menuItem43" label="Send
Online" icon="/resources/images/icons/save.gif" disabled="true"
/>
+ </rich:menuGroup>
+
+ <rich:menuItem id="menuItem5"
label="Print" action="#{richDropDownMenuBean.doPrint}"
disabled="true"/>
+
+ <c:if test="${empty
richDropDownMenuBean.dynamicMenuGroups}" >
+ <rich:menuItem label="Empty Menu Item" />
+ </c:if>
+
+ <c:if test="${not empty
richDropDownMenuBean.dynamicMenuGroups}" >
+ <c:forEach
items="#{richDropDownMenuBean.dynamicMenuGroups}" var="tab">
+ <rich:menuGroup id="menu-group-#{tab.label}"
label="#{tab.description}">
+ <rich:menuItem label="Sub Item 1"
/>
+ <rich:menuItem label="Sub Item 2"
/>
+ </rich:menuGroup>
+ </c:forEach>
+ </c:if>
+
+ <rich:menuSeparator id="menuSeparator12" />
+ <rich:menuItem id="menuItem7" label="Exit"
action="#{richDropDownMenuBean.doExit}" />
+
+ </rich:dropDownMenu>
+ </rich:toolbarGroup>
+ </rich:toolbar>
+
+ <br/>
+ <a4j:commandButton id="a4jButton" value="[a4j] Change list
of tabs" render="menu-opened-tabs"
+ actionListener="${richDropDownMenuBean.changeTabList}" />
+
+ <br/><br/>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/list.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/list.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richDropDownMenu/list.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -38,6 +38,16 @@
<metamer:testPageLink id="sideMenu" outcome="sideMenu"
value="Side Menu">
Page containing several <b>rich:dropDownMenu</b>s and inputs
for all attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="RF-11730_1"
outcome="RF-11730_1" value="RF-11730 with ui:fragment">
+ Page containing <b>rich:dropDownMenu</b> with dynamic menu
groups using ui:fragment and @rendered
+ simulating <a
href="https://issues.jboss.org/browse/RF-11730">RF-11730<...
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="RF-11730_2"
outcome="RF-11730_2" value="RF-11730 with c:if">
+ Page containing <b>rich:dropDownMenu</b> with dynamic menu
groups using c:if and @test
+ simulating <a
href="https://issues.jboss.org/browse/RF-11730">RF-11730<...
+ </metamer:testPageLink>
</ui:define>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -101,8 +101,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -94,8 +94,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -58,8 +58,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -91,8 +91,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -60,8 +60,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -66,8 +66,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -58,8 +58,6 @@
<ui:define name="component">
<rich:extendedDataTable id="richEDT"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -92,8 +92,6 @@
<rich:extendedDataTable id="richEDT"
binding="#{richExtendedDataTableBean.binding}"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -92,8 +92,6 @@
<rich:extendedDataTable id="richEDT"
binding="#{richExtendedDataTableBean.binding}"
-
cellspacing="#{richExtendedDataTableBean.attributes['cellspacing'].value}"
-
cellpadding="#{richExtendedDataTableBean.attributes['cellpadding'].value}"
columnClasses="#{richExtendedDataTableBean.attributes['columnClasses'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
footerClass="#{richExtendedDataTableBean.attributes['footerClass'].value}"
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/columnLayout.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/columnLayout.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/columnLayout.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -95,7 +95,7 @@
ontargetdblclick="#{richPickListBean.attributes['ontargetdblclick'].value}"
ontargetkeydown="#{richPickListBean.attributes['ontargetkeydown'].value}"
ontargetkeypress="#{richPickListBean.attributes['ontargetkeypress'].value}"
-
ntargetkeyup="#{richPickListBean.attributes['ontargetkeyup'].value}"
+
ontargetkeyup="#{richPickListBean.attributes['ontargetkeyup'].value}"
ontargetmousedown="#{richPickListBean.attributes['ontargetmousedown'].value}"
ontargetmousemove="#{richPickListBean.attributes['ontargetmousemove'].value}"
ontargetmouseout="#{richPickListBean.attributes['ontargetmouseout'].value}"
@@ -112,6 +112,8 @@
sourceCaption="#{richPickListBean.attributes['sourceCaption'].value}"
style="#{richPickListBean.attributes['style'].value}"
styleClass="#{richPickListBean.attributes['styleClass'].value}"
+
switchByClick="#{richPickListBean.attributes['switchByClick'].value}"
+
switchByDblClick="#{richPickListBean.attributes['switchByDblClick'].value}"
targetCaption="#{richPickListBean.attributes['targetCaption'].value}"
upText="#{richPickListBean.attributes['upText'].value}"
upTopText="#{richPickListBean.attributes['upTopText'].value}"
@@ -161,4 +163,4 @@
</ui:define>
</ui:composition>
-</html>
\ No newline at end of file
+</html>
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/lazyLoading.xhtml
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/lazyLoading.xhtml)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/lazyLoading.xhtml
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/lazyLoading.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-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="component">
+
+ <rich:tabPanel id="tabpanel" switchType="ajax"
activeItem="#{richTabPanelBean.attributes['activeItem'].value}">
+
+ <rich:tab id="tab1" header="Tab 1">
+ Here is tab #1
+ </rich:tab>
+
+ <rich:tab id="tab2" header="Tab 2">
+ <rich:dataTable value="#{richTabPanelBean.testListA}"
var="item" rows="10">
+ <rich:column>
+ <f:facet name="header">
+ List A
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ </rich:dataTable>
+ </rich:tab>
+ <rich:tab id="tab3" header="Tab 3">
+ <rich:dataTable value="#{richTabPanelBean.testListB}"
var="item" rows="10">
+ <rich:column>
+ <f:facet name="header">
+ List B
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ </rich:dataTable>
+ </rich:tab>
+ </rich:tabPanel>
+
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/list.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/list.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTabPanel/list.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -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:ui="http://java.sun.com/jsf/facelets"
-
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
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
@@ -25,26 +26,31 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
- <ui:composition template="/templates/list.xhtml">
+<ui:composition template="/templates/list.xhtml">
- <ui:define name="pageTitle">Rich Tab Panel</ui:define>
+ <ui:define name="pageTitle">Rich Tab Panel</ui:define>
- <ui:define name="links">
+ <ui:define name="links">
- <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
Simple page containing <b>rich:tabPanel</b> and input boxes
for all its attributes.
</metamer:testPageLink>
-
- <metamer:testPageLink id="addTab" outcome="addTab"
value="Add tab v1">
- Simple page containing <b>rich:tabPanel</b> and buttons for
create new tabs using binding
+
+ <metamer:testPageLink id="addTab" outcome="addTab"
value="Add Tab v1">
+ Simple page containing <b>rich:tabPanel</b> and buttons for
creating new tabs using binding.
</metamer:testPageLink>
-
- <metamer:testPageLink id="addTab2" outcome="addTab2"
value="Add tab v2">
- Simple page containing <b>rich:tabPanel</b> and buttons for
create new tabs
+
+ <metamer:testPageLink id="addTab2" outcome="addTab2"
value="Add Tab v2">
+ Simple page containing <b>rich:tabPanel</b> and buttons for
creating new tabs.
</metamer:testPageLink>
- </ui:define>
+ <metamer:testPageLink id="lazyLoading"
outcome="lazyLoading" value="Lazy Loading">
+ Simple page containing <b>rich:tabPanel</b> demonstrating
that ajax-switching tabs causes all tabs to load
+ (<h:outputLink id="jiraRF11782"
value="https://issues.jboss.org/browse/RF-11782">RF-11782<...>).
+ </metamer:testPageLink>
- </ui:composition>
+ </ui:define>
+</ui:composition>
+
</html>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/list.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/list.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/list.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -32,16 +32,20 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple"
value="Simple">
- The sample of <b>rich:tooltip</b> by default targeted to its
parent (rich:panel).
- </metamer:testPageLink>
+ The sample of <b>rich:tooltip</b> by default targeted to its
parent (rich:panel). The tooltip text is defined in inner text of the
<b>rich:tooltip</b> element.
+ </metamer:testPageLink>
+ <metamer:testPageLink id="value" outcome="value"
value="With Value Attribute">
+ The sample of <b>rich:tooltip</b> by default targeted to its
parent (rich:panel). The tooltip text is defined in value attribute of the
<b>rich:tooltip</b> element.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="targetting" outcome="targetting"
value="Targetting">
The sample of <b>rich:tooltip</b> with ability to change
target.
- </metamer:testPageLink>
+ </metamer:testPageLink>
<metamer:testPageLink id="rf10960" outcome="rf10960"
value="RF-10960">
Page demonstrating problems with tooltip in IE7.
- </metamer:testPageLink>
+ </metamer:testPageLink>
</ui:define>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/simple.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -87,6 +87,7 @@
style="#{richTooltipBean.attributes['style'].value}"
styleClass="#{richTooltipBean.attributes['styleClass'].value}"
title="#{richTooltipBean.attributes['title'].value}"
+
value="#{richTooltipBean.attributes['value'].value}"
verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
zindex="#{richTooltipBean.attributes['zindex'].value}"
Copied:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/value.xhtml
(from rev 23067,
modules/tests/metamer/trunk/application/src/main/webapp/components/richTooltip/value.xhtml)
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/value.xhtml
(rev 0)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTooltip/value.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -0,0 +1,103 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich" >
+
+ <!--
+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">
+ <style type="text/css">
+ .sample-panel {
+ border: 1px solid black;
+ background: white;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:panel id="panel" style="width: 200px">
+
+ Panel's content 8
+
+ <rich:tooltip id="tooltip"
+
attached="#{richTooltipBean.attributes['attached'].value}"
+
data="#{richTooltipBean.attributes['data'].value}"
+
dir="#{richTooltipBean.attributes['dir'].value}"
+
direction="#{richTooltipBean.attributes['direction'].value}"
+
followMouse="#{richTooltipBean.attributes['followMouse'].value}"
+
hideDelay="#{richTooltipBean.attributes['hideDelay'].value}"
+
hideEvent="#{richTooltipBean.attributes['hideEvent'].value}"
+
horizontalOffset="#{richTooltipBean.attributes['horizontalOffset'].value}"
+
jointPoint="#{richTooltipBean.attributes['jointPoint'].value}"
+
lang="#{richTooltipBean.attributes['lang'].value}"
+
layout="#{richTooltipBean.attributes['layout'].value}"
+
limitRender="#{richTooltipBean.attributes['limitRender'].value}"
+
mode="#{richTooltipBean.attributes['mode'].value}"
+
onbeforehide="#{richTooltipBean.attributes['onbeforehide'].value}"
+
onbeforeshow="#{richTooltipBean.attributes['onbeforeshow'].value}"
+
onclick="#{richTooltipBean.attributes['onclick'].value}"
+
ondblclick="#{richTooltipBean.attributes['ondblclick'].value}"
+
onhide="#{richTooltipBean.attributes['onhide'].value}"
+
onmousedown="#{richTooltipBean.attributes['onmousedown'].value}"
+
onmousemove="#{richTooltipBean.attributes['onmousemove'].value}"
+
onmouseout="#{richTooltipBean.attributes['onmouseout'].value}"
+
onmouseover="#{richTooltipBean.attributes['onmouseover'].value}"
+
onmouseup="#{richTooltipBean.attributes['onmouseup'].value}"
+
onbegin="#{richTooltipBean.attributes['onbegin'].value}"
+
onbeforedomupdate="#{richTooltipBean.attributes['onbeforedomupdate'].value}"
+
oncomplete="#{richTooltipBean.attributes['oncomplete'].value}"
+
onshow="#{richTooltipBean.attributes['onshow'].value}"
+
render="#{richTooltipBean.attributes['render'].value}"
+
rendered="#{richTooltipBean.attributes['rendered'].value}"
+
showDelay="#{richTooltipBean.attributes['showDelay'].value}"
+
showEvent="#{richTooltipBean.attributes['showEvent'].value}"
+
status="#{richTooltipBean.attributes['status'].value}"
+
style="#{richTooltipBean.attributes['style'].value}"
+
styleClass="#{richTooltipBean.attributes['styleClass'].value}"
+
title="#{richTooltipBean.attributes['title'].value}"
+
value="#{richTooltipBean.attributes['value'].value}"
+
verticalOffset="#{richTooltipBean.attributes['verticalOffset'].value}"
+
zindex="#{richTooltipBean.attributes['zindex'].value}"
+ />
+ </rich:panel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richTooltipBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/resources/script/push.js
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/resources/script/push.js 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/resources/script/push.js 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,5 +1,6 @@
function updateList(data) {
author = '<span style="font-weight:bold"
class="author">' + data.author + '</span>: ';
message = '<span class="message">' + data.text +
'</span>';
- jQuery("ul.push-list").append('<li>' + author + message +
'</li>');
+ timestamp = ' <span>[' + data.timestamp + ']</span>';
+ jQuery("ul.push-list").append('<li>' + author + message +
timestamp + '</li>');
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/header.xhtml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -87,6 +87,13 @@
updateStatusChecker();
</script>
</a4j:outputPanel>
+
+ <h:outputLabel id="jsFunctionCheckerLabel"
value="jsFunction Checker" for="jsFunctionChecker"/>
+ <a4j:outputPanel id="jsFunctionChecker">
+ <h:outputText value="#{phasesBean.date}">
+ <f:convertDateTime pattern="HH:MM:ss.SSS" />
+ </h:outputText>
+ </a4j:outputPanel>
<!--
TODO: disabled because of MyFaces issue: MYFACES-3061 (RF-10668)
@@ -95,6 +102,7 @@
ui:debug hotkey="L"
-->
+ <a4j:jsFunction name="functionChecker"
render="jsFunctionChecker"/>
</h:panelGrid>
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml 2011-12-12 11:04:27
UTC (rev 23067)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml 2011-12-12 13:51:30
UTC (rev 23068)
@@ -31,7 +31,7 @@
<groupId>org.richfaces.tests</groupId>
<artifactId>metamer-ftest</artifactId>
- <version>4.1.0-CR1-redhat-1</version>
+ <version>4.1.0.CR2-redhat-1</version>
<name>Metamer: RichFaces Testing Application - Functional Test</name>
<packaging>pom</packaging>
@@ -81,8 +81,8 @@
<properties>
<context.path>/metamer/</context.path>
<deployable.classifier>mojarra</deployable.classifier>
- <deployable.version>4.1.0-CR1-redhat-1</deployable.version>
- <ftest.source.version>4.1.0-CR1-redhat-1</ftest.source.version>
+ <deployable.version>4.1.0.CR2-redhat-1</deployable.version>
+ <ftest.source.version>4.1.0.CR2-redhat-1</ftest.source.version>
<testng.suite.xml>src/test/resources/testng.xml</testng.suite.xml>
<container.home>target/installs/${container.dir.deflatted}/${container.dir.unflatted}</container.home>
<jsf.config>Mojarra-2.0</jsf.config>
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml 2011-12-12
11:04:27 UTC (rev 23067)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml 2011-12-12
13:51:30 UTC (rev 23068)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.richfaces.tests</groupId>
<artifactId>metamer-root</artifactId>
- <version>4.1.0-CR1-redhat-1</version>
+ <version>4.1.0.CR2-redhat-1</version>
</parent>
<artifactId>metamer-ftest-source</artifactId>
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -74,6 +74,8 @@
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import com.thoughtworks.selenium.SeleniumException;
+
/**
* Abstract test case used as a basis for majority of test cases.
*
@@ -88,12 +90,14 @@
public static final long TIMEOUT = 5000;
protected JQueryLocator time = jq("span[id$=requestTime]");
+ protected JQueryLocator jsFunctionChecker =
jq("span[id$=jsFunctionChecker]");
protected JQueryLocator renderChecker = jq("span[id$=renderChecker]");
protected JQueryLocator statusChecker =
jq("span[id$=statusCheckerOutput]");
protected IdLocator fullPageRefreshIcon =
id("controlsForm:fullPageRefreshImage");
protected IdLocator rerenderAllIcon = id("controlsForm:reRenderAllImage");
protected TextRetriever retrieveRequestTime = retrieveText.locator(time);
protected Retriever<String> retrieveWindowData = new
ScriptEvaluationRetriever().script(js("window.data"));
+ protected TextRetriever retrieveJsFunctionChecker =
retrieveText.locator(jsFunctionChecker);
protected TextRetriever retrieveRenderChecker =
retrieveText.locator(jq("#renderChecker"));
protected TextRetriever retrieveStatusChecker =
retrieveText.locator(jq("#statusCheckerOutput"));
protected PhaseInfo phaseInfo = new PhaseInfo();
@@ -373,22 +377,35 @@
* locator of tested element
*/
protected void testLang(ElementLocator<?> element) {
- JavaScript getAttributeLang = null;
- if (SystemProperties.getBrowser().getType() == BrowserType.FIREFOX) {
- getAttributeLang = new JavaScript("window.jQuery('" +
element.getRawLocator() + "').attr('lang')");
- } else {
- getAttributeLang = new JavaScript("window.jQuery('" +
element.getRawLocator() + "').attr('xml:lang')");
- }
-
+// JavaScript getAttributeLang = null;
+// if (SystemProperties.getBrowser().getType() == BrowserType.FIREFOX) {
+// getAttributeLang = new JavaScript("window.jQuery('" +
element.getRawLocator() + "').attr('lang')");
+// } else {
+// getAttributeLang = new JavaScript("window.jQuery('" +
element.getRawLocator() + "').attr('xml:lang')");
+// }
+//
+// // lang = null
+// String langAttr = selenium.getEval(getAttributeLang);
+// assertTrue("null".equals(langAttr) || "".equals(langAttr),
"Attribute xml:lang should not be present.");
+//
+// selenium.type(pjq("input[type=text][id$=langInput]"),
"sk");
+// selenium.waitForPageToLoad();
+//
+ // lang = sk
+// assertEquals(selenium.getEval(getAttributeLang), "sk",
"Attribute xml:lang should be present.");
+
// lang = null
- String langAttr = selenium.getEval(getAttributeLang);
- assertTrue("null".equals(langAttr) || "".equals(langAttr),
"Attribute xml:lang should not be present.");
+ try {
+ String attrValue =
selenium.getAttribute(element.getAttribute(Attribute.LANG));
+ assertEquals(attrValue.trim(), "", "The attribute
'lang' shouldn't be present.");
+ } catch(SeleniumException ignored) {}
selenium.type(pjq("input[type=text][id$=langInput]"), "sk");
selenium.waitForPageToLoad();
-
+
// lang = sk
- assertEquals(selenium.getEval(getAttributeLang), "sk", "Attribute
xml:lang should be present.");
+ String attrValue = selenium.getAttribute(element.getAttribute(Attribute.LANG));
+ assertEquals(attrValue, "sk", "The attribute 'lang' should
be present.");
}
/**
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/PhaseInfo.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -39,6 +39,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.retrievers.RetrieverFactory;
import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
/**
* Retrieves and asserts the info about life-cycle.
@@ -107,6 +108,25 @@
}
}
+ public SeleniumCondition getListenerCondition(final PhaseId phaseId, final String
message) {
+ return new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ initialize();
+ Set<String> set = map.get(phaseId);
+ if (set != null && set.size() > 0) {
+ for (String description : set) {
+ if (description.contains(message)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ };
+
+ }
+
private void initialize() {
if (retrieveRequestTime.isValueChanged()) {
map.clear();
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -48,9 +48,8 @@
private static final int STATUS_CODE_OK = 200;
- protected PushAttributes pushAttributes = new PushAttributes();
-
private JQueryLocator outputCounter = pjq("span[id$=outputCounter]");
+ protected JQueryLocator outputList = pjq("ul.push-list");
private HttpClient httpClient;
private HttpMethod pushMethod;
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * 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.a4jPush;
-
-import static org.jboss.test.selenium.locator.LocatorFactory.id;
-import static org.jboss.test.selenium.SeleniumGetter.*;
-
-import org.jboss.test.selenium.framework.AjaxSelenium;
-import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
-import org.jboss.test.selenium.locator.IdLocator;
-
-/**
- * The control point for setting different attributes for a4j:push test page.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class PushAttributes {
-
- private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
- private IdLocator attributeInterval = id("form:attributes:intervalInput");
-
- public void setInterval(long miliseconds) {
- selenium.type(attributeInterval, String.valueOf(miliseconds));
- selenium.waitForPageToLoad();
- }
-
- public long getInterval() {
- return getValue(attributeInterval).asLong();
- }
-}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -53,8 +53,7 @@
*/
@Test(enabled = false)
public void testSimple() throws HttpException, IOException {
- pushAttributes.setInterval(SIMPLE_INTERVAL);
-
+
int beginCounter = getCounter();
pushAndWait(1);
int endCounter = getCounter();
Deleted:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * 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.a4jPush;
-
-import static org.jboss.test.selenium.utils.PrimitiveUtils.asLong;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.io.IOException;
-
-import org.apache.commons.httpclient.HttpException;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Templates;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.testng.annotations.Test;
-
-/**
- * Tests the interval attribute for a4j:push
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestInterval extends AbstractPushTest {
-
- private static final int DEFAULT_COUNTER_STEP = 2;
- private static final int ITERATION_COUNT = 3;
- private static final int MULTIPLE_PUSH_COUNT = 5;
-
- @Inject
- int interval;
-
- AttributeLocator<?> clientTime =
pjq("span[id$=clientDate\\:outputTime]").getAttribute(Attribute.TITLE);
-
- long startTime;
- int counter;
- int counterStep;
-
- long deviationTotal = 0;
- long deviationCount = 0;
-
- /**
- * <p>
- * For interval 1000, test that the interval between push event triggered and event
observered by client haven't
- * greater deviation than the one interval.
- * </p>
- *
- * <p>
- * First set the given interval into the interval attribute.
- * </p>
- *
- * <p>
- * Then push and wait for result of update triggered by observation of push event.
- * </p>
- *
- * <p>
- * Then repeat push and wait 6 times with 1 event triggered and 5 fast events
triggered in sequence.
- * </p>
- */
- @Test(enabled = false)
- @Use(field = "interval", ints = { 1000 })
- public void testClientAllTemplates() throws HttpException, IOException {
- testClient();
- }
-
- /**
- * <p>
- * For interval two different values (small and big), test that the interval between
push event triggered and event
- * observered by client haven't greater deviation than the one interval.
- * </p>
- *
- * <p>
- * First set the given interval into the interval attribute.
- * </p>
- *
- * <p>
- * Then push and wait for result of update triggered by observation of push event.
- * </p>
- *
- * <p>
- * Then repeat push and wait 6 times with 1 event triggered and 5 fast events
triggered in sequence.
- * </p>
- */
- @Test(enabled = false)
- @Use(field = "interval", ints = { 500, 5000 })
- @Templates(value = "plain")
- public void testClientDifferentIntervals() throws HttpException, IOException {
- testClient();
- }
-
- private void testClient() throws HttpException, IOException {
- counterStep = DEFAULT_COUNTER_STEP;
- pushAttributes.setInterval(interval);
-
- pushAndWait(1);
- for (int i = 0; i < ITERATION_COUNT; i++) {
- startIntervalAndCounter();
- pushAndWait(1);
- validateIntervalAndCounter();
-
- startIntervalAndCounter();
- pushAndWait(MULTIPLE_PUSH_COUNT);
- validateIntervalAndCounter();
- }
-
- validateAverageDeviation();
- }
-
- /**
- * Remembers start of the time frame and current value of counter.
- */
- private void startIntervalAndCounter() {
- startTime = getClientTime();
- counter = getCounter();
- }
-
- /**
- * <p>
- * Obtains current value of counter and end of the time frame to compute the run
time.
- * </p>
- *
- * <p>
- * Validates that run time haven't greater deviation from given maximum {@link
#MAX_DEVIATION}.
- * </p>
- *
- * <p>
- * Remembers the deviation as part of total deviation for computing average value.
- * </p>
- *
- * <p>
- * Validates that counter have been increased by right value.
- * </p>
- */
- private void validateIntervalAndCounter() {
- long runTime = getClientTime() - startTime;
- long deviation = Math.abs(interval - runTime);
-
- if (seleniumDebug) {
- System.out.println(format("deviation for interval {0}: {1}",
interval, deviation));
- }
-
- assertTrue(deviation <= (2 * interval),
- format("Deviation ({0}) is greater than two intervals (2 * {1})",
deviation, interval));
-
- deviationTotal += deviation;
- deviationCount += 1;
-
- int newCounter = getCounter();
- assertEquals(newCounter, counter + counterStep);
- counter = newCounter;
-
- }
-
- /**
- * Validates the average deviations from intervals.
- */
- private void validateAverageDeviation() {
- long maximumAvgDeviation = Math.min(interval / 4, 1000);
- long averageDeviation = deviationTotal / deviationCount;
- if (seleniumDebug) {
- System.out.println("averageDeviation: " + averageDeviation);
- }
- assertTrue(
- averageDeviation <= maximumAvgDeviation,
- format("Average deviation for all the intervals ({0}) should not be
greater than defined maximum {1}",
- averageDeviation, maximumAvgDeviation));
- }
-
- /**
- * Returns the time of push event (the time when arrived the response from server)
- *
- * @return the time of push event (the time when arrived the response from server)
- */
- private long getClientTime() {
- waitGui.until(attributePresent.locator(clientTime));
- return asLong(selenium.getAttribute(clientTime));
- }
-}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -61,7 +61,7 @@
* Tests delay between time last event occurs and time when event triggers request
(begin).
*/
@Test
- @Use(field = "requestDelay", ints = { 0, 500, 1500, 5000 })
+ @Use(field = "requestDelay", ints = { 0, 750, 1500, 5000 })
public void testRequestDelay() {
attributes.set(QueueAttributes.requestDelay, requestDelay);
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -25,6 +25,7 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.testng.Assert.fail;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
@@ -116,14 +117,27 @@
if (lastPage != null && (pageNumber < 1 || pageNumber > lastPage))
{
throw new IllegalStateException(SimplifiedFormat.format("The given
pageNumber '{0}' is out of range of pages <1,{1}>", pageNumber,
lastPage));
}
- while (pageNumber > getLastVisiblePage()) {
+
+ int counter = 50; // to prevent infinite loops
+ while (pageNumber > getLastVisiblePage() && counter > 0) {
fastForward(pageNumber);
+ counter--;
}
- while (pageNumber < getFirstVisiblePage()) {
+ if (counter == 0) {
+ fail("Scroller doesn't change pages.");
+ }
+
+ counter = 50; // to prevent inifinite loops
+ while (pageNumber < getFirstVisiblePage() && counter > 0) {
fastRewind(pageNumber);
+ counter--;
}
+ if (counter == 0) {
+ fail("Scroller doesn't change pages.");
+ }
+
if (pageNumber == getCurrentPage()) {
return;
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestDataScrollerAttributes.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -48,19 +48,20 @@
*
* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
-@Use(field = "scroller", value = {"scrollerOutsideTable",
"scrollerInsideTable"})
+@Use(field = "scroller", value = { "scrollerOutsideTable",
"scrollerInsideTable" })
public class TestDataScrollerAttributes extends AbstractMetamerTest {
- private final Attributes<DataScrollerAttributes> attributes = new
Attributes<DataScrollerAttributes>(pjq("table[id$='attributes']"));
- private final Attributes<DataTableAttributes> tableAttributes = new
Attributes<DataTableAttributes>(pjq("table[id$='tableAttributes']"));
-
+ private final Attributes<DataScrollerAttributes> attributes = new
Attributes<DataScrollerAttributes>(
+ pjq("table[id$='attributes']"));
+ private final Attributes<DataTableAttributes> tableAttributes = new
Attributes<DataTableAttributes>(
+ pjq("table[id$='tableAttributes']"));
+
@Inject
private DataScroller scroller;
-
+
private DataScroller scrollerOutsideTable =
PaginationTester.DATA_SCROLLER_OUTSIDE_TABLE;
private DataScroller scrollerInsideTable =
PaginationTester.DATA_SCROLLER_IN_TABLE_FOOTER;
-
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richDataScroller/simple.xhtml");
@@ -76,7 +77,7 @@
assertFalse(getScroller().isFirstPageButtonPresent(), "The first button
shouldn't be present.");
assertFalse(getScroller().isLastPageButtonPresent(), "The last button
shouldn't be present.");
}
-
+
@Test
public void testData() {
// attributes
@@ -88,9 +89,9 @@
waitGui.waitForChange(retrieveRequestTime);
// check
String data = selenium.getEval(new JavaScript("window.data"));
- assertEquals(data, "RichFaces", "Data sent with ajax
request");
+ assertEquals(data, "RichFaces", "Data sent with ajax
request");
}
-
+
@Test
public void testEvents() throws InterruptedException {
// set event attributes
@@ -106,11 +107,14 @@
// check events
String[] events = selenium.getEval(new
JavaScript("window.metamerEvents")).split(" ");
assertEquals(events.length, 3, "3 events should be fired, found events are
" + Arrays.toString(events) + ".");
- assertEquals(events[0], "begin", "Attribute onbegin doesn't
work, found events are " + Arrays.toString(events) + ".");
- assertEquals(events[1], "beforedomupdate", "Attribute
onbeforedomupdate doesn't work, found events are " + Arrays.toString(events) +
".");
- assertEquals(events[2], "complete", "Attribute oncomplete
doesn't work, found events are " + Arrays.toString(events) + ".");
+ assertEquals(events[0], "begin", "Attribute onbegin doesn't
work, found events are " + Arrays.toString(events)
+ + ".");
+ assertEquals(events[1], "beforedomupdate", "Attribute
onbeforedomupdate doesn't work, found events are "
+ + Arrays.toString(events) + ".");
+ assertEquals(events[2], "complete",
+ "Attribute oncomplete doesn't work, found events are " +
Arrays.toString(events) + ".");
}
-
+
@Test
public void testExecute() {
// attributes
@@ -126,9 +130,9 @@
return;
}
}
- fail("Attribute execute does not work");
+ fail("Attribute execute does not work");
}
-
+
@Test
public void testFastControls() {
// init - show
@@ -137,80 +141,85 @@
// hide
getAttributes().set(DataScrollerAttributes.fastControls, "hide");
assertFalse(getScroller().isFastForwardButtonPresent(), "The fast forward
button shouldn't be present.");
- assertFalse(getScroller().isFastRewindButtonPresent(), "The fast rewind
button shouldn't be present.");
+ assertFalse(getScroller().isFastRewindButtonPresent(), "The fast rewind
button shouldn't be present.");
}
-
+
@Test
public void testFastStep() {
getAttributes().set(DataScrollerAttributes.fastStep, 3);
retrieveRequestTime.initializeValue();
getScroller().clickFastForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 4, "After clicking on the fast
forward button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 4,
+ "After clicking on the fast forward button, the current page doesn't
match.");
retrieveRequestTime.initializeValue();
getScroller().clickFastRewind();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1, "After clicking on the fast
rewind button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 1,
+ "After clicking on the fast rewind button, the current page doesn't
match.");
}
-
+
@Test
public void testLastPageMode() {
retrieveRequestTime.initializeValue();
getScroller().clickLastPageButton();
- waitGui.waitForChange(retrieveRequestTime);
+ waitGui.waitForChange(retrieveRequestTime);
// init - short
- assertEquals(getNumberOfRows(), 5, "Attribute lastPageMode doesn't work.
The number of rows doesn't match, when the value is set to <short>");
+ assertEquals(getNumberOfRows(), 5,
+ "Attribute lastPageMode doesn't work. The number of rows doesn't
match, when the value is set to <short>");
// full
getAttributes().set(DataScrollerAttributes.lastPageMode, "full");
- assertEquals(getNumberOfRows(), 9, "Attribute lastPageMode doesn't work.
The number of rows doesn't match, when the value is set to <full>");
+ assertEquals(getNumberOfRows(), 9,
+ "Attribute lastPageMode doesn't work. The number of rows doesn't
match, when the value is set to <full>");
}
-
+
@Test
public void testLimitRender() {
// false
- getAttributes().set(DataScrollerAttributes.limitRender, false);
- retrieveRequestTime.initializeValue();
- getScroller().clickFastForward();
- waitGui
- .failWith("The panel hasn't been rerendered despite of the fact the
attribute 'limitRender' is set to <false>.")
- .waitForChange(retrieveRequestTime);
- // true
- getAttributes().set(DataScrollerAttributes.limitRender, false);
- String timeBefore = retrieveRequestTime.getValue();
- getScroller().clickFastRewind();
- waitModel
- .until(new SeleniumCondition() {
- @Override
- public boolean isTrue() {
- return getScroller().getCurrentPage() == 1;
- }
- });
- String timeAfter = retrieveRequestTime.getValue();
- assertEquals(timeAfter, timeBefore, "The panel hasn been rerendered despite
of the fact the attribute 'limitRender' is set to <true>.");
-
+ getAttributes().set(DataScrollerAttributes.limitRender, false);
+ retrieveRequestTime.initializeValue();
+ getScroller().clickFastForward();
+ waitGui.failWith(
+ "The panel hasn't been rerendered despite of the fact the attribute
'limitRender' is set to <false>.")
+ .waitForChange(retrieveRequestTime);
+ // true
+ getAttributes().set(DataScrollerAttributes.limitRender, false);
+ String timeBefore = retrieveRequestTime.getValue();
+ getScroller().clickFastRewind();
+ waitModel.until(new SeleniumCondition() {
+ @Override
+ public boolean isTrue() {
+ return getScroller().getCurrentPage() == 1;
+ }
+ });
+ String timeAfter = retrieveRequestTime.getValue();
+ assertEquals(timeAfter, timeBefore,
+ "The panel hasn been rerendered despite of the fact the attribute
'limitRender' is set to <true>.");
+
}
-
+
@Test
public void testMaxPages() {
// init - 10
- assertEquals(getScroller().getCountOfVisiblePages(), 6 /* it means - all pages
*/, "The number of visible pages doesn't match.");
+ assertEquals(getScroller().getCountOfVisiblePages(), 6 /* it means - all pages
*/,
+ "The number of visible pages doesn't match.");
// smaller number
getAttributes().set(DataScrollerAttributes.maxPages, 3);
assertEquals(getScroller().getCountOfVisiblePages(), 3, "The number of
visible pages doesn't match.");
}
-
+
@Test
public void testPage() {
getAttributes().set(DataScrollerAttributes.page, 4);
assertEquals(getScroller().getCurrentPage(), 4, "The number of current page
doesn't match.");
}
-
+
@Test
public void testRendered() {
getAttributes().set(DataScrollerAttributes.rendered, false);
assertFalse(getScroller().isPresent(), "The data scroller shouldn't be
present.");
}
-
+
@Test
public void testRenderIfSinglePage() {
// prepare
@@ -221,7 +230,7 @@
getAttributes().set(DataScrollerAttributes.renderIfSinglePage, false);
assertFalse(getScroller().isPresent(), "The attribute
'renderIfSinglePage' doesn't work.");
}
-
+
@Test
public void testStatus() {
// prepare
@@ -231,11 +240,11 @@
retrieveRequestTime.initializeValue();
getScroller().clickFastForward();
waitGui.waitForChange(retrieveRequestTime);
- // check
+ // check
String statusAfter = selenium.getText(statusChecker);
assertNotEquals(statusAfter, statusBefore, "The status attribute doesn't
work.");
}
-
+
@Test
public void testStepControls() {
// init - show
@@ -246,7 +255,7 @@
assertFalse(getScroller().isNextButtonPresent(), "The next button
shouldn't be present.");
assertFalse(getScroller().isPreviousButtonPresent(), "The previous button
shouldn't be present.");
}
-
+
/**
* Test simple step forward and step back buttons on dataScroller
*/
@@ -256,29 +265,33 @@
// 2 times move forward by basic step
getScroller().clickStepForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step
next button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 2,
+ "After clicking on the step next button, the current page doesn't
match.");
getScroller().clickStepForward();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3, "After clicking on the step
next button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 3,
+ "After clicking on the step next button, the current page doesn't
match.");
// then move backward by basic step back
retrieveRequestTime.initializeValue();
getScroller().clickStepPrevious();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2, "After clicking on the step
previous button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 2,
+ "After clicking on the step previous button, the current page
doesn't match.");
getScroller().clickStepPrevious();
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1, "After clicking on the step
previous button, the current page doesn't match.");
+ assertEquals(getScroller().getCurrentPage(), 1,
+ "After clicking on the step previous button, the current page
doesn't match.");
}
-
+
/**
* Test buttons with scroller JS API binding
*/
@Test
public void testJsApi() {
verifyJsApi(1);
- verifyJsApi(2);
+ verifyJsApi(2);
}
-
+
/**
* Test buttons with scroller JS API binding, using switchToPage operation
*/
@@ -287,7 +300,7 @@
verifyJsApiStp(1);
verifyJsApiStp(2);
}
-
+
@Test
public void testStyle() {
super.testStyle(getScroller());
@@ -297,71 +310,71 @@
public void testStyleClass() {
super.testStyleClass(getScroller());
}
-
+
@Test
public void testTitle() {
super.testTitle(getScroller());
}
-
+
private Attributes<DataScrollerAttributes> getAttributes() {
return attributes;
}
-
+
private int getNumberOfRows() {
- return selenium.getCount(pjq("*.rf-dt tbody tr.rf-dt-r"));
+ return selenium.getCount(pjq("table[id$=richDataTable].rf-dt tbody
tr.rf-dt-r"));
}
-
+
private DataScroller getScroller() {
return scroller;
}
-
+
private Attributes<DataTableAttributes> getTableAttributes() {
return tableAttributes;
}
-
+
private void verifyJsApi(int scrollerNo) {
retrieveRequestTime.initializeValue();
getScroller().clickJsApiLast(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 6,
+ assertEquals(getScroller().getCurrentPage(), 6,
"After clicking on the step last button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiFirst(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1,
+ assertEquals(getScroller().getCurrentPage(), 1,
"After clicking on the step first button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2,
+ assertEquals(getScroller().getCurrentPage(), 2,
"After clicking on the step next button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3,
+ assertEquals(getScroller().getCurrentPage(), 3,
"After clicking on the step next button (JS API), the current page
doesn't match.");
}
-
+
private void verifyJsApiStp(int scrollerNo) {
retrieveRequestTime.initializeValue();
getScroller().clickJsApiStpLast(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 6,
+ assertEquals(getScroller().getCurrentPage(), 6,
"After clicking on the step last button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiStpFirst(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 1,
+ assertEquals(getScroller().getCurrentPage(), 1,
"After clicking on the step first button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiStpNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 2,
+ assertEquals(getScroller().getCurrentPage(), 2,
"After clicking on the step next button (JS API), the current page
doesn't match.");
-
+
getScroller().clickJsApiStpNext(scrollerNo);
waitGui.waitForChange(retrieveRequestTime);
- assertEquals(getScroller().getCurrentPage(), 3,
+ assertEquals(getScroller().getCurrentPage(), 3,
"After clicking on the step next button (JS API), the current page
doesn't match.");
}
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSelection.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSelection.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestExtendedDataTableSelection.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -44,6 +44,7 @@
import org.richfaces.tests.metamer.ftest.abstractions.AbstractDataTableTest;
import org.richfaces.tests.metamer.ftest.abstractions.DataTableAttributes;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.model.ExtendedDataTable;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
@@ -83,6 +84,8 @@
}
@Test
+ @Templates(exclude = { "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid",
+ "richList", "a4jRepeat" })
public void testMultiSelectionUsingControl() {
Collection<Integer> forSelection = order(2, 5, 29, 16, 13, 21);
@@ -93,9 +96,17 @@
selected.add(s);
assertEquals(selection.getCurrent(), selected);
}
-
+
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-10256")
+ @Templates(value = { "richDataTable", "richCollapsibleSubTable",
"richExtendedDataTable", "richDataGrid",
+ "richList", "a4jRepeat" })
+ public void testMultiSelectionUsingControlIterationComponents() {
+ testMultiSelectionUsingControl();
+ }
+
@Test
public void testMultiSelectionUsingShiftOnOnePage() {
IntRange range = new IntRange(2, 5);
@@ -108,7 +119,8 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10256")
+ @Templates(exclude = { "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid",
+ "richList", "a4jRepeat" })
public void testMultiSelectionUsingShiftBetweenPagesInReversedOrder() {
IntRange range = new IntRange(12, 35);
@@ -120,6 +132,14 @@
}
@Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-10256")
+ @Templates(value = { "richDataTable", "richCollapsibleSubTable",
"richExtendedDataTable", "richDataGrid",
+ "richList", "a4jRepeat" })
+ public void
testMultiSelectionUsingShiftBetweenPagesInReversedOrderIterationComponents() {
+ testMultiSelectionUsingShiftBetweenPagesInReversedOrder();
+ }
+
+ @Test(groups = "4.Future")
@IssueTracking("https://issues.jboss.org/browse/RF-9977")
public void testMultiSelectionUsingCtrlAndShiftCombinations() {
IntRange range1 = new IntRange(2, 14);
@@ -140,7 +160,8 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10256")
+ @Templates(exclude = { "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid",
+ "richList", "a4jRegion", "a4jRepeat" })
public void testMultiSelectionRemovingUsingCtrl() {
IntRange range1 = new IntRange(2, 14);
@@ -158,6 +179,14 @@
verifySelected();
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-10256")
+ @Templates(value = { "richDataTable", "richCollapsibleSubTable",
"richExtendedDataTable", "richDataGrid",
+ "richList", "a4jRegion", "a4jRepeat" })
+ public void testMultiSelectionRemovingUsingCtrlIterationComponents() {
+ testMultiSelectionRemovingUsingCtrl();
+ }
+
private Collection<Integer> order(int... selection) {
return Arrays.asList(ArrayUtils.toObject(selection));
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -529,7 +529,7 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
- selenium.fireEvent(input, Event.BLUR);
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
assertEquals(selenium.getValue(input), "Hawaii", "Input should
contain selected value.");
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestScroller.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestScroller.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richList/TestScroller.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -5,6 +5,8 @@
import java.net.URL;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.DataScroller;
import org.richfaces.tests.metamer.ftest.richDataScroller.PaginationTester;
@@ -44,13 +46,41 @@
int lastPage = dataScroller.obtainLastPage();
dataScroller.setLastPage(lastPage);
paginationTester.initializeTestedPages(lastPage);
-
+
dataScroller.setFastStep(1);
}
@Test
- @Use(field = "dataScroller", value = "dataScroller*")
- public void testScrollerWithRowsAttribute() {
+ @Use(field = "dataScroller", value = "dataScroller1")
+ @Templates(exclude = { "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid",
+ "richList", "a4jRepeat", "hDataTable",
"uiRepeat" })
+ public void testScrollerWithRowsAttributeOut() {
paginationTester.testNumberedPages();
}
+
+ @Test(groups = "4.Future")
+ @Use(field = "dataScroller", value = "dataScroller1")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11787")
+ @Templates(value = { "richDataTable", "richCollapsibleSubTable",
"richExtendedDataTable", "richDataGrid",
+ "richList", "a4jRepeat", "hDataTable",
"uiRepeat" })
+ public void testScrollerWithRowsAttributeOutIterationComponents() {
+ paginationTester.testNumberedPages();
+ }
+
+ @Test
+ @Use(field = "dataScroller", value = "dataScroller2")
+ @Templates(exclude = { "richDataTable",
"richCollapsibleSubTable", "richExtendedDataTable",
"richDataGrid",
+ "richList", "a4jRepeat" })
+ public void testScrollerWithRowsAttributeIn() {
+ paginationTester.testNumberedPages();
+ }
+
+ @Test(groups = "4.Future")
+ @Use(field = "dataScroller", value = "dataScroller2")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11787")
+ @Templates(value = { "richDataTable", "richCollapsibleSubTable",
"richExtendedDataTable", "richDataGrid",
+ "richList", "a4jRepeat" })
+ public void testScrollerWithRowsAttributeInIterationComponents() {
+ paginationTester.testNumberedPages();
+ }
}
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -34,6 +34,7 @@
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.PanelMenu;
import org.testng.annotations.Test;
@@ -43,28 +44,29 @@
* @version $Revision$
*/
public class TestPanelMenuGroupClientSideHandlers extends AbstractPanelMenuGroupTest {
-
+
PanelMenu.Group group1 = menu.getGroupContains("Group 1");
@Inject
@Use(empty = true)
String event;
- String[] ajaxExpansionEvents = new String[]{"beforeselect",
"beforeswitch", "beforeexpand", "begin",
- "beforedomupdate", "select", "expand",
"switch", "complete"};
- String[] ajaxCollapsionEvents = new String[]{"beforeselect",
"beforeswitch", "beforecollapse", "begin",
- "beforedomupdate", "select", "collapse",
"switch", "complete"};
- String[] clientExpansionEvents = new String[]{"beforeselect",
"beforeswitch", "beforeexpand", "select",
"expand",
- "switch"};
- String[] clientCollapsionEvents = new String[]{"beforeselect",
"beforeswitch", "beforecollapse", "select",
- "collapse", "collapse", "switch"};
- String[] serverExpansionEvents = new String[]{"beforeswitch",
"beforeexpand"};
- String[] serverCollapsionEvents = new String[]{"beforeswitch",
"beforecollapse"};
+ String[] ajaxExpansionEvents = new String[] { "beforeselect",
"beforeswitch", "beforeexpand", "begin",
+ "beforedomupdate", "select", "expand",
"switch", "complete" };
+ String[] ajaxCollapsionEvents = new String[] { "beforeselect",
"beforeswitch", "beforecollapse", "begin",
+ "beforedomupdate", "select", "collapse",
"switch", "complete" };
+ String[] clientExpansionEvents = new String[] { "beforeselect",
"beforeswitch", "beforeexpand", "select",
"expand",
+ "switch" };
+ String[] clientCollapsionEvents = new String[] { "beforeselect",
"beforeswitch", "beforecollapse", "select",
+ "collapse", "collapse", "switch" };
+ String[] serverExpansionEvents1 = new String[] { "beforeswitch" };
+ String[] serverExpansionEvents2 = new String[] { "beforeexpand" };
+ String[] serverCollapsionEvents = new String[] { "beforeswitch",
"beforecollapse" };
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richPanelMenuGroup/simple.xhtml");
}
-
+
@Test
@Use(field = "event", value = "ajaxCollapsionEvents")
public void testClientSideCollapsionEvent() {
@@ -76,8 +78,9 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11547")
@Use(field = "event", value = "ajaxExpansionEvents")
+ @Templates(exclude = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
public void testClientSideExpansionEvent() {
panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
@@ -87,6 +90,15 @@
super.testRequestEventsAfter(event);
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
+ @Use(field = "event", value = "ajaxExpansionEvents")
+ @Templates(value = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
+ public void testClientSideExpansionEventInIterationComponents() {
+ testClientSideExpansionEvent();
+ }
+
@Test
public void testClientSideExpansionEventsOrderClient() {
panelMenuGroupAttributes.set(mode, client);
@@ -111,7 +123,8 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11547")
+ @Templates(exclude = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
public void testClientSideExpansionEventsOrderAjax() {
panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
@@ -122,6 +135,14 @@
super.testRequestEventsAfter(ajaxExpansionEvents);
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
+ @Templates(value = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
+ public void testClientSideExpansionEventsOrderAjaxInIterationComponents() {
+ testClientSideExpansionEventsOrderAjax();
+ }
+
@Test
public void testClientSideCollapsionEventsOrderAjax() {
panelMenuGroupAttributes.set(mode, ajax);
@@ -132,9 +153,23 @@
}
@Test
+ @Use(field = "event", value = "serverExpansionEvents1")
+ public void testClientSideExpansionEventsServerBeforeSwitch() {
+ panelMenuGroupAttributes.set(mode, server);
+ menu.setGroupMode(server);
+ topGroup.toggle();
+ menu.setGroupMode(null);
+ testRequestEventsBeforeByAlert(event);
+ topGroup.toggle();
+ testRequestEventsAfterByAlert(event);
+ }
+
+ @Test
@IssueTracking("https://issues.jboss.org/browse/RF-11547")
- @Use(field = "event", value = "serverExpansionEvents")
- public void testClientSideExpansionEventsServer() {
+ @Use(field = "event", value = "serverExpansionEvents2")
+ @Templates(exclude = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
+ public void testClientSideExpansionEventsServerBeforeExpand() {
panelMenuGroupAttributes.set(mode, server);
menu.setGroupMode(server);
topGroup.toggle();
@@ -144,6 +179,15 @@
testRequestEventsAfterByAlert(event);
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
+ @Use(field = "event", value = "serverExpansionEvents2")
+ @Templates(value = { "a4jRepeat", "richCollapsibleSubTable",
"richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
+ public void testClientSideExpansionEventsServerBeforeExpandIterationComponents() {
+ testClientSideExpansionEventsServerBeforeExpand();
+ }
+
@Test
@Use(field = "event", value = "serverCollapsionEvents")
public void testClientSideCollapsionEventsServer() {
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -41,6 +41,7 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
@@ -73,7 +74,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11550")
+ @Templates(exclude = { "hDataTable", "richCollapsibleSubTable",
"richDataGrid", "richDataTable" })
public void testHeaderAlignment() {
JQueryLocator spaceLeft = jq(panel.getRawLocator() + "
*.rf-tab-hdr-spcr:eq(0)");
JQueryLocator spaceRight = jq(panel.getRawLocator() + "
*.rf-tab-hdr-spcr:eq(6)");
@@ -100,6 +101,13 @@
"The header should be aligned to the right, but it isn't.");
}
+ @Test(groups = "4.Future")
+ @IssueTracking("https://issues.jboss.org/browse/RF-11550")
+ @Templates(value = { "hDataTable", "richCollapsibleSubTable",
"richDataGrid", "richDataTable" })
+ public void testHeaderAlignmentIterationComponents() {
+ testHeaderAlignment();
+ }
+
@Test
public void testHeaderPosition() {
selenium.click(pjq("input[name$=headerPositionInput][value=bottom]"));
Modified:
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
===================================================================
---
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-12-12
11:04:27 UTC (rev 23067)
+++
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-12-12
13:51:30 UTC (rev 23068)
@@ -43,6 +43,7 @@
import javax.faces.event.PhaseId;
+import org.jboss.cheiron.halt.XHRHalter;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.Attribute;
@@ -249,6 +250,29 @@
}
@Test
+ public void testOnbeforetoggleWithJsFunction() {
+ attributes.set(onbeforetoggle, "functionChecker()");
+ retrieveJsFunctionChecker.initializeValue();
+ XHRHalter.enable();
+
+ selenium.click(treeNode.getHandle());
+ XHRHalter handle = XHRHalter.getHandleBlocking();
+ handle.complete();
+
+ retrieveRequestTime.initializeValue();
+ waitGui.waitForChange(retrieveJsFunctionChecker);
+ phaseInfo.assertNoListener("tree toggle listener invoked");
+ handle.complete();
+
+ waitGui.waitForChange(retrieveRequestTime);
+ waitModel
+ .failWith("The toggle listener hasn't been invoked.")
+ .until(phaseInfo.getListenerCondition(PhaseId.PROCESS_VALIDATIONS, "tree
toggle listener invoked"));
+
+ XHRHalter.disable();
+ }
+
+ @Test
public void testRendered() {
treeNode.expand();
subTreeNode.expand();
Modified: modules/tests/metamer/branches/wfk2-product-branch/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/pom.xml 2011-12-12 11:04:27 UTC
(rev 23067)
+++ modules/tests/metamer/branches/wfk2-product-branch/pom.xml 2011-12-12 13:51:30 UTC
(rev 23068)
@@ -23,15 +23,9 @@
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>11-redhat-1</version>
- </parent>
-
<groupId>org.richfaces.tests</groupId>
<artifactId>metamer-root</artifactId>
- <version>4.1.0-CR1-redhat-1</version>
+ <version>4.1.0.CR2-redhat-1</version>
<packaging>pom</packaging>
<name>Metamer: RichFaces Testing Application - Project Root</name>
@@ -124,7 +118,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<richfaces.checkstyle.version>3</richfaces.checkstyle.version>
- <version.richfaces>4.1.0-CR1-redhat-1</version.richfaces>
+ <version.richfaces>4.1.0.CR2-redhat-1</version.richfaces>
</properties>
<dependencyManagement>