Package org.springframework.webflow.action

Examples of org.springframework.webflow.action.FormAction


  }

  public void testResolveMultiAction() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm", new FluentParserContext()
        .evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
View Full Code Here


  public void testResolveSpringBean() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("testBean", new TestBean());
    ac.getBeanFactory().registerSingleton("action", new TestAction());
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction(TestBean.class));
    context.getRootFlow().setApplicationContext(ac);
    context.getConversationScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    assertEquals("bar", exp.getValue(context));
  }
View Full Code Here

  }

  public void testResolveMultiAction() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm", new FluentParserContext()
        .evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
View Full Code Here

          assertNull(result);
        }
      }
    }));
    FlowExecution execution = factory.createFlowExecution(flow);
    FormAction action = (FormAction) flow.getApplicationContext().getBean("formAction");
    assertFalse(((TestBeanValidator) action.getValidator()).getInvoked());
    execution.start(null, new MockExternalContext());
    MockExternalContext context = new MockExternalContext();
    context.setEventId("submit");
    execution.resume(context);
    assertTrue(((TestBeanValidator) action.getValidator()).getInvoked());
  }
View Full Code Here

          assertNull(result);
        }
      }
    }));
    FlowExecution execution = factory.createFlowExecution(flow);
    FormAction action = (FormAction) flow.getApplicationContext().getBean("formAction");
    assertFalse(((TestBeanValidator) action.getValidator()).getInvoked());
    execution.start(null, new MockExternalContext());
    MockExternalContext context = new MockExternalContext();
    context.setEventId("submit");
    execution.resume(context);
    assertTrue(((TestBeanValidator) action.getValidator()).getInvoked());
  }
View Full Code Here

  }

  public void testResolveMultiAction() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm",
        new FluentParserContext().evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
View Full Code Here

  public void testResolveSpringBean() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("testBean", new TestBean());
    ac.getBeanFactory().registerSingleton("action", new TestAction());
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction(TestBean.class));
    context.getRootFlow().setApplicationContext(ac);
    context.getConversationScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    assertEquals("bar", exp.getValue(context));
  }
View Full Code Here

  }

  public void testResolveMultiAction() {
    MockRequestContext context = new MockRequestContext();
    StaticApplicationContext ac = new StaticApplicationContext();
    ac.getBeanFactory().registerSingleton("multiAction", new FormAction());
    context.getRootFlow().setApplicationContext(ac);
    Expression exp = parser.parseExpression("multiAction.setupForm",
        new FluentParserContext().evaluate(RequestContext.class));
    AnnotatedAction action = (AnnotatedAction) exp.getValue(context);
    assertSame(ac.getBean("multiAction"), action.getTargetAction());
View Full Code Here

TOP

Related Classes of org.springframework.webflow.action.FormAction

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.