package servletunit.struts.tests.cactus; import servletunit.struts.CactusStrutsTestCase; import org.apache.cactus.WebResponse; public class TestProcessResults extends CactusStrutsTestCase { public void testSuccessfulLogin() { processRequest(true); addRequestParameter("username","deryl"); addRequestParameter("password","radar"); setRequestPathInfo("/login"); actionPerform(); verifyForward("success"); verifyForwardPath("/main/success.jsp"); assertEquals("deryl", getSession().getAttribute("authentication")); verifyNoActionErrors(); } public void endSuccessfulLogin(WebResponse response) { assertEquals("unexpected response code",200,response.getStatusCode()); String[] text = response.getTextAsArray(); for (int i = 0; i < text.length; i++) { String line = text[i]; if (line != null && !line.equals("