Author: julien(a)jboss.com
Date: 2008-01-14 20:23:56 -0500 (Mon, 14 Jan 2008)
New Revision: 9503
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringActionTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringEventTestCase.java
Modified:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/event-war/WEB-INF/portlet.xml
Log:
- asserted TCK 142 or 143
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringActionTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringActionTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringActionTestCase.java 2008-01-15
01:23:56 UTC (rev 9503)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.event;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+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.UTP7;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.Portlet;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR286_143})
+public class NonDeclaredEventPublicationDuringActionTestCase
+{
+
+ public NonDeclaredEventPublicationDuringActionTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP7.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+ seq.bindAction(1, UTP7.ACTION_JOIN_POINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ // We just test that we can publish it
+ try
+ {
+ response.setEvent("SomeNonDeclaredString", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail(e);
+ }
+ }
+ });
+ seq.bindAction(1, UTP7.EVENT_JOIN_POINT, new PortletEventTestAction()
+ {
+ protected void run(Portlet portlet, EventRequest request, EventResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ }
+ });
+ seq.bindAction(1, UTP7.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringEventTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringEventTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/event/NonDeclaredEventPublicationDuringEventTestCase.java 2008-01-15
01:23:56 UTC (rev 9503)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.event;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+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.UTP7;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.Portlet;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR286_143})
+public class NonDeclaredEventPublicationDuringEventTestCase
+{
+
+ public NonDeclaredEventPublicationDuringEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP8.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+ seq.bindAction(1, UTP8.ACTION_JOIN_POINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ // Use a declared event to jump to the process event
+ response.setEvent("Bar", null);
+ }
+ });
+ seq.bindAction(1, UTP8.EVENT_JOIN_POINT, new PortletEventTestAction()
+ {
+ protected void run(Portlet portlet, EventRequest request, EventResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ // We just test that we can publish it
+ try
+ {
+ response.setEvent("SomeNonDeclaredString", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail(e);
+ }
+ }
+ });
+ seq.bindAction(1, UTP8.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Modified:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/event-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/tck/event-war/WEB-INF/portlet.xml 2008-01-15
01:10:39 UTC (rev 9502)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/tck/event-war/WEB-INF/portlet.xml 2008-01-15
01:23:56 UTC (rev 9503)
@@ -123,6 +123,28 @@
</supported-publishing-event>
</portlet>
+ <portlet>
+ <portlet-name>UniversalTestPortletG</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP7</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletH</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP8</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <name>Bar</name>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <name>Bar</name>
+ </supported-publishing-event>
+ </portlet>
+
<default-namespace>urn:default-namespace</default-namespace>
<event-definition>