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

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


         {
            name1 = ((AbstractUniversalTestPortlet)portlet).getPortletConfig().getPortletName();
            request.setAttribute("NAME", name1);

            //
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });
      seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
View Full Code Here


            calls.add("0");
            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");

            // Refresh
            String url = response.createRenderURL().toString();
            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(1, renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            //
            calls.add("1");
            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");

            // Refresh
            String url = response.createActionURL().toString();
            return new InvokeGetResponse(url);
         }
      });

      //
      seq.bindAction(2, actionjp, new PortletActionTestAction()
View Full Code Here

            // Create invalidating action url for later use
            url = response.createActionURL().toString();

            // Refresh
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

      //
      seq.bindAction(1, p1renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Should not be called
            calls.add("1");
            return null;
         }
      });
      seq.bindAction(1, 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(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");

            // Configure the navitional state
            configurator.configureNavigationalState(response);
         }
      });
      seq.bindAction(5, p1renderjp, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            // Should be called
            calls.add("5_render");

            // Refresh with different navigational state to check it will be called in the next render phase
            PortletURL url = response.createRenderURL();
            url.setPortletMode(PortletMode.VIEW);
            url.setWindowState(WindowState.NORMAL);
            return new InvokeGetResponse(url.toString());
         }
      });

      //
      seq.bindAction(6, p1renderjp, new PortletRenderTestAction()
View Full Code Here

            // Content is not cached
            calls.add("0");

            // Refresh
            url = response.createActionURL().toString();
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

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

      //
      seq.bindAction(2, p1actionjp, new PortletActionTestAction()
View Full Code Here

            case 0:
            {
               // Invoking VIEW mode
               PortletURL url = resp.createRenderURL();
               url.setPortletMode(PortletMode.VIEW);
               return new InvokeGetResponse(url.toString());
            }
            case 1:
            {
               assertEquals("doView", methodCall);

               // Invoking EDIT mode
               PortletURL url = resp.createRenderURL();
               url.setPortletMode(PortletMode.EDIT);
               return new InvokeGetResponse(url.toString());
            }
            case 2:
            {
               assertEquals("doEdit", methodCall);

               // Invoking HELP mode
               PortletURL url = resp.createRenderURL();
               url.setPortletMode(PortletMode.HELP);
               return new InvokeGetResponse(url.toString());
            }
            case 3:
            {
               assertEquals("doHelp", methodCall);
View Full Code Here

         HTTPDriverResponse resp = (HTTPDriverResponse)response;
         if (resp instanceof InvokeMethodResponse)
         {
            if (resp instanceof InvokeGetResponse)
            {
               InvokeGetResponse igr = (InvokeGetResponse)resp;
               nextCommandContext = new ClientRequestContext(respCtx, new DoGetRequest(igr.getURI(), igr.getHeaders()));
            }
            else
            {
               InvokePostResponse ipr = (InvokePostResponse)resp;
               Body dpcb = ipr.getBody();
View Full Code Here

            writer.write("@BEFORE_NON_ESCAPED@");
            url.write(writer, false);
            writer.write("@AFTER_NON_ESCAPED@");

            //
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });
      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
View Full Code Here

      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
         {
            //here we should test if after resetBuffer() response properties were cleared
            //but it's rather hard to do this now as there is no getProperty() method.
            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

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

            PortletURL url = response.createRenderURL();
            url.setParameter("testParamOne", "testValue1");
            url.setParameter("testParameterTwo", "testValue2");


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

      seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
      {
         protected Response run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
         {
            response.setContentType("text/html");
            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().
               getRequestDispatcher("/renderURL.jsp");

            PortletURL pu1 = response.createRenderURL();

            pu1.setWindowState(WindowState.NORMAL);
            pu1.setPortletMode(PortletMode.EDIT);
            pu1.setSecure(true);

            // Params from previos request
            pu1.setParameter("testParamOne", "testValue1");
            pu1.setParameter("testParameterTwo", "testValue2");

            PortletURL pu2 = response.createRenderURL();
            pu2.setSecure(false);

            pu2.setParameter("testParam", new String[] {"testParamValue", "testParamValue2"});
            pu2.setParameter("secondParam", "testParamValue");
            pu2.setProperty("testProperty", "testPropValue");
            pu2.setProperty("testProperty", "testPropValue2");
            pu2.setProperty("secondProperty", "testPropValue");

            StringWriter sw = new StringWriter();

            // Create session
            request.getPortletSession();

            // escapeXml=true
            pu1.write(sw, true);
            String url1 = response.encodeURL(sw.toString());

            sw = new StringWriter();

            // escapeXml=false
            pu2.write(sw, false);
            String url2 = response.encodeURL(sw.toString());
            sw.flush();


            expectedResults = new String[]{ url1, url1, url2};

            include(dispatcher, request, response);


            return new InvokeGetResponse(response.createRenderURL().toString());
         }
      });

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

      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

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.