📄 anttask.html
字号:
<tr class="a"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="b"> <td> type </td> <td> Type of Database operation to perform. Supported types are UPDATE, INSERT, DELETE, DELETE_ALL, REFRESH, CLEAN_INSERT, MSSQL_INSERT, MSSQL_REFRESH, MSSQL_CLEAN_INSERT. </td> <td> Yes </td> </tr> <tr class="a"> <td> src </td> <td> The xml source upon which the operation is to be performed </td> <td> Yes </td> </tr> <tr class="b"> <td> format </td> <td> For mat type of supplied source file. Possible values are "flat" or "xml". Defaults to <b> "flat" </b> </td> <td> <p> No </p> </td> </tr> </table> </td> </tr> <tr class="a"> <td> export </td> <td> <p> Use nested < export > operation elements to export the database to the supplied filename. The default operation is to < export > the entire database to the destination filename with the supplied dataset type. You can specify individual tables or queries to < export > by nesting them under the < export > step. </p> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="a"> <td> dest </td> <td> The xml destination filename </td> <td> Yes </td> </tr> <tr class="b"> <td> format </td> <td> Format type of supplied destination file. Possible values are "flat", "xml" or "dtd". Defaults to <b> "flat" </b> </td> <td> No </td> </tr> <tr class="a"> <td> doctype </td> <td> If set and format is "flat", add DOCTYPE declaration referencing specified DTD to exported dataset. The DTD path can be absolute or relative. </td> <td> No </td> </tr> </table> <h4> Parameters specified as nested elements </h4> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <td> table </td> <td> <p> Use nested < table > elements to export specific tables. </p> <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> name </td> <td> Name of the database table to export. </td> <td> Yes </td> </tr> </table> </td> </tr> <tr class="a"> <td> query </td> <td> <p> Use nested <a class="code"> < query > </a> elements to export data according to a sql statement. </p> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="a"> <td> name </td> <td> Name to reference the sql statement. </td> <td> Yes </td> </tr> <tr class="b"> <td> sql </td> <td> The sql to execute. You can use either SELECT * from Mytable or SELECT col1, col4 from MyTable </td> <td> Yes </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="a"> <td> compare </td> <td> <p> Use nested < compare > elements to validate the content of the database against the specified dataset file. </p> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="a"> <td> src </td> <td> The xml source upon which the comparison is to be performed </td> <td> Yes </td> </tr> <tr class="b"> <td> format </td> <td> Format type of supplied source file. Possible values are "flat" or "xml". Defaults to <b> "flat" </b> </td> <td> No </td> </tr> <tr class="a"> <td> sort </td> <td> Sorts tables prior comparison. Defaults to <b> "false". </b> </td> <td> No </td> </tr> </table> <h4> Parameters specified as nested elements </h4> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <td> table </td> <td> <p> Use nested < table > elements to compare specific tables. </p> <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> name </td> <td> Name of the database table to compare. </td> <td> Yes </td> </tr> </table> </td> </tr> <tr class="a"> <td> query </td> <td> <p> Use nested <a class="code"> < query > </a> elements to compare data according to a sql statement. </p> <table border="1" width="100%" cellspacing="2" cellpadding="3"> <tr class="b"> <th> Attribute </th> <th> Description </th> <th> Required </th> </tr> <tr class="a"> <td> name </td> <td> Name of the database table to compare. </td> <td> Yes </td> </tr> <tr class="b"> <td> sql </td> <td> The sql to execute. You can use either SELECT * from Mytable or SELECT col1, col4 from MyTable </td> <td> Yes </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <h3> Examples </h3> <h4> Update operation with specified JDBC driver jar </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <classpath> <pathelement location="/some/jdbc.jar"/> </classpath> <operation type="UPDATE" src="updateFile.xml"/> </dbunit></pre> </div> <h4> Insert and update operations </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <operation type="INSERT" src="insertFile.xml"/> <operation type="UPDATE" src="updateFile.xml"/> </dbunit></pre> </div> <h4> Database data export to XML </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <export dest="export.xml"/> </dbunit></pre> </div> <h4> Database structure export to DTD </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <export dest="export.dtd" format="dtd"/></dbunit></pre> </div> <h4> <a name="partialexport"> Partial database data export </a> </h4> <p> Export two tables: FOO, resulting from specified query and BAR entire content </p> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <export dest="partial.xml"> <query name="FOO" sql="SELECT COL1, COL2 FROM FOO WHERE COL1=4"/> <table name="BAR"/> </export></dbunit></pre> </div> <h4> Database data comparison </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <compare src="expectedData.xml"/> </dbunit></pre> </div> <h4> <a name="partialcompare"> Partial database data comparison </a> </h4> <div id="source"> <pre><dbunit driver="com.vendor.jdbc.Driver" url="jdbc:vendor:mydatabase" userid="user" password="password"> <compare src="expectedData.xml"> <query name="FOO" sql="SELECT COL1, COL2 FROM FOO WHERE COL1=4"/> <table name="BAR"/> </compare></dbunit></pre> </div> </div> </div> </div> </td> </tr> </table> <div id="footer"> <table border="0" style="width:100%" cellpadding="4" cellspacing="0"> <tr> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -