junit.extensions.xml.elements
Class AssertEnabledTagHandler

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

public class AssertEnabledTagHandler
extends AbstractAssertTagHandler

This class will handle the processing of <assertenabled> nodes.

Mandatory attributes

refid Id of the property to be compared.

Optional attributes (default value)

message Message to be displayed when assertion fails.
enabled true or false. Default value is true.

Examples:

<assertenabled refid="MyComponent" message="Component is not enabled" enabled="true"/>
<assertenabled refid="MyComponent" message="Component is enabled" enabled="false"/>
<assertenabled refid="MyComponent" message="Component is not enabled"/>

Author:
Bruce Aylward : Nexagent Ltd.

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
AssertEnabledTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Constructor for AssertEnabledTagHandler.
 
Method Summary
private  boolean getEnabled()
          Returns the value of the ENABLED attribute for this element.
 void processElement()
          This method obtains the refid which is assumed to be a java.awt.Component.
 void validateElement()
          Validate the element has a refid.
 
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

AssertEnabledTagHandler

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

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

processElement

public void processElement()
                    throws XMLException
This method obtains the refid which is assumed to be a java.awt.Component. The enabled method is tested and compared with test enabed attribute if specified. If enabled is not specified it is assumed to be true.

Specified by:
processElement in class AbstractTagHandler
Throws:
XMLException - may be thrown.

validateElement

public void validateElement()
                     throws XMLException
Validate the element has a refid.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - when the refid is not specified.

getEnabled

private boolean getEnabled()
Returns the value of the ENABLED attribute for this element.

Returns:
String The value of the ENABLED attribute.


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