Author: julien(a)jboss.com
Date: 2008-01-29 12:12:14 -0500 (Tue, 29 Jan 2008)
New Revision: 9636
Removed:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ErrorHandlingTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/GETMethodTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ObtainingDispatcherTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/QueryStringInRequestDispatcherTestCase.java
Log:
- removed migrated test cases
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ErrorHandlingTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ErrorHandlingTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ErrorHandlingTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,203 +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.test.portlet.jsr168.tck.dispatcher;
-
-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.unit.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.PortletTestContext;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import static org.jboss.unit.api.Assert.fail;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_142, Assertion.JSR168_143})
-public class ErrorHandlingTestCase
-{
-
- public ErrorHandlingTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
- {
-
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
- try
- {
- dispatcher.include(request, response);
- fail();
- }
- catch (RuntimeException e)
- {
- //expected
- }
-
- return new InvokeGetResponse(response.createRenderURL().toString());
- }
- });
-
- seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- return null;
- }
-
- public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- //SPEC:142 - RuntimeException
- throw new RuntimeException();
- }
- });
-
- seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException
- {
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
- try
- {
- dispatcher.include(request, response);
- fail();
- }
- catch (IOException e)
- {
- //expected
- }
-
- return new InvokeGetResponse(response.createRenderURL().toString());
- }
- });
-
- seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- return null;
- }
-
- public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- //SPEC:142 - checked exception of type IOException
- throw new IOException();
- }
- });
-
- seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
- {
-
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
- try
- {
- dispatcher.include(request, response);
- fail();
- }
- catch (PortletException e)
- {
- //expected
- if (!(e.getCause() instanceof ServletException))
- {
- fail();
- }
- }
- return new InvokeGetResponse(response.createRenderURL().toString());
- }
- });
-
- seq.bindAction(2, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- return null;
- }
-
- public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- //SPEC:143 - ServletException
- throw new ServletException();
- }
- });
-
- seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
- {
- /*PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
- try
- {
- dispatcher.include(request,response);
- fail();
- }
- catch(Error e)
- {
- //expected
- }*/
-
- return new EndTestResponse();
- }
- });
-
- seq.bindAction(3, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- return null;
- }
-
- public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- //SPEC:143 - 'other' exception
- throw new Error();
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/GETMethodTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/GETMethodTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/GETMethodTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,89 +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.test.portlet.jsr168.tck.dispatcher;
-
-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.unit.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.PortletTestContext;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import static org.jboss.unit.api.Assert.assertEquals;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_126})
-public class GETMethodTestCase
-{
-
- public GETMethodTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
-
-
- dispatcher.include(request, response);
-
- //assert that servlet handle this as GET
- assertEquals(Boolean.TRUE, (Boolean)UTP1.local.get());
- return new EndTestResponse();
- }
- });
-
- seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- if (request.getMethod().equals("GET"))
- {
- UTP1.local.set(Boolean.TRUE);
- }
- return null;
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestAttributesTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestAttributesTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,113 +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.test.portlet.jsr168.tck.dispatcher;
-
-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.unit.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.PortletTestContext;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import static org.jboss.unit.api.Assert.assertEquals;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_128})
-public class IncludedRequestAttributesTestCase
-{
- public IncludedRequestAttributesTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
- assertNotNull(dispatcher);
- dispatcher.include(request, response);
- //assert that servlet has access to correct objects via attributes
- assertAttributes((AbstractUniversalTestPortlet)portlet, request, response);
-
- dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
- dispatcher.include(request, response);
- //assert that servlet has access to correct objects via attributes
- assertAttributes((AbstractUniversalTestPortlet)portlet, request, response);
-
- return new EndTestResponse();
-
- }
-
- public void assertAttributes(AbstractUniversalTestPortlet portlet, RenderRequest
request, RenderResponse response)
- {
- try
- {
- assertNotNull(UTP1.local1.get());
- assertNotNull(UTP1.local2.get());
- assertNotNull(UTP1.local3.get());
-
- assertEquals(UTP1.local1.get(), portlet.getPortletConfig());
- assertEquals(UTP1.local2.get(), request);
- assertEquals(UTP1.local3.get(), response);
-
- }
- finally
- {
- UTP1.local1.set(null);
- UTP1.local2.set(null);
- UTP1.local3.set(null);
- }
- }
- });
-
- seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- UTP1.local1.set(request.getAttribute("javax.portlet.config"));
- UTP1.local2.set(request.getAttribute("javax.portlet.request"));
- UTP1.local3.set(request.getAttribute("javax.portlet.response"));
- return null;
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,127 +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.test.portlet.jsr168.tck.dispatcher;
-
-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.unit.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import static org.jboss.unit.api.Assert.assertEquals;
-import static org.jboss.unit.api.Assert.assertNull;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_127})
-public class IncludedRequestParametersTestCase
-{
- public IncludedRequestParametersTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA/pathinfo?foo=bar");
- assertNotNull(dispatcher);
-
- //assert that servlet HAS access to specific request attributes
- try
- {
- dispatcher.include(request, response);
-
assertEquals("/test-jsr168-tck-dispatcher/universalServletA/pathinfo",
UTP1.local1.get());
- assertEquals("/test-jsr168-tck-dispatcher", UTP1.local2.get());
- assertEquals("/universalServletA", UTP1.local3.get());
- assertEquals("/pathinfo", UTP1.local4.get());
- assertEquals("foo=bar", UTP1.local5.get());
- }
- finally
- {
- UTP1.local1.set(null);
- UTP1.local2.set(null);
- UTP1.local3.set(null);
- UTP1.local4.set(null);
- UTP1.local5.set(null);
- }
-
- //
- dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
-
- // Assert that servlet has NO access to specific request attributes
- // it shouldn't access that attributes because getNamedDispatcher was
used
- try
- {
- dispatcher.include(request, response);
- assertNull(UTP1.local1.get());
- assertNull(UTP1.local2.get());
- assertNull(UTP1.local3.get());
- assertNull(UTP1.local4.get());
- assertNull(UTP1.local5.get());
- }
- finally
- {
- UTP1.local1.set(null);
- UTP1.local2.set(null);
- UTP1.local3.set(null);
- UTP1.local4.set(null);
- UTP1.local5.set(null);
- }
-
- return new EndTestResponse();
- }
- });
-
- seq.bindAction(0, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
-
UTP1.local1.set(request.getAttribute("javax.servlet.include.request_uri"));
-
UTP1.local2.set(request.getAttribute("javax.servlet.include.context_path"));
-
UTP1.local3.set(request.getAttribute("javax.servlet.include.servlet_path"));
-
UTP1.local4.set(request.getAttribute("javax.servlet.include.path_info"));
-
UTP1.local5.set(request.getAttribute("javax.servlet.include.query_string"));
- return null;
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ObtainingDispatcherTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ObtainingDispatcherTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/ObtainingDispatcherTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,96 +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.test.portlet.jsr168.tck.dispatcher;
-
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.PortletTestContext;
-import org.jboss.portal.unit.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.PortletTestContext;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import static org.jboss.unit.api.Assert.assertNotNull;
-import static org.jboss.unit.api.Assert.assertNull;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletRequestDispatcher;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_121, Assertion.JSR168_122})
-public class ObtainingDispatcherTestCase
-{
- public ObtainingDispatcherTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- UTP1 p = (UTP1)portlet;
- //correct
- PortletRequestDispatcher dispatcher =
p.getPortletContext().getNamedDispatcher("UniversalServletA");
- assertNotNull(dispatcher);
-
- //incorrect
- dispatcher =
p.getPortletContext().getNamedDispatcher("FAKE_NAME_SERVLET");
- assertNull(dispatcher);
-
- //incorrect
- dispatcher = p.getPortletContext().getNamedDispatcher("/");
- assertNull(dispatcher);
-
- //incorrect
- dispatcher =
p.getPortletContext().getNamedDispatcher("/universalServletA");
- assertNull(dispatcher);
-
- //incorrect
- dispatcher =
p.getPortletContext().getRequestDispatcher("UniversalServletA");
- assertNull(dispatcher);
-
- //incorrect
- dispatcher =
p.getPortletContext().getRequestDispatcher("universalServletA");
- assertNull(dispatcher);
-
- //incorrect
- //dispatcher =
getPortletContext().getRequestDispatcher("/UniversalServletA");
- //assertNull(dispatcher);
-
- //incorrect
- //dispatcher = getPortletContext().getRequestDispatcher("/");
- //assertNull(dispatcher);
-
- //correct
- dispatcher =
p.getPortletContext().getRequestDispatcher("/universalServletA");
- assertNotNull(dispatcher);
- return new EndTestResponse();
- }
- });
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/QueryStringInRequestDispatcherTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/QueryStringInRequestDispatcherTestCase.java 2008-01-29
17:09:15 UTC (rev 9635)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/QueryStringInRequestDispatcherTestCase.java 2008-01-29
17:12:14 UTC (rev 9636)
@@ -1,111 +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.test.portlet.jsr168.tck.dispatcher;
-
-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.unit.actions.PortletActionTestAction;
-import org.jboss.portal.unit.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.unit.annotations.TestCase;
-import org.jboss.portal.unit.Assertion;
-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.assertNotNull;
-import static org.jboss.unit.api.Assert.assertEquals;
-import static org.jboss.unit.api.Assert.assertNull;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-(a)TestCase({Assertion.JSR168_123})
-public class QueryStringInRequestDispatcherTestCase
-{
- public QueryStringInRequestDispatcherTestCase(PortletTestCase seq)
- {
- seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
- {
- return new InvokeGetResponse(response.createActionURL().toString());
- }
- });
-
- seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
- {
- protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
- {
- //set some render params to test them in dispatcher include (precedense)
- response.setRenderParameter("key1", "differentValue");
- response.setRenderParameter("key3", "k3value1");
- }
- });
-
- seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
- {
- protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
- {
- String path = "/universalServletA";
- path += "?key1=k1value1&key2=k2value1";
- PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher(path);
- assertNotNull(dispatcher);
-
- dispatcher.include(request, response);
-
- //assert that params from query string doesn't last longer then in
include call
- assertEquals("differentValue",
request.getParameter("key1"));
- assertNull(request.getParameter("key2"));
- return new EndTestResponse();
- }
- });
-
- seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
- {
- protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
- {
- assertEquals("k1value1", request.getParameter("key1"));
- assertEquals("k2value1", request.getParameter("key2"));
- assertEquals("k3value1", request.getParameter("key3"));
- return null;
- }
- });
- }
-}