Examples of BindBean


Examples of org.springframework.webflow.mvc.view.MvcViewTests.BindBean

  public void testResumeEvent() throws Exception {
    MockRequestContext context = new MockRequestContext();
    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("booleanProperty", "true");
    context.putRequestParameter("_booleanProperty", "whatever");
    BindBean bindBean = new BindBean();
    StaticExpression modelObject = new StaticExpression(bindBean);
    modelObject.setExpressionString("bindBean");
    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = (org.springframework.web.servlet.View) EasyMock
        .createMock(org.springframework.web.servlet.View.class);
    AbstractMvcView view = new PortletMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    view.processUserEvent();
    assertEquals(true, bindBean.getBooleanProperty());
    ViewActionStateHolder holder = (ViewActionStateHolder) context.getFlashScope().get(ViewActionStateHolder.KEY);
    assertEquals("submit", holder.getEventId());
    assertNotNull(holder.getMappingResults());
  }
View Full Code Here

Examples of org.springframework.webflow.mvc.view.MvcViewTests.BindBean

  public void testResumeEvent() throws Exception {
    MockRequestContext context = new MockRequestContext();
    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("booleanProperty", "bogus");
    context.putRequestParameter("_booleanProperty", "whatever");
    BindBean bindBean = new BindBean();
    StaticExpression modelObject = new StaticExpression(bindBean);
    modelObject.setExpressionString("bindBean");
    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = EasyMock.createMock(org.springframework.web.servlet.View.class);
    AbstractMvcView view = new PortletMvcView(mvcView, context);
    view.setExpressionParser(new WebFlowSpringELExpressionParser(new SpelExpressionParser()));
    view.setMessageCodesResolver(new WebFlowMessageCodesResolver());
    view.processUserEvent();
    assertEquals(true, bindBean.getBooleanProperty());
  }
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.