From portal-commits at lists.jboss.org Tue Feb 5 09:34:50 2008 Content-Type: multipart/mixed; boundary="===============5270770382586857980==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9773 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test. Date: Tue, 05 Feb 2008 09:34:50 -0500 Message-ID: --===============5270770382586857980== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/T= estInstanceContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortalContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletApplicationDeployer.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletInvocationContext.java modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/T= estPortletInvoker.java Log: those files should have been deleted... Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestInstanceContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 Julien Viet - * @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 =3D portletContext.getId(); - PortletContext target =3D portletContext; - boolean useClone =3D false; - HttpSession session =3D req.getSession(false); - if (session !=3D null) - { - PortletContext clone =3D (PortletContext)session.getAttribute("cl= one." + id); - if (clone !=3D null) - { - target =3D clone; - useClone =3D true; - } - } - - // - this.req =3D req; - this.useClone =3D useClone; - this.target =3D target; - this.id =3D id; - this.modifiable =3D modifiable; - } - - public PortletContext getTarget() - { - return target; - } - - public String getId() - { - return id; - } - - public AccessMode getAccessMode() - { - return modifiable ? (useClone ? AccessMode.READ_WRITE : AccessMode.C= LONE_BEFORE_WRITE) : AccessMode.READ_ONLY; - } - - public void onStateEvent(StateEvent event) - { - target =3D event.getPortletContext(); - req.getSession().setAttribute("clone." + id, target); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortalContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 Julien Viet - * @version $Revision: 630 $ - */ -public class TestPortalContext extends AbstractPortalContext -{ - public TestPortalContext() - { - super(Collections.singletonMap("javax.portlet.markup.head.element.su= pport", "true")); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortletApplicationDeployer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 Chris Laprun - * @version $Revision$ - */ -public class TestPortletApplicationDeployer extends PortletApplicationDepl= oyer -{ - /** . */ - private Object driver; - - public Object getDriver() - { - return driver; - } - - public void setDriver(Object driver) - { - this.driver =3D 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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.PrincipalAttributeResol= ver; -import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author Julien Viet - * @version $Revision: 1.1 $ - */ -public class TestPortletInvocationContext extends AbstractPortletInvocatio= nContext -{ - - /** . */ - 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 =3D clientRequest; - this.clientResponse =3D clientResponse; - this.windowId =3D windowId; - this.pageState =3D pageState; - this.urlRenderer =3D new PortletURLRenderer(pageState, windowId, cli= entRequest, clientResponse); - - // - addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttribut= eResolver(clientRequest)); - addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); - addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); - addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); - addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); - } - - public HttpServletRequest getClientRequest() throws IllegalStateExcepti= on - { - return clientRequest; - } - - public HttpServletResponse getClientResponse() throws IllegalStateExcep= tion - { - return clientResponse; - } - - public String renderURL(ContainerURL containerURL, Boolean wantSecure, = Boolean wantAuthenticated, boolean relative) - { - return urlRenderer.renderURL(containerURL, wantSecure, wantAuthentic= ated, relative); - } -} Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/= test/TestPortletInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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.PortletInvocationRespo= nse; -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 Julien Viet - * @version $Revision: 6712 $ - */ -public class TestPortletInvoker implements PortletInvoker -{ - - /** . */ - private InterceptorStackFactory stackFactory; - - /** . */ - private PortletInvoker producer; - - /** . */ - private InvocationHandler handler =3D new InvocationHandler() - { - public Object invoke(Invocation invocation) throws Exception, Invoca= tionException - { - PortletInvocation portletInvocation =3D (PortletInvocation)invoca= tion; - try - { - portletInvocation.setHandler(null); - return producer.invoke(portletInvocation); - } - finally - { - portletInvocation.setHandler(this); - } - } - }; - - public InterceptorStackFactory getStackFactory() - { - return stackFactory; - } - - public void setStackFactory(InterceptorStackFactory stackFactory) - { - this.stackFactory =3D stackFactory; - } - - public PortletInvoker getProducer() - { - return producer; - } - - public void setProducer(PortletInvoker producer) - { - this.producer =3D producer; - } - - public Set getPortlets() throws PortletInvokerException - { - return producer.getPortlets(); - } - - public Portlet getPortlet(PortletContext portletContext) throws Illegal= ArgumentException, PortletInvokerException - { - return producer.getPortlet(portletContext); - } - - public PortletInvocationResponse invoke(PortletInvocation invocation) t= hrows PortletInvokerException - { - InvocationHandler prevHandler =3D 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, UnsupportedOperationExc= eption - { - throw new UnsupportedOperationException(); - } - - public List destroyClones(List por= tletContexts) throws IllegalArgumentException, PortletInvokerException, Uns= upportedOperationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext, Set key= s) throws IllegalArgumentException, PortletInvokerException, UnsupportedOpe= rationException - { - throw new UnsupportedOperationException(); - } - - public PropertyMap getProperties(PortletContext portletContext) throws = IllegalArgumentException, PortletInvokerException, UnsupportedOperationExce= ption - { - throw new UnsupportedOperationException(); - } - - public PortletContext setProperties(PortletContext portletContext, Prop= ertyChange[] changes) throws IllegalArgumentException, PortletInvokerExcept= ion, UnsupportedOperationException - { - throw new UnsupportedOperationException(); - } -} --===============5270770382586857980==--