📄 anttask.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> DbUnit - Ant Integration </title> <style type="text/css"> @import url("./style/tigris.css"); @import url("./style/maven.css"); </style> <link rel="stylesheet" href="./style/print.css" type="text/css" media="print"></link> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta> </head> <body class="composite"> <div id="banner"> <table border="0" width="100%" cellpadding="8" cellspacing="0"> <tr> <td> <a href="http://www.sourceforge.net/projects/dbunit"> <img border="0" alt="DbUnit.org" src="http://sourceforge.net/sflogo.php?group_id=47439&type=5" align="left"></img> </a> </td> <td> <div id="login" align="right"> <a href="http://www.dbunit.org"> <img border="0" alt="DbUnit" src="./images/dbunit-logo.jpg" align="right"></img> </a> </div> </td> </tr> </table> </div> <div id="breadcrumbs"> <table border="0" width="100%" cellpadding="4" cellspacing="0"> <tr> <td>Last published: 31 May 2004 | Doc for 2.1 </td> <td> <div align="right"> <a href="http://www.dbunit.org/wiki/"><img class="handle" src="./images/none.png" alt=""></img>Wiki</a> | <a href="http://www.sf.net/projects/dbunit"><img class="handle" src="./images/none.png" alt=""></img>SF.net Project Page</a> | <a href="http://maven-plugins.sourceforge.net/maven-dbunit-plugin/index.html"><img class="handle" src="./images/none.png" alt=""></img>Maven Plugin</a> </div> </td> </tr> </table> </div> <table border="0" width="100%" cellpadding="8" cellspacing="0"> <tr valign="top"> <td width="20%" id="leftcol"> <div id="navcolumn"> <div> <strong>Quick Links</strong> <div> <small> <a href="http://sourceforge.net/project/showfiles.php?group_id=47439&release_id=211888"><img class="handle" src="./images/none.png" alt=""></img>Download</a> </small> </div> <div> <small> <a href="changes-report.html"><img class="handle" src="./images/none.png" alt=""></img>Changes</a> </small> </div> <div> <small> <a href="faq.html"><img class="handle" src="./images/none.png" alt=""></img>FAQ</a> </small> </div> <div> <small> <a href="https://sourceforge.net/support/getsupport.php?group_id=47439"><img class="handle" src="./images/none.png" alt=""></img>Get Support</a> </small> </div> <div> <small> <a href="http://www.dbunit.org/wiki/"><img class="handle" src="./images/none.png" alt=""></img>Wiki</a> </small> </div> <div> <small> <a href="cvs-usage.html"><img class="handle" src="./images/none.png" alt=""></img>Source</a> </small> </div> <div> <small> <a href="apidocs/index.html"><img class="handle" src="./images/none.png" alt=""></img>JavaDocs</a> </small> </div> </div> <div> <strong>Overview</strong> <div> <small> <a href="index.html"><img class="handle" src="./images/none.png" alt=""></img>About DbUnit</a> </small> </div> <div> <small> <a href="intro.html"><img class="handle" src="./images/none.png" alt=""></img>Database Testing</a> </small> </div> <div> <small> <a href="howto.html"><img class="handle" src="./images/none.png" alt=""></img>Getting Started</a> </small> </div> <div> <small> <a href="bestpractices.html"><img class="handle" src="./images/none.png" alt=""></img>Best Practices</a> </small> </div> <div> <small> <a href="components.html"><img class="handle" src="./images/none.png" alt=""></img>Core Components</a> </small> </div> <div> <small> <a href="properties.html"><img class="handle" src="./images/none.png" alt=""></img>Properties</a> </small> </div> <div> <small> <b><a href="anttask.html"><img class="handle" src="./images/none.png" alt=""></img>Ant Task</a></b> </small> </div> <div> <small> <a href="resources.html"><img class="handle" src="./images/none.png" alt=""></img>Resources</a> </small> </div> </div> <div> <strong>Project Documentation</strong> <div> <small> <a href="index.html"><img class="handle" src="./images/none.png" alt=""></img>About DbUnit</a> </small> </div> <div> <small> <a href="project-info.html"><img class="handle" src="./images/collapsed.png" alt=""></img>Project Info</a> </small> </div> <div> <small> <a href="maven-reports.html"><img class="handle" src="./images/collapsed.png" alt=""></img>Project Reports</a> </small> </div> <div> <small> <a href="http://maven.apache.org/development-process.html"><img class="handle" src="./images/none.png" alt=""></img>Development Process</a> </small> </div> </div> <div style="margin-top: 20px; width: 100%; text-align: center;"> <a href="http://maven.apache.org/" title="Powered by Maven"><img style="border: 1px solid black" alt="Powered by Maven" src="./images/logos/maven-propaganda.png"></img></a> </div> </div> </td> <td rowspan="2"> <div id="bodycol"> <div class="app"> <div class="h3"> <h3> Ant Integration </h3> <h4> Installation </h4> <p> 1. Add the DbUnit jar to Ant's classpath. </p> <p> 2. Add a < taskdef > element to your build script as follows: <div id="source"> <pre><taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask"/></pre> </div> </p> <p> 3. Use the task in the rest of the buildfile. </p> <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" width="100%" cellspacing="2" cellpadding="3"> <tr class="a"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="b"> <td> driver </td> <td> Class name of the jdbc driver </td> <td> Yes </td> </tr> <tr class="a"> <td> url </td> <td> Database connection url </td> <td> Yes </td> </tr> <tr class="b"> <td> userid </td> <td> Database username </td> <td> Yes </td> </tr> <tr class="a"> <td> password </td> <td> Database password </td> <td> Yes </td> </tr> <tr class="b"> <td> schema </td> <td> Database schema </td> <td> No </td> </tr> <tr class="a"> <td> classpath </td> <td> Classpath used to load driver </td> <td> No (use system classpath) </td> </tr> <tr class="b"> <td> useQualifiedTableNames </td> <td> Set the <a href="properties.html#qualifiedtablenames"> qualified table names </a> feature. Defaults to false </td> <td> No </td> </tr> <tr class="a"> <td> supportBatchStatement </td> <td> Set the <a href="properties.html#batchstatement"> batched statement </a> feature. Defaults to false </td> <td> No </td> </tr> <tr class="b"> <td> datatypeWarning </td> <td> Set the <a href="properties.html#typewarning"> data type warning </a> feature. Defaults to true </td> <td> No </td> </tr> <tr class="a"> <td> escapePattern </td> <td> Set the <a href="properties.html#escapepattern"> escape pattern </a> property. </td> <td> No </td> </tr> <tr class="b"> <td> datatypeFactory </td> <td> Set the <a href="properties.html#typefactory"> datatype factory </a> property. </td> <td> No </td> </tr> </table> <h4> Parameters specified as nested elements </h4> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="a"> <td> classpath </td> <td> <p> DbUnit's classpath attribute is a PATH like structure and can also be set via a nested classpath element. It is used to load the JDBC classes. </p> </td> </tr> <tr class="b"> <td> operation </td> <td> <p> Use nested < operation > elements to specify which DbUnit operation to perform on the particular file. <br> </br> </p> <table border="1" width="100%" cellspacing="2" cellpadding="3">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -