package examples;
import servletunit.struts.CactusStrutsTestCase;

public class TestCactusFailLoginAction extends CactusStrutsTestCase {
    
    public void testFailedLogin() {
        addRequestParameter("username", "deryl");
        addRequestParameter("password", "express");
        setRequestPathInfo("/login");
        actionPerform();
        verifyForward("login");
        verifyForwardPath("/login/login.jsp");
        verifyInputForward();
        verifyActionErrors(new String[] { "error.password.mismatch" });
        assertNull(getSession().getAttribute("authentication"));
    }
}