SQLUnit User Guide

Sujit Pal

Table of Contents
Alternative Forms of this document
Printer Friendly Format
Downloadable Format
Historical Trivia
Porting Information
License Information
Downloading the source
Required JAR files
Running the install script
SQLUnit Command Line
Interpreting the output
SQLUnit GUI Tool
SQLUnit TUI Tool
SQLUnit XSL Transform Tool
SQLUnit TestDocsGenerator Tool
SQLUnit Canoo2HTML Tool
SQLUnit Tags
List of currently supported tags
The sqlunit Tag
The setup Tag
The skip Tag
The struct Tag
The subparam Tag
The batchresult Tag
The call Tag
The set Tag
The classifiers Tag
The jndi Tag
The methodinvoker Tag
The teardown Tag
The foreach Tag
The connection Tag
The func Tag
The echo Tag
The include Tag
The result Tag
The methodArgs Tag
The row Tag
The param Tag
The funcdef Tag
The batchsql Tag
The prepare Tag
The typedef Tag
The severity Tag
The paramset Tag
The subdef Tag
The col Tag
The batchtest Tag
The constructorArgs Tag
The batchcall Tag
The outparam Tag
The typemap Tag
The test Tag
The resultset Tag
The match Tag
The field Tag
The sub Tag
The exception Tag
The diff Tag
The category Tag
The arg Tag
The sql Tag
The dynamicsql Tag
Extending SQLUnit: Writing your own tag handler
Finding your way around
Writing your handler
Adding the tag to handler class mapping
Updating the list of valid swappable child tags
Adding the DTD for the new tag
Getting Connections
Basic JDBC Connection
JDBC Connection with properties
Basic JNDI Connection
JDBC Connection using local JAR file
Connection Properties from external file
Passing in a Connection object to SQLUnit
Controlling Transactions
Using variables
Setting explicitly from scalar
Setting explicitly from query
Setting explicitly from Java method call
Setting variables from ant
Setting variables implicitly
Including Files
Including XML Files
SQLUnit Include Files
Error Messages
Supported Datatypes
List of currently supported datatypes
Extending SQLUnit: Adding support for your own datatypes
Using an existing implementation for an unlisted datatype
Overriding the implementation for a datatype
Adding a new implementation for a new datatype
SQLUnit Assertions
List of currently supported Assertions
Extending SQLUnit: Adding your own Assertion
Large Object (LOB) Support
Handling Object output from ORDBMS
Handling BLOB and CLOB outputs
Java Object Support
User-Defined Matching
What is User-Defined Matching
Wildcarding rules for Match Attributes
List of currently supported Matchers
Extending SQLUnit: Writing your own Matcher
Setting up your Matcher for use with SQLUnit
User-Defined Reporting
What is User-Defined Reporting?
List of currently supported Reporters
Extending SQLUnit: Writing your own Reporter
Setting up your Reporter for use with SQLUnit
User-Defined Test Grouping and Test Skipping
What are User-Defined Test Groups
Declaring the group of a test
Extending SQLUnit: Write your own classification
Skipping Tests with <skip>
Using the Mock Testing Framework
Writing your own mock procedures
Writing tests against the mock procedures