simpleDispatcherPortlet.doDispatch(request, response);
assertEquals("34", response.getContentAsString());
}
public void testSimpleFormViewWithSessionAndBindOnNewForm() throws Exception {
MockRenderRequest renderRequest = new MockRenderRequest();
MockRenderResponse renderResponse = new MockRenderResponse();
renderRequest.setParameter("action", "form-session-bind");
renderRequest.setParameter("age", "30");
TestBean testBean = new TestBean();
testBean.setAge(40);
SimplePortletApplicationContext ac =
(SimplePortletApplicationContext)simpleDispatcherPortlet.getPortletApplicationContext();
String formAttribute = ac.getFormSessionAttributeName();
PortletSession session = new MockPortletSession();
session.setAttribute(formAttribute, testBean);
renderRequest.setSession(session);
simpleDispatcherPortlet.doDispatch(renderRequest, renderResponse);
assertEquals("35", renderResponse.getContentAsString());
}