org.apache.commons.latka.jelly.validators
Class HttpValidatorTagSupport

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by org.apache.commons.latka.jelly.validators.HttpValidatorTagSupport
All Implemented Interfaces:
org.apache.commons.jelly.Tag
Direct Known Subclasses:
ByteLengthTag, CookieTag, GoldenFileTag, MaxRequestTimeTag, RegexpTag, ResponseHeaderTag, StatusCodeTag, StatusTextTag, XPathTag

public abstract class HttpValidatorTagSupport
extends org.apache.commons.jelly.TagSupport

A base class for validation tags

Version:
$Id: HttpValidatorTagSupport.java 155424 2005-02-26 13:09:29Z dirkv $
Author:
Morgan Delagrange, dIon Gillard

Field Summary
protected  String _label
          label for the test
protected  LatkaEventInfo _listener
          the listener handling request success/failure etc
protected static org.apache.log4j.Category _log
           
protected  Response _response
          the response being validated
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
HttpValidatorTagSupport()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput xmlOutput)
          Provides a default implementation for simple validation tags.
 Response getResponse()
          the response being validated
abstract  Validator getValidator()
           
 void init()
          Called by the ValidationFactory.
 void setLabel(String label)
           
 boolean validate(Validator validator)
          validate the response using the validator provided.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_response

protected Response _response
the response being validated


_listener

protected LatkaEventInfo _listener
the listener handling request success/failure etc


_label

protected String _label
label for the test


_log

protected static final org.apache.log4j.Category _log
Constructor Detail

HttpValidatorTagSupport

public HttpValidatorTagSupport()
Method Detail

getValidator

public abstract Validator getValidator()

doTag

public void doTag(org.apache.commons.jelly.XMLOutput xmlOutput)
           throws org.apache.commons.jelly.JellyTagException
Provides a default implementation for simple validation tags. Will execute the validator produced by getValidator(). Override if necessary.

Parameters:
xmlOutput - a place to write output
Throws:
org.apache.commons.jelly.JellyTagException - if the tag body could not be invoked

init

public void init()
Called by the ValidationFactory.

Parameters:
listener - supplier of information about the suite/progress
tagName - name of the validating tag
reader - xml to process
response - response to validate

setLabel

public void setLabel(String label)

getResponse

public Response getResponse()
the response being validated

Returns:
the response being validated

validate

public boolean validate(Validator validator)
validate the response using the validator provided. This method will notify the listener in the event of a failure. Will return false and not execute the validation if the request is already invalid.

Parameters:
validator - the object that performs validation
Returns:
whether or not the request passed validation


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.