Author: mvanco(a)redhat.com
Date: 2010-08-31 09:45:35 -0400 (Tue, 31 Aug 2010)
New Revision: 3981
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-events-portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-eventswithobject-portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletmodes-portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventConsumerPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventGeneratorPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectConsumerPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectGeneratorPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/PortletModesPortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/utils/
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/utils/TestObject.java
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/web.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_consumer.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_generator.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/web.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_consumer.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_generator.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/web.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/edit.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/help.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/test_mode.jsp
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/view.jsp
Modified:
components/wsrp/trunk/wsrp-producer-war/
components/wsrp/trunk/wsrp-producer-war/pom.xml
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
Log:
WSRP2 sample test portlets + 2 unit tests at wsrp-producer-war (MarkupTestCase)
- tests verify eventing between 2 portlets, one test is using sample event (with String
value), another one is using TestObject
- test testGetMarkupWithEventsAndObjects reproduces error:
javax.xml.ws.soap.SOAPFaultException: Couldn't marshall payload TestObject with
expected type {##default}##default
- simple portlets contain these features: events, events with object, portlet modes
- added assembly descriptors to generate separate war archives
Property changes on: components/wsrp/trunk/wsrp-producer-war
___________________________________________________________________
Name: svn:ignore
- .settings
target
.project
+ .settings
target
.project
.classpath
Modified: components/wsrp/trunk/wsrp-producer-war/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-08-31 11:14:25 UTC (rev 3980)
+++ components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-08-31 13:45:35 UTC (rev 3981)
@@ -176,6 +176,9 @@
<descriptor>src/test/assembly/test-resourcenoencodeurl-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-applicationscope-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-portletstate-portlet.xml</descriptor>
+
<descriptor>src/test/assembly/test-eventswithobject-portlet.xml</descriptor>
+
<descriptor>src/test/assembly/test-events-portlet.xml</descriptor>
+
<descriptor>src/test/assembly/test-portletmodes-portlet.xml</descriptor>
</descriptors>
</configuration>
<executions>
Added: components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-events-portlet.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-events-portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-events-portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,26 @@
+<assembly>
+ <id>events-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <!-- Test Classes -->
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+
<include>org/gatein/wsrp/portlet/EventGeneratorPortlet.class</include>
+
<include>org/gatein/wsrp/portlet/EventConsumerPortlet.class</include>
+ </includes>
+ </fileSet>
+ <!-- Fileset for the sar strucuture -->
+ <fileSet>
+ <directory>src/test/test-portlets/test-events-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-eventswithobject-portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-eventswithobject-portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-eventswithobject-portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,26 @@
+<assembly>
+ <id>eventswithobject-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <!-- Test Classes -->
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/gatein/wsrp/portlet/EventObject*.class</include>
+ <include>org/gatein/wsrp/portlet/utils/TestObject.class</include>
+ </includes>
+ </fileSet>
+ <!-- Fileset for the sar strucuture -->
+ <fileSet>
+
<directory>src/test/test-portlets/test-eventswithobject-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletmodes-portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletmodes-portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletmodes-portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,25 @@
+<assembly>
+ <id>portletmodes-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <!-- Test Classes -->
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/gatein/wsrp/portlet/PortletModesPortlet.class</include>
+ </includes>
+ </fileSet>
+ <!-- Fileset for the sar strucuture -->
+ <fileSet>
+
<directory>src/test/test-portlets/test-portletmodes-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventConsumerPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventConsumerPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventConsumerPortlet.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,36 @@
+package org.gatein.wsrp.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * EventConsumer Portlet Class
+ */
+public class EventConsumerPortlet extends GenericPortlet {
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ String param = request.getParameter("parameter-event");
+ request.setAttribute("parameter", param);
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/view_consumer.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void processEvent(EventRequest request, EventResponse response)
+ throws PortletException, IOException {
+ String param = (String) request.getEvent().getValue();
+ response.setRenderParameter("parameter-event", param);
+ }
+
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventGeneratorPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventGeneratorPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventGeneratorPortlet.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,34 @@
+package org.gatein.wsrp.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.namespace.QName;
+
+/**
+ * EventGenerator Portlet Class
+ */
+public class EventGeneratorPortlet extends GenericPortlet {
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/view_generator.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, IOException {
+ String param = request.getParameter("parameter");
+ response.setEvent(new QName("urn:jboss:gatein:samples:event",
"eventsample"), param);
+ }
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectConsumerPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectConsumerPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectConsumerPortlet.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,46 @@
+package org.gatein.wsrp.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.gatein.wsrp.portlet.utils.TestObject;
+
+/**
+ * EventObjectConsumer Portlet Class
+ */
+public class EventObjectConsumerPortlet extends GenericPortlet {
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ TestObject object = (TestObject)
request.getPortletSession().getAttribute("object");
+ request.setAttribute("object", object);
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/view_consumer.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void processEvent(EventRequest request, EventResponse response)
+ throws PortletException, IOException {
+ TestObject object = (TestObject) request.getEvent().getValue();
+ request.getPortletSession().setAttribute("object", object);
+ }
+
+ @Override
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, IOException {
+ request.getPortletSession().removeAttribute("object");
+ }
+
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectGeneratorPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectGeneratorPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/EventObjectGeneratorPortlet.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,60 @@
+package org.gatein.wsrp.portlet;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.namespace.QName;
+
+import org.gatein.wsrp.portlet.utils.TestObject;
+
+/**
+ * EventObjectGenerator Portlet Class
+ */
+public class EventObjectGeneratorPortlet extends GenericPortlet {
+
+ private List<TestObject> objects;
+
+ @Override
+ public void init() throws PortletException {
+ super.init();
+ objects = new ArrayList<TestObject>();
+ objects.add(new TestObject("Prabhat", "Jha", "pjha",
654321, "pjha(a)redhat.com"));
+ objects.add(new TestObject("Michal", "Vanco", "mvanco",
123456, "mvanco(a)redhat.com"));
+ objects.add(new TestObject("Marek", "Posolda",
"mposolda", 112233, "mposolda(a)redhat.com"));
+ objects.add(new TestObject("Viliam", "Rockai", "vrockai",
223311, "vrockai(a)redhat.com"));
+ }
+
+ public TestObject getTestObjectByUserName(String username) {
+ for (TestObject object : objects) {
+ if (object.getUsername().equals(username)) {
+ return object;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ request.setAttribute("objects", objects);
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/view_generator.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, IOException {
+ String username = request.getParameter("username");
+ response.setEvent(new QName("urn:jboss:gatein:samples:event:object",
"eventObject"), getTestObjectByUserName(username));
+ }
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/PortletModesPortlet.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/PortletModesPortlet.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/PortletModesPortlet.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,52 @@
+package org.gatein.wsrp.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * PortletModes Class
+ */
+public class PortletModesPortlet extends GenericPortlet {
+
+ @Override
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/view.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void doHelp(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/help.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @Override
+ public void doEdit(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/edit.jsp");
+ dispatcher.include(request, response);
+ }
+
+ @RenderMode(name = "TEST_MODE")
+ public void doTestMode(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher("/test_mode.jsp");
+ dispatcher.include(request, response);
+ }
+}
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/utils/TestObject.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/utils/TestObject.java
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/utils/TestObject.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,110 @@
+package org.gatein.wsrp.portlet.utils;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class TestObject implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String firstName;
+ private String lastName;
+ private String username;
+ private Integer employeeNumber;
+ private String email;
+
+ public TestObject() {
+ }
+
+ public TestObject(String firstName, String lastName, String username,
+ Integer employeeNumber, String email) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.username = username;
+ this.employeeNumber = employeeNumber;
+ this.email = email;
+ }
+
+ public TestObject(TestObject object) {
+ this.firstName = object.getFirstName();
+ this.lastName = object.getLastName();
+ this.username = object.getUsername();
+ this.employeeNumber = object.getEmployeeNumber();
+ this.email = object.getEmail();
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Integer getEmployeeNumber() {
+ return employeeNumber;
+ }
+
+ public void setEmployeeNumber(Integer employeeNumber) {
+ this.employeeNumber = employeeNumber;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof TestObject) {
+ TestObject object = (TestObject) obj;
+ if (this.getUsername().equals(object.getUsername()))
+ return true;
+ }
+ return false;
+
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode() + this.getUsername().hashCode();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("TestObject: ");
+ builder.append(firstName);
+ builder.append(", ");
+ builder.append(lastName);
+ builder.append(", ");
+ builder.append(username);
+ builder.append(", ");
+ builder.append(employeeNumber);
+ builder.append(", ");
+ builder.append(email);
+ builder.append(".");
+ return builder.toString();
+ }
+}
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-08-31
11:14:25 UTC (rev 3980)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-08-31
13:45:35 UTC (rev 3981)
@@ -731,8 +731,84 @@
undeploy(archive);
}
}
+
+ @Test
+ public void testGetMarkupWithEventsAndObjects() throws Exception
+ {
+ undeploy(DEFAULT_MARKUP_PORTLET_WAR);
+ String archive = "test-eventswithobject-portlet.war";
+ deploy(archive);
+ NamedString namedString = createNamedString("username",
"pjha");
+ try
+ {
+ List<String> handles = getHandlesForCurrentlyDeployedArchive();
+ String generatorHandle = null;
+ String consumerHandle = null;
+ for (String portletHandle : handles)
+ {
+ if (portletHandle.contains("Generator"))
+ {
+ generatorHandle = portletHandle;
+ } else if (portletHandle.contains("Consumer"))
+ {
+ consumerHandle = portletHandle;
+ }
+ }
+ PerformBlockingInteraction action =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(generatorHandle);
+ List<NamedString> formParameters =
action.getInteractionParams().getFormParameters();
+ formParameters.add(namedString);
+ BlockingInteractionResponse actionResponse =
producer.performBlockingInteraction(action);
+ GetMarkup markupRequestConsumer = createMarkupRequest(consumerHandle);
+
markupRequestConsumer.getMarkupParams().setNavigationalContext(actionResponse.getUpdateResponse().getNavigationalContext());
+ MarkupResponse response = producer.getMarkup(markupRequestConsumer);
+ checkMarkupResponse(response, "Prabhat");
+ }
+ finally
+ {
+ undeploy(archive);
+ }
+ }
+
@Test
+ public void testGetMarkupWithSimpleEvent() throws Exception
+ {
+ undeploy(DEFAULT_MARKUP_PORTLET_WAR);
+ String archive = "test-events-portlet.war";
+ deploy(archive);
+
+ NamedString namedString = createNamedString("parameter",
"param-value");
+ try
+ {
+ List<String> handles = getHandlesForCurrentlyDeployedArchive();
+ String generatorHandle = null;
+ String consumerHandle = null;
+ for (String portletHandle : handles)
+ {
+ if (portletHandle.contains("Generator"))
+ {
+ generatorHandle = portletHandle;
+ } else if (portletHandle.contains("Consumer"))
+ {
+ consumerHandle = portletHandle;
+ }
+ }
+ PerformBlockingInteraction action =
WSRPTypeFactory.createDefaultPerformBlockingInteraction(generatorHandle);
+ List<NamedString> formParameters =
action.getInteractionParams().getFormParameters();
+ formParameters.add(namedString);
+ BlockingInteractionResponse actionResponse =
producer.performBlockingInteraction(action);
+ GetMarkup markupRequestConsumer = createMarkupRequest(consumerHandle);
+
markupRequestConsumer.getMarkupParams().setNavigationalContext(actionResponse.getUpdateResponse().getNavigationalContext());
+ MarkupResponse response = producer.getMarkup(markupRequestConsumer);
+ checkMarkupResponse(response, "param-value");
+ }
+ finally
+ {
+ undeploy(archive);
+ }
+ }
+
+ @Test
public void testGetMarkupNoRegistrationWhenRegistrationRequired() throws Exception
{
configureRegistrationSettings(true, false);
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~ ~ Copyright 2007, 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>
+ <description>Event Generator</description>
+ <portlet-name>Event Generator</portlet-name>
+ <display-name>Event Generator</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.EventGeneratorPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Event Generator sample</title>
+ <short-title>Event Generator sample</short-title>
+ </portlet-info>
+
+ <supported-publishing-event>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event">gtn:eventsample</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Consumer</description>
+ <portlet-name>Event Consumer</portlet-name>
+ <display-name>Event Consumer</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.EventConsumerPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Event Consumer sample</title>
+ <short-title>Event Consumer sample</short-title>
+ </portlet-info>
+
+ <supported-processing-event>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event">gtn:eventsample</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <event-definition>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event">gtn:eventsample</qname>
+ <value-type>java.lang.String</value-type>
+ </event-definition>
+
+ <!-- Make these portlets remotable -->
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
+
+</portlet-app>
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/web.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/web.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/WEB-INF/web.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+</web-app>
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_consumer.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_consumer.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_consumer.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,16 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<%@ taglib
uri="http://java.sun.com/jstl/core_rt" prefix="c"
%>
+<portlet:defineObjects/>
+<br />
+<c:choose>
+ <c:when test='${empty parameter}'>
+ Please fill in your name at Event Generator portlet to see if eventing works.<br
/>
+ </c:when>
+ <c:otherwise>
+ <h1>Welcome ${parameter}!</h1>
+ Thanks for submiting your name, if you can see your name above -> events works
properly.<br />
+ </c:otherwise>
+</c:choose>
+<br />
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_generator.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_generator.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-events-portlet-war/view_generator.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,13 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<portlet:defineObjects/>
+<br />
+<h1>Hello!</h1>
+This is sample portlet to verify events.<br />
+Please type in your name and submit. <br /><br />
+<portlet:actionURL name="submit" var="submit" />
+<form method="post" action="${submit}">
+Your name: <input type="text" name="parameter"/> <input
type="submit" value="Submit">
+</form>
+<br />
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~ ~ Copyright 2007, 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>
+ <description>Event Object Generator</description>
+ <portlet-name>Event Object Generator</portlet-name>
+ <display-name>Event Object Generator</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.EventObjectGeneratorPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Event Object Generator sample</title>
+ <short-title>Event Object Generator sample</short-title>
+ </portlet-info>
+
+ <supported-publishing-event>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event:object">gtn:eventObject</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Object Consumer</description>
+ <portlet-name>Event Object Consumer</portlet-name>
+ <display-name>Event Object Consumer</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.EventObjectConsumerPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Event Object Consumer sample</title>
+ <short-title>Event Object Consumer sample</short-title>
+ </portlet-info>
+
+ <supported-processing-event>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event:object">gtn:eventObject</qname>
+ </supported-processing-event>
+
+ </portlet>
+
+ <event-definition>
+ <qname
xmlns:gtn="urn:jboss:gatein:samples:event:object">gtn:eventObject</qname>
+ <value-type>org.gatein.wsrp.portlet.utils.TestObject</value-type>
+ </event-definition>
+
+
+ <!-- Make these portlets remotable -->
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
+
+</portlet-app>
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/web.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/web.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/WEB-INF/web.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+</web-app>
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_consumer.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_consumer.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_consumer.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,24 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<%@ taglib
uri="http://java.sun.com/jstl/core_rt" prefix="c"
%>
+<portlet:defineObjects/>
+<c:choose>
+ <c:when test='${empty object}'>
+ <br />
+ Please select user at Event Object Generator portlet to see if eventing with object
works.<br />
+ </c:when>
+ <c:otherwise>
+ <h1>Thanks for selection!</h1>
+ You have selected following user: <br /><br />
+ <b>${object.firstName}, ${object.lastName}, ${object.username},
${object.employeeNumber}, ${object.email}</b>
+ <br />
+ <br />
+ If you can see selected user above, events with objects works properly!<br />
+ <portlet:actionURL name="clean" var="clean" />
+ <form method="post" action="${clean}">
+ <input type="submit" value="Clear selection">
+ </form>
+ </c:otherwise>
+</c:choose>
+<br />
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_generator.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_generator.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-eventswithobject-portlet-war/view_generator.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,37 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<%@ taglib
uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
+<portlet:defineObjects/>
+<h1>Hello!</h1>
+This is sample portlet to verify object passing through events.<br />
+Please click on any select button below to pass event with object (user).<br />
+<br />
+<table align="center">
+ <thead>
+ <tr>
+ <th>First Name</th>
+ <th>Lasst Name</th>
+ <th>Username</th>
+ <th>Employee number</th>
+ <th>Email</th>
+ <th>Select</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="${objects}" var="user">
+ <portlet:actionURL name="select" var="select">
+ <portlet:param name="username" value="${user.username}" />
+ </portlet:actionURL>
+ <tr>
+ <td align="center">${user.firstName}</td>
+ <td align="center">${user.lastName}</td>
+ <td align="center">${user.username}</td>
+ <td align="center">${user.employeeNumber}</td>
+ <td align="center">${user.email}</td>
+ <td align="center"><form method="post"
action="${select}"><input type="submit" value="Select"
/></form></td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</table>
+<br />
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/portlet.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/portlet.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/portlet.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~ ~ Copyright 2007, 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>
+ <description>Portlet Modes</description>
+ <portlet-name>Portlet Modes</portlet-name>
+ <display-name>Portlet Modes</display-name>
+ <portlet-class>org.gatein.wsrp.portlet.PortletModesPortlet</portlet-class>
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <portlet-mode>TEST_MODE</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>Portlet Modes sample</title>
+ <short-title>Portlet Modes sample</short-title>
+ </portlet-info>
+ </portlet>
+
+ <custom-portlet-mode>
+ <description>Test mode</description>
+ <portlet-mode>TEST_MODE</portlet-mode>
+ <portal-managed>false</portal-managed>
+ </custom-portlet-mode>
+
+ <!-- Make these portlets remotable -->
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
+
+</portlet-app>
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/web.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/web.xml
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/WEB-INF/web.xml 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+</web-app>
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/edit.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/edit.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/edit.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,7 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<portlet:defineObjects/>
+<br />
+<b>This is EDIT MODE.</b>
+<br /><br />
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/help.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/help.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/help.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,7 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<portlet:defineObjects/>
+<br />
+<b>This is HELP MODE.</b>
+<br /><br />
\ No newline at end of file
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/test_mode.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/test_mode.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/test_mode.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,7 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<portlet:defineObjects/>
+<br />
+<b>This is TEST MODE.</b>
+<br /><br />
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/view.jsp
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/view.jsp
(rev 0)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletmodes-portlet-war/view.jsp 2010-08-31
13:45:35 UTC (rev 3981)
@@ -0,0 +1,9 @@
+<%@page contentType="text/html"%>
+<%@page pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
+<portlet:defineObjects/>
+<h1>Hello!</h1>
+This is sample portlet to verify portlet modes.<br />
+Change portlet mode at upper right corner to verify correct functionality.<br
/><br />
+<b>This is VIEW MODE.</b>
+<br /><br />