junit.extensions.jfcunit.finder
Class FindTagHandler

java.lang.Object
  extended byjunit.extensions.xml.elements.AbstractTagHandler
      extended byjunit.extensions.jfcunit.finder.FindTagHandler
All Implemented Interfaces:
EventDataConstants, JFCXMLConstants, XMLConstants

public class FindTagHandler
extends AbstractTagHandler
implements JFCXMLConstants

This element helps locate objects within the gui. It uses the underlying JFCUnit finders to locate objects. The finders implementation may be extended via the TagMapping.properties file specified in the classpath.

Description

This creates a DialogFinder and executes the find.

Parameters

Attribute Description Required Default Values
finder This element specifies the finder implementation to use. Yes N/A AbstractButtonFinder ComponentFinder DialogFinder FrameFinder JLabelFinder JMenuItemFinder JWindowFinder NamedComponentFinder or other custom finder tags specified in TagMapping.properties.
id Id for the object found. Yes N/A String
others See corresponding tag handler implementation for a definition of other attributes that may be required. Yes N/A N/A

Example

 <find
    finder="DialogFinder"
    id="MyDialog"
    title="^My dialog box$"
 />
 

The above uses the TagHandler associated with the DialogFinder tag in the TagMapping.properties file. In the default jfcUnit case this would be the junit.extensions.jfcunit.finder.DialogFinderTagMapping.

Author:
Kevin Wilson, Vijay Aravamudhan : ThoughtWorks Inc.
See Also:
AbstractButtonFinderTagHandler, ComponentFinderTagHandler, DialogFinderTagHandler, FrameFinderTagHandler, JLabelFinderTagHandler, JMenuItemFinderTagHandler, JWindowFinderTagHandler, NamedComponentFinderTagHandler, JPopupMenuFinderTagHandler, junit.extensions.jfcunit.finder.LabeledComponentFinderTagHander

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
FindTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          Constructor for FindTagHandler.
 
Method Summary
 java.lang.String getFinder()
          Returns the value of the FINDER attribute for this element.
 java.lang.String getName()
          Returns the value of the NAME attribute for this element.
 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

FindTagHandler

public FindTagHandler(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

getFinder

public java.lang.String getFinder()
Returns the value of the FINDER attribute for this element.

Returns:
String The value of the FINDER attribute.

getName

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

Returns:
String The value of the NAME attribute.

processElement

public 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.processElement()

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()


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