Package org.gatein.pc.test.unit.actions

Examples of org.gatein.pc.test.unit.actions.PortletActionTestAction


            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(2, actionjp, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            //
            calls.add("2_action");
View Full Code Here


            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(2, p1actionjp, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            calls.add("2_action");
         }
      });
      seq.bindAction(2, p1renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Should be called
            calls.add("2_render");

            // Refresh with different URL
            PortletURL url = configurator.createPortletURL(response);
            return new InvokeGetResponse(url.toString());
         }
      });

      //
      seq.bindAction(3, p1renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Should be called
            calls.add("3");

            // Invoke with same different URL
            PortletURL url = configurator.createPortletURL(response);
            return new InvokeGetResponse(url.toString());
         }
      });

      //
      seq.bindAction(4, p1renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Should not be called
            calls.add("4");
            return null;
         }
      });
      seq.bindAction(4, p2renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Invalidate with action
            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(5, p1actionjp, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            calls.add("5_action");
View Full Code Here

            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(2, p1actionjp, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            //
            calls.add("2_action");
View Full Code Here

            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) throws IOException
         {
            response.sendRedirect(request.getContextPath() + "/universalServletA");
View Full Code Here

         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))
            {
View Full Code Here

            //
            return post;
         }
      });
      seq.bindAction(2, UTP5.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(expectedClientDataMap, request);
            assertEquals(expectedClientDataPrivateMap, request.getPrivateParameterMap());
View Full Code Here

            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)
         {
            try
            {
View Full Code Here

            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()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
         {
            // Don't set any parameter
         }
View Full Code Here

            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"});
View Full Code Here

            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"});
View Full Code Here

TOP

Related Classes of org.gatein.pc.test.unit.actions.PortletActionTestAction

Copyright © 2018 www.massapicom. 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.