Package org.springframework.binding.expression.support

Examples of org.springframework.binding.expression.support.StaticExpression


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


    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("stringProperty", "foo");
    context.putRequestParameter("integerProperty", "5");
    context.putRequestParameter("dateProperty", "2007-01-01");
    BindBean bindBean = new ValidatingBindBean();
    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());
View Full Code Here

    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("stringProperty", "foo");
    context.putRequestParameter("integerProperty", "5");
    context.putRequestParameter("dateProperty", "2007-01-01");
    BindBean bindBean = new ValidatingBindBeanFallback();
    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());
View Full Code Here

    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("stringProperty", "foo");
    context.putRequestParameter("integerProperty", "bogus");
    context.putRequestParameter("dateProperty", "2007-01-01");
    BindBean bindBean = new ValidatingBindBean();
    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());
View Full Code Here

    context.putRequestParameter("_eventId", "submit");
    context.putRequestParameter("stringProperty", "foo");
    context.putRequestParameter("integerProperty", "bogus");
    context.putRequestParameter("dateProperty", "2007-01-01");
    BindBean bindBean = new ValidatingBindBean();
    StaticExpression modelObject = new StaticExpression(bindBean);
    modelObject.setExpressionString("bindBean");
    context.getMockFlowExecutionContext().putAttribute("validateOnBindingErrors", false);
    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
View Full Code Here

  public void testResumeEventStringValidationHint() throws Exception {
    StubSmartValidator validator = new StubSmartValidator();
    MockRequestContext context = new MockRequestContext();
    context.putRequestParameter("_eventId", "submit");
    TestModel testModel = new TestModel();
    StaticExpression validationHintsExpression = new StaticExpression("State1,AllStates");
    context.getCurrentState().getAttributes().put("validationHints", validationHintsExpression);
    StaticExpression modelExpression = new StaticExpression(testModel);
    modelExpression.setExpressionString("testModel");
    context.getCurrentState().getAttributes().put("model", modelExpression);
    context.getFlowScope().put("testModel", testModel);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
View Full Code Here

    StubSmartValidator validator = new StubSmartValidator();
    MockRequestContext context = new MockRequestContext();
    context.putRequestParameter("_eventId", "submit");
    TestModel testModel = new TestModel();
    Object[] validationHints = new Object[] { TestModel.State1.class };
    StaticExpression validationHintsExpression = new StaticExpression(validationHints);
    context.getCurrentState().getAttributes().put("validationHints", validationHintsExpression);
    StaticExpression modelExpression = new StaticExpression(testModel);
    modelExpression.setExpressionString("testModel");
    context.getCurrentState().getAttributes().put("model", modelExpression);
    context.getFlowScope().put("testModel", testModel);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
View Full Code Here

  }

  public void testNullExpressionEvaluation() throws Exception {
    serviceLocator.getFlowBuilderServices().setExpressionParser(new ExpressionParser() {
      public Expression parseExpression(String expressionString, ParserContext context) throws ParserException {
        return new StaticExpression(null);
      }
    });
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass("doesnt matter",
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
View Full Code Here

import org.springframework.webflow.test.MockRequestContext;

public class SetActionTests extends TestCase {

  public void testSetAction() throws Exception {
    StaticExpression name = new StaticExpression("");
    SetAction action = new SetAction(name, new StaticExpression("bar"));
    MockRequestContext context = new MockRequestContext();
    Event result = action.execute(context);
    assertEquals("success", result.getId());
    assertEquals("bar", name.getValue(null));
  }
View Full Code Here

import org.springframework.webflow.execution.View;
import org.springframework.webflow.test.MockRequestContext;

public class RenderActionTests extends TestCase {
  public void testRenderAction() throws Exception {
    StaticExpression name = new StaticExpression("frag1");
    StaticExpression name2 = new StaticExpression("frag2");
    RenderAction action = new RenderAction(new Expression[] { name, name2 });
    MockRequestContext context = new MockRequestContext();
    Event result = action.execute(context);
    assertEquals("success", result.getId());
    String[] fragments = context.getFlashScope().getArray(View.RENDER_FRAGMENTS_ATTRIBUTE, String[].class);
View Full Code Here

TOP

Related Classes of org.springframework.binding.expression.support.StaticExpression

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.