1 7 package com.inversoft.verge.mvc.controller.form.test; 8 9 10 import junit.framework.Assert; 11 12 import com.inversoft.junit.internal.http.MockHttpServletRequest; 13 import com.inversoft.verge.mvc.controller.form.FormAction; 14 15 16 23 public class TestActionHandler2 { 24 25 public static boolean pre = false; 26 public static boolean post = false; 27 public static boolean longTxn = false; 28 29 30 33 public TestActionHandler2() { 34 } 35 36 37 public void preHandle(FormAction action) { 38 pre = true; 39 } 40 41 public String handleTestPreAndPost(FormAction formAction) { 42 return "foo"; 43 } 44 45 public String handleTestLongTxn(FormAction formAction) { 46 MockHttpServletRequest request = (MockHttpServletRequest) 47 formAction.getHttpServletRequest(); 48 Assert.assertEquals("/longTxnWait.jsp", request.getRequestDispatcher().getURL()); 49 50 return "doneLongTxn"; 51 } 52 53 public void postHandle(FormAction action, Object result) { 54 post = true; 55 56 if (!longTxn) { 57 Assert.assertSame("foo", result); 58 } 59 } 60 } | Popular Tags |