Package org.springframework.binding.expression.support

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


   * View has not yet been created
   */
  public final void testGetView_Create() {

    lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, new FluentParserContext().template().evaluate(
        RequestContext.class).expectResult(String.class)), lifecycle);

    UIViewRoot newRoot = new UIViewRoot();
    newRoot.setViewId(VIEW_ID);
    ((MockViewHandler) viewHandler).setCreateView(newRoot);
View Full Code Here


   * View already exists in flash scope and must be restored and the lifecycle executed, no event signaled
   */
  public final void testGetView_Restore() {

    lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, new FluentParserContext().template().evaluate(
        RequestContext.class).expectResult(String.class)), lifecycle);

    UIViewRoot existingRoot = new UIViewRoot();
    existingRoot.setViewId(VIEW_ID);
    UIInput input = new UIInput();
View Full Code Here

   * View already exists in flash scope and must be restored and the lifecycle executed, no event signaled
   */
  public final void testGetView_RestoreWithBindings() {

    lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, new FluentParserContext().template().evaluate(
        RequestContext.class).expectResult(String.class)), lifecycle);

    UIViewRoot existingRoot = new UIViewRoot();
    existingRoot.setViewId(VIEW_ID);
    UIPanel panel = new UIPanel();
View Full Code Here

   * signaled
   */
  public final void testGetView_Restore_Ajax() {

    lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, new FluentParserContext().template().evaluate(
        RequestContext.class).expectResult(String.class)), lifecycle);

    UIViewRoot existingRoot = new UIViewRoot();
    existingRoot.setViewId(VIEW_ID);
    ((MockViewHandler) viewHandler).setRestoreView(existingRoot);
View Full Code Here

  /**
   * Third party sets the view root before RESTORE_VIEW
   */
  public final void testGetView_ExternalViewRoot() {
    lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle());
    factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, new FluentParserContext().template().evaluate(
        RequestContext.class).expectResult(String.class)), lifecycle);

    UIViewRoot newRoot = new UIViewRoot();
    newRoot.setViewId(VIEW_ID);
    jsfMock.facesContext().setViewRoot(newRoot);
View Full Code Here

    jsfMock.tearDown();
  }

  public void testGetJSFBean() {
    jsfMock.externalContext().getRequestMap().put("myJsfBean", new Object());
    Expression expr = parser.parseExpression("myJsfBean", new FluentParserContext().evaluate(RequestContext.class));
    Object result = expr.getValue(requestContext);
    assertNotNull("The JSF Bean should not be null.", result);
  }
View Full Code Here

  }

  public void testStartWithMapper() {
    DefaultMapper attributeMapper = new DefaultMapper();
    ExpressionParser parser = new WebFlowSpringELExpressionParser(new SpelExpressionParser());
    Expression x = parser.parseExpression("attr", new FluentParserContext().evaluate(AttributeMap.class));
    Expression y = parser.parseExpression("flowScope.attr",
        new FluentParserContext().evaluate(RequestContext.class));
    attributeMapper.addMapping(new DefaultMapping(x, y));
    flow.setInputMapper(attributeMapper);
    MockRequestControlContext context = new MockRequestControlContext(flow);
    LocalAttributeMap<Object> sessionInput = new LocalAttributeMap<Object>();
    sessionInput.put("attr", "foo");
View Full Code Here

  }

  public void testStartWithMapperButNoInput() {
    DefaultMapper attributeMapper = new DefaultMapper();
    ExpressionParser parser = new WebFlowSpringELExpressionParser(new SpelExpressionParser());
    Expression x = parser.parseExpression("attr", new FluentParserContext().evaluate(AttributeMap.class));
    Expression y = parser.parseExpression("flowScope.attr",
        new FluentParserContext().evaluate(RequestContext.class));
    attributeMapper.addMapping(new DefaultMapping(x, y));
    flow.setInputMapper(attributeMapper);
    MockRequestControlContext context = new MockRequestControlContext(flow);
    LocalAttributeMap<Object> sessionInput = new LocalAttributeMap<Object>();
    flow.start(context, sessionInput);
View Full Code Here

  public void testEndWithOutputMapper() {
    DefaultMapper attributeMapper = new DefaultMapper();
    ExpressionParser parser = new WebFlowSpringELExpressionParser(new SpelExpressionParser());
    Expression x = parser.parseExpression("flowScope.attr",
        new FluentParserContext().evaluate(RequestContext.class));
    Expression y = parser.parseExpression("attr", new FluentParserContext().evaluate(MutableAttributeMap.class));
    attributeMapper.addMapping(new DefaultMapping(x, y));
    flow.setOutputMapper(attributeMapper);
    MockRequestControlContext context = new MockRequestControlContext(flow);
    context.getFlowScope().put("attr", "foo");
    LocalAttributeMap<Object> sessionOutput = new LocalAttributeMap<Object>();
View Full Code Here

  }

  public void testParseSimpleEvalExpressionNoEvalContextWithTypeCoersion() {
    String expressionString = "3 + 4";
    Expression exp = parser
        .parseExpression(expressionString, new FluentParserContext().expectResult(Integer.class));
    assertEquals(new Integer(7), exp.getValue(null));
  }
View Full Code Here

TOP

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

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.