ca.intelliware.amakihi.validator
Class ExactReturnValueValidator

java.lang.Object
  |
  +--ca.intelliware.amakihi.validator.BaseReturnValueValidator
        |
        +--ca.intelliware.amakihi.validator.ExactReturnValueValidator
All Implemented Interfaces:
ResponseValidationStrategy

public class ExactReturnValueValidator
extends BaseReturnValueValidator


Inner classes inherited from class ca.intelliware.amakihi.validator.BaseReturnValueValidator
BaseReturnValueValidator.MatchResult, BaseReturnValueValidator.NonMatchResult, BaseReturnValueValidator.PerfectMatchResult
 
Fields inherited from class ca.intelliware.amakihi.validator.BaseReturnValueValidator
containsTextRule, PRECEDENCE_ALL_MATCH, PRECEDENCE_CHILD_ELEMENT_COUNT_DOESNT_MATCH, PRECEDENCE_ELEMENT_AND_ATTRIBUTES_MATCH_BUT_TEXT_DOESNT, PRECEDENCE_ELEMENT_DOESNT_MATCH, PRECEDENCE_ELEMENT_MATCH_BUT_ATTRIBUTE_DOESNT, RULE_CONTAINS_TEXT, RULE_DONT_START_AT_TOP, RULE_DONT_VALIDATE_ATTRIBUTES, RULE_EXACT_TEXT, RULE_START_AT_TOP, RULE_VALIDATE_ATTRIBUTES
 
Constructor Summary
ExactReturnValueValidator()
           
 
Method Summary
protected  BaseReturnValueValidator.MatchResult elementsAreEqual(org.w3c.dom.Element expected, org.w3c.dom.Element actual)
          We define nodes to be equal if: the tag names are the same the text values are the same (excluding leading and/or trailing white space) all sub-elements are also equal and in the same order
protected  org.w3c.dom.Attr[] findUnmatchedAttributesIfRequired(org.w3c.dom.Element expected, org.w3c.dom.Element actual)
          Find a list of all attributes in expected that either doesn't exist in actual, or that has a different value than in actual.
protected  void populateChildElementNodeListAndTextNodeConcatenation(org.w3c.dom.Element element, java.lang.StringBuffer childTextNodeData, java.util.List childElementNodes)
           
protected  void setRequiredSimplyToContainText(boolean flag)
           
 
Methods inherited from class ca.intelliware.amakihi.validator.BaseReturnValueValidator
addRule, createBranchSummary, createBranchSummary, isElementNodeOrNonWhiteSpaceTextNode, isRequiredSimplyToContainText, isRequiredToStartAtTop, isRequiredToValidateAttributes, renderAsStringExcludingTopNode, setRequiredToStartAtTop, setRequiredToValidateAttributes, validate, validateOutputStartAnywhere, validateOutputStartAtTop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExactReturnValueValidator

public ExactReturnValueValidator()
Method Detail

elementsAreEqual

protected BaseReturnValueValidator.MatchResult elementsAreEqual(org.w3c.dom.Element expected,
                                                                org.w3c.dom.Element actual)
We define nodes to be equal if:
  1. the tag names are the same
  2. the text values are the same (excluding leading and/or trailing white space)
  3. all sub-elements are also equal and in the same order
      Overrides:
      elementsAreEqual in class BaseReturnValueValidator

populateChildElementNodeListAndTextNodeConcatenation

protected void populateChildElementNodeListAndTextNodeConcatenation(org.w3c.dom.Element element,
                                                                    java.lang.StringBuffer childTextNodeData,
                                                                    java.util.List childElementNodes)

findUnmatchedAttributesIfRequired

protected org.w3c.dom.Attr[] findUnmatchedAttributesIfRequired(org.w3c.dom.Element expected,
                                                               org.w3c.dom.Element actual)
Description copied from class: BaseReturnValueValidator

Find a list of all attributes in expected that either doesn't exist in actual, or that has a different value than in actual.

Overrides:
findUnmatchedAttributesIfRequired in class BaseReturnValueValidator
Following copied from class: ca.intelliware.amakihi.validator.BaseReturnValueValidator
Returns:
the list of attribute nodes or zero-length array if no unmatched attributes are found or if we aren't required to validate the attributes.

setRequiredSimplyToContainText

protected void setRequiredSimplyToContainText(boolean flag)
                                       throws InconsistentValidationRuleException
Overrides:
setRequiredSimplyToContainText in class BaseReturnValueValidator


Copyright 2002 Intelliware Development. All Rights Reserved.