1 5 9 package com.opensymphony.webwork.dispatcher; 10 11 import com.opensymphony.webwork.TestAction; 12 import com.opensymphony.xwork.ActionInvocation; 13 import com.opensymphony.xwork.interceptor.Interceptor; 14 import junit.framework.Assert; 15 16 17 20 public class ServletDispatchedTestAssertInterceptor implements Interceptor { 21 23 26 public ServletDispatchedTestAssertInterceptor() { 27 super(); 28 } 29 30 32 35 public void destroy() { 36 } 37 38 41 public void init() { 42 } 43 44 47 public String intercept(ActionInvocation invocation) throws Exception { 48 Assert.assertTrue(invocation.getAction() instanceof TestAction); 49 50 TestAction testAction = (TestAction) invocation.getAction(); 51 52 Assert.assertEquals("bar", testAction.getFoo()); 53 54 String result = invocation.invoke(); 55 56 return result; 57 } 58 } 59 | Popular Tags |