1 7 package com.inversoft.verge.mvc.controller.actionflow.test; 8 9 10 import java.util.HashMap ; 11 import java.util.Map ; 12 13 import com.inversoft.junit.WebTestCase; 14 import com.inversoft.verge.mvc.MVCException; 15 import com.inversoft.verge.mvc.MVCRegistry; 16 import com.inversoft.verge.mvc.MVCRequest; 17 import com.inversoft.verge.mvc.controller.ControllerMVCInfo; 18 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowControllerHandler; 19 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowURLTools; 20 21 22 31 public class ActionFlowControllerHandlerTest extends WebTestCase { 32 33 38 public ActionFlowControllerHandlerTest(String name) { 39 super(name); 40 setLocal(true); 41 } 42 43 44 47 public void testSetupMVCRequest() { 48 49 MVCRequest mvcRequest = new MVCRequest(request, response); 50 Map map = new HashMap (); 51 map.put(ActionFlowURLTools.MODEL_ENABLED_PARAM, "false"); 52 map.put(ActionFlowURLTools.VALIDATION_ENABLED_PARAM, "false"); 53 54 ActionFlowControllerHandler handler = new ActionFlowControllerHandler(); 56 MVCRegistry.register("actionFlow", handler); 57 try { 58 ControllerMVCInfo info = new ControllerMVCInfo( 59 "/actionFlow/n.namespace/e.entry"); 60 mvcRequest.setControllerInfo(info); 61 62 getRequest().setParameter(ActionFlowURLTools.SUBMIT_PARAMETER, 64 ActionFlowURLTools.generateSubmitParameter("subName", "action", 65 null, map)); 66 getRequest().setParameter("subName", "value"); 67 68 handler.preExecute(mvcRequest); 70 } catch (MVCException mvce) { 71 fail(mvce.toString()); 72 } 73 74 assertFalse(mvcRequest.isModelEnabled()); 75 assertFalse(mvcRequest.isValidationEnabled()); 76 } 77 } | Popular Tags |