Package org.springframework.mock.web.portlet

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


    assertEquals("edit", mav.getViewName());
  }

  public void testHelpPortletMode() throws Exception {
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    request.setPortletMode(PortletMode.HELP);
    ModelAndView mav = controller.handleRenderRequest(request, response);
    assertEquals("help", mav.getViewName());
  }
View Full Code Here


    assertEquals("help", mav.getViewName());
  }
 
  public void testViewPortletMode() throws Exception {
    MockRenderRequest request = new MockRenderRequest();
    MockRenderResponse response = new MockRenderResponse();
    request.setPortletMode(PortletMode.VIEW);
    ModelAndView mav = controller.handleRenderRequest(request, response);
    assertEquals("view", mav.getViewName());
  }
View Full Code Here

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

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

    assertEquals("value", actionResponse.getRenderParameter("test"));

    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");
    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");
    response = new MockRenderResponse();
    portlet.render(request, response);
    assertEquals("test-name1-typeMismatch", response.getContentAsString());
  }
View Full Code Here

    portlet.init(new MockPortletConfig());

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

    portlet.init(new MockPortletConfig());

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

    MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
    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");
    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");
    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());
  }
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());
  }
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());
  }
View Full Code Here

TOP

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

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.