junit.extensions.jfcunit.finder
Class BaseFindTagHandler

java.lang.Object
  extended byjunit.extensions.xml.elements.AbstractTagHandler
      extended byjunit.extensions.jfcunit.finder.BaseFindTagHandler
All Implemented Interfaces:
EventDataConstants, JFCXMLConstants, XMLConstants
Direct Known Subclasses:
AbstractButtonFinderTagHandler, ComponentFinderTagHandler, DialogFinderTagHandler, FrameFinderTagHandler, JInternalFrameFinderTagHandler, JLabelFinderTagHandler, JMenuItemFinderTagHandler, JPopupMenuFinderTagHandler, JWindowFinderTagHandler, LabeledComponentFinderTagHandler, NamedComponentFinderTagHandler

public abstract class BaseFindTagHandler
extends AbstractTagHandler
implements JFCXMLConstants

This class provides the basic handling for all of the FindTagHandler implementations.

Optional Attributes:

 operation - match, equals, startswith, endswith, contains
 show      - show the candidate items by moving the cursor
             to each item passing the finder. A Message dialog
             will show the current index.
 

Author:
Vijay Aravamudhan : ThoughtWorks Inc., Kevin Wilson

Field Summary
 
Fields inherited from class junit.extensions.xml.elements.AbstractTagHandler
 
Fields inherited from interface junit.extensions.jfcunit.xml.JFCXMLConstants
ALT, ALTGR, AMOUNT, ASSERTEXIT, AWTTHREAD, BUTTON1, BUTTON2, BUTTON3, CASEINDEPENDENT, CLASS, CLICK, CLICKS, CODE, CONTAINER, CONTAINS, CTRL, DESTINATION, DOWN, DRAG, DURATION, EDITOR, ENDSWITH, EQUALS, FIND, FINDER, FLUSH, ICONDESCRIPTION, ICONFILE, INDEXDELIMITER, INDEXES, KEY, LABEL, MATCH, META, MODIFIERS, NODEVALUE, OPERATION, PATH, PATHDELIMITER, PAUSE, POINT, POPUPTRIGGER, POSITION, RECORDING, REFERENCE, RESUME, ROBOT, ROTATION, SHIFT, SHOW, SLEEP, SLEEPTIME, SOURCE, STARTSWITH, STRING, SUBCOMPONENT, TERMINATOR, TITLE, UP, WAIT
 
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
 
Fields inherited from interface junit.extensions.jfcunit.eventdata.EventDataConstants
CENTER, CUSTOM, DEFAULT_HOLDTIME, DEFAULT_ISPOPUPTRIGGER, DEFAULT_KEY_MODIFIERS, DEFAULT_MOUSE_MODIFIERS, DEFAULT_NUMBEROFCLICKS, DEFAULT_POPUP_MODIFIERS, DEFAULT_POSITION, DEFAULT_SCROLL_AMOUNT, DEFAULT_SLEEPTIME, DEFAULT_WHEEL_ROTATION, DOWN_ARROW_SUBCOMPONENT, EAST, EDITOR_SUBCOMPONENT, INVALID_SUBCOMPONENT, INVALID_TEXT_OFFSET, NORTH, NORTH_EAST, NORTH_WEST, OFFSET, PERCENT, POSITIONSTRINGS, SOUTH, SOUTH_EAST, SOUTH_WEST, UP_ARROW_SUBCOMPONENT, WEST
 
Constructor Summary
BaseFindTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Constructor for FindTagHandler.
 
Method Summary
protected  void find(Finder finder)
          Execute the common find on the TestHelper.
protected  void findWindow(AbstractWindowFinder wfinder)
          Execute the common findWindow on the TestHelper.
protected  boolean getCaseIndependent()
          Returns the value of the CASEINDEPENDENT attribute for this element.
protected  java.lang.String getClassName()
          Returns the value of the CLASS attribute for this element.
protected  java.lang.String getContainerId()
          Returns the value of the CONTAINER attribute for this element.
protected  javax.swing.Icon getIcon()
          Returns the Icon described by the ICONFILE and ICONDESCRIPTION attributes for this element.
protected  java.lang.String getId()
          Returns the value of the ID attribute for this element.
protected  int getIndex()
          Returns the value of the INDEX attribute for this element.
protected  java.lang.String getLabel()
          Returns the value of the LABEL attribute for this element.
protected  java.lang.String getName()
          Returns the value of the NAME attribute for this element.
protected  int getOperation()
          Get the operation as a string and translate to a OP code.
protected  boolean getShow()
          Get the value of the show attribute.
protected  java.lang.String getTitle()
          Retrun the value of the TITLE attribute for this element.
protected  int getWait()
          Get the Wait time for the finder.
abstract  void processElement()
          This method is used to process the xml Element (i.e.
 void validateElement()
          Sub-classes should implement this method to provide validation of the element attributes, etc.
 
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

BaseFindTagHandler

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

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

processElement

public abstract void processElement()
                             throws XMLException
Description copied from class: AbstractTagHandler
This method is used to process the xml Element (i.e. parsing and setting the attributes on XYZ objects from those parsed values.

Specified by:
processElement in class AbstractTagHandler
Throws:
XMLException - Some kind of Exception might be thrown.
See Also:
AbstractTagHandler.validateElement()

validateElement

public void validateElement()
                     throws XMLException
Description copied from class: AbstractTagHandler
Sub-classes should implement this method to provide validation of the element attributes, etc.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - A validation exception is thrown.
See Also:
AbstractTagHandler.validateElement()

getCaseIndependent

protected final boolean getCaseIndependent()
Returns the value of the CASEINDEPENDENT attribute for this element.

Returns:
boolean The value of the CASEINDEPENDENT attribute.

getClassName

protected final java.lang.String getClassName()
Returns the value of the CLASS attribute for this element.

Returns:
String The value of the CLASS attribute.

getContainerId

protected final java.lang.String getContainerId()
Returns the value of the CONTAINER attribute for this element.

Returns:
String The value of the CONTAINER attribute.

getIcon

protected final javax.swing.Icon getIcon()
Returns the Icon described by the ICONFILE and ICONDESCRIPTION attributes for this element.

Returns:
Icon The ImageIcon described by the value of the ICONFILE and ICONDESCRIPTION attributes.

getId

protected final java.lang.String getId()
Returns the value of the ID attribute for this element.

Returns:
String The value of the ID attribute.

getIndex

protected final int getIndex()
Returns the value of the INDEX attribute for this element. Defaults to 0 (zero) if not found.

Returns:
int The value of the parsed INDEX attribute, zero if not found.

getLabel

protected final java.lang.String getLabel()
Returns the value of the LABEL attribute for this element.

Returns:
String The value of the LABEL attribute.

getName

protected final java.lang.String getName()
Returns the value of the NAME attribute for this element.

Returns:
String The value of the NAME attribute.

getOperation

protected final int getOperation()
Get the operation as a string and translate to a OP code.

Returns:
Finder.OP_code

getShow

protected final boolean getShow()
Get the value of the show attribute.

Returns:
true if the finder is to show the candidate items.

getTitle

protected final java.lang.String getTitle()
Retrun the value of the TITLE attribute for this element.

Returns:
String The value of the TITLE attribute.

getWait

protected int getWait()
Get the Wait time for the finder.

Returns:
Duration for the Finder to try again until the object is found.

find

protected void find(Finder finder)
Execute the common find on the TestHelper.

Parameters:
finder - Finder to be used to locate the object.

findWindow

protected void findWindow(AbstractWindowFinder wfinder)
Execute the common findWindow on the TestHelper.

Parameters:
wfinder - Finder to be used to locate the object.


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