junit.extensions.xml.elements
Class StopWatchTagHandler

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

public class StopWatchTagHandler
extends AbstractTagHandler

This is tag handler can measure the milliseconds within a test case.

Description

Mark the start of the process to be timed with a mark action.

 <stopwatch id="myid" action="mark"/>
 
Then afterward assert that the duration in milliseconds.
 <stopwatch refid="myid" action="lessthan"
               value="8000"/>
 
Or to simply write the duration to stdout.
 <stopwatch refid="myid" action="log"/>
 

Author:
Kevin Wilson
See Also:
JComboBoxMouseEventData

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
StopWatchTagHandler(org.w3c.dom.Element element, IXMLTestCase testCase)
          constructor.
 
Method Summary
 java.lang.String getAction()
          Get the action attribute from the element.
 java.lang.String getId()
          Get the value of the id attribute.
 java.lang.String getRefid()
          Get the value of the refid attribute.
 void processElement()
          Process the element.
 void validateElement()
          Validate that the element is properly configured.
 
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

StopWatchTagHandler

public StopWatchTagHandler(org.w3c.dom.Element element,
                           IXMLTestCase testCase)
constructor.

Parameters:
element - Element to be processed.
testCase - containing test case.
Method Detail

getAction

public java.lang.String getAction()
Get the action attribute from the element.

Returns:
String The value of the action attribute.

getId

public java.lang.String getId()
Get the value of the id attribute.

Returns:
String value of the id attribute.

getRefid

public java.lang.String getRefid()
Get the value of the refid attribute.

Returns:
String value of the refid attribute.

processElement

public void processElement()
                    throws XMLException
Process the element.

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

validateElement

public void validateElement()
                     throws XMLException
Validate that the element is properly configured.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - Exception may be thrown if there are missing elements.


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