Author: julien(a)jboss.com
Date: 2008-02-25 18:12:41 -0500 (Mon, 25 Feb 2008)
New Revision: 10111
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletinterface/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletinterface/UnavailablePortletTestCase.java
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletFilterContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletApplicationContextSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletContainerContextSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletFilterContextSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
- fixed the valve interceptor
- added test case for valve interceptor unavailability
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -23,13 +23,15 @@
package org.jboss.portal.portlet.aspects.portlet;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
/**
* This aspect has two responsabilities :<br/> <ul> <li>continue the
request only if the portlet container valve is
@@ -44,26 +46,57 @@
public class ValveInterceptor extends PortletInterceptor
{
+ /** . */
+ private PortletApplicationRegistry registry;
+
+ public PortletApplicationRegistry getPortletApplicationRegistry()
+ {
+ return registry;
+ }
+
+ public void setPortletApplicationRegistry(PortletApplicationRegistry
portletApplicationRegistry)
+ {
+ this.registry = portletApplicationRegistry;
+ }
+
protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
{
- PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
+ PortletContainerImpl container =
(PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
- // Stop the container if necessary
- if (response instanceof UnavailableResponse)
+ //
+ Valve valve = container.getValve();
+
+ if (valve.beforeInvocation())
{
- // This call will wait until all the current threads have exited the component
valve.
- // Perhaps this should be done asynchronously as it may lead to a long delay ?
- // It could be made parametrizable too, so the deployer can choose what mode is
preferable
- PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInvocationResponse response;
- // Get the context
- PortletContainerContext context = container.getContext();
+ try
+ {
+ response = (PortletInvocationResponse)invocation.invokeNext();
+ }
+ finally
+ {
+ // Release the valve
+ valve.afterInvocation();
+ }
- // Invoke stop
-// context.invokeStop();
+ // Stop the container if necessary
+ if (response instanceof UnavailableResponse)
+ {
+ PortletContainerContext containerContext = container.getContext();
+
+ // This call will wait until all the current threads have exited the
component valve.
+ // Perhaps this should be done asynchronously as it may lead to a long delay
?
+ // It could be made parametrizable as a runtime option too, so the deployer
can choose what mode is preferable
+ containerContext.managedStop();
+ }
+
+ //
+ return response;
}
-
- //
- return response;
+ else
+ {
+ return new UnavailableResponse();
+ }
}
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationContext.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationContext.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -54,4 +54,14 @@
* @return the classloader
*/
ClassLoader getClassLoader();
+
+ /**
+ * Attempt to start the portlet application.
+ */
+ void managedStart();
+
+ /**
+ * Stop the portlet application.
+ */
+ void managedStop();
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerContext.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerContext.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -28,4 +28,13 @@
*/
public interface PortletContainerContext
{
+ /**
+ * Attempt to start the portlet container.
+ */
+ void managedStart();
+
+ /**
+ * Stop the portlet container.
+ */
+ void managedStop();
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletFilterContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletFilterContext.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletFilterContext.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -28,4 +28,13 @@
*/
public interface PortletFilterContext
{
+ /**
+ * Attempt to start the portlet filter.
+ */
+ void managedStart();
+
+ /**
+ * Stop the portlet filter.
+ */
+ void managedStop();
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -80,7 +80,6 @@
import javax.portlet.filter.FilterChain;
import javax.portlet.filter.FilterConfig;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
import java.util.List;
@@ -200,11 +199,6 @@
filters.remove((PortletFilterImpl)filter);
}
- public boolean isStarted()
- {
- return valve.getState() == Valve.OPEN;
- }
-
public void start() throws PortletInitializationException
{
// Set class name
@@ -340,7 +334,7 @@
public void stop()
{
- // if the portlet is not started, we shouldn't be trying to stop it...
+ // If the portlet is not started, we shouldn't be trying to stop it...
if (started)
{
// Wait at most 60 seconds before all invocations are done
@@ -457,28 +451,7 @@
public PortletInvocationResponse dispatch(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
{
- if (valve.beforeInvocation())
- {
- try
- {
- return invokeDispatch(invocation);
- }
- finally
- {
- // Release the valve
- valve.afterInvocation();
- }
- }
- else
- {
- return new UnavailableResponse();
- }
- }
-
- private PortletInvocationResponse invokeDispatch(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
- {
HttpServletRequest dreq = invocation.getDispatchedRequest();
- HttpServletResponse dresp = invocation.getDispatchedResponse();
//
PortletRequestImpl req;
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletApplicationContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletApplicationContextSupport.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletApplicationContextSupport.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -44,4 +44,14 @@
{
throw new UnsupportedOperationException();
}
+
+ public void managedStart()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void managedStop()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletContainerContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletContainerContextSupport.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletContainerContextSupport.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -28,4 +28,13 @@
*/
public class PortletContainerContextSupport implements PortletContainerContext
{
+ public void managedStart()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void managedStop()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletFilterContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletFilterContextSupport.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/portlet/container/PortletFilterContextSupport.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -28,4 +28,13 @@
*/
public class PortletFilterContextSupport implements PortletFilterContext
{
+ public void managedStart()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void managedStop()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletinterface/UnavailablePortletTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletinterface/UnavailablePortletTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/portletinterface/UnavailablePortletTestCase.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -0,0 +1,96 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.ext.portletinterface;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.UnavailableException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+@TestCase
+public class UnavailablePortletTestCase
+{
+
+ /** . */
+ private AbstractUniversalTestPortlet utp1;
+
+ public UnavailablePortletTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse runWithRuntimeException(Portlet portlet, RenderRequest
request, RenderResponse response, PortletTestContext context) throws PortletException,
IOException
+ {
+ utp1 = (AbstractUniversalTestPortlet)portlet;
+
+ //
+ throw new UnavailableException("blah");
+ }
+ });
+ seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+ seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ fail("Should not be called");
+
+ //
+ return null;
+ }
+ });
+ seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ assertEquals(AbstractUniversalTestPortlet.RuntimeStatus.STOPPED,
utp1.getRuntimeStatus());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -77,6 +77,16 @@
return className;
}
+ /**
+ * The runtime status of a portlet.
+ */
+ public static enum RuntimeStatus
+ {
+ INSTANTIATED,
+ STARTED,
+ STOPPED
+ }
+
/** . */
private final Logger log = createLogger();
@@ -95,14 +105,19 @@
/** To keep PortletConfig for some tests*-. */
private PortletConfig config;
+ /** Indicate the status of the portlet. */
+ private RuntimeStatus runtimeStatus;
+
/** Construct a test portlet with a test id computed with the method
<code>getComponentId()</code>. */
public AbstractUniversalTestPortlet()
{
+ runtimeStatus = RuntimeStatus.INSTANTIATED;
}
public void init(PortletConfig config) throws PortletException
{
this.config = config;
+ this.runtimeStatus = RuntimeStatus.STARTED;
}
/**
@@ -376,8 +391,14 @@
public void destroy()
{
+ this.runtimeStatus = RuntimeStatus.STOPPED;
}
+ public RuntimeStatus getRuntimeStatus()
+ {
+ return runtimeStatus;
+ }
+
/**
* Returns SequenceRegistry which should be injected into ServletContext Returns null
if there is no SequenceRegistry
* in context
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationContextImpl.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.web.WebApp;
import javax.servlet.ServletContext;
@@ -37,6 +38,8 @@
/** . */
private final WebApp webApp;
+ ManagedPortletApplication managedPortletApplication;
+
public PortletApplicationContextImpl(WebApp webApp)
{
this.webApp = webApp;
@@ -56,4 +59,14 @@
{
return webApp.getClassLoader();
}
+
+ public void managedStart()
+ {
+ managedPortletApplication.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletApplication.managedStop();
+ }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -38,9 +38,6 @@
import org.jboss.portal.portlet.container.object.PortletApplicationObject;
import org.jboss.portal.portlet.container.object.PortletContainerObject;
import org.jboss.portal.portlet.container.object.PortletFilterObject;
-import org.jboss.portal.portlet.container.PortletApplicationContext;
-import org.jboss.portal.portlet.container.PortletContainerContext;
-import org.jboss.portal.portlet.container.PortletFilterContext;
import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
import org.jboss.portal.web.WebApp;
@@ -94,7 +91,7 @@
//
PortletApplicationObject portletApplicationObject = new
PortletApplicationImpl(builder.getApplication());
- PortletApplicationContext portletApplicationContext = new
PortletApplicationContextImpl(webApp);
+ PortletApplicationContextImpl portletApplicationContext = new
PortletApplicationContextImpl(webApp);
//
@@ -103,25 +100,34 @@
portletApplicationContext,
portletApplicationObject);
+ // Needed for the managed callbacks
+ portletApplicationContext.managedPortletApplication = portletApplicationLifeCycle;
+
//
for (ContainerFilterInfo filterInfo :
builder.getApplication().getFilters().values())
{
PortletFilterObject portletFilterObject = new PortletFilterImpl(filterInfo);
- PortletFilterContext portletFilterContext = new PortletFilterContextImpl();
+ PortletFilterContextImpl portletFilterContext = new PortletFilterContextImpl();
//
- portletApplicationLifeCycle.addPortletFilter(portletFilterContext,
portletFilterObject);
+ PortletFilterLifeCycle portletFilterLifeCycle =
portletApplicationLifeCycle.addPortletFilter(portletFilterContext, portletFilterObject);
+
+ // Needed for the managed callbacks
+ portletFilterContext.managedPortletFilter = portletFilterLifeCycle;
}
//
for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
PortletContainerObject portletContainerObject = new
PortletContainerImpl(containerInfo);
- PortletContainerContext portletContainerContext = new
PortletContainerContextImpl();
+ PortletContainerContextImpl portletContainerContext = new
PortletContainerContextImpl();
//
PortletContainerLifeCycle portletContainerLifeCycle =
portletApplicationLifeCycle.addPortletContainer(portletContainerContext,
portletContainerObject);
+ // Needed for the managed callbacks
+ portletContainerContext.managedPortletContainer = portletContainerLifeCycle;
+
// Now create deps
for (String filterRef : containerInfo.getFilterRefs())
{
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletContainerContextImpl.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletContainerContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -30,4 +31,17 @@
*/
public class PortletContainerContextImpl implements PortletContainerContext
{
+
+ /** . */
+ ManagedPortletContainer managedPortletContainer;
+
+ public void managedStart()
+ {
+ managedPortletContainer.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletContainer.managedStop();
+ }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletFilterContextImpl.java 2008-02-25
23:12:41 UTC (rev 10111)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.test;
import org.jboss.portal.portlet.container.PortletFilterContext;
+import org.jboss.portal.portlet.container.managed.ManagedPortletFilter;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -30,4 +31,16 @@
*/
public class PortletFilterContextImpl implements PortletFilterContext
{
+
+ ManagedPortletFilter managedPortletFilter;
+
+ public void managedStart()
+ {
+ managedPortletFilter.managedStart();
+ }
+
+ public void managedStop()
+ {
+ managedPortletFilter.managedStop();
+ }
}
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-25 22:53:37 UTC (rev 10110)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-25 23:12:41 UTC (rev 10111)
@@ -377,6 +377,7 @@
<package-jsr286-ext-test test="portletresponses"/>
<package-jsr286-ext-test test="dispatcher"/>
<package-jsr286-ext-test test="portletcontext"/>
+ <package-jsr286-ext-test test="portletinterface"/>
<!-- -->
<jar jarfile="${test.temp.lib}/portlet-test-lib.jar">
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/portlet.xml 2008-02-25
23:12:41 UTC (rev 10111)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+</portlet-app>
Added:
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/jsr286/ext/portletinterface-war/WEB-INF/web.xml 2008-02-25
23:12:41 UTC (rev 10111)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+
<listener-class>org.jboss.portal.unit.PortletTestSuite</listener-class>
+ </listener>
+</web-app>
Modified:
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-25
22:53:37 UTC (rev 10110)
+++
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-02-25
23:12:41 UTC (rev 10111)
@@ -35,6 +35,7 @@
</bean>
<bean name="PortletApplicationDeployer"
class="org.jboss.portal.portlet.test.TestPortletApplicationDeployer">
+ <alias>PortletApplicationRegistry</alias>
<property name="servletContainer"><inject
bean="ServletContainer"/></property>
<property name="driver"><inject
bean="TestDriverServer"/></property>
<property name="portletContainerInvoker"><inject
bean="PortletContainerInvoker"/></property>
@@ -70,7 +71,9 @@
</bean>
<!-- Container stack -->
- <bean name="ValveInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"/>
+ <bean name="ValveInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
+ <property name="portletApplicationRegistry"><inject
bean="PortletApplicationRegistry"
state="Instantiated"/></property>
+ </bean>
<bean name="SecureTransportInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"/>
<bean name="ContextDispatcherInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
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-25
22:53:37 UTC (rev 10110)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-02-25
23:12:41 UTC (rev 10111)
@@ -223,6 +223,10 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-ext-portletcontext.war"/>
</generic>
+ <generic>
+ <class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ <property name="archiveId"
value="test-jsr286-ext-portletinterface.war"/>
+ </generic>
<!--Misc Tests-->
<!--