org.apache.commons.latka.validators
Class CookieValidator

java.lang.Object
  |
  +--org.apache.commons.latka.validators.BaseValidator
        |
        +--org.apache.commons.latka.validators.CookieValidator
All Implemented Interfaces:
Validator

public class CookieValidator
extends BaseValidator
implements Validator

CookieValidator validates cookie existence and/or value in an HTTP session.

Author:
Doug Sale

Constructor Summary
CookieValidator()
           
CookieValidator(java.lang.String label)
           
CookieValidator(java.lang.String name, java.lang.String value)
           
CookieValidator(java.lang.String label, java.lang.String name, java.lang.String value)
           
 
Method Summary
 void setCookieName(java.lang.String name)
          The cookie name must be set for this Validator to function properly.
 void setCookieValue(java.lang.String value)
          If cookie value is set, this Validator tests for cookie value equivalency, in addition to cookie existence
 void validate(Response response)
          Run custom validation.
 
Methods inherited from class org.apache.commons.latka.validators.BaseValidator
getLabel, setLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieValidator

public CookieValidator()

CookieValidator

public CookieValidator(java.lang.String label)

CookieValidator

public CookieValidator(java.lang.String name,
                       java.lang.String value)

CookieValidator

public CookieValidator(java.lang.String label,
                       java.lang.String name,
                       java.lang.String value)
Method Detail

setCookieName

public void setCookieName(java.lang.String name)
The cookie name must be set for this Validator to function properly.
Parameters:
name - the name of the cookie

setCookieValue

public void setCookieValue(java.lang.String value)
If cookie value is set, this Validator tests for cookie value equivalency, in addition to cookie existence
Parameters:
value - the value of the cookie

validate

public void validate(Response response)
              throws ValidationException
Description copied from interface: Validator
Run custom validation. Latka will provide the HTTP response to this method. The implementer should throw a ValidationException if the Response fails to meet the validation criteria.
Specified by:
validate in interface Validator
Overrides:
validate in class BaseValidator
Throws:
ValidationException - if cookie name hasn't been set, the cookie doesn't exist in the session, or if cookie value has been set and the cookie values don't match


Copyright © 2001 Apache Software Foundation. Documenation generated September 13 2001.