junit.extensions.xml.elements
Class EchoTagHandler

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

public class EchoTagHandler
extends AbstractTagHandler

Provide a mechanism for sending debug messages to the test case developer.

Tag Name:

echo

Attributes:

 message - the message to output        [required]
 mode    - what is the output mechanism [optional]
          'stdout' is default, sends output to stdout
          'dialog' sends the output to a JOptionPane
          'confirm' sends the output to a JOptionPane
                    confirmation dialog.
          'stderr' sends the output to stderr
 block   - Block is a valid attribute when the mode is
           dialog or confirm. It controlls the modality
           of the dialog. Default value is true.
 

Examples:

   <echo message="hello world"/>
   <echo mode='dialog' message="hello world"/>
   <echo mode='dialog' block="false" message="hello world"/>
   <echo mode='stderr' message="hello world"/>
 

Author:
JFCUnit contributor

Nested Class Summary
private  class EchoTagHandler.EchoDialog
          Title: EchoDialog non-modal dialog for echos
 
Field Summary
private  boolean m_result
          Window close result.
private static int NO_OPTION
          Result of confirm dialog when NO or CANCEL button is pressed.
private static int YES_OPTION
          Result of confirm dialog when YES button is pressed.
 
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
EchoTagHandler(org.w3c.dom.Element element, IXMLTestCase testcase)
          Constructor.
 
Method Summary
 void processElement()
          Handle the XML processing of the tag 'echo'.
(package private)  int showConfirm(java.lang.String msg)
          Show a confirm dialog.
(package private)  void showDialog(java.lang.String msg)
          Show a Dialog.
(package private)  int showDialog(java.lang.String msg, boolean confirm)
          Show the dialog with the message given.
 void validateElement()
          Make sure the appropriate tag and attributes are used.
 
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

YES_OPTION

private static final int YES_OPTION
Result of confirm dialog when YES button is pressed.

See Also:
Constant Field Values

NO_OPTION

private static final int NO_OPTION
Result of confirm dialog when NO or CANCEL button is pressed.

See Also:
Constant Field Values

m_result

private boolean m_result
Window close result.

Constructor Detail

EchoTagHandler

public EchoTagHandler(org.w3c.dom.Element element,
                      IXMLTestCase testcase)
Constructor.

Parameters:
element - Element to be processed by the tag handler.
testcase - parent test case.
Method Detail

processElement

public void processElement()
                    throws XMLException
Handle the XML processing of the tag 'echo'.

Specified by:
processElement in class AbstractTagHandler
Throws:
XMLException - upon failure of processing.

validateElement

public void validateElement()
                     throws XMLException
Make sure the appropriate tag and attributes are used.

Overrides:
validateElement in class AbstractTagHandler
Throws:
XMLException - when validation fails.

showConfirm

int showConfirm(java.lang.String msg)
Show a confirm dialog.

Parameters:
msg - Message to be displayed.
Returns:
YES_OPTION or NO_OPTION

showDialog

void showDialog(java.lang.String msg)
Show a Dialog.

Parameters:
msg - Message to be displayed.

showDialog

int showDialog(java.lang.String msg,
               boolean confirm)
Show the dialog with the message given.

Parameters:
msg - message to be displayed.
confirm - if true then use YES/NO buttons.
Returns:
YES_OPTION or NO_OPTION.


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