|
From: <mla...@us...> - 2002-06-16 20:35:08
|
Update of /cvsroot/dbunit/./dbunit/docs
In directory usw-pr-cvs1:/tmp/cvs-serv14842/dbunit/docs
Added Files:
anttask.html
Log Message:
* Add missing ant doc html...
--- NEW FILE: anttask.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- #BeginTemplate "/Templates/main.dwt" -->
<head>
<meta http-equiv="Content-Style-Type" content="text/css">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<!-- #BeginEditable "doctitle" -->
<title>The Dbunit Framework - Ant Task</title>
<!-- #EndEditable -->
</head>
<body>
<table cellspadding = 0 cellspacing = 0 border = 0 width="100%">
<tr height="100">
<td class="logo" width = 200><img src="images/logo.jpg" width=200 height=100></td>
<td class="header"></td>
</tr>
</table>
<table cellspadding = 0 cellspacing = 0 border = 0>
<tr>
<td class="menu" nowrap valign="top" >
<p><a href="index.html">Home</a><br>
<br>
<a href="intro.html">Introduction</a><br>
<a href="components.html">Core classes</a><br>
<a href="anttask.html">Ant Task</a><br>
<a href="howto.html">How-to Guides</a><br>
<a href="bestpractices.html">Best Practices</a><br>
<a href="properties.html">Properties</a><br>
<a href="api/index.html">API Reference</a><br>
<a href="faq.html">FAQ</a><br>
<br>
<a href="changes.html">Changes</a><br>
<a href="download.html">Download</a><br>
<a href="support.html">Support</a><br>
<a href="resources.html">Resources</a><br>
<br>
</p>
<div align="center"><a href="http://sourceforge.net"> <img alt="SourceForge Logo" border="0" height="31" width="88" src="http://sourceforge.net/sflogo.php?group_id=47439">
</a></div>
<br>
<div align="center"><a href="http://www.silphid.com/"><img alt="Silphid Creations"
src="images/silphid.gif" border=0></a></div>
</td>
<td class="body" valign="top"> <!-- #BeginEditable "body" -->
<h2>Ant Integration</h2>
<h3>Installation</h3>
The steps required to add the DbUnit task to your system are:
<ol>
<li>Add the DbUnit jar to Ant's classpath. </li>
<li>Add a <taskdef> element to your build script as follows:
<pre class=code><taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask"/></pre>
</li>
<li>Use the task in the rest of the buildfile. </li>
</ol>
<h3>Usage </h3>
<p>Executes either a single transaction, or a group of transactions, under
the DbUnit database testing framework.</p>
<h4>Parameters</h4>
<table border="1">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
</tr>
<tr>
<td>driver</td>
<td>Class name of the jdbc driver</td>
<td>Yes</td>
</tr>
<tr>
<td>url</td>
<td>Database connection url</td>
<td>Yes</td>
</tr>
<tr>
<td>userid</td>
<td>Database username</td>
<td>Yes</td>
</tr>
<tr>
<td>password</td>
<td>Database password</td>
<td>Yes</td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<table cellspadding = 0 border = 1 >
<tr>
<td>operation</td>
<td>
<p>Use nested <operation> elements to specify which DbUnit operation
to perform on the particular file. <br>
</p>
<table border="1">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
</tr>
<tr>
<td>type</td>
<td>Type of Database operation to perform. Supported types are<br>
UPDATE, INSERT, DELETE, <br>
DELETE_ALL, REFRESH, <br>
CLEAN_INSERT, MSSQL_INSERT,<br>
MSSQL_REFRESH, MSSQL_CLEAN_INSERT.</td>
<td>Yes</td>
</tr>
<tr>
<td>src</td>
<td>The xml source upon which the operation is to be performed</td>
<td>Yes</td>
</tr>
<tr>
<td>flat</td>
<td>If true, use <a class="code">FlatXmlDataSet</a> type in the
supplied src file. Otherwise use <a class="code">XmlDataSet</a>.
Defaults to <a class="code">true</a></td>
<td>
<p>No</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>composite</td>
<td>
<p>Use nested <a class="code"><composite></a> operation elements
to combine multiple <a class="code"><operation></a>s (on the
same file) into a single one.</p>
<table border="1">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
</tr>
<tr>
<td>src</td>
<td>The xml source upon which the operation is to be performed</td>
<td>Yes</td>
</tr>
<tr>
<td>flat</td>
<td>If true, use <a class="code">FlatXmlDataSet</a> type in the
supplied src file. Otherwise use <a class="code">XmlDataSet</a>.
Defaults to <a class="code">true</a></td>
<td>
<p>No</p>
</td>
</tr>
</table>
<h4>Parameters specified as nested elements </h4>
<table border="1">
<tr>
<td>operation</td>
<td>See above definition for details. The src and flat attributes
are supplied as attributes to the <a class="code"><composite></a>
step and should not be attempted to be overridden by the nested
<a class="code"><operation></a> step.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>export</td>
<td>
<p>Use nested <a class="code"><export></a> operation elements
to export the database to the supplied filename. The default operation
is to <a class="code"><export></a> the entire database to
the destination filename with the supplied dataset type. You can
specify individual tables to<br>
<a class="code"><export></a> by nesting them under the <export>
step.</p>
<table width="100%" border="1">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
</tr>
<tr>
<td>dest</td>
<td>The xml destination filename</td>
<td>Yes</td>
</tr>
<tr>
<td>flat</td>
<td>If true, use <a class="code">FlatXmlDataSet</a> type in the
supplied src file. Otherwise use <a class="code">XmlDataSet</a>.
Defaults to <a class="code">true</a></td>
<td>
<p>No</p>
</td>
</tr>
</table>
<h4>Parameters specified as nested elements </h4>
<table border="1">
<tr>
<td>table</td>
<td>
<p>Use nested <a class=code><table></a> elements to <a class=code><export></a>
specific tables. </p>
<table border="1">
<tr>
<td><b>Attribute</b></td>
<td><b>Description</b></td>
<td><b>Required</b></td>
</tr>
<tr>
<td>name</td>
<td>Name of the database table to export.</td>
<td>No</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<h3>Examples</h3>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <operation type="UPDATE" src="updateFile.xml"/><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver
and executes the UPDATE operation contained within the FlatXmlDataSet
file updateFile.xml.</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <operation type="INSERT" src="insertFile.xml"/><br> <operation type="UPDATE" src="updateFile.xml"/><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver.
It then executes the INSERT operation contained within the FlatXmlDataSet
file insertFile.xml <br>
followed by the execution of the UPDATE operation contained within the
FlatXmlDataSet file updateFile.xml.</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <operation type="UPDATE" src="updateFile.xml" flat="false"/><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver
and executes the UPDATE operation contained within the XmlDataSet file
updateFile.xml.</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <composite src="compositeFile.xml"><br> <operation type="DELETE"/><br> <operation type="INSERT"/><br> </composite><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver.
It then executes the CompositeOperation, DELETE and then UPDATE, contained
within the FlatXmlDataSet file updateFile.xml.</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <composite src="compositeFile.xml" flat="false"><br> <operation type="INSERT"/><br> <operation type="UPDATE"/><br> </composite><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver.
It then executes the CompositeOperation, DELETE and then UPDATE, contained
within the XmlDataSet file updateFile.xml.</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <export dest="exportFile.xml"/><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver
and exports the database to the given destination file as a FlatXmlDataSet.
</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <export dest="exportNonFlatFile.xml" flat="false"/><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver
and exports the database to the given destination file as an XmlDataSet.
</p>
<pre> <dbunit driver="org.hsqldb.jdbcDriver"<br> url="jdbc:hsqldb:."<br> userid="dbunit"<br> password="dbunit"><br> <export dest="exportFile.xml"><br> <table name="FOO"/><br> <table name="BAR"/><br> </export><br> </dbunit></pre>
<p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver
and exports the contents of the provided tables to the given destination
file as an XmlDataSet. <br>
</p>
<!-- #EndEditable -->
<hr>
<div align="center">
<p><font size="2">Copyright ©2002, Manuel Laflamme, All Rights Reserved</font></p>
<p><font size="1"><a href="index.html">Home</a> - <a href="intro.html">Introduction</a>
- <a href="components.html">Core Classes</a> - <a href="anttask.html">Ant
Task</a> - <a href="howto.html">How-to Guides</a> - <a href="bestpractices.html">Best
Practices</a> - <a href="properties.html">Properties</a> - <a href="api/index.html">API
Reference</a> - <a href="faq.html">FAQ</a> - <a href="changes.html">Changes
History</a> - <a href="download.html">Download</a> - <a href="support.html">Support</a>
- <a href="resources.html">Resources</a></font></p>
<font size="1">$Revision: 1.1 $ $Date: 2002/06/16 20:35:02 $</font> </div>
</tr>
</table>
</body>
<!-- #EndTemplate --></html>
|