net.sourceforge.sqlunit.handlers
Class BatchTestHandler

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

public class BatchTestHandler
extends java.lang.Object
implements IHandler

The BatchTestHandler allows the grouping of a number of Stored Procedure calls and/or SQL statements and a number of expected results from these. The whole group is executed within a single transactional context, so a failure in one of the SQL statements will roll back the entire test to the point before it was called. Note that all the results need not be specified. The handler will use the result's id attribute to match with the corresponding sql or call element's id attribute to compare the results. Pairs for which the result is not specified will be considered to have passed.

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

Constructor Summary
BatchTestHandler()
           
 
Method Summary
 java.lang.Object process(org.jdom.Element elBatchTest)
          Collects the stored procedures and SQL statements specified and runs them in a batch, matching with the specified results with the same id attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchTestHandler

public BatchTestHandler()
Method Detail

process

public final java.lang.Object process(org.jdom.Element elBatchTest)
                               throws java.lang.Exception
Collects the stored procedures and SQL statements specified and runs them in a batch, matching with the specified results with the same id attribute. If a failure occurs, the entire batch is rolled back. This behavior of this handler is largely identical to the behavior of the Test handler.

Specified by:
process in interface IHandler
Parameters:
elBatchTest - the JDOM Element representing the batchtest tag.
Returns:
a Boolean.TRUE if the test succeeded else Boolean.FALSE.
Throws:
java.lang.Exception - if there was a problem running the process.