public class CookieValidator extends BaseConditionalValidator
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_cookieName |
protected java.lang.String |
_cookieValue |
protected java.lang.String |
_lastTestedCookieValue |
protected static java.lang.String |
BARE_MESSAGE_EQUAL_VALUES |
protected static java.lang.String |
BARE_MESSAGE_EXISTENT_COOKIE |
protected static java.lang.String |
MESSAGE_INVALID_TEST |
_condition, _log
_label
Constructor and Description |
---|
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,
boolean condition) |
Modifier and Type | Method and Description |
---|---|
boolean |
assertTrue(Response response)
Return true or false, depending on whether or not
the test conditions were met.
|
java.lang.String |
generateBareExceptionMessage()
The BASE exception message for a subclass of
BaseConditionalValidator.
|
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 |
getCondition, setCondition, throwValidationException, validate
fail, getLabel, setLabel
protected java.lang.String _cookieValue
protected java.lang.String _cookieName
protected static final java.lang.String MESSAGE_INVALID_TEST
protected static final java.lang.String BARE_MESSAGE_EXISTENT_COOKIE
protected static final java.lang.String BARE_MESSAGE_EQUAL_VALUES
protected java.lang.String _lastTestedCookieValue
public CookieValidator()
public CookieValidator(java.lang.String label)
public CookieValidator(java.lang.String name, java.lang.String value)
public CookieValidator(java.lang.String label, java.lang.String name, java.lang.String value, boolean condition)
public void setCookieValue(java.lang.String value)
Validator
tests for cookie value equivalency, in addition to cookie existencevalue
- the value of the cookiepublic void setCookieName(java.lang.String name)
Validator
to function properly.name
- the name of the cookiepublic boolean assertTrue(Response response) throws ValidationException
BaseConditionalValidator
assertTrue
in class BaseConditionalValidator
response
- HTTP responseValidationException
- 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 matchpublic java.lang.String generateBareExceptionMessage()
BaseConditionalValidator
generateBareExceptionMessage
in class BaseConditionalValidator
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.