Package org.gatein.pc.test.unit.protocol.response

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


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


         }
      });
View Full Code Here

            catch (PortletModeException e)
            {
               throw new IllegalStateException("Edit mode in test not supported");
            }

            return new InvokeGetResponse(url.toString());
         }
      });

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

            test(response, URLRenderer.ToString);
            test(response, URLRenderer.Write);
            test(response, URLRenderer.WriteXMLEspaced);

            //
            return new InvokeGetResponse(response.createResourceURL().toString());
         }
      });
      seq.bindAction(1, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
View Full Code Here

      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            // Invoke render with header
            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
            render.addHeader("myheader", "render-value");

            return render;
         }
      });
View Full Code Here

            assertEquals(null, actionURL.getPortletMode());
            assertEquals(null, actionURL.getWindowState());
            assertEquals(0, actionURL.getParameterMap().size());

            //
            return new InvokeGetResponse(s);
         }
      });
      seq.bindAction(1, UTP1.ACTION_JOIN_POINT, new PortletActionTestAction()
      {
         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(Collections.singletonMap("foo", new String[]{"fooAction"}), request);
            assertEquals(PortletMode.EDIT, request.getPortletMode());
            assertEquals(WindowState.MAXIMIZED, request.getWindowState());
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            PortletURL renderURL = response.createRenderURL();

            //
            String s = renderURL.toString();

            //
            assertEquals(null, renderURL.getPortletMode());
            assertEquals(null, renderURL.getWindowState());
            assertEquals(0, renderURL.getParameterMap().size());

            //
            return new InvokeGetResponse(s);
         }
      });
      seq.bindAction(2, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
         {
            assertParameterMap(Collections.singletonMap("foo", new String[]{"fooRender"}), request);
            assertEquals(PortletMode.VIEW, request.getPortletMode());
            assertEquals(WindowState.NORMAL, request.getWindowState());

            //
            ResourceURL resourceURL = response.createResourceURL();

            //
            String s = resourceURL.toString();

            //
            assertEquals(ResourceURL.PAGE, resourceURL.getCacheability());
            assertEquals(0, resourceURL.getParameterMap().size());

            //
            return new InvokeGetResponse(s);
         }
      });
      seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
      {
         protected Response run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
View Full Code Here

      seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            // Invoke render with header
            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
            render.addHeader("myheader", "render-value");

            return render;
         }
      });
View Full Code Here

            assertFalse(propertyNames.contains("myheader"));
            assertNull(request.getProperty("myheader"));
            assertFalse(request.getProperties("myheader").hasMoreElements());

            // Invoke render with header
            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
            render.addHeader("myheader", "render-value");
            return render;
         }
      });

      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            // Test the header is here
            Set propertyNames = Tools.toSet(request.getPropertyNames());
            assertTrue(propertyNames.contains("myheader"));
            assertEquals("render-value", request.getProperty("myheader"));
            Enumeration values = request.getProperties("myheader");
            assertTrue(values.hasMoreElements());
            assertEquals("render-value", values.nextElement());
            assertFalse(values.hasMoreElements());

            // Invoke action with header
            InvokeGetResponse action = new InvokeGetResponse(response.createActionURL().toString());
            action.addHeader("myheader", "action-value");
            return action;
         }
      });

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

         {
            PortletSession session = request.getPortletSession();
            System.out.println(session.getId());
            session.setAttribute("key", "value", PortletSession.APPLICATION_SCOPE);
            String path = request.getContextPath();
            return new InvokeGetResponse(path + "/universalServletA");
         }
      });

      /**
       * This servlet is normally accessed after that the CrossContextSessionAttributePortlet asked
View Full Code Here

   {
      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());
         }
      });

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

TOP

Related Classes of org.gatein.pc.test.unit.protocol.response.InvokeGetResponse

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.