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

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


            //
            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
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertNull(cookieMap.get("action_cookie"));

            //
            Cookie cookie = new Cookie("action_cookie", "action_cookie_value");
            response.addProperty(cookie);

            //
            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
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertEquals("action_cookie_value", cookieMap.get("action_cookie"));
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertEquals("action_cookie_value", cookieMap.get("action_cookie"));

            //
            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) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertEquals("action_cookie_value", cookieMap.get("action_cookie"));

            //
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(2, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertEquals("action_cookie_value", cookieMap.get("action_cookie"));
            assertNull(cookieMap.get("event_cookie"));

            //
            Cookie cookie = new Cookie("event_cookie", "event_cookie_value");
            response.addProperty(cookie);
         }
      });
      seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
            assertEquals("action_cookie_value", cookieMap.get("action_cookie"));
            assertEquals("event_cookie_value", cookieMap.get("event_cookie"));

            //
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(3, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("render_cookie_value", cookieMap.get("render_cookie"));
View Full Code Here


            assertParameterMap(new HashMap<String, String[]>(), request.getPrivateParameterMap());
            assertParameterMap(expectedPublicRenderParameterMap, request.getPublicParameterMap());
            return null;
         }
      });
      seq.bindAction(4, UTP2.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(expectedPublicRenderParameterMap, request);
            assertParameterMap(new HashMap<String, String[]>(), request.getPrivateParameterMap());
View Full Code Here

         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            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
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "foo_1");
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            scopedId1 = assertNotNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            assertEquals("foo_1", request.getAttribute("foo"));

            //
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            refresh1 = response.createRenderURL().toString();

            //
            return null;
         }
      });
      seq.bindAction(2, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "foo_2");
View Full Code Here

            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
         {
            commonPayload = new CommonEventPayload();
            commonPayload.setString("commonpingvalue");
View Full Code Here

         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            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
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "bar");
View Full Code Here

         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            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
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "bar");
View Full Code Here

            InvokeGetResponse get = new InvokeGetResponse(response.createActionURL().toString());
            get.addHeader("Cookie", "foo=foo_value3; bar=bar_value4");
            return get;
         }
      });
      seq.bindAction(2, UTP5.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Map<String, String> cookieMap = createCookieMap(request);
            assertEquals("foo_value3", cookieMap.get("foo"));
View Full Code Here

         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            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
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "foo_1");
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            scopedId1 = assertNotNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            assertEquals("foo_1", request.getAttribute("foo"));

            //
            return null;
         }
      });
      seq.bindAction(1, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(2, UTP2.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            // Send an event to UTP1 which should create a new scope
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
View Full Code Here

         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            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
         {
            assertNull(request.getParameter(PortletRequest.ACTION_SCOPE_ID));
            request.setAttribute("foo", "foo_1");
View Full Code Here

         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            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) throws PortletException, IOException
         {
            assertEquals(new String[]{"foo_value1","foo_value2"}, request.getParameterValues("foo"));
            response.removePublicRenderParameter("foo");
         }
      });
      seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(new HashMap<String, String[]>(), request);
            assertParameterMap(new HashMap<String, String[]>(), request.getPublicParameterMap());
            PortletURL url = response.createRenderURL();
            url.setParameter("foo", new String[]{"foo_value1","foo_value2"});
            return new InvokeGetResponse(url.toString());
         }
      });
      seq.bindAction(3, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(4, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            response.setEvent("Event", null);
         }
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.