01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: /*
06: * Created on 2/10/2003
07: *
08: */
09: 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: * @author CameronBraid
18: */
19: public class ServletDispatchedTestAssertInterceptor implements
20: Interceptor {
21: public ServletDispatchedTestAssertInterceptor() {
22: super ();
23: }
24:
25: public void destroy() {
26: }
27:
28: public void init() {
29: }
30:
31: public String intercept(ActionInvocation invocation)
32: throws Exception {
33: Assert.assertTrue(invocation.getAction() instanceof TestAction);
34:
35: TestAction testAction = (TestAction) invocation.getAction();
36:
37: Assert.assertEquals("bar", testAction.getFoo());
38:
39: String result = invocation.invoke();
40:
41: return result;
42: }
43: }
|