junit.extensions.xml.elements
Class AbstractAssertTagHandler

java.lang.Object
  extended byjunit.extensions.xml.elements.AbstractTagHandler
      extended byjunit.extensions.xml.elements.AbstractAssertTagHandler
All Implemented Interfaces:
XMLConstants
Direct Known Subclasses:
AssertEnabledTagHandler, AssertEqualsTagHandler, AssertHasFocusTagHandler, AssertNotEqualsTagHandler, AssertNotNullTagHandler, AssertNotSameTagHandler, AssertNullTagHandler, AssertSameTagHandler, FailTagHandler

public abstract class AbstractAssertTagHandler
extends AbstractTagHandler

This tag handler provides the basics for the assert tag handers to be derived. The methods provide a consistent way to validate and read the attributes of the commands.

Author:
Kevin Wilson

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
AbstractAssertTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Constructor for AssertNotNullTagHandler.
 
Method Summary
protected  void checkActual()
          Check that either a actualobj or actualrefid is specified.
protected  void checkExpected()
          Check that either a expectedobj or expectedrefid is specified.
protected  java.lang.Object getActualObject()
          Returns the value of the ACTUALOBJ attribute for this element.
private  java.lang.String getActualRefId()
          Returns the value of the ACTUALREFID attribute for this element.
protected  java.lang.Object getExpectedObject()
          Returns the value of the EXPECTEDOBJ attribute for this element.
private  java.lang.String getExpectedRefId()
          Returns the value of the EXPECTEDREFID attribute for this element.
protected  java.lang.String getMessage()
          Returns the value of the MESSAGE attribute for this element.
protected  java.lang.String getRefId()
          Returns the value of the REFID attribute for this element.
 
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, processElement, resolveVariables, validateElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAssertTagHandler

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

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

getActualObject

protected java.lang.Object getActualObject()
Returns the value of the ACTUALOBJ attribute for this element. If the element contains an actual ref id attribute and that object was found previously, then that object is returned.

Returns:
String The value of the ACTUALOBJ attribute. (If an actual ref id object was found and was not null, then that value is returned.

getExpectedObject

protected java.lang.Object getExpectedObject()
Returns the value of the EXPECTEDOBJ attribute for this element. If the element contains an expected ref id attribute and that object was found previously, then that object is returned.

Returns:
String The value of the EXPECTEDOBJ attribute. (If an expected ref id object was found and was not null, then that value is returned.

getMessage

protected java.lang.String getMessage()
Returns the value of the MESSAGE attribute for this element.

Returns:
String The value of the MESSAGE attribute.

getRefId

protected java.lang.String getRefId()
Returns the value of the REFID attribute for this element.

Returns:
String The value of the REFID attribute.

checkActual

protected void checkActual()
                    throws XMLException
Check that either a actualobj or actualrefid is specified.

Throws:
XMLException - thrown if one of the above is not present. Or if both are present.

checkExpected

protected void checkExpected()
                      throws XMLException
Check that either a expectedobj or expectedrefid is specified.

Throws:
XMLException - thrown if one of the above is not present. Or if both are present.

getActualRefId

private java.lang.String getActualRefId()
Returns the value of the ACTUALREFID attribute for this element.

Returns:
String The value of the ACTUALREFID attribute.

getExpectedRefId

private java.lang.String getExpectedRefId()
Returns the value of the EXPECTEDREFID attribute for this element.

Returns:
String The value of the EXPECTEDREFID attribute.


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