1 7 package com.inversoft.verge.mvc.test; 8 9 10 import junit.framework.Assert; 11 12 import com.inversoft.junit.internal.http.MockHttpServletRequest; 13 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowAction; 14 import com.inversoft.verge.mvc.controller.form.FormAction; 15 16 17 25 public class LongTxnActionHandler { 26 27 public String handleStart(ActionFlowAction action) { 28 return "action1"; 29 } 30 31 public String handleAction1(ActionFlowAction action) { 32 MockHttpServletRequest request = (MockHttpServletRequest) 33 action.getHttpServletRequest(); 34 Assert.assertNotNull("Should have gotten dispatcher", request.getRequestDispatcher()); 35 Assert.assertEquals("/longTxn1.jsp", request.getRequestDispatcher().getURL()); 36 37 return "action2"; 38 } 39 40 public String handleAction2(ActionFlowAction action) { 41 MockHttpServletRequest request = (MockHttpServletRequest) 42 action.getHttpServletRequest(); 43 Assert.assertEquals("/longTxn1.jsp", request.getRequestDispatcher().getURL()); 44 45 return "action3"; 46 } 47 48 public String handleAction3(ActionFlowAction action) { 49 MockHttpServletRequest request = (MockHttpServletRequest) 50 action.getHttpServletRequest(); 51 Assert.assertNull(request.getRequestDispatcher().getURL()); 52 53 return "action4"; 54 } 55 56 public String handleAction4(ActionFlowAction action) { 57 MockHttpServletRequest request = (MockHttpServletRequest) 58 action.getHttpServletRequest(); 59 Assert.assertNull(request.getRequestDispatcher().getURL()); 61 62 return "action5"; 63 } 64 65 public String handleAction5(ActionFlowAction action) { 66 MockHttpServletRequest request = (MockHttpServletRequest) 67 action.getHttpServletRequest(); 68 Assert.assertEquals("/longTxn1.jsp", request.getRequestDispatcher().getURL()); 69 70 return "action6"; 71 } 72 73 public String handleAction6(ActionFlowAction action) { 74 MockHttpServletRequest request = (MockHttpServletRequest) 75 action.getHttpServletRequest(); 76 Assert.assertEquals("/longTxn1.jsp", request.getRequestDispatcher().getURL()); 77 78 return "action7"; 79 } 80 81 public String handleFormBasedLongTxn(FormAction action) { 82 MockHttpServletRequest request = (MockHttpServletRequest) 83 action.getHttpServletRequest(); 84 Assert.assertEquals("/longTxnStart.jsp", request.getRequestDispatcher().getURL()); 85 86 return "success"; 87 } 88 } | Popular Tags |