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

TestCookieServlet

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

Fields Summary
private CookieServlet
servlet
Constructors Summary
public TestCookieServlet(String name)

        super(name);
    
Methods Summary
public voidbeginGetUpdatedCookie(org.apache.cactus.WebRequest req)

        req.addCookie(CookieServlet.TEST_COOKIE_NAME, "3");
    
public voidendGetUpdatedCookie(org.apache.cactus.WebResponse res)

        org.apache.cactus.Cookie cookie =
                res.getCookie(CookieServlet.TEST_COOKIE_NAME);
        assertNotNull("Returned Cookie.", cookie);
        assertEquals("Cookie Value.", "4", cookie.getValue());
    
protected voidsetUp()

        this.servlet = new CookieServlet();
    
public voidtestGetInitialCookie()


        Cookie cookie = this.servlet.getCookie(this.request);
        assertNotNull("Cookie.", cookie);
        assertEquals("Cookie Name.",
                     CookieServlet.TEST_COOKIE_NAME,
                     cookie.getName());
        assertEquals("Cookie Value.",
                     "0",
                     cookie.getValue());
    
public voidtestGetUpdatedCookie()

        this.servlet.doGet(this.request, this.response);