Author: julien(a)jboss.com
Date: 2008-02-05 09:34:50 -0500 (Tue, 05 Feb 2008)
New Revision: 9773
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestInstanceContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvoker.java
Log:
those files should have been deleted...
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestInstanceContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestInstanceContext.java 2008-02-05
14:32:02 UTC (rev 9772)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestInstanceContext.java 2008-02-05
14:34:50 UTC (rev 9773)
@@ -1,102 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.StateEvent;
-import org.jboss.portal.portlet.spi.InstanceContext;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestInstanceContext implements InstanceContext
-{
-
- /** . */
- private HttpServletRequest req;
-
- /** . */
- private boolean modifiable;
-
- /** . */
- private PortletContext target;
-
- /** . */
- private boolean useClone;
-
- /** . */
- private String id;
-
- public TestInstanceContext(
- HttpServletRequest req,
- PortletContext portletContext,
- boolean modifiable)
- {
- String id = portletContext.getId();
- PortletContext target = portletContext;
- boolean useClone = false;
- HttpSession session = req.getSession(false);
- if (session != null)
- {
- PortletContext clone = (PortletContext)session.getAttribute("clone." +
id);
- if (clone != null)
- {
- target = clone;
- useClone = true;
- }
- }
-
- //
- this.req = req;
- this.useClone = useClone;
- this.target = target;
- this.id = id;
- this.modifiable = modifiable;
- }
-
- public PortletContext getTarget()
- {
- return target;
- }
-
- public String getId()
- {
- return id;
- }
-
- public AccessMode getAccessMode()
- {
- return modifiable ? (useClone ? AccessMode.READ_WRITE :
AccessMode.CLONE_BEFORE_WRITE) : AccessMode.READ_ONLY;
- }
-
- public void onStateEvent(StateEvent event)
- {
- target = event.getPortletContext();
- req.getSession().setAttribute("clone." + id, target);
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java 2008-02-05
14:32:02 UTC (rev 9772)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java 2008-02-05
14:34:50 UTC (rev 9773)
@@ -1,40 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
-
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class TestPortalContext extends AbstractPortalContext
-{
- public TestPortalContext()
- {
-
super(Collections.singletonMap("javax.portlet.markup.head.element.support",
"true"));
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java 2008-02-05
14:32:02 UTC (rev 9772)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletApplicationDeployer.java 2008-02-05
14:34:50 UTC (rev 9773)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.web.WebApp;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class TestPortletApplicationDeployer extends PortletApplicationDeployer
-{
- /** . */
- private Object driver;
-
- public Object getDriver()
- {
- return driver;
- }
-
- public void setDriver(Object driver)
- {
- this.driver = driver;
- }
-
- @Override
- protected void add(WebApp webApp)
- {
- // Set the driver for the web app
- webApp.getServletContext().setAttribute("TestDriverServer", driver);
-
- super.add(webApp);
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05
14:32:02 UTC (rev 9772)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-05
14:34:50 UTC (rev 9773)
@@ -1,97 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller2.PortletURLRenderer;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestPortletInvocationContext extends AbstractPortletInvocationContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- /** . */
- private final String windowId;
-
- /** . */
- private final PageNavigationalState pageState;
-
- /** . */
- private final HttpServletRequest clientRequest;
-
- /** . */
- private final HttpServletResponse clientResponse;
-
- public TestPortletInvocationContext(
- HttpServletRequest clientRequest,
- HttpServletResponse clientResponse,
- String windowId,
- PageNavigationalState pageState,
- MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.clientRequest = clientRequest;
- this.clientResponse = clientResponse;
- this.windowId = windowId;
- this.pageState = pageState;
- this.urlRenderer = new PortletURLRenderer(pageState, windowId, clientRequest,
clientResponse);
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new
PrincipalAttributeResolver(clientRequest));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new
MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return clientRequest;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return clientResponse;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated,
relative);
- }
-}
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvoker.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvoker.java 2008-02-05
14:32:02 UTC (rev 9772)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvoker.java 2008-02-05
14:34:50 UTC (rev 9773)
@@ -1,158 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.state.DestroyCloneFailure;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-
-import java.util.Set;
-import java.util.List;
-
-/**
- * A simple consumer.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public class TestPortletInvoker implements PortletInvoker
-{
-
- /** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
- private PortletInvoker producer;
-
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
- try
- {
- portletInvocation.setHandler(null);
- return producer.invoke(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return producer.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
- {
- return producer.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
- {
- InvocationHandler prevHandler = invocation.getHandler();
- try
- {
- invocation.setHandler(handler);
- return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
- }
- catch (Exception e)
- {
- if (e instanceof PortletInvokerException)
- {
- throw(PortletInvokerException)e;
- }
- else if (e instanceof RuntimeException)
- {
- throw(RuntimeException)e;
- }
- else
- {
- throw new PortletInvokerException(e);
- }
- }
- finally
- {
- invocation.setHandler(prevHandler);
- }
- }
-
- public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext>
portletContexts) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}