Package org.springframework.web.portlet

Examples of org.springframework.web.portlet.DispatcherPortlet.render()


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

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

  public void testAdaptedHandleMethods() throws Exception {
    doTestAdaptedHandleMethods(MyAdaptedController.class);
View Full Code Here


    MockRenderRequest request = new MockRenderRequest(PortletMode.EDIT);
    request.addParameter("param1", "value1");
    request.addParameter("param2", "2");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("test-value1-2", response.getContentAsString());

    request = new MockRenderRequest(PortletMode.HELP);
    request.addParameter("name", "name1");
    request.addParameter("age", "2");
View Full Code Here

    request = new MockRenderRequest(PortletMode.HELP);
    request.addParameter("name", "name1");
    request.addParameter("age", "2");
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("test-name1-2", response.getContentAsString());

    request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("name", "name1");
    request.addParameter("age", "value2");
View Full Code Here

    request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("name", "name1");
    request.addParameter("age", "value2");
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("test-name1-typeMismatch", response.getContentAsString());
  }

  public void testFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
View Full Code Here

    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("name", "name1");
    request.addParameter("age", "value2");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView-name1-typeMismatch-tb1-myValue", response.getContentAsString());
  }

  public void testModelFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
View Full Code Here

    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("name", "name1");
    request.addParameter("age", "value2");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView-name1-typeMismatch-tb1-myValue", response.getContentAsString());
  }

  public void testCommandProvidingFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
View Full Code Here

    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("defaultName", "myDefaultName");
    request.addParameter("age", "value2");
    request.addParameter("date", "2007-10-02");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView-String:myDefaultName-typeMismatch-tb1-myOriginalValue", response.getContentAsString());
  }

  public void testTypedCommandProvidingFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
View Full Code Here

    request.addParameter("myParam", "myValue");
    request.addParameter("defaultName", "10");
    request.addParameter("age", "value2");
    request.addParameter("date", "2007-10-02");
    MockRenderResponse response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView-Integer:10-typeMismatch-tb1-myOriginalValue", response.getContentAsString());

    request = new MockRenderRequest(PortletMode.VIEW);
    request.addParameter("myParam", "myOtherValue");
    request.addParameter("defaultName", "10");
View Full Code Here

    request.addParameter("myParam", "myOtherValue");
    request.addParameter("defaultName", "10");
    request.addParameter("age", "value2");
    request.addParameter("date", "2007-10-02");
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myOtherView-Integer:10-typeMismatch-tb1-myOriginalValue", response.getContentAsString());

    request = new MockRenderRequest(PortletMode.EDIT);
    request.addParameter("myParam", "myValue");
    request.addParameter("defaultName", "10");
View Full Code Here

    request.addParameter("myParam", "myValue");
    request.addParameter("defaultName", "10");
    request.addParameter("age", "value2");
    request.addParameter("date", "2007-10-02");
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("myView-myName-typeMismatch-tb1-myOriginalValue", response.getContentAsString());
  }

  public void testBinderInitializingCommandProvidingFormController() throws Exception {
    DispatcherPortlet portlet = new DispatcherPortlet() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.