Package org.springframework.webflow.core.collection

Examples of org.springframework.webflow.core.collection.LocalAttributeMap


    }
  }

  public void testCreateWithExecutionAttributes() {
    MutableAttributeMap attributes = new LocalAttributeMap();
    attributes.put("foo", "bar");
    factory.setExecutionAttributes(attributes);
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertEquals(attributes, execution.getAttributes());
  }
View Full Code Here


    assertNull(execution.getKey());
  }

  public void testRestoreExecutionState() {
    FlowExecutionImpl flowExecution = (FlowExecutionImpl) factory.createFlowExecution(flowDefinition);
    LocalAttributeMap executionAttributes = new LocalAttributeMap();
    factory.setExecutionAttributes(executionAttributes);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory();
    factory.setExecutionKeyFactory(keyFactory);
    FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1");
    LocalAttributeMap conversationScope = new LocalAttributeMap();
    SimpleFlowDefinitionLocator locator = new SimpleFlowDefinitionLocator();
    FlowSessionImpl session1 = new FlowSessionImpl();
    session1.setFlowId("flow");
    session1.setStateId("end");
    FlowSessionImpl session2 = new FlowSessionImpl();
View Full Code Here

    assertEquals("custom", event.getId());
    assertEquals("value", event.getAttributes().getString("result"));
  }

  public void testCustomResultCollection() {
    LocalAttributeMap collection = new LocalAttributeMap();
    collection.put("result", "value");
    Event event = action.result("custom", collection);
    assertEquals("custom", event.getId());
    assertEquals("value", event.getAttributes().getString("result"));
  }
View Full Code Here

public class WebFlowELExpressionParserTests extends TestCase {
  private WebFlowELExpressionParser parser = new WebFlowELExpressionParser(DefaultExpressionFactoryUtils
      .createExpressionFactory());

  public void testResolveMap() {
    LocalAttributeMap map = new LocalAttributeMap();
    map.put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(AttributeMap.class));
    Expression exp2 = parser.parseExpression("bogus", new FluentParserContext().evaluate(AttributeMap.class));
    assertEquals("bar", exp.getValue(map));
    assertEquals(null, exp2.getValue(map));
  }
View Full Code Here

    assertEquals("bar", exp.getValue(map));
    assertEquals(null, exp2.getValue(map));
  }

  public void testSetMap() {
    LocalAttributeMap map = new LocalAttributeMap();
    map.put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(MutableAttributeMap.class));
    Expression exp2 = parser
        .parseExpression("bogus", new FluentParserContext().evaluate(MutableAttributeMap.class));
    exp.setValue(map, "baz");
    exp2.setValue(map, "new");
View Full Code Here

    assertEquals("setupForm", action.getMethod());
  }

  public void testResolveEventAttributes() {
    MockRequestContext context = new MockRequestContext();
    LocalAttributeMap attributes = new LocalAttributeMap();
    attributes.put("foo", "bar");
    context.setCurrentEvent(new Event(this, "event", attributes));
    Expression exp = parser.parseExpression("currentEvent.attributes.foo", new FluentParserContext()
        .evaluate(RequestContext.class));
    assertEquals("bar", exp.getValue(context));
  }
View Full Code Here

  EasyMock.expect(bookingService.createBooking(1L, "keith")).andReturn(booking);

  EasyMock.replay(bookingService);

  MutableAttributeMap input = new LocalAttributeMap();
  input.put("hotelId", "1");
  MockExternalContext context = new MockExternalContext();
  context.setCurrentUser("keith");
  startFlow(input, context);

  assertCurrentStateEquals("enterBookingDetails");
View Full Code Here

    request.setRequestURI("/springtravel/app/whatever");
    request.setMethod("GET");
    Map parameters = new HashMap();
    request.setParameters(parameters);
    flowExecutor.launchExecution("foo", flowInput, context);
    LocalAttributeMap output = new LocalAttributeMap();
    output.put("bar", "baz");
    FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output);
    FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome);
    EasyMock.expectLastCall().andReturn(result);
    EasyMock.replay(new Object[] { flowExecutor });
    flowHandlerAdapter.handle(request, response, flowHandler);
View Full Code Here

    request.setMethod("POST");
    request.addParameter("execution", "12345");
    Map parameters = new HashMap();
    request.setParameters(parameters);
    flowExecutor.resumeExecution("12345", context);
    LocalAttributeMap output = new LocalAttributeMap();
    output.put("bar", "baz");
    FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output);
    FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome);
    EasyMock.expectLastCall().andReturn(result);
    EasyMock.replay(new Object[] { flowExecutor });
    ModelAndView mv = flowHandlerAdapter.handle(request, response, flowHandler);
View Full Code Here

    request.setMethod("POST");
    request.addParameter("execution", "12345");
    Map parameters = new HashMap();
    request.setParameters(parameters);
    flowExecutor.resumeExecution("12345", context);
    LocalAttributeMap output = new LocalAttributeMap();
    output.put("bar", "baz");
    context.recordResponseComplete();
    FlowExecutionOutcome outcome = new FlowExecutionOutcome("finish", output);
    FlowExecutionResult result = FlowExecutionResult.createEndedResult("foo", outcome);
    EasyMock.expectLastCall().andReturn(result);
    EasyMock.replay(new Object[] { flowExecutor });
View Full Code Here

TOP

Related Classes of org.springframework.webflow.core.collection.LocalAttributeMap

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.