FileDocCategorySizeDatePackage
TestSecurityFilter.javaAPI DocExample1370Sat Mar 15 19:39:50 GMT 2003com.oreilly.javaxp.cactus.filter

TestSecurityFilter

public class TestSecurityFilter extends org.apache.cactus.FilterTestCase
author
Brian M. Coyner $version $Id: TestSecurityFilter.java,v 1.2 2003/02/27 00:24:43 jepc Exp $

Fields Summary
private SecurityFilter
filter
private MockFilterChain
mockChain
Constructors Summary
public TestSecurityFilter(String name)

        super(name);
    
Methods Summary
public voidbeginAuthenticatedUser(org.apache.cactus.WebRequest webRequest)

        webRequest.setRedirectorName("SecureFilterRedirector");
        webRequest.setAuthentication(
                new BasicAuthentication("coyner_b", "secret"));
    
public voidsetUp()

        this.filter = new SecurityFilter();
        this.mockChain = new MockFilterChain();
    
public voidtestAuthenticatedUser()

        this.mockChain.setExpectedInvocation(true);
        this.filter.doFilter(this.request, this.response, this.mockChain);
        this.mockChain.verify();
    
public voidtestNonAuthenticatedUser()

        this.mockChain.setExpectedInvocation(false);
        this.filter.doFilter(this.request, this.response, this.mockChain);
        this.mockChain.verify();