|
|||||||||||
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.ChooseTagHandler
The ChooseTagHandler allows for some flow control in a test case. The handler is pattered after the xsl:choose elements.
The choose tag processes its child elements which should be either when or otherwise elements. Each when element contains a test attribute which points to a tag handler. If the tag handler does not assert, then the test is assumed to process properly. The when element is passed as the element to process to the test tag handler defined. If the when does not cause a assertion, then the test is assumed to be successful, and the child elements of the when which succeeded will be processed, and the processing of the Choose element will conclude.
If none of the When elements are tested successful, then the otherwise elements children will be processed.
<choose> <when test="assertnotnull" refid="ComponentA"> ...do when... </when> <when test="assertnotnull" refid="ComponentB"> ...do when... </when> <otherwise> ...do otherwise... </otherwise> </choose>"choose" element requires no attributes but should contain a ordered list of "when" elements and "otherwise".
"when" element requires one attribute "test" which defines a tag handler to be processed. Other "when" attributes may be required depending upon the tag handler specified. Children of the when should be specified which are to be conditionaly processed. "otherwise" element requires no attributes. The children elements will conditionally be processed.
Copyright: Copyright (c) 2003
Company: JFCUnit Sourceforge project
Field Summary | |
private java.lang.String |
m_choose
choose string. |
private java.lang.String |
m_other
other string. |
private java.lang.String |
m_when
when string. |
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 | |
ChooseTagHandler(org.w3c.dom.Element element,
IXMLTestCase testCase)
Constructor. |
Method Summary | |
void |
processElement()
process the element. |
protected void |
setChoose(java.lang.String choose)
Set the choose string. |
protected void |
setOther(java.lang.String other)
Set the other string. |
protected void |
setWhen(java.lang.String when)
Set the when string. |
void |
validateElement()
Validate that the element is correct. |
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 |
Field Detail |
private java.lang.String m_choose
private java.lang.String m_other
private java.lang.String m_when
Constructor Detail |
public ChooseTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
element
- Element to be processed.testCase
- Test case processing tag handler.Method Detail |
public void processElement() throws XMLException
processElement
in class AbstractTagHandler
XMLException
- is thrown if the element cannot be understood.public void validateElement() throws XMLException
validateElement
in class AbstractTagHandler
XMLException
- may be thrown.protected void setChoose(java.lang.String choose)
choose
- Choose string to be used.protected void setOther(java.lang.String other)
other
- string to be used.protected void setWhen(java.lang.String when)
when
- When string to be used.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |