Examples of MutableAttributeMap


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

  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

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

      public void mapSubflowOutput(AttributeMap flowOutput, RequestContext context) {
      }
    });
    subflow.setInputMapper(new Mapper() {
      public MappingResults map(Object source, Object target) {
        MutableAttributeMap map = (MutableAttributeMap) source;
        assertEquals("bar", map.get("foo"));
        return new DefaultMappingResults(source, target, Collections.EMPTY_LIST);
      }
    });
    new State(subflow, "whatev") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
View Full Code Here

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

      }
    };
    new EndState(subflow, "end");
    subflow.setOutputMapper(new Mapper() {
      public MappingResults map(Object source, Object target) {
        MutableAttributeMap map = (MutableAttributeMap) target;
        map.put("foo", "bar");
        return new DefaultMappingResults(source, target, Collections.EMPTY_LIST);
      }
    });
    subflowState.enter(context);
    assertEquals("parent", context.getActiveFlow().getId());
View Full Code Here

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

    inputMap.put("childInputAttribute", context.getFlowScope().get("parentInputAttribute"));
    return inputMap;
  }

  public void mapSubflowOutput(AttributeMap subflowOutput, RequestContext context) {
    MutableAttributeMap parentAttributes = context.getFlowExecutionContext().getActiveSession().getScope();
    parentAttributes.put("parentOutputAttribute", subflowOutput.get("childInputAttribute"));
  }
View Full Code Here

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

    Flow flow = getFlow(model);
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    FlowExecution execution = factory.createFlowExecution(flow);
    MockExternalContext context = new MockExternalContext();
    MutableAttributeMap map = new LocalAttributeMap();
    map.put("foo", "bar");
    map.put("number", "3");
    map.put("required", "9");
    execution.start(map, context);
    FlowExecutionOutcome outcome = execution.getOutcome();
    assertEquals("end", outcome.getId());
    assertEquals("bar", outcome.getOutput().get("foo"));
    assertEquals("bar", outcome.getOutput().get("differentName"));
View Full Code Here

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

    }
  }

  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

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

   * Logger, usable by subclasses.
   */
  protected final Log logger = LogFactory.getLog(getClass());

  public Object get(String name, ObjectFactory objectFactory) {
    MutableAttributeMap scope = getScope();
    Object scopedObject = scope.get(name);
    if (scopedObject == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("No scoped instance '" + name + "' found; creating new instance");
      }
      scopedObject = objectFactory.getObject();
      scope.put(name, scopedObject);
    } else {
      if (logger.isDebugEnabled()) {
        logger.debug("Returning scoped instance '" + name + "'");
      }
    }
View Full Code Here

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

    flowExecutor = new FlowExecutorImpl(locator, factory, repository);
  }

  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);
View Full Code Here

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

    verifyMocks();
  }

  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);
View Full Code Here

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

      }
    }
  }

  private AttributeMap parseFlowMetaAttributes(FlowModel flow) {
    MutableAttributeMap flowAttributes = parseMetaAttributes(flow.getAttributes());
    parseAndPutPersistenceContext(flow.getPersistenceContext(), flowAttributes);
    parseAndPutSecured(flow.getSecured(), flowAttributes);
    return flowAttributes;
  }
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.