morgand 2002/10/10 11:44:25
Added: latka/src/java/org/apache/commons/latka/jelly/validators
GoldenFileTag.java MaxRequestTimeTag.java
ResponseHeaderTag.java StatusCodeTag.java
StatusTextTag.java XPathTag.java
Log:
added the remainder of the validators
Revision Changes Path
1.1
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/GoldenFileTag.java
Index: GoldenFileTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/GoldenFileTag.java,v
1.1 2002/10/10 18:44:25 morgand Exp $
* $Revision: 1.1 $
* $Date: 2002/10/10 18:44:25 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.latka.jelly.validators;
import java.io.File;
import org.apache.commons.latka.Validator;
import org.apache.commons.latka.validators.GoldenFileValidator;
import org.apache.log4j.Category;
/**
* A class to compare an HTTP response to a golden
* file
*
* @author Morgan Delagrange
* @version $Id: GoldenFileTag.java,v 1.1 2002/10/10 18:44:25 morgand Exp $
*/
public class GoldenFileTag extends HttpValidatorTagSupport {
protected String _fileName = null;
protected boolean _ignoreWhitespace = false;
protected static final Category _log = Category.getInstance(GoldenFileTag.class);
/**
* return the golden file validator
*
* @return golden file validator
*/
public Validator getValidator() {
GoldenFileValidator validator =
new GoldenFileValidator(_label, new File(_fileName));
validator.setIgnoreWhitespace(_ignoreWhitespace);
return validator;
}
/**
* whether or not to ignore whitespace
*
* @param ignoreWhitespace
* whether or not to ignore whitespace
*/
public void setIgnoreWhitespace(boolean ignoreWhitespace) {
_ignoreWhitespace = ignoreWhitespace;
}
/**
* set the file name for the golden file
*
* @param fileName golden file name
*/
public void setFileName(String fileName) {
_fileName = fileName;
}
}
1.1
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/MaxRequestTimeTag.java
Index: MaxRequestTimeTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/MaxRequestTimeTag.java,v
1.1 2002/10/10 18:44:25 morgand Exp $
* $Revision: 1.1 $
* $Date: 2002/10/10 18:44:25 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.latka.jelly.validators;
import java.io.File;
import org.apache.commons.latka.Validator;
import org.apache.commons.latka.validators.MaxRequestTimeValidator;
import org.apache.log4j.Category;
/**
* Class to validate the request time
*
* @author Morgan Delagrange
* @version $Id: MaxRequestTimeTag.java,v 1.1 2002/10/10 18:44:25 morgand Exp $
*/
public class MaxRequestTimeTag extends HttpValidatorTagSupport {
protected int _millis = -1;
protected static final Category _log =
Category.getInstance(MaxRequestTimeTag.class);
/**
* return the validator
*
* @return validator
*/
public Validator getValidator() {
MaxRequestTimeValidator validator =
new MaxRequestTimeValidator(_label);
if (_millis != -1) {
validator.setMaxMillis(_millis);
}
return validator;
}
public void setMillis(int millis) {
_millis = millis;
}
}
1.5 +47 -62
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/ResponseHeaderTag.java
1.5 +30 -39
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/StatusCodeTag.java
1.4 +28 -43
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/StatusTextTag.java
1.1
jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/XPathTag.java
Index: XPathTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/validators/XPathTag.java,v
1.1 2002/10/10 18:44:25 morgand Exp $
* $Revision: 1.1 $
* $Date: 2002/10/10 18:44:25 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.latka.jelly.validators;
import java.io.File;
import org.apache.commons.latka.Validator;
import org.apache.commons.latka.validators.XPathValidator;
import org.apache.log4j.Category;
/**
* Validator tag class
*
* @author Morgan Delagrange
* @version $Id: XPathTag.java,v 1.1 2002/10/10 18:44:25 morgand Exp $
*/
public class XPathTag extends HttpValidatorTagSupport {
protected String _select = null;
protected String _value = null;
protected boolean _condition = true;
protected static final Category _log = Category.getInstance(XPathTag.class);
/**
* return the validator
*
* @return validator
*/
public Validator getValidator() {
XPathValidator validator =
new XPathValidator(_label);
validator.setSelect(_select);
validator.setValue(_value);
validator.setCondition(_condition);
return validator;
}
public void setSelect(String select) {
_select = select;
}
public void setValue(String value) {
_value = value;
}
public void setCond(boolean condition) {
_condition = condition;
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>