FileDocCategorySizeDatePackage
AnnotationValidationInterceptorTest.javaAPI DocExample2863Mon Jul 23 13:26:18 BST 2007org.apache.struts2.interceptor.validation

AnnotationValidationInterceptorTest

public class AnnotationValidationInterceptorTest extends org.apache.struts2.StrutsTestCase

Fields Summary
private AnnotationValidationInterceptor
interceptor
private com.mockobjects.dynamic.Mock
mockActionInvocation
private com.mockobjects.dynamic.Mock
mockActionProxy
private TestAction
test
Constructors Summary
Methods Summary
public voidsetUp()


         
        super.setUp();
        test = new TestAction();
        interceptor = new AnnotationValidationInterceptor();
        mockActionInvocation = new Mock(ActionInvocation.class);
        mockActionProxy = new Mock(ActionProxy.class);
        mockActionInvocation.matchAndReturn("getProxy", (ActionProxy) mockActionProxy.proxy());
        mockActionInvocation.matchAndReturn("getAction", test);
        mockActionInvocation.expect("invoke");
    
public voidtestShouldNotSkip()

        mockActionProxy.expectAndReturn("getMethod", "execute");
        mockActionProxy.expectAndReturn("getActionName", "foo");
        mockActionProxy.expectAndReturn("getMethod", "execute");
        interceptor.doIntercept((ActionInvocation)mockActionInvocation.proxy());
        mockActionProxy.verify();
    
public voidtestShouldSkip()

        mockActionProxy.expectAndReturn("getMethod", "skipMe");
        interceptor.doIntercept((ActionInvocation)mockActionInvocation.proxy());
        mockActionProxy.verify();