Examples of StaticExpression


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

import org.springframework.webflow.test.MockRequestContext;

public class ActionResultExposerTests extends TestCase {

  public void testEvaluateExpressionResult() throws Exception {
    StaticExpression resultExpression = new StaticExpression("");
    ActionResultExposer exposer = new ActionResultExposer(resultExpression, null, null);
    MockRequestContext context = new MockRequestContext();
    exposer.exposeResult("foo", context);
    assertEquals("foo", resultExpression.getValue(null));
  }
View Full Code Here

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

    exposer.exposeResult("foo", context);
    assertEquals("foo", resultExpression.getValue(null));
  }

  public void testEvaluateExpressionNullResult() throws Exception {
    StaticExpression resultExpression = new StaticExpression("");
    ActionResultExposer exposer = new ActionResultExposer(resultExpression, null, null);
    MockRequestContext context = new MockRequestContext();
    exposer.exposeResult(null, context);
    assertEquals(null, resultExpression.getValue(null));
  }
View Full Code Here

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

    exposer.exposeResult(null, context);
    assertEquals(null, resultExpression.getValue(null));
  }

  public void testEvaluateExpressionResultExposerWithTypeConversion() throws Exception {
    StaticExpression resultExpression = new StaticExpression("");
    ActionResultExposer exposer = new ActionResultExposer(resultExpression, Integer.class,
        new DefaultConversionService());
    MockRequestContext context = new MockRequestContext();
    exposer.exposeResult("3", context);
    assertEquals(new Integer(3), resultExpression.getValue(null));
  }
View Full Code Here

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

    exposer.exposeResult("3", context);
    assertEquals(new Integer(3), resultExpression.getValue(null));
  }

  public void testEvaluateExpressionResultExposerWithTypeConversionForgotArgument() throws Exception {
    StaticExpression resultExpression = new StaticExpression("");
    try {
      new ActionResultExposer(resultExpression, Integer.class, null);
      fail("should have failed iae");
    } catch (IllegalArgumentException e) {
View Full Code Here

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

import org.springframework.webflow.execution.Event;
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"), null, null);
    MockRequestContext context = new MockRequestContext();
    Event result = action.execute(context);
    assertEquals("success", result.getId());
    assertEquals("bar", name.getValue(null));
  }
View Full Code Here

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

    assertEquals("success", result.getId());
    assertEquals("bar", name.getValue(null));
  }

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

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

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 = (String[]) context.getFlashScope().getArray(View.RENDER_FRAGMENTS_ATTRIBUTE,
View Full Code Here

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

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

  public void testRenderWithBindingModel() throws Exception {
    MockRequestControlContext context = new MockRequestControlContext();
    context.setCurrentState(new ViewState(context.getRootFlow(), "test", new StubViewFactory()));
    Object 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

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

    context.putRequestParameter("stringArrayProperty", new String[] { "foo", "bar", "baz" });
    context.putRequestParameter("integerArrayProperty", new String[] { "1", "2", "3" });
    context.putRequestParameter("primitiveArrayProperty", new String[] { "1", "2", "3" });
    context.putRequestParameter("listProperty", new String[] { "1", "2", "3" });
    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
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.