org.apache.commons.latka.validators
Class GoldenFileValidator
java.lang.Object
org.apache.commons.latka.validators.BaseValidator
org.apache.commons.latka.validators.GoldenFileValidator
- All Implemented Interfaces:
- Validator
public class GoldenFileValidator
- extends BaseValidator
- implements Validator
Compare the response with a golden
file. Right now this is a proof
of concept class; we should extend it to support
more than just files, I think. Also, maybe
golden files should be more than just text.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_goldFile
protected File _goldFile
_ignoreWhitespace
protected boolean _ignoreWhitespace
TRUE_MESSAGE
protected static String TRUE_MESSAGE
_matchLog
protected StringBuffer _matchLog
GoldenFileValidator
public GoldenFileValidator(File goldenFile)
GoldenFileValidator
public GoldenFileValidator(String label,
File goldenFile)
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean ignoreWhitespace)
validate
public void validate(Response response)
throws ValidationException
- Description copied from class:
BaseValidator
- Validate a response
- Specified by:
validate
in interface Validator
- Specified by:
validate
in class BaseValidator
- Parameters:
response
- the response to validate
- Throws:
ValidationException
- if the Response fails to be valid
compare
protected boolean compare(byte[] array1,
byte[] array2)
compareWeak
protected boolean compareWeak(String str1,
String str2)
log
protected void log(String message)
Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.