junit.extensions.xml.elements
Class AssertEqualsTagHandler

java.lang.Object
  extended byjunit.extensions.xml.elements.AbstractTagHandler
      extended byjunit.extensions.xml.elements.AbstractAssertTagHandler
          extended byjunit.extensions.xml.elements.AssertEqualsTagHandler
All Implemented Interfaces:
XMLConstants

public class AssertEqualsTagHandler
extends AbstractAssertTagHandler

This class will handle the processing of <assertequal> nodes. Insures that the actual and expected objects are equal.

Summary

<assertequal [message="message text"] actualrefid="id"|actualobj="value" expectedrefid="id"|expectedobj="value"/>

One of the following attributes are required:

actualrefid id of the object to be compared.
actualobj value of the object to be compared.

One of the following attributes are required:

expectedrefid id of the object to be compared.
expectedobj value of the object to be compared.

Optional Attributes:

message Optional message text to be displayed in assertion.

Author:
Vijay Aravamudhan : ThoughtWorks Inc.

Field Summary
 
Fields inherited from class junit.extensions.xml.elements.AbstractTagHandler
 
Fields inherited from interface junit.extensions.xml.XMLConstants
ACTION, ACTUALOBJ, ACTUALREFID, ADD, ASSERTENABLED, ASSERTEQUALS, ASSERTNOTEQUALS, ASSERTNOTNULL, ASSERTNOTSAME, ASSERTNULL, ASSERTSAME, CALL, CASE, CHOOSE, CLASSNAME, COLUMN, CONFIRM, DEBUG, DEFAULT, DELIMITER, DIALOG, DUMP, ECHO, ENABLED, ENCODING, EVALUATE, EXPECTEDOBJ, EXPECTEDREFID, FAIL, FILE, FOCUS, FOREACH, ID, INDEX, JFCFILELOC, LESSTHAN, LISTITEM, LOG, MARK, MESSAGE, METHOD, MODE, NAME, OTHERWISE, PATHREFID, PROCEDURE, PROPERTY, RECURSIVE, REFID, RELATIVE, REMOVE, ROW, SAVE, STDERR, STDOUT, STOPWATCH, SUITE, SWITCH, TABLECELL, TAGHANDLERS, TAGNAME, TEST, TYPE, USERE, VALUE, WHEN, WHILE
 
Constructor Summary
AssertEqualsTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Constructor for AssertEqualsTagHandler.
 
Method Summary
 void processElement()
          Obtain the expected and actual objects.
 void validateElement()
          Insure that the element contains a Actual and expected attribute.
 
Methods inherited from class junit.extensions.xml.elements.AbstractAssertTagHandler
checkActual, checkExpected, getActualObject, getExpectedObject, getMessage, getRefId
 
Methods inherited from class junit.extensions.xml.elements.AbstractTagHandler
checkAtLeastOneRequiredAttribute, checkAtLeastOneRequiredAttribute, checkElementTagName, checkOneRequiredAttribute, checkOneRequiredAttribute, checkRequiredAttribute, checkRequiredAttribute, getBoolean, getBoolean, getBoolean, getBoolean, getElement, getInt, getInt, getLong, getLong, getPoint, getPoint, getString, getString, getString, getString, getTagName, getTest, getTestCase, getXMLTestCase, getXMLTestSuite, resolveVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertEqualsTagHandler

public AssertEqualsTagHandler(org.w3c.dom.Element element,
                              IXMLTestCase testCase)
Constructor for AssertEqualsTagHandler.

Parameters:
element - The element to be processed
testCase - The IXMLTestCase that uses this element
Method Detail

processElement

public void processElement()
                    throws XMLException
Obtain the expected and actual objects. Then test if one of the objects is a string. If so the call toString() to normalize both objects to a string. Assert that the values of the actual and the expected are equal.

Specified by:
processElement in class AbstractTagHandler
Throws:
XMLException - upon assertion failure.

validateElement

public void validateElement()
                     throws XMLException
Insure that the element contains a Actual and expected attribute.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - Thrown if a required attribute is missing.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999