public void testFlow1_11_1() throws Exception
{
setupRequest("/flow_base.xhtml");
processLifecycleExecute();
ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler) facesContext.getApplication().getNavigationHandler();
processRender();
//Enter flow 1
UICommand button = (UICommand) facesContext.getViewRoot().findComponent("mainForm:startFlow4");
submit(button);
processLifecycleExecute();
Assert.assertEquals("/flow4/flow4.xhtml", facesContext.getViewRoot().getViewId());
Flow currentFlow = facesContext.getApplication().getFlowHandler().getCurrentFlow(facesContext);
Assert.assertNotNull(currentFlow);
Assert.assertEquals(currentFlow.getId(), "flow4");
processRender();
NavigationCase goFlowBase = handler.getNavigationCase(facesContext, null, "flow_base");
Assert.assertNotNull(goFlowBase);
UICommand button2 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:go_flow_base");
submit(button2);
processLifecycleExecute();
Assert.assertEquals("/flow_base.xhtml", facesContext.getViewRoot().getViewId());
processRender();
UICommand button3 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:startFlow2");
submit(button3);
processLifecycleExecute();
Flow currentFlow2 = facesContext.getApplication().getFlowHandler().getCurrentFlow(facesContext);
Assert.assertNotNull(currentFlow2);
Assert.assertEquals(currentFlow2.getId(), "flow2");
processRender();
UICommand button4 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:go_flow_base");
submit(button4);
processLifecycleExecute();
Assert.assertEquals("/flow_base.xhtml", facesContext.getViewRoot().getViewId());
processRender();
UICommand button5 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:startFlow1_4");
submit(button5);
processLifecycleExecute();
Flow currentFlow3 = facesContext.getApplication().getFlowHandler().getCurrentFlow(facesContext);
Assert.assertNotNull(currentFlow3);
Assert.assertEquals(currentFlow3.getId(), "flow1");
processRender();
UICommand button6 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:go_flow_base");
submit(button6);
processLifecycleExecute();
Assert.assertEquals("/flow_base.xhtml", facesContext.getViewRoot().getViewId());
processRender();
//UICommand button7 = (UICommand) facesContext.getViewRoot().findComponent("mainForm:returnFlow1_4");
//submit(button7);
NavigationCase endCase = handler.getNavigationCase(facesContext, null, "back_flow_1_4");
Assert.assertNotNull(endCase);
String toViewId = endCase.getToViewId(facesContext);
// Check if the dynamic outcome return hack has been correctly resolved.
Assert.assertEquals(toViewId, "/flow_base.xhtml");