Author: julien(a)jboss.com
Date: 2008-03-04 16:31:31 -0500 (Tue, 04 Mar 2008)
New Revision: 10194
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/common/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/common/CommonEventPayload.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/event/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/event/EventPayloadTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/eventsupport/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/eventsupport/CommonPayloadEventPortlet.java
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/web.xml
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
JBPORTAL-1897 : Event payload marshalling
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-03-04 20:04:28 UTC (rev 10193)
+++ modules/portlet/trunk/build/pom.xml 2008-03-04 21:31:31 UTC (rev 10194)
@@ -33,7 +33,7 @@
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
<version.jbossxb>2.0.0.CR5</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.2.0-Beta1</version.jboss.portal.common>
+
<version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
<version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
Modified:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-03-04
20:04:28 UTC (rev 10193)
+++
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -70,6 +70,7 @@
<bean name="ProducerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
<bean name="CCPPInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
<bean name="RequestAttributeConversationInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
+ <bean name="EventPayloadInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
<bean name="ContainerStackFactory"
class="org.jboss.portal.portlet.portal.InterceptorStackFactoryImpl">
<property name="interceptors">
<array>
@@ -79,6 +80,7 @@
<inject bean="ProducerCacheInterceptor"/>
<inject bean="CCPPInterceptor"/>
<inject bean="RequestAttributeConversationInterceptor"/>
+ <inject bean="EventPayloadInterceptor"/>
</array>
</property>
</bean>
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,198 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.aspects.portlet;
+
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.EventingInfo;
+import org.jboss.portal.portlet.info.EventInfo;
+import org.jboss.portal.portlet.impl.info.ContainerTypeInfo;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.io.IOTools;
+import org.apache.log4j.Logger;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * This interceptor is responsible for taking care of converting the optional event
payload to the application
+ * classloader.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EventPayloadInterceptor extends PortletInterceptor
+{
+
+ /** . */
+ private final static Logger log = Logger.getLogger(EventPayloadInterceptor.class);
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ if (invocation instanceof EventInvocation)
+ {
+ EventInvocation eventInvocation = (EventInvocation)invocation;
+
+ //
+ Serializable srcPayload = eventInvocation.getPayload();
+
+ //
+ Serializable dstPayload = null;
+ if (srcPayload != null)
+ {
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+
+ //
+ PortletApplication application = container.getPortletApplication();
+ PortletApplicationContext applicationContext = application.getContext();
+ ClassLoader applicationClassLoader = applicationContext.getClassLoader();
+ String srcPayloadClassName = srcPayload.getClass().getName();
+ boolean trace = log.isTraceEnabled();
+ QName eventName = eventInvocation.getName();
+ String containerId = container.getId();
+ String applicationId = application.getId();
+
+ //
+ PortletInfo info = container.getInfo();
+ EventingInfo eventingInfo = info.getEventing();
+ Map<QName, ? extends EventInfo> consumedEventInfos =
eventingInfo.getConsumedEvents();
+ EventInfo eventInfo = consumedEventInfos.get(eventName);
+
+ //
+ if (trace)
+ {
+ log.trace("Attempt to obtain for event " + eventName + "
its payload class " + srcPayloadClassName + " in the application " +
applicationId +
+ " for portlet " + container.getInfo());
+ }
+
+ //
+ Class dstPayloadClass = null;
+ if (eventInfo != null)
+ {
+ ContainerTypeInfo typeInfo = (ContainerTypeInfo)eventInfo.getType();
+
+ //
+ if (typeInfo != null)
+ {
+ dstPayloadClass = typeInfo.getType();
+ if (trace)
+ {
+ log.trace("Obtained for event " + eventName + " its
payload class " + dstPayloadClass.getName() + " declared by the portlet meta
data "
+ + containerId);
+ }
+ }
+ else
+ {
+ if (trace)
+ {
+ log.trace("No type declared for event " + eventName +
" declared by the portlet meta data " + containerId);
+ }
+ }
+ }
+
+
+ //
+ if (dstPayloadClass == null)
+ {
+ if (trace)
+ {
+ log.trace("No event meta data declared by portlet " +
containerId + " for event " + eventName + " will attempty " +
+ " to load same class name from the application " +
applicationId + " classloader");
+ }
+
+ // We try to load the same class from the applicaton class loader
+ try
+ {
+ dstPayloadClass =
applicationClassLoader.loadClass(srcPayloadClassName);
+ if (trace)
+ {
+ log.trace("Obtained matching event class " +
dstPayloadClass.getName() + " in application " + applicationId + " for
event " + eventName);
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ return new ErrorResponse("The application " + applicationId +
" does not have access to the event payload class"
+ + srcPayloadClassName, e);
+ }
+ catch (NoClassDefFoundError e)
+ {
+ return new ErrorResponse("The application " + applicationId +
" does not have access to the event payload class"
+ + srcPayloadClassName, e);
+ }
+ }
+
+ // We need maybe to perform some serialization to the classloader
+ if (dstPayloadClass != srcPayload.getClass())
+ {
+ if (trace)
+ {
+ log.trace("Need to convert event payload from class " +
srcPayloadClassName + " to " + dstPayloadClass.getName());
+ }
+ try
+ {
+ dstPayload = IOTools.clone(srcPayload, applicationClassLoader);
+ }
+ catch (ClassNotFoundException e)
+ {
+ return new ErrorResponse("Could not convert the event payload from
class " + srcPayloadClassName + " to class " + dstPayloadClass.getName(),
e);
+ }
+ catch (IOException e)
+ {
+ // The cause is likely a non compatible changes in class version
+ return new ErrorResponse("Could not convert the event payload from
class " + srcPayloadClassName + " to class " + dstPayloadClass.getName(),
e);
+ }
+ }
+ else
+ {
+ dstPayload = srcPayload;
+ }
+ }
+
+ // Set payload
+ eventInvocation.setPayload(dstPayload);
+
+ //
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ eventInvocation.setPayload(srcPayload);
+ }
+ }
+ else
+ {
+ return invocation.invokeNext();
+ }
+ }
+}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/ErrorResponse.java 2008-03-04
20:04:28 UTC (rev 10193)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/ErrorResponse.java 2008-03-04
21:31:31 UTC (rev 10194)
@@ -49,6 +49,20 @@
this.message = cause.getMessage();
}
+ public ErrorResponse(String message, Throwable cause)
+ {
+ if (message == null)
+ {
+ throw new IllegalArgumentException("There must be a message");
+ }
+ if (cause == null)
+ {
+ throw new IllegalArgumentException("There must be a cause");
+ }
+ this.cause = cause;
+ this.message = message;
+ }
+
public ErrorResponse(String message)
{
if (message == null)
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/common/CommonEventPayload.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/common/CommonEventPayload.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/common/CommonEventPayload.java 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.ext.common;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class CommonEventPayload implements Serializable
+{
+
+ /** . */
+ private String string;
+
+ public String getString()
+ {
+ return string;
+ }
+
+ public void setString(String string)
+ {
+ this.string = string;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/event/EventPayloadTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/event/EventPayloadTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/event/EventPayloadTestCase.java 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.ext.event;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.unit.actions.PortletActionTestAction;
+import org.jboss.portal.unit.actions.PortletEventTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.deployer.response.DeployResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+@TestCase
+public class EventPayloadTestCase
+{
+
+ /** . */
+ boolean commonEventPonged = false;
+
+ /** . */
+ CommonEventPayload commonPayload;
+
+ /** . */
+ boolean sharedEventPonged = false;
+
+ public EventPayloadTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ return new DeployResponse("test-jsr286-ext-eventsupport.war");
+ }
+ });
+ seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ //
+ seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ commonPayload = new CommonEventPayload();
+ commonPayload.setString("commonpingvalue");
+ response.setEvent("CommonPing", commonPayload);
+ }
+ });
+ seq.bindAction(2, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
+ {
+ protected void run(Portlet portlet, EventRequest request, EventResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ assertEquals("commonpingvalue", commonPayload.getString());
+ Event event = request.getEvent();
+ assertEquals("CommonPong", event.getName());
+ CommonEventPayload payload = (CommonEventPayload)event.getValue();
+ assertEquals("commonpongvalue", payload.getString());
+ commonEventPonged = true;
+ }
+ });
+ seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ assertTrue(commonEventPonged);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/eventsupport/CommonPayloadEventPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/eventsupport/CommonPayloadEventPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/eventsupport/CommonPayloadEventPortlet.java 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.ext.eventsupport;
+
+import org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+import javax.portlet.Event;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CommonPayloadEventPortlet extends GenericPortlet
+{
+ public void processEvent(EventRequest req, EventResponse resp) throws
PortletException, IOException
+ {
+ Event event = req.getEvent();
+
+ //
+ if ("CommonPing".equals(event.getName()))
+ {
+ CommonEventPayload payload = (CommonEventPayload)event.getValue();
+ if (payload.getString().equals("commonpingvalue"))
+ {
+ CommonEventPayload newPayload = new CommonEventPayload();
+ payload.setString("commonpongvalue");
+ newPayload.setString("commonpongvalue");
+ resp.setEvent("CommonPong", newPayload);
+ }
+ }
+ }
+}
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-03-04 20:04:28 UTC (rev 10193)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-03-04 21:31:31 UTC (rev 10194)
@@ -378,6 +378,8 @@
<package-jsr286-ext-test test="dispatcher"/>
<package-jsr286-ext-test test="portletcontext"/>
<package-jsr286-ext-test test="portletinterface"/>
+ <package-jsr286-ext-test test="event"/>
+ <package-jsr286-ext-test test="eventsupport"/>
<!-- -->
<jar jarfile="${test.temp.lib}/portlet-test-lib.jar">
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/portlet.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <name>CommonPong</name>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <name>CommonPing</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <event-definition>
+ <name>CommonPing</name>
+
<value-type>org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload</value-type>
+ </event-definition>
+
+ <event-definition>
+ <name>CommonPong</name>
+
<value-type>org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload</value-type>
+ </event-definition>
+
+</portlet-app>
Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/event-war/WEB-INF/web.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+
<listener-class>org.jboss.portal.unit.PortletTestSuite</listener-class>
+ </listener>
+</web-app>
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/portlet.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>CommonPayloadEvenPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr286.ext.eventsupport.CommonPayloadEventPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <name>CommonPing</name>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <name>CommonPong</name>
+ </supported-publishing-event>
+ </portlet>
+
+ <event-definition>
+ <name>CommonPing</name>
+
<value-type>org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload</value-type>
+ </event-definition>
+
+ <event-definition>
+ <name>CommonPong</name>
+
<value-type>org.jboss.portal.test.portlet.jsr286.ext.common.CommonEventPayload</value-type>
+ </event-definition>
+
+</portlet-app>
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/eventsupport-war/WEB-INF/web.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>
Modified:
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-03-04
20:04:28 UTC (rev 10193)
+++
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -85,6 +85,7 @@
<bean name="ProducerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
<bean name="CCPPInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
<bean name="RequestAttributeConversationInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
+ <bean name="EventPayloadInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
<bean name="ContainerStackFactory"
class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
<property name="interceptors">
<array>
@@ -94,6 +95,7 @@
<inject bean="ProducerCacheInterceptor"/>
<inject bean="CCPPInterceptor"/>
<inject bean="RequestAttributeConversationInterceptor"/>
+ <inject bean="EventPayloadInterceptor"/>
</array>
</property>
</bean>
Modified:
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-03-04
20:04:28 UTC (rev 10193)
+++
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -85,6 +85,7 @@
<bean name="ProducerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
<bean name="CCPPInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
<bean name="RequestAttributeConversationInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
+ <bean name="EventPayloadInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
<bean name="ContainerStackFactory"
class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
<property name="interceptors">
<array>
@@ -94,6 +95,7 @@
<inject bean="ProducerCacheInterceptor"/>
<inject bean="CCPPInterceptor"/>
<inject bean="RequestAttributeConversationInterceptor"/>
+ <inject bean="EventPayloadInterceptor"/>
</array>
</property>
</bean>
Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-03-04
20:04:28 UTC (rev 10193)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-03-04
21:31:31 UTC (rev 10194)
@@ -231,6 +231,10 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-ext-portletinterface.war"/>
</generic>
+ <generic>
+ <class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ <property name="archiveId"
value="test-jsr286-ext-event.war"/>
+ </generic>
<!--Misc Tests-->
<!--