FileDocCategorySizeDatePackage
TestLoginServlet.javaAPI DocExample2436Sat Mar 15 19:39:50 GMT 2003com.oreilly.javaxp.cactus.servlet

TestLoginServlet

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

Fields Summary
private LoginServlet
servlet
Constructors Summary
public TestLoginServlet(String name)

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

        webRequest.addParameter("username", "coyner_b", WebRequest.POST_METHOD);
        webRequest.addParameter("password", "", WebRequest.POST_METHOD);
    
public voidbeginPasswordParameterNull(org.apache.cactus.WebRequest webRequest)

        webRequest.addParameter("username", "coyner_b", WebRequest.POST_METHOD);
    
public voidbeginUsernameParameterEmptyString(org.apache.cactus.WebRequest webRequest)

        webRequest.addParameter("username", "", WebRequest.POST_METHOD);
        webRequest.addParameter("password", "secret", WebRequest.POST_METHOD);
    
public voidbeginUsernameParameterNull(org.apache.cactus.WebRequest webRequest)

        webRequest.addParameter("password", "secret", WebRequest.POST_METHOD);
    
public voidbeginValidFormParameters(org.apache.cactus.WebRequest webRequest)

        webRequest.addParameter("username", "coyner_b", WebRequest.POST_METHOD);
        webRequest.addParameter("password", "secret", WebRequest.POST_METHOD);
    
public voidsetUp()

        this.servlet = new LoginServlet();
    
public voidtestPasswordParameterEmptyString()

        assertTrue("Password not entered.",
                   !this.servlet.validateParameters(this.request));
    
public voidtestPasswordParameterNull()

        assertTrue("Passord form field not specified in request.",
                   !this.servlet.validateParameters(this.request));
    
public voidtestUsernameParameterEmptyString()

        assertTrue("Username not entered.",
                   !this.servlet.validateParameters(this.request));
    
public voidtestUsernameParameterNull()

        assertTrue("Username form field not specified in request.",
                   !this.servlet.validateParameters(this.request));
    
public voidtestValidFormParameters()

        assertTrue("Valid Parameters.",
                   this.servlet.validateParameters(this.request));