Examples of InvokeGetResponse


Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            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) throws PortletException, IOException
         {
            if (performTest(LifeCyclePhase.ACTION))
            {
               doTest(portlet, request, response);
            }

            //
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            if (performTest(LifeCyclePhase.EVENT))
            {
               doTest(portlet, request, response);
            }
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            if (performTest(LifeCyclePhase.RENDER))
            {
               doTest(portlet, request, response);
            }

            //
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, service);
      seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            PortletURL url = response.createActionURL();
            return new InvokeGetResponse(url.toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

            PortletURL renderURL = response.createRenderURL();
            renderURL.setParameter("foo", new String[]{"foo_value1","foo_value2"});
            renderURL.setParameter("bar", new String[]{"bar_value1","bar_value2"});
            renderURL.setParameter("juu", new String[]{"juu_value1","juu_value2"});
            renderURL.setParameter("daa", new String[]{"daa_value1","daa_value2"});
            return new InvokeGetResponse(renderURL.toString());
         }
      });
      seq.bindAction(1, UTP5.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

   {
      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            InvokeGetResponse resource = new InvokeGetResponse(response.createResourceURL().toString());
            resource.addHeader("myheader", "render-value");
            return resource;
         }
      });

      seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

            }
            catch (IllegalStateException e)
            {
               //expected
            }
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            PortletURL url = response.createActionURL();
            return new InvokeGetResponse(url.toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            response.setRenderParameter("key1", "some strange value to overwrite");
            response.setRenderParameter("key2", "some strange value to overwrite 2");
            response.setRenderParameter("key1", "k1value1");
            response.setRenderParameter("key2", new String[]{"k2value1", "k2value2", "k2value3"});
         }
      });

      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            //we should receive overwrite values
            assertEquals("k1value1", request.getParameter("key1"));
            assertEquals(new String[]{"k2value1", "k2value2", "k2value3"}, request.getParameterValues("key2"));
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

   {
      seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });

      // Test updates from an action
      seq.bindAction(1, UTP3.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            response.setRenderParameter("foo", new String[]{"foo_value1", "foo_value2"});
            response.setRenderParameter("bar", new String[]{"bar_value1", "bar_value2"});
         }
      });
      seq.bindAction(1, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            assertEquals(new String[]{"foo_value1","foo_value2"}, request.getParameterValues("foo"));
            assertEquals(new String[]{"bar_value1","bar_value2"}, request.getParameterValues("bar"));
            return null;
         }
      });
      seq.bindAction(1, UTP4.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            String[] fooValues = request.getParameterValues("foo");
            assertEquals(new String[]{"foo_value1","foo_value2"}, fooValues);
            assertEquals(null, request.getParameterValues("bar"));
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

      // Test updates from a render URL
      seq.bindAction(2, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            PortletURL url = response.createRenderURL();
            url.setParameter("foo", new String[]{"foo_value3", "foo_value4"});
            url.setParameter("bar", new String[]{"bar_value3", "bar_value4"});
            return new InvokeGetResponse(url.toString());
         }
      });
      seq.bindAction(3, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            PortletURL actionURL = response.createActionURL();
            actionURL.setParameter("key1", "k1actionvalue");
            actionURL.setParameter("key3", "k3actionvalue");
            return new InvokeGetResponse(actionURL.toString());
         }
      });

      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException, PortletException
         {
            Map<String, String[]> actionParams = new HashMap<String, String[]>();
            actionParams.put("key1", new String[]{"k1actionvalue"});
            actionParams.put("key3", new String[]{"k3actionvalue"});
            assertParameterMap(actionParams, request);

            //
            String path = "/universalServletA?key1=k1value1&key2=k2value1";
            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher(path);
            dispatcher.include(request, response);

            //assert that params from query string doesn't last longer then in include call
            assertParameterMap(actionParams, request);

            //
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, new ServletServiceTestAction()
      {
         protected Response run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
         {
            assertEquals(new String[]{"k1value1","k1actionvalue"}, request.getParameterValues("key1"));
            assertEquals(new String[]{"k2value1"}, request.getParameterValues("key2"));
            assertEquals(new String[]{"k3actionvalue"}, request.getParameterValues("key3"));
            return null;
         }
      });

      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String[]> eventParams = new HashMap<String, String[]>();
            assertParameterMap(eventParams, request);

            //
            String path = "/universalServletB?key1=k1value1&key2=k2value1";
            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher(path);
            dispatcher.include(request, response);

            //assert that params from query string doesn't last longer then in include call
            assertParameterMap(eventParams, request);

            //set some render params to test them in dispatcher include (precedense)
            response.setRenderParameter("key1", "k1rendervalue");
            response.setRenderParameter("key3", "k3rendervalue");
         }
      });
      seq.bindAction(1, UTS2.SERVICE_JOIN_POINT, new ServletServiceTestAction()
      {
         protected Response run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
         {
            assertEquals(new String[]{"k1value1"}, request.getParameterValues("key1"));
            assertEquals(new String[]{"k2value1"}, request.getParameterValues("key2"));
            assertEquals(null, request.getParameterValues("key3"));
            return null;
         }
      });

      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            Map<String, String[]> renderParams = new HashMap<String, String[]>();
            renderParams.put("key1", new String[]{"k1rendervalue"});
            renderParams.put("key3", new String[]{"k3rendervalue"});
            assertParameterMap(renderParams, request);

            //
            String path = "/universalServletC?key1=k1value1&key2=k2value1";
            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher(path);
            dispatcher.include(request, response);

            //assert that params from query string doesn't last longer then in include call
            assertParameterMap(renderParams, request);

            //
            ResourceURL resourceURL = response.createResourceURL();
            resourceURL.setParameter("key1", "k1resourcevalue");
            resourceURL.setParameter("key3", "k3resourcevalue");
            return new InvokeGetResponse(resourceURL.toString());
         }
      });
      seq.bindAction(1, UTS3.SERVICE_JOIN_POINT, new ServletServiceTestAction()
      {
         protected Response run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            check(portlet);

            //
            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) throws PortletException, IOException
         {
            check(portlet);

            //
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            check(portlet);
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
View Full Code Here

Examples of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

   {
      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            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) throws PortletException, IOException
         {
            dispatchAndCatchRuntimeException(portlet, request, response);
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchRuntimeException(portlet, request, response);
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            dispatchAndCatchRuntimeException(portlet, request, response);
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, throwRuntimeException);
      seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchRuntimeException(portlet, request, response);
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(2, UTS1.SERVICE_JOIN_POINT, throwRuntimeException);

      //
      seq.bindAction(3, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchIOException(portlet, request, response);
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(3, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchIOException(portlet, request, response);
         }
      });
      seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchIOException(portlet, request, response);
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(3, UTS1.SERVICE_JOIN_POINT, throwIOException);
      seq.bindAction(4, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchIOException(portlet, request, response);
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(4, UTS1.SERVICE_JOIN_POINT, throwIOException);

      //
      seq.bindAction(5, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchServletException(portlet, request, response);
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(5, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchServletException(portlet, request, response);
         }
      });
      seq.bindAction(5, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
         {
            dispatchAndCatchServletException(portlet, request, response);
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(5, UTS1.SERVICE_JOIN_POINT, throwServletException);
      seq.bindAction(6, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
         {
            dispatchAndCatchServletException(portlet, request, response);
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });
      seq.bindAction(6, UTS1.SERVICE_JOIN_POINT, throwServletException);

      //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.