|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.extensions.xml.elements.AbstractTagHandler
junit.extensions.xml.elements.IndexOfTagHandler
Provide a mechanism for finding row/column in a table for a given value. It will return throw an assertion if the value is not found.
refid - the object to inspect [required] id - the id of the results [required] value - the expected value [required] type - the field type of the object [required] tablecell - locate a table cell in the specified row or column. row and column attributes may be used to narrow the search. listcell - locate a item in the list. tab - locate a tab. tablecolumn - locate a table column.
index - the x'th instance of the value to find [optional] operation - The type of matching operation to perform. match - Use a regular expression match. equals - (default) if not specified. contains - The item contains the value. startswith - The item starts with the value. endswith - The item ends with the value. useRE - (depricated use operation="match") allow the value to contain a regular expression [optional] default - is false exact string match needed If set to true partial strings will work.
Successful execution will set the following:tablecell
id to the value of the cell. id.row to the row of the tablecell.
id.column to the column of the tablecell.
tablecolumn
id to the value of the header. id.index to the column of the table header. listitem
id to the value of the item. id.index to the index of the list item.
tab
id to the value of the title. id.index to the index of the tab.
Unsuccessfull id will be set to null and -1 will be set as the index, row and column.
<indexof id="cell" refid="JTable1" type="tablecell" column="1" value="Joe"/>Return the cell where the value Joe is found in a specific row
<indexof id="cell" refid="JTable1" type="tablecell" row="1" value="Joe"/>Return the 2nd cell where the value Joe is found in the table
<indexof id="cell" refid="JTable1" type="tablecell" value="Joe" index="2"/>Return the index of the column header containing SearchCode
<indexof id="table" refid="JTable1" type="tablecolumn" value="SearchCode" index="0"/>Return the index of the tab containing the General.
<indexof id="tab" refid="TabPane1" type="tab" value="General" index="0"/>Return the index of the tab containing the Peanut.
<indexof id="item" refid="JList1" type="listitem" value="Peanut" index="0"/>Return the index of the list containing the Watermellon.
<indexof id="item" refid="JComboBox1" type="listitem" value="Watermellon" index="0"/>
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 | |
IndexOfTagHandler(org.w3c.dom.Element element,
IXMLTestCase testcase)
Constructor. |
Method Summary | |
private boolean |
evaluate(int operation,
java.lang.String tableval,
java.lang.String expectedval)
Evaluate the operation. |
protected boolean |
getCaseIndependent()
Get the case independent attribute. |
protected int |
getOperation()
Get the operation from the string value. |
void |
processElement()
Locate the index or cell matching the value. |
void |
validateElement()
Insure that the id, refid, type and value attributes are specified. |
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 |
public IndexOfTagHandler(org.w3c.dom.Element element, IXMLTestCase testcase)
element
- Element to be processed.testcase
- Containing test case.Method Detail |
public void processElement() throws XMLException
processElement
in class AbstractTagHandler
XMLException
- exception maybe thrown.public void validateElement() throws XMLException
validateElement
in class AbstractTagHandler
XMLException
- if one or more of the above attributes are missing.protected boolean getCaseIndependent()
protected int getOperation()
private boolean evaluate(int operation, java.lang.String tableval, java.lang.String expectedval)
operation
- Operation to be evaluated.tableval
- Actual value.expectedval
- expected value.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |