Author: julien(a)jboss.com
Date: 2008-02-02 20:53:19 -0500 (Sat, 02 Feb 2008)
New Revision: 9717
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionRequest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionResponse.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventRequest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventResponse.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderRequest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderResponse.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceRequest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceResponse.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractPortletFilter.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractRenderFilter.java
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
- test case for filter config
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java 2008-02-03
00:39:42 UTC (rev 9716)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -144,7 +144,7 @@
{
if(this.filterMapping == null)
{
- this.filterMapping = new HashMap<String, FilterMappingMetaData>();
+ this.filterMapping = new LinkedHashMap<String, FilterMappingMetaData>();
}
this.filterMapping.put(filterMapping.getName(), filterMapping);
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractPortletFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractPortletFilter.java 2008-02-03
00:39:42 UTC (rev 9716)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractPortletFilter.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -23,13 +23,24 @@
package org.jboss.portal.test.portlet.jsr286.common;
import javax.portlet.filter.FilterConfig;
+import javax.portlet.filter.FilterChain;
+import javax.portlet.filter.PortletFilter;
import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public abstract class AbstractPortletFilter
+public abstract class AbstractPortletFilter implements PortletFilter
{
/** . */
@@ -61,4 +72,24 @@
return null;
}
}
+
+ public void doFilter(ActionRequest req, ActionResponse resp, FilterChain chain) throws
IOException, PortletException
+ {
+ chain.doFilter(req, resp);
+ }
+
+ public void doFilter(EventRequest req, EventResponse resp, FilterChain chain) throws
IOException, PortletException
+ {
+ chain.doFilter(req, resp);
+ }
+
+ public void doFilter(RenderRequest req, RenderResponse resp, FilterChain chain) throws
IOException, PortletException
+ {
+ chain.doFilter(req, resp);
+ }
+
+ public void doFilter(ResourceRequest req, ResourceResponse resp, FilterChain chain)
throws IOException, PortletException
+ {
+ chain.doFilter(req, resp);
+ }
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractRenderFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractRenderFilter.java 2008-02-03
00:39:42 UTC (rev 9716)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/AbstractRenderFilter.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -35,8 +35,4 @@
*/
public class AbstractRenderFilter extends AbstractPortletFilter implements RenderFilter
{
- public void doFilter(RenderRequest req, RenderResponse resp, FilterChain chain) throws
IOException, PortletException
- {
- chain.doFilter(req, resp);
- }
}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionRequest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionRequest.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.ActionRequestWrapper;
+import javax.portlet.ActionRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomActionRequest extends ActionRequestWrapper
+{
+ public CustomActionRequest(ActionRequest actionRequest)
+ {
+ super(actionRequest);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomActionResponse.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.ActionResponseWrapper;
+import javax.portlet.ActionResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomActionResponse extends ActionResponseWrapper
+{
+ public CustomActionResponse(ActionResponse actionResponse)
+ {
+ super(actionResponse);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventRequest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventRequest.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.EventRequestWrapper;
+import javax.portlet.EventRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomEventRequest extends EventRequestWrapper
+{
+ public CustomEventRequest(EventRequest eventRequest)
+ {
+ super(eventRequest);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomEventResponse.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.EventResponseWrapper;
+import javax.portlet.EventResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomEventResponse extends EventResponseWrapper
+{
+ public CustomEventResponse(EventResponse eventResponse)
+ {
+ super(eventResponse);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderRequest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderRequest.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.RenderRequestWrapper;
+import javax.portlet.RenderRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomRenderRequest extends RenderRequestWrapper
+{
+ public CustomRenderRequest(RenderRequest renderRequest)
+ {
+ super(renderRequest);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomRenderResponse.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.RenderResponseWrapper;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomRenderResponse extends RenderResponseWrapper
+{
+ public CustomRenderResponse(RenderResponse renderResponse)
+ {
+ super(renderResponse);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceRequest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceRequest.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.ResourceRequestWrapper;
+import javax.portlet.ResourceRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomResourceRequest extends ResourceRequestWrapper
+{
+ public CustomResourceRequest(ResourceRequest resourceRequest)
+ {
+ super(resourceRequest);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/common/CustomResourceResponse.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.common;
+
+import javax.portlet.filter.ResourceResponseWrapper;
+import javax.portlet.ResourceResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CustomResourceResponse extends ResourceResponseWrapper
+{
+ public CustomResourceResponse(ResourceResponse resourceResponse)
+ {
+ super(resourceResponse);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter1.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * 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.portletfilter;
+
+import org.jboss.portal.test.portlet.jsr286.common.AbstractPortletFilter;
+import org.jboss.portal.test.portlet.jsr286.common.CustomRenderRequest;
+import org.jboss.portal.test.portlet.jsr286.common.CustomRenderResponse;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.filter.FilterChain;
+import javax.portlet.filter.RenderFilter;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PropagateDoFilterArgsFilter1 extends AbstractPortletFilter implements
RenderFilter
+{
+
+ /** . */
+ public static CustomRenderRequest publishedRenderRequest;
+
+ /** . */
+ public static CustomRenderResponse publishedRenderResponse;
+
+ public void doFilter(RenderRequest req, RenderResponse resp, FilterChain chain) throws
IOException, PortletException
+ {
+ try
+ {
+ chain.doFilter(publishedRenderRequest = new CustomRenderRequest(req),
publishedRenderResponse = new CustomRenderResponse(resp));
+ }
+ finally
+ {
+ publishedRenderRequest = null;
+ publishedRenderResponse = null;
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsFilter2.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.portletfilter;
+
+import org.jboss.portal.test.portlet.jsr286.common.AbstractPortletFilter;
+import org.jboss.portal.test.portlet.jsr286.common.CustomRenderRequest;
+import org.jboss.portal.test.portlet.jsr286.common.CustomRenderResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.filter.FilterChain;
+import javax.portlet.filter.RenderFilter;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PropagateDoFilterArgsFilter2 extends AbstractPortletFilter implements
RenderFilter
+{
+
+ /** . */
+ public static RenderRequest consumedRenderRequest;
+
+ /** . */
+ public static RenderResponse consumedRenderResponse;
+
+ /** . */
+ public static CustomRenderRequest publishedRenderRequest;
+
+ /** . */
+ public static CustomRenderResponse publishedRenderResponse;
+
+ public void doFilter(RenderRequest req, RenderResponse resp, FilterChain chain) throws
IOException, PortletException
+ {
+ consumedRenderRequest = req;
+ consumedRenderResponse = resp;
+
+ //
+ try
+ {
+ chain.doFilter(publishedRenderRequest = new CustomRenderRequest(req),
publishedRenderResponse = new CustomRenderResponse(resp));
+ }
+ finally
+ {
+ consumedRenderRequest = null;
+ consumedRenderResponse = null;
+ publishedRenderRequest = null;
+ publishedRenderResponse = null;
+ }
+ }
+}
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletfilter/PropagateDoFilterArgsTestCase.java 2008-02-03
01:53:19 UTC (rev 9717)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * 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.portletfilter;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase(Assertion.JSR286_296)
+public class PropagateDoFilterArgsTestCase
+{
+ public PropagateDoFilterArgsTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest req, RenderResponse
resp, PortletTestContext context) throws PortletException, IOException
+ {
+ assertSame(PropagateDoFilterArgsFilter1.publishedRenderRequest,
PropagateDoFilterArgsFilter2.consumedRenderRequest);
+ assertSame(PropagateDoFilterArgsFilter1.publishedRenderResponse,
PropagateDoFilterArgsFilter2.consumedRenderResponse);
+ assertSame(PropagateDoFilterArgsFilter2.publishedRenderRequest, req);
+ assertSame(PropagateDoFilterArgsFilter2.publishedRenderResponse, resp);
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Modified:
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-war/WEB-INF/portlet.xml 2008-02-03
00:39:42 UTC (rev 9716)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletfilter-war/WEB-INF/portlet.xml 2008-02-03
01:53:19 UTC (rev 9717)
@@ -55,6 +55,20 @@
</supported-publishing-event>
</portlet>
+ <portlet>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <name>Event</name>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <name>Event</name>
+ </supported-publishing-event>
+ </portlet>
+
<filter>
<filter-name>PortletFilterCounter</filter-name>
<filter-class>org.jboss.portal.test.portlet.jsr286.tck.portletfilter.PortletFilterCounter</filter-class>
@@ -79,6 +93,18 @@
<lifecycle>RESOURCE_PHASE</lifecycle>
</filter>
+ <filter>
+ <filter-name>PropagateDoFilterArgsFilter1</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr286.tck.portletfilter.PropagateDoFilterArgsFilter1</filter-class>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ </filter>
+
+ <filter>
+ <filter-name>PropagateDoFilterArgsFilter2</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr286.tck.portletfilter.PropagateDoFilterArgsFilter2</filter-class>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ </filter>
+
<filter-mapping>
<filter-name>WildcardFilter</filter-name>
<portlet-name>*</portlet-name>
@@ -89,6 +115,16 @@
<portlet-name>Prefixed*</portlet-name>
</filter-mapping>
+ <filter-mapping>
+ <filter-name>PropagateDoFilterArgsFilter1</filter-name>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PropagateDoFilterArgsFilter2</filter-name>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+ </filter-mapping>
+
<event-definition>
<name>Event</name>
</event-definition>
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-02-03
00:39:42 UTC (rev 9716)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-02-03
01:53:19 UTC (rev 9717)
@@ -4,7 +4,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
- <!--Spec TCK Assertions tests-->
+<!--
+ -->
+<!--Spec TCK Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-tck-dispatcher.war"/>
@@ -50,7 +53,9 @@
<property name="archiveId"
value="test-jsr168-tck-windowstates.war"/>
</generic>
- <!--API Tests-->
+ -->
+<!--API Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-api-actionrequest.war"/>
@@ -104,7 +109,9 @@
<property name="archiveId"
value="test-jsr168-api-windowstate.war"/>
</generic>
- <!--Ext Tests-->
+ -->
+<!--Ext Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-ext-portletconfig.war"/>
@@ -146,7 +153,9 @@
<property name="archiveId"
value="test-jsr168-ext-taglib.war"/>
</generic>
- <!--Spec TCK Assertions tests-->
+ -->
+<!--Spec TCK Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-dispatcher.war"/>
@@ -183,18 +192,24 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-portleturl.war"/>
</generic>
+-->
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-portletfilter.war"/>
</generic>
- <!--Spec API Assertions tests-->
+<!--
+ -->
+<!--Spec API Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-api-event.war"/>
</generic>
- <!--Ext Assertions tests-->
+ -->
+<!--Ext Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-ext-portletrequests.war"/>
@@ -207,6 +222,7 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-ext-dispatcher.war"/>
</generic>
+-->
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-ext-portletfilter.war"/>