Package org.springframework.mock.web.portlet

Examples of org.springframework.mock.web.portlet.MockActionRequest


        return wac;
      }
    };
    portlet.init(new MockPortletConfig());

    MockActionRequest actionRequest = new MockActionRequest(PortletMode.VIEW);
    MockActionResponse actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);
    assertEquals("value", actionResponse.getRenderParameter("test"));

    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    request.setSession(actionRequest.getPortletSession());
    request.setParameters(actionResponse.getRenderParameterMap());
    request.addParameter("name", "name1");
    request.addParameter("age", "value2");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
View Full Code Here


    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView", response.getContentAsString());

    MockActionRequest actionRequest = new MockActionRequest("this");
    MockActionResponse actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-value", response.getContentAsString());

    actionRequest = new MockActionRequest("that");
    actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-value2", response.getContentAsString());

    actionRequest = new MockActionRequest("else");
    actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-value3", response.getContentAsString());

    actionRequest = new MockActionRequest("error");
    actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    request.setSession(actionRequest.getPortletSession());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("XXX", response.getContentAsString());

    MockEventRequest eventRequest = new MockEventRequest(new MockEvent("event1"));
View Full Code Here

    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView", response.getContentAsString());

    MockActionRequest actionRequest = new MockActionRequest("this");
    MockActionResponse actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    request.setSession(actionRequest.getPortletSession());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-value", response.getContentAsString());

    actionRequest = new MockActionRequest();
    actionRequest.addParameter("action", "details");
    actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(actionResponse.getRenderParameterMap());
    request.setSession(actionRequest.getPortletSession());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-details", response.getContentAsString());

    MockEventRequest eventRequest = new MockEventRequest(new MockEvent("event1"));
    eventRequest.setParameters(actionRequest.getParameterMap());
    MockEventResponse eventResponse = new MockEventResponse();
    portlet.processEvent(eventRequest, eventResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(eventResponse.getRenderParameterMap());
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myLargeView-value3", response.getContentAsString());

    eventRequest = new MockEventRequest(new MockEvent("event3"));
    eventRequest.setParameters(actionRequest.getParameterMap());
    eventResponse = new MockEventResponse();
    portlet.processEvent(eventRequest, eventResponse);

    request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
    request.setParameters(eventResponse.getRenderParameterMap());
View Full Code Here

        return wac;
      }
    };
    portlet.init(new MockPortletConfig());

    MockActionRequest actionRequest = new MockActionRequest(PortletMode.VIEW);
    MockActionResponse actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);
    assertEquals("value", actionResponse.getRenderParameter("test"));

    MockRenderRequest request = new MockRenderRequest(PortletMode.EDIT);
View Full Code Here

        return wac;
      }
    };
    portlet.init(new MockPortletConfig());

    MockActionRequest actionRequest = new MockActionRequest(PortletMode.VIEW);
    MockActionResponse actionResponse = new MockActionResponse();
    portlet.processAction(actionRequest, actionResponse);
    assertEquals("value", actionResponse.getRenderParameter("test"));

    MockRenderRequest request = new MockRenderRequest(PortletMode.EDIT);
View Full Code Here

TOP

Related Classes of org.springframework.mock.web.portlet.MockActionRequest

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.