Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Transition


  }

  public void testTransitionExecutingNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Transition transition = new Transition(new DefaultTargetStateResolver("target"));
    listener.transitionExecuting(context, transition);
  }
View Full Code Here


  }

  public void testTransitionExecutingWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Transition transition = new Transition(new DefaultTargetStateResolver("target"));
    SecurityRule rule = getSecurityRuleAnyAuthorized();
    ((LocalAttributeMap) transition.getAttributes()).put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.transitionExecuting(context, transition);
  }
View Full Code Here

    state = new TransitionableState(flow, "state1") {
      protected void doEnter(RequestControlContext context) {
        throw new FlowExecutionException(getFlow().getId(), getId(), "Oops!", new TestException());
      }
    };
    state.getTransitionSet().add(new Transition(toState("end")));
  }
View Full Code Here

    ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
      public void resume(RequestControlContext context) {
        context.execute(getRequiredTransition(context));
      }
    };
    state.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("finish")));
    EndState end = new EndState(flow, "finish");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
View Full Code Here

  public void testStatic() throws Exception {
    String expression = "mockState";
    TargetStateResolver resolver = (TargetStateResolver) converter.convertSourceToTargetClass(expression,
        TargetStateResolver.class);
    MockRequestContext context = new MockRequestContext();
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

    String expression = "${flowScope.lastState}";
    TargetStateResolver resolver = (TargetStateResolver) converter.convertSourceToTargetClass(expression,
        TargetStateResolver.class);
    MockRequestContext context = new MockRequestContext();
    context.getFlowScope().put("lastState", "mockState");
    Transition transition = new Transition();
    assertEquals("mockState", resolver.resolveTargetState(transition, null, context).getId());
  }
View Full Code Here

    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    factoryBean.afterPropertiesSet();
View Full Code Here

    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    Set attributes = new HashSet();
View Full Code Here

      return new Transition[0];
    }
  }

  private Transition[] parseIf(IfModel ifModel) {
    Transition thenTransition = parseThen(ifModel);
    if (StringUtils.hasText(ifModel.getElse())) {
      Transition elseTransition = parseElse(ifModel);
      return new Transition[] { thenTransition, elseTransition };
    } else {
      return new Transition[] { thenTransition };
    }
  }
View Full Code Here

        final Flow flow = new Flow(id);
        final ActionState state1 = new ActionState(flow, "state1-action");
        final ViewState state2 = new ViewState(flow, "state2-view", new MockViewFactory("view"));
        new EndState(flow, "state3-end");
        state1.getActionList().add(new MockAction("state1-result"));
        state1.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state2-view")));
        state2.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state3-end")));
        return flow;
    }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.Transition

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.