net.sourceforge.sqlunit.handlers
Class TestHandler

java.lang.Object
  extended by net.sourceforge.sqlunit.handlers.TestHandler
All Implemented Interfaces:
IHandler

public class TestHandler
extends java.lang.Object
implements IHandler

The TestHandler class is responsible for executing a single test specified by the contents of the test tag in the input XML file. A test consists of either a single sql or a call tag followed by a result tag. Thus a test will involve first running the sql or stored procedure and comparing the results with the supplied result. The test will also have to replace any variables specified in the result element with the corresponding value from the symbol table.

Version:
$Revision: 1.19 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
TestHandler()
           
 
Method Summary
 java.lang.Object process(org.jdom.Element elTest)
          Calls either the SqlHandler or CallHandler and compares the result returned with the supplied result in the result tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestHandler

public TestHandler()
Method Detail

process

public final java.lang.Object process(org.jdom.Element elTest)
                               throws java.lang.Exception
Calls either the SqlHandler or CallHandler and compares the result returned with the supplied result in the result tag.

Specified by:
process in interface IHandler
Parameters:
elTest - the JDOM Element representing the test tag.
Returns:
a Boolean.TRUE if the test passed, else a Boolean.FALSE. If test was skipped, then it returns null.
Throws:
java.lang.Exception - if there was a problem running the process.