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

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


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


            assertEquals(expectedClientDataPrivateMap, request.getPrivateParameterMap());
            assertEquals(expectedPublicMap, request.getPublicParameterMap());
            response.setEvent("Event", null);
         }
      });
      seq.bindAction(2, UTP5.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(expectedPublicMap, request);
            assertEquals(Collections.emptyMap(), request.getPrivateParameterMap());
View Full Code Here

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

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

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

            dispatcher.forward(request, response);

         }
      });

      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            eventCount++;
View Full Code Here

         {
            response.setEvent("Bar", null);
            response.setRenderParameter("foo", "actionbar");
         }
      });
      seq.bindAction(1, UTP9.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            if (request.getEvent().getName().equals("Bar"))
            {
               response.setRenderParameter("foo", "eventbar");
               response.setEvent("Bar", null);
               throw new PortletException();
            }
            else
            {
               fail("Should not be here");
            }
         }
      });
      seq.bindAction(1, UTP9.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            assertEquals(1, request.getParameterMap().size());
            assertTrue(request.getParameterMap().containsKey("foo"));
            assertEquals(new String[]{"actionbar"}, request.getParameterMap().get("foo"));
            return new InvokeGetResponse(response.createActionURL().toString());
         }
      });
      seq.bindAction(2, UTP9.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            response.setEvent("Bar", null);
            response.setRenderParameter("foo", "actionbar");
         }
      });
      seq.bindAction(2, UTP9.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void runWithRuntimeException(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            if (request.getEvent().getName().equals("Bar"))
            {
View Full Code Here

            //
            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, request, response, "GET");
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            check(portlet, request, response, "GET");

            //
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(1, UTS1.SERVICE_JOIN_POINT, service);
      seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
         {
            check(portlet, request, response, "GET");

            //
            InvokePostResponse post = new InvokePostResponse(response.createActionURL().toString());
            post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
            post.setBody(new Body.Form());
            return post;
         }
      });
      seq.bindAction(2, UTS1.SERVICE_JOIN_POINT, service);

      //
      seq.bindAction(3, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            check(portlet, request, response, "POST");

            //
            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
         {
            check(portlet, request, response, "POST");
         }
View Full Code Here

         {
            // Use a declared event to jump to the process event
            response.setEvent("Bar", null);
         }
      });
      seq.bindAction(1, UTP8.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            // We test that we can publish it
            try
View Full Code Here

         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            response.setEvent(new QName("urn:explicit-namespace", "Foo"), null);
         }
      });
      seq.bindAction(1, UTP1.EVENT_JOIN_POINT, new PortletEventTestAction()
      {
         protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
         {
            Event event = request.getEvent();
            assertEquals(new QName("urn:explicit-namespace", "Foo"), event.getQName());
View Full Code Here

TOP

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

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.