public abstract class BaseConditionalValidator extends BaseValidator
Modifier and Type | Field and Description |
---|---|
protected boolean |
_condition
condition to test against
|
protected org.apache.log4j.Category |
_log
log4j category for output
|
_label
Constructor and Description |
---|
BaseConditionalValidator(boolean condition)
A test without a label
|
BaseConditionalValidator(java.lang.String label,
boolean condition)
A test with a label
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
assertTrue(Response response)
Return true or false, depending on whether or not
the test conditions were met.
|
abstract java.lang.String |
generateBareExceptionMessage()
The BASE exception message for a subclass of
BaseConditionalValidator.
|
boolean |
getCondition()
Returns whether or not this test is supposed to succeed
|
void |
setCondition(boolean condition)
Set whether or not this test is supposed to succeed
|
protected void |
throwValidationException()
Automatically generated exception messages, based
on the value of getCondition() and
generateBareExceptionMessage().
|
void |
validate(Response response)
Final method.
|
fail, getLabel, setLabel
protected final org.apache.log4j.Category _log
protected boolean _condition
public BaseConditionalValidator(boolean condition)
condition
- Whether the test should evaluate to true or falsepublic BaseConditionalValidator(java.lang.String label, boolean condition)
label
- test labelcondition
- whether the test should evaluate to true or falsepublic void setCondition(boolean condition)
condition
- true if the test should succeedpublic boolean getCondition()
public final void validate(Response response) throws ValidationException
validate
in interface Validator
validate
in class BaseValidator
response
- Response from the HTTP serverValidationException
- when a validation failspublic abstract boolean assertTrue(Response response) throws ValidationException
response
- HTTP responseValidationException
- when a validation failspublic abstract java.lang.String generateBareExceptionMessage()
protected void throwValidationException() throws ValidationException
ValidationException
- generated ExceptionCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.