Package org.springframework.webflow.test

Examples of org.springframework.webflow.test.MockExternalContext


  }

  public void testLaunchFlowExecution() {
    String flowId = "foo";
    MutableAttributeMap input = null;
    MockExternalContext context = new MockExternalContext();

    EasyMock.expect(locator.getFlowDefinition(flowId)).andReturn(definition);
    EasyMock.expect(factory.createFlowExecution(definition)).andReturn(execution);

    execution.start(input, context);
View Full Code Here


  }

  public void testLaunchFlowExecutionEndsAfterProcessing() {
    String flowId = "foo";
    MutableAttributeMap input = null;
    MockExternalContext context = new MockExternalContext();

    EasyMock.expect(locator.getFlowDefinition(flowId)).andReturn(definition);
    EasyMock.expect(factory.createFlowExecution(definition)).andReturn(execution);

    execution.start(input, context);
View Full Code Here

    verifyMocks();
  }

  public void testResumeFlowExecution() {
    String flowExecutionKey = "12345";
    MockExternalContext context = new MockExternalContext();
    FlowExecutionKey key = new GeneratedFlowExecutionKey();

    EasyMock.expect(repository.parseFlowExecutionKey(flowExecutionKey)).andReturn(key);
    EasyMock.expect(repository.getLock(key)).andReturn(lock);
View Full Code Here

  }

  public void testResumeFlowExecutionEndsAfterProcessing() {
    String flowExecutionKey = "12345";
    MockExternalContext context = new MockExternalContext();
    FlowExecutionKey key = new MockFlowExecutionKey("12345");

    EasyMock.expect(repository.parseFlowExecutionKey(flowExecutionKey)).andReturn(key);
    EasyMock.expect(repository.getLock(key)).andReturn(lock);
View Full Code Here

    factoryBean.setFlowExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    factoryBean.setMaxFlowExecutionSnapshots(2);
    factoryBean.setMaxFlowExecutions(1);
    factoryBean.afterPropertiesSet();
    FlowExecutor executor = (FlowExecutor) factoryBean.getObject();
    MockExternalContext context = new MockExternalContext();

    MockExternalContext context2 = new MockExternalContext();
  }
View Full Code Here

    context = new ClassPathXmlApplicationContext("org/springframework/webflow/config/flow-executor.xml");
  }

  public void testConfigOk() {
    FlowExecutor executor = (FlowExecutor) context.getBean("flowExecutor", FlowExecutor.class);
    executor.launchExecution("flow", null, new MockExternalContext());
    FlowExecutor executor2 = (FlowExecutor) context.getBean("flowExecutorSimpleRepo", FlowExecutor.class);
    executor2.launchExecution("flow", null, new MockExternalContext());
  }
View Full Code Here

  public void testPutFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    String key = execution.getKey().toString();
    FlowExecutionKey parsedKey = repository.parseFlowExecutionKey(key);
    FlowExecution execution2 = repository.getFlowExecution(parsedKey);
View Full Code Here

  public void testRemoveFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    repository.removeFlowExecution(execution);
    try {
      repository.getFlowExecution(execution.getKey());
View Full Code Here

  public void testRemoveNoSuchFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    try {
      repository.removeFlowExecution(execution);
      repository.removeFlowExecution(execution);
      fail("Should have failed");
    } catch (NoSuchFlowExecutionException e) {
View Full Code Here

      }
    }));
    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

TOP

Related Classes of org.springframework.webflow.test.MockExternalContext

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.