public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException { TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState(); TransitionDefinition transition = state.getTransition(eventId); if (transition == null) { transition = getRootFlow().getGlobalTransition(eventId); } return transition; }
public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException { TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState(); TransitionDefinition transition = state.getTransition(eventId); if (transition == null) { transition = getRootFlow().getGlobalTransition(eventId); } return transition; }
public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException { TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState(); TransitionDefinition transition = state.getTransition(eventId); if (transition == null) { transition = getRootFlow().getGlobalTransition(eventId); } return transition; }
protected void initView(MockRequestContext requestContext) { ((MockFlowSession) requestContext.getFlowExecutionContext().getActiveSession()).setState(new ViewState( requestContext.getRootFlow(), "view", context -> { throw new UnsupportedOperationException("Auto-generated method stub"); })); }
protected void initView(MockRequestContext requestContext) { ((MockFlowSession) requestContext.getFlowExecutionContext().getActiveSession()).setState(new ViewState( requestContext.getRootFlow(), "view", new ViewFactory() { public View getView(RequestContext context) { throw new UnsupportedOperationException("Not implemented"); } })); }
public void testResolveSpringBean() { MockRequestContext context = new MockRequestContext(); StaticApplicationContext ac = new StaticApplicationContext(); ac.getBeanFactory().registerSingleton("testBean", new TestBean()); context.getRootFlow().setApplicationContext(ac); Expression exp = parser.parseExpression("testBean", new FluentParserContext().evaluate(RequestContext.class)); assertSame(ac.getBean("testBean"), exp.getValue(context)); }
public void testResolveAction() { MockRequestContext context = new MockRequestContext(); StaticApplicationContext ac = new StaticApplicationContext(); ac.getBeanFactory().registerSingleton("action", new TestAction()); context.getRootFlow().setApplicationContext(ac); Expression exp = parser.parseExpression("action", new FluentParserContext().evaluate(RequestContext.class)); assertSame(ac.getBean("action"), exp.getValue(context)); }
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()); assertEquals("setupForm", action.getMethod()); }
public void testResolveMessage() { MockRequestContext context = new MockRequestContext(); StaticApplicationContext ac = new StaticApplicationContext(); ac.getStaticMessageSource().addMessage("foo", Locale.FRANCE, "bar"); ac.refresh(); context.getRootFlow().setApplicationContext(ac); context.getMockExternalContext().setLocale(Locale.FRANCE); Expression exp = parser.parseExpression("resourceBundle.foo", new FluentParserContext().evaluate(RequestContext.class)); assertEquals("bar", exp.getValue(context)); } }