You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(7) |
Aug
(37) |
Sep
|
Oct
|
Nov
(1) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(8) |
Feb
(68) |
Mar
(72) |
Apr
(149) |
May
(32) |
Jun
(46) |
Jul
(26) |
Aug
(59) |
Sep
(25) |
Oct
(18) |
Nov
(4) |
Dec
(3) |
2004 |
Jan
(90) |
Feb
(19) |
Mar
(38) |
Apr
(41) |
May
(44) |
Jun
(2) |
Jul
(10) |
Aug
|
Sep
(14) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(15) |
Jun
(1) |
Jul
|
Aug
(9) |
Sep
|
Oct
(17) |
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
(16) |
Mar
|
Apr
(1) |
May
(48) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(29) |
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(23) |
Mar
(31) |
Apr
|
May
(26) |
Jun
(6) |
Jul
(1) |
Aug
|
Sep
(7) |
Oct
(1) |
Nov
(8) |
Dec
(8) |
2009 |
Jan
(5) |
Feb
(9) |
Mar
(1) |
Apr
|
May
(23) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(9) |
Oct
(28) |
Nov
(18) |
Dec
(8) |
2010 |
Jan
(19) |
Feb
(24) |
Mar
(3) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(11) |
Oct
|
Nov
(2) |
Dec
(1) |
2011 |
Jan
|
Feb
(7) |
Mar
|
Apr
(6) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(32) |
Oct
(6) |
Nov
|
Dec
|
From: <mla...@us...> - 2004-01-14 22:04:24
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv7894/xdocs Modified Files: components.xml Log Message: More doc rewriting Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** components.xml 14 Jan 2004 02:03:59 -0000 1.2 --- components.xml 14 Jan 2004 22:04:21 -0000 1.3 *************** *** 61,70 **** </p> <h4><a name="FlatXmlDataSet">FlatXmlDataSet</a></h4> - <p>The FlatXmlDataSet class has been introduced in version - 1.2. I found that generic XML datasets were hard to write and to maintain. - This was particularly painful for tables having a lot of columns. </p> <p>In the flat XML format, each XML element corresponds to a table row. Each XML element name corresponds to a table name. The XML attributes ! correspond to table columns. Here is an example dataset containing the same data than the XmlDataSet <a href="#originalxmlsample">example</a>: <source><![CDATA[ --- 61,68 ---- </p> <h4><a name="FlatXmlDataSet">FlatXmlDataSet</a></h4> <p>In the flat XML format, each XML element corresponds to a table row. Each XML element name corresponds to a table name. The XML attributes ! correspond to table columns.</p> ! <p> Here is an example dataset containing the same data than the XmlDataSet <a href="#originalxmlsample">example</a>: <source><![CDATA[ *************** *** 79,102 **** </dataset>]]></source> </p> <p>Learn how to export your database data to this format <a href="howto.html#extract">here</a> and how to generate a DTD representing your database schema <a href="howto.html#generatedtd">here</a>. ! <b>Note that DbUnit does not automatically add a reference to your DTD when you export a dataset. You must edit the output file to manually add the ! DOCTYPE declaration.</b></p> ! <h5>Null Values</h5> ! <p>To specify a null value, you simply have to omit its corresponding attribute. ! In the above example, COLUMN1 and COLUMN2 are nulls for the second row of ! TEST_TABLE. </p> ! <h5>Table metadata</h5> ! <p>DbUnit use the DTD referenced by the document type declaration as metadata. ! DbUnit only support external system URI. The URI can be absolute or relative.</p> ! <p> Example of system document type declaration: ! <source><![CDATA[<!DOCTYPE dataset SYSTEM "my-dataset.dtd">]]></source> ! </p><p>If the xml document does not contain a document type declaration, the ! metadata is generated from the first row of each table. This is highly ! recommended to always provide a document type declaration since DbUnit ! will think your table is missing some columns if the first row has one ! or more null values. ! </p> <a name="XmlDataSet"> <h4>XmlDataSet </h4> --- 77,93 ---- </dataset>]]></source> </p> + <p>To specify a null value, you simply have to omit its corresponding attribute. + In the above example, COLUMN1 and COLUMN2 are nulls for the second row of + TEST_TABLE.</p> + <p>Table metadata is deduced from the first row of each table. <b>Beware that DbUnit may think + a table miss some columns if the first row of that table has one or more null values.</b></p> + <p>For this kind of situation, this is highly recommended to use DTD. DbUnit will use the + columns declared in the DTD as table metadata. DbUnit only support external system URI. + The URI can be absolute or relative.</p> <p>Learn how to export your database data to this format <a href="howto.html#extract">here</a> and how to generate a DTD representing your database schema <a href="howto.html#generatedtd">here</a>. ! Note that DbUnit does not automatically add a reference to your DTD when you export a dataset. You must edit the output file to manually add the ! DOCTYPE declaration.</p> <a name="XmlDataSet"> <h4>XmlDataSet </h4> |
From: <mla...@us...> - 2004-01-14 03:44:42
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv3898/xdocs Modified Files: faq.fml index.xml properties.xml resources.xml support.xml Log Message: More xdoc reformating Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** faq.fml 13 Aug 2003 09:40:02 -0000 1.1 --- faq.fml 14 Jan 2004 03:44:38 -0000 1.2 *************** *** 5,9 **** <title>General</title> ! <faq id="whats-foo"> <question> Which database system are supported? --- 5,9 ---- <title>General</title> ! <faq id="supportedvendors"> <question> Which database system are supported? *************** *** 19,23 **** </faq> ! <faq id="whats-bar"> <question> Can I use DbUnit with IDENTITY or auto-increment --- 19,23 ---- </faq> ! <faq id="identity"> <question> Can I use DbUnit with IDENTITY or auto-increment *************** *** 96,100 **** <faq id="p6spy"> <question> ! How to use DbUnit with p6spy </question> <answer> --- 96,100 ---- <faq id="p6spy"> <question> ! How to see SQL statements issued by DbUnit using P6Spy? </question> <answer> *************** *** 125,129 **** </faq> </part> ! <part id="install"> <title>Installation</title> --- 125,129 ---- </faq> </part> ! <!-- <part id="install"> <title>Installation</title> *************** *** 138,140 **** --- 138,141 ---- </faq> </part> + --> </faqs> \ No newline at end of file Index: index.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/index.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.xml 10 Oct 2003 09:53:33 -0000 1.1 --- index.xml 14 Jan 2004 03:44:38 -0000 1.2 *************** *** 29,57 **** <section name="News"> <p> ! <ul> ! <li>2003-10-05 - Version 1.5.6 released. See <a href="changes.html#1.5.6">changes</a>.</li> ! <li>2003-07-16 - Federico Spinazzi joined the DbUnit developement team.</li> ! <li>2003-07-16 - Version 1.5.5 released. See <a href="changes.html#1.5.5">changes</a>.</li> ! <li>2003-04-04 - Version 1.5.1 released. See <a href="changes.html#1.5.1">changes</a>.</li> ! <li>2003-03-01 - Version 1.5 released. See <a href="changes.html#1.5">changes</a>.</li> ! <li>2002-11-07 - Eric Pugh joined the DbUnit developement team.</li> ! <li>2002-07-17 - The java API documentation is now available <a href="api/index.html">online</a>.</li> ! <li>2002-07-17 - Version 1.4 released. See <a href="changes.html#1.4">changes</a>.</li> ! <li>2002-05-10 - Timothy Ruppert and Ben Cox joined the DbUnit developement ! team.</li> ! <li>2002-04-04 - Version 1.3 released. See <a href="changes.html#1.3">changes</a>.</li> ! <li>2002-04-04 - New website design done by <a href="http://www.silphid.com/">Silphid ! Creations</a>.</li> ! <li>2002-03-19 - Version 1.2.4 released. See <a href="changes.html#1.2.4">changes</a>.</li> ! <li>2002-03-19 - Added Daedalos JUnit Extensions link in the <a href="resources.html">Resources</a> ! page.</li> ! <li>2002-03-17 - Added the <a href="support.html#knownissues">Known Issues</a> ! section in support page.</li> ! <li>2002-03-15 - Version 1.2 released. See <a href="changes.html#1.2">changes</a>.</li> ! <li>2002-03-10 - Modified the <a href="bestpractices.html#connections">connections ! management strategies</a> best practices.</li> ! <li>2002-03-10 - Version 1.1 released. See <a href="changes.html#1.1">changes</a>.</li> ! <li>2002-02-27 - Version 1.0 released. This is the first public release.</li> ! </ul> </p> </section> --- 29,96 ---- <section name="News"> <p> ! <table border="1"> ! <tr> ! <td>2003-10-05</td> ! <td>Version 1.5.6 released. See <a href="changes-report.html#1.5.6">changes</a>.</td> ! </tr> ! <tr> ! <td>2003-07-16</td> ! <td>Federico Spinazzi joined the DbUnit developement team.</td> ! </tr> ! <tr> ! <td>2003-07-16</td> ! <td>Version 1.5.5 released. See <a href="changes-report.html#1.5.5">changes</a>.</td> ! </tr> ! <tr> ! <td>2003-04-04</td> ! <td>Version 1.5.1 released. See <a href="changes-report.html#1.5.1">changes</a>.</td> ! </tr> ! <tr> ! <td>2003-03-01</td> ! <td>Version 1.5 released. See <a href="changes-report.html#1.5">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-11-07</td> ! <td>Eric Pugh joined the DbUnit developement team.</td> ! </tr> ! <tr> ! <td>2002-07-17</td> ! <td>The java API documentation is now available <a href="apidocs/index.html">online</a>.</td> ! </tr> ! <tr> ! <td>2002-07-17</td> ! <td>Version 1.4 released. See <a href="changes-report.html#1.4">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-05-10</td> ! <td>Timothy Ruppert and Ben Cox joined the DbUnit developement ! team.</td> ! </tr> ! <tr> ! <td>2002-04-04</td> ! <td>Version 1.3 released. See <a href="changes-report.html#1.3">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-04-04</td> ! <td>New website design and logo done by <a href="http://www.silphid.com/">Silphid ! Creations</a>.</td> ! </tr> ! <tr> ! <td>2002-03-19</td> ! <td>Version 1.2.4 released. See <a href="changes-report.html#1.2.4">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-03-15</td> ! <td>Version 1.2 released. See <a href="changes-report.html#1.2">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-03-10</td> ! <td>Version 1.1 released. See <a href="changes-report.html#1.1">changes</a>.</td> ! </tr> ! <tr> ! <td>2002-02-27</td> ! <td>Version 1.0 released. This is the first public release.</td> ! </tr> ! </table> </p> </section> Index: properties.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/properties.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** properties.xml 13 Aug 2003 09:40:02 -0000 1.1 --- properties.xml 14 Jan 2004 03:44:38 -0000 1.2 *************** *** 1,12 **** <?xml version="1.0" encoding="ISO-8859-1"?> <document><properties><title>The Dbunit Framework - Properties</title></properties><body><section> ! <p>DbUnit does use System properties anymore since version 1.6/2.0. DbUnit ! use a configuration object, <a class="code">DatabaseConfig</a>, to query ! and set feature flags and property values for a <a class="code">IDatabaseConnection</a>. It is possible to change DbUnit behaviors, such as using batched statements ! or not, using the <a class="code">getFeature</a>, <a class="code">setFeature</a>, ! <a class="code">getProperty</a>, and <a class="code">setProperty</a> methods ! of <a class="code">DatabaseConfig</a>: </p> ! <pre> String id = "http://www.dbunit.org/features/batchedStatements"; DatabaseConfig config = connection.getConfig(); if (config.getFeature(id)) --- 1,15 ---- <?xml version="1.0" encoding="ISO-8859-1"?> <document><properties><title>The Dbunit Framework - Properties</title></properties><body><section> ! <h2>DbUnit features and properties</h2> ! <p>DbUnit does not use System properties anymore since version 2.0. DbUnit ! use a configuration object, <code>DatabaseConfig</code>, to query ! and set feature flags and property values for a <code>IDatabaseConnection</code>. It is possible to change DbUnit behaviors, such as using batched statements ! or not, using the <code>getFeature</code>, <code>setFeature</code>, ! <code>getProperty</code>, and <code>setProperty</code> methods ! of <code>DatabaseConfig</code>. </p> ! <p>While feature flags are always boolean, property values are arbitrary objects. </p> ! <p>The Following sample displays the <code>batched statement</code> feature status: ! <source><![CDATA[ String id = "http://www.dbunit.org/features/batchedStatements"; DatabaseConfig config = connection.getConfig(); if (config.getFeature(id)) *************** *** 18,27 **** System.out.println("Batched statements is disabled."); } ! </pre> ! While feature flags are always boolean, property values are arbitrary objects. ! <br></br> ! Here is the complete list of standard DbUnit feature flags and properties. ! <br></br> ! <h2>Feature Flags</h2> <table border="1"> <tr> --- 21,27 ---- System.out.println("Batched statements is disabled."); } ! ]]></source></p> ! <h3>Feature Flags</h3> ! <h4>Batched statements</h4> <table border="1"> <tr> *************** *** 41,45 **** </tr> </table> ! <p> <a name="qualifiedtablenames"></a> <table border="1"> <tr> --- 41,46 ---- </tr> </table> ! <a name="qualifiedtablenames"></a> ! <h4>Qualified table names</h4> <table border="1"> <tr> *************** *** 49,53 **** <tr> <td>Default</td> ! <td>false (since 1.5.5)</td> </tr> <tr> --- 50,54 ---- <tr> <td>Default</td> ! <td>false</td> </tr> <tr> *************** *** 60,65 **** </tr> </table> ! </p><h2>Properties</h2> ! <p> <a name="escapepattern"></a> <table border="1"> <tr> --- 61,66 ---- </tr> </table> ! <h3>Properties</h3> ! <h4><a name="escapepattern">Escape pattern</a></h4> <table border="1"> <tr> *************** *** 84,88 **** </tr> </table> ! </p><p> <table border="1"> <tr> --- 85,89 ---- </tr> </table> ! <h4>DataType factory</h4> <table border="1"> <tr> *************** *** 101,105 **** </tr> </table> ! </p><p> <table border="1"> <tr> --- 102,106 ---- </tr> </table> ! <h4>Statement factory</h4> <table border="1"> <tr> *************** *** 117,121 **** </tr> </table> ! </p> <table border="1"> <tr> --- 118,122 ---- </tr> </table> ! <h4>ResultSetTable factory</h4> <table border="1"> <tr> Index: resources.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/resources.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resources.xml 13 Aug 2003 09:40:02 -0000 1.1 --- resources.xml 14 Jan 2004 03:44:38 -0000 1.2 *************** *** 1,38 **** <?xml version="1.0" encoding="ISO-8859-1"?> <document><properties><title>The Dbunit Framework - Ressources</title></properties><body><section> ! <h2>Project Ressources</h2> <p><a href="http://sourceforge.net/projects/dbunit/">Project summary</a></p> <p><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dbunit/">Browse CVS repository</a></p> <p> ! </p><h2>Other Ressources</h2> ! <p></p> ! <p><a href="http://groups.yahoo.com/group/agileDatabases/">The Agile Database ! Mailing List</a> <font color="#FF0000">(new)</font><br></br> ! Discussion about Database management with regards to Extreme Programming ! practices and principles.</p> ! <p><a href="http://www.agiledata.org/">The Agile Data Home Page</a> <font color="#FF0000">(new)</font><br></br> ! Scott W. Ambler's site about Agile Data methodology. Ambler is sharing ! multiple techniques about data-related software development issues. Online ! material is going to be published in its new book titled "Agile Database ! Techniques".<br></br> ! <br></br> ! <a href="http://www.martinfowler.com/articles/evodb.html">Evolutionary ! Database Design</a> <font color="#FF0000">(new)</font><br></br> ! A Martin Fowler's white paper that describes techniques that allows a ! database design to evolve as an application develops<br></br> ! </p> ! <p><a href="http://webtest.canoo.com/">Canoo Webtest Home</a><br></br> ! Canoo WebTest is a free open source tool for automated testing of web ! applications. </p> ! <p><a href="http://www.junit.org">JUnit, Testing Resources for Extreme Programming</a><br></br> ! The home of the Java JUnit software.<br></br> ! <br></br> ! <a name="RichardDallaway" href="http://www.dallaway.com/acad/dbunit.html">Unit ! testing database code</a><br></br> ! Richard Dallaway notes about database unit testing.</p> ! <p><a href="http://mockobjects.sourceforge.net/papers/jdbc_testfirst.html">Developing ! JDBC applications test-first</a><br></br> ! The Mock Objects approach applied to JDBC development.<br></br> </p> </section></body></document> \ No newline at end of file --- 1,53 ---- <?xml version="1.0" encoding="ISO-8859-1"?> <document><properties><title>The Dbunit Framework - Ressources</title></properties><body><section> ! <h3>SourceForge Project Ressources</h3> <p><a href="http://sourceforge.net/projects/dbunit/">Project summary</a></p> <p><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dbunit/">Browse CVS repository</a></p> <p> ! </p><h3>Other Ressources</h3> ! <p> ! <table border="1"> ! <tr> ! <td><b>Document</b></td> ! <td><b>Description</b></td> ! </tr> ! <tr> ! <td><a href="http://groups.yahoo.com/group/agileDatabases/">The Agile Database ! Mailing List</a></td> ! <td>Discussion about Database management with regards to Extreme Programming ! practices and principles.</td> ! </tr> ! <tr> ! <td><a href="http://www.agiledata.org/">The Agile Data Home Page</a></td> ! <td>Scott W. Ambler's site about Agile Data methodology. Ambler is sharing ! multiple techniques about data-related software development issues.</td> ! </tr> ! <tr> ! <td><a href="http://www.martinfowler.com/articles/evodb.html">Evolutionary ! Database Design</a></td> ! <td>A Martin Fowler's white paper that describes techniques that allows a ! database design to evolve as an application develops</td> ! </tr> ! <tr> ! <td><a href="http://webtest.canoo.com/">Canoo Webtest Home</a></td> ! <td>Canoo WebTest is a free open source tool for automated testing of web ! applications.</td> ! </tr> ! <tr> ! <td><a href="http://www.junit.org">JUnit</a></td> ! <td>The home of the Java JUnit software.</td> ! </tr> ! <tr> ! <td><a name="RichardDallaway" href="http://www.dallaway.com/acad/dbunit.html">Unit ! testing database code</a></td> ! <td>Richard Dallaway notes about database unit testing.</td> ! </tr> ! <tr> ! <td><a href="http://www.mockobjects.com/wiki/DevelopingJdbcApplicationsTestFirst">Developing ! JDBC applications test-first</a></td> ! <td>The Mock Objects approach applied to JDBC development.</td> ! </tr> ! </table> </p> </section></body></document> \ No newline at end of file Index: support.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/support.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** support.xml 13 Aug 2003 09:40:02 -0000 1.1 --- support.xml 14 Jan 2004 03:44:38 -0000 1.2 *************** *** 4,11 **** <h3>Product Support</h3> <p>If you have questions or comments about the software or documentation ! on this site, please post them to the mailling list: ! </p><p><a href="http://lists.sourceforge.net/lists/listinfo/dbunit-user">Mailling ! List</a> </p><h3><a name="knownissues">Known Issues</a></h3> ! <a href="https://sourceforge.net/tracker/?atid=449491&group_id=47439&func=browse">Bug ! database</a></section></body></document> \ No newline at end of file --- 4,11 ---- <h3>Product Support</h3> <p>If you have questions or comments about the software or documentation ! on this site, please post them to one of the mailling lists: ! </p><p><a href="mail-lists.html">Mailling ! Lists</a> </p><h3><a name="knownissues">Known Issues</a></h3> ! <p><a href="https://sourceforge.net/tracker/?atid=449491&group_id=47439&func=browse">Bug ! database</a></p></section></body></document> \ No newline at end of file |
From: <mla...@us...> - 2004-01-14 03:44:41
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv3898 Modified Files: project.xml Log Message: More xdoc reformating Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** project.xml 12 Jan 2004 02:16:05 -0000 1.10 --- project.xml 14 Jan 2004 03:44:38 -0000 1.11 *************** *** 39,43 **** <!-- the project home page --> <url>http://www.dbunit.org</url> ! <issueTrackingUrl>http://sourceforge.net/tracker/?group_id=47439&atid=449491</issueTrackingUrl> <siteAddress>www.dbunit.org</siteAddress> <siteDirectory></siteDirectory> --- 39,43 ---- <!-- the project home page --> <url>http://www.dbunit.org</url> ! <issueTrackingUrl>http://sourceforge.net/tracker/?group_id=47439</issueTrackingUrl> <siteAddress>www.dbunit.org</siteAddress> <siteDirectory></siteDirectory> |
From: <mla...@us...> - 2004-01-14 02:04:02
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv20088/xdocs Modified Files: components.xml download.xml intro.xml Log Message: More xdoc reformating Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** components.xml 13 Aug 2003 09:40:02 -0000 1.1 --- components.xml 14 Jan 2004 02:03:59 -0000 1.2 *************** *** 15,40 **** <p>The <a class="code">IDataSet</a> interface represents is a collection of data from various tables. As explained later, these data is used to ! execute setup operations on a target database. </p> ! <p>The <a class="code">IDataSet</a> implementations provided by the framework ! are: </p> ! <ul> ! <li><a href="#XmlDataSet">XmlDataSet</a></li> ! <li><a href="#FlatXmlDataSet">FlatXmlDataSet</a> <font color="#FF0000">(updated)</font></li> ! <li><a href="#DatabaseDataSet">DatabaseDataSet</a></li> ! <li><a href="#DefaultDataSet">DefaultDataSet</a></li> ! <li><a href="#CompositeDataSet">CompositeDataSet</a></li> ! <li><a href="#FilteredDataSet">FilteredDataSet</a></li> ! <li><a href="#QueryDataSet">QueryDataSet</a> <font color="#FF0000">(new)</font></li> ! </ul> ! The <a class="code">IDataSet</a> interface: ! <pre>public interface IDataSet { /** ! * Returns list of table names this dataset contains. */ public String[] getTableNames() throws DataSetException; /** ! * Returns the specified table metatdata. */ public ITableMetaData getTableMetaData(String tableName) --- 15,31 ---- <p>The <a class="code">IDataSet</a> interface represents is a collection of data from various tables. As explained later, these data is used to ! execute setup operations on a target database. ! <source> ! public interface IDataSet { /** ! * Returns names of tables in this dataset in proper sequence. Multiple ! * occurence of the same name may be returned if multiple tables having ! * the same name are present in the dataset. */ public String[] getTableNames() throws DataSetException; /** ! * Returns the specified table metadata. */ public ITableMetaData getTableMetaData(String tableName) *************** *** 46,112 **** public ITable getTable(String tableName) throws DataSetException; ! /**<br></br> * Returns tables contained by this dataset. Multiple table having the same<br></br> * name but different data may be returned. This method exist since version 1.5.<br></br> */<br></br> public ITable[] getTables() throws DataSetException;<br></br>}</pre> ! <a name="XmlDataSet"> ! <h4>XmlDataSet </h4> ! </a> ! <p>The <a class="code">XmlDataSet</a> class provides the persistence support ! to read from and write to the generic XML dataset format. This format ! is very verbiose and must conform to the following DTD:</p> ! <pre> ! <?xml version="1.0" encoding="UTF-8"?> ! <!ELEMENT dataset (table+)> ! <!ELEMENT table (column*, row*)> ! <!ATTLIST table ! name CDATA #REQUIRED ! > ! <!ELEMENT column (#PCDATA)> ! <!ELEMENT row (value | null | none)*> ! <!ELEMENT value (#PCDATA)> ! <!ELEMENT null EMPTY> ! </pre> ! <a name="originalxmlsample">Example of XML document:</a><br></br> ! <pre> ! <!DOCTYPE dataset SYSTEM "dataset.dtd"> ! <dataset> ! <table name="TEST_TABLE"> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <column>COLUMN2</column> ! <column>COLUMN3</column> ! <row> ! <value>row 0 col 0</value> ! <value>row 0 col 1</value> ! <value>row 0 col 2</value> ! <value>row 0 col 3</value> ! </row> ! <row> ! <value>row 1 col 0</value> ! <null/> ! <null/> ! <value>row 1 col 3</value> ! </row> ! </table> ! <table name="SECOND_TABLE"> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <row> ! <value>row 0 col 0</value> ! <value>row 0 col 1</value> ! </row> ! <row> ! <value>row 1 col 0</value> ! <value>row 1 col 1</value> ! </row> ! </table> ! <table name='EMPTY_TABLE'> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <column>COLUMN2</column> ! <column>COLUMN3</column> ! </table> ! </dataset></pre> <h4><a name="FlatXmlDataSet">FlatXmlDataSet</a></h4> ! <p>The <a class="code">FlatXmlDataSet</a> class has been introduced in version 1.2. I found that generic XML datasets were hard to write and to maintain. This was particularly painful for tables having a lot of columns. </p> --- 37,65 ---- public ITable getTable(String tableName) throws DataSetException; + /** + * Returns an iterator over the tables in this dataset in proper sequence. + */ + public ITableIterator iterator() throws DataSetException; ! /** ! * Returns an iterator over the tables in this dataset in reverse sequence. ! */ ! public ITableIterator reverseIterator() throws DataSetException; ! }</source> ! </p> ! <p>The <a class="code">IDataSet</a> implementations provided by the framework ! are: ! <ul> ! <li><a href="#FlatXmlDataSet">FlatXmlDataSet</a></li> ! <li><a href="#XmlDataSet">XmlDataSet</a></li> ! <li><a href="#DatabaseDataSet">DatabaseDataSet</a></li> ! <li><a href="#DefaultDataSet">DefaultDataSet</a></li> ! <li><a href="#CompositeDataSet">CompositeDataSet</a></li> ! <li><a href="#FilteredDataSet">FilteredDataSet</a></li> ! <li><a href="#QueryDataSet">QueryDataSet</a> <font color="#FF0000">(new)</font></li> ! </ul> ! </p> <h4><a name="FlatXmlDataSet">FlatXmlDataSet</a></h4> ! <p>The FlatXmlDataSet class has been introduced in version 1.2. I found that generic XML datasets were hard to write and to maintain. This was particularly painful for tables having a lot of columns. </p> *************** *** 114,143 **** Each XML element name corresponds to a table name. The XML attributes correspond to table columns. Here is an example dataset containing the ! same data than the <a href="#originalxmlsample">XmlDataSet example</a>:<br></br> </p> ! <pre> ! <!DOCTYPE dataset SYSTEM "my-dataset.dtd"> ! <dataset> ! <TEST_TABLE COLUMN0="row 0 col 0" COLUMN1="row 0 col 1" ! COLUMN2="row 0 col 2" COLUMN3="row 0 col 3"/> ! <TEST_TABLE COLUMN0="row 1 col 0" COLUMN3="row 1 col 3"/> ! <SECOND_TABLE COLUMN0="row 0 col 0" COLUMN1="row 0 col 1" /> ! <SECOND_TABLE COLUMN0="row 1 col 0" COLUMN1="row 1 col 1" /> ! <EMPTY_TABLE/> ! </dataset></pre> ! Learn how to export your database data to this format <a href="howto.html#extract">here</a> and how to generate a DTD representing your database schema <a href="howto.html#generatedtd">here</a>. ! Note that DbUnit does not automatically add a reference to your DTD when you export a dataset. You must edit the output file to manually add the ! DOCTYPE declaration. <h5>Null Values</h5> ! To specify a null value, you simply have to omit its corresponding attribute. In the above example, COLUMN1 and COLUMN2 are nulls for the second row of ! TEST_TABLE. <h5>Table metadata</h5> ! DbUnit use the DTD referenced by the document type declaration as metadata. ! DbUnit only support external system URI. The URI can be absolute or relative. <p> Example of system document type declaration: ! <pre><!DOCTYPE dataset SYSTEM "my-dataset.dtd"></pre> </p><p>If the xml document does not contain a document type declaration, the metadata is generated from the first row of each table. This is highly --- 67,96 ---- Each XML element name corresponds to a table name. The XML attributes correspond to table columns. Here is an example dataset containing the ! same data than the XmlDataSet <a href="#originalxmlsample">example</a>: ! <source><![CDATA[ ! <!DOCTYPE dataset SYSTEM "my-dataset.dtd"> ! <dataset> ! <TEST_TABLE COLUMN0="row 0 col 0" COLUMN1="row 0 col 1" ! COLUMN2="row 0 col 2" COLUMN3="row 0 col 3"/> ! <TEST_TABLE COLUMN0="row 1 col 0" COLUMN3="row 1 col 3"/> ! <SECOND_TABLE COLUMN0="row 0 col 0" COLUMN1="row 0 col 1" /> ! <SECOND_TABLE COLUMN0="row 1 col 0" COLUMN1="row 1 col 1" /> ! <EMPTY_TABLE/> ! </dataset>]]></source> </p> ! <p>Learn how to export your database data to this format <a href="howto.html#extract">here</a> and how to generate a DTD representing your database schema <a href="howto.html#generatedtd">here</a>. ! <b>Note that DbUnit does not automatically add a reference to your DTD when you export a dataset. You must edit the output file to manually add the ! DOCTYPE declaration.</b></p> <h5>Null Values</h5> ! <p>To specify a null value, you simply have to omit its corresponding attribute. In the above example, COLUMN1 and COLUMN2 are nulls for the second row of ! TEST_TABLE. </p> <h5>Table metadata</h5> ! <p>DbUnit use the DTD referenced by the document type declaration as metadata. ! DbUnit only support external system URI. The URI can be absolute or relative.</p> <p> Example of system document type declaration: ! <source><![CDATA[<!DOCTYPE dataset SYSTEM "my-dataset.dtd">]]></source> </p><p>If the xml document does not contain a document type declaration, the metadata is generated from the first row of each table. This is highly *************** *** 145,170 **** will think your table is missing some columns if the first row has one or more null values. ! </p><h4><a name="DatabaseDataSet">DatabaseDataSet</a></h4> ! The <a class="code">DatabaseDataSet</a> is an adapter class that allows access to a database contents as a dataset. This class is not usually instantiated ! directly but from the factory method <a class="code">IDatabaseConnection.createDataSet()</a>.<br></br> <h4><a name="DefaultDataSet">DefaultDataSet</a></h4> ! The <a class="code">DefaultDataSet</a> class can be used to create datasets ! programmatically. <br></br> <h4><a name="CompositeDataSet">CompositeDataSet</a></h4> ! The <a class="code">CompositeDataSet</a> class combines multiple datasets ! into a single one at runtime.<br></br> <h4><a name="FilteredDataSet">FilteredDataSet</a></h4> ! The <a class="code">FileteredDataSet</a> class is is a decorator which exposes ! only some tables from the decorated dataset. <br></br> <h4><a name="QueryDataSet">QueryDataSet</a></h4> ! The <a class="code">QueryDataSet</a> allows to easily manipulates multiple <a href="./api/org/dbunit/database/IDatabaseConnection.html#createQueryTable(java.lang.String,%20java.lang.String)">query ! tables</a>.<br></br> ! <hr></hr> <h3><a name="databaseconnection">IDatabaseConnection</a></h3> ! <p>As its name implies, the <a class="code">IDatabaseConnection</a> represent ! a connection to a database. </p> ! <p>The DbUnit framework provides two implementations: </p> <ul> <li><a class="code">DatabaseConnection</a>, which is a JDBC Connection --- 98,183 ---- will think your table is missing some columns if the first row has one or more null values. ! </p> ! <a name="XmlDataSet"> ! <h4>XmlDataSet </h4> ! </a> ! <p>The XmlDataSet class provides the persistence support ! to read from and write to the generic XML dataset format. This format ! is very verbiose and must conform to the following DTD: ! <source><![CDATA[ ! <?xml version="1.0" encoding="UTF-8"?> ! <!ELEMENT dataset (table+)> ! <!ELEMENT table (column*, row*)> ! <!ATTLIST table ! name CDATA #REQUIRED ! > ! <!ELEMENT column (#PCDATA)> ! <!ELEMENT row (value | null | none)*> ! <!ELEMENT value (#PCDATA)> ! <!ELEMENT null EMPTY> ! ]]></source></p> ! <p><a name="originalxmlsample">Example of XML document:</a><br></br> ! <source><![CDATA[ ! <!DOCTYPE dataset SYSTEM "dataset.dtd"> ! <dataset> ! <table name="TEST_TABLE"> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <column>COLUMN2</column> ! <column>COLUMN3</column> ! <row> ! <value>row 0 col 0</value> ! <value>row 0 col 1</value> ! <value>row 0 col 2</value> ! <value>row 0 col 3</value> ! </row> ! <row> ! <value>row 1 col 0</value> ! <null/> ! <null/> ! <value>row 1 col 3</value> ! </row> ! </table> ! <table name="SECOND_TABLE"> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <row> ! <value>row 0 col 0</value> ! <value>row 0 col 1</value> ! </row> ! <row> ! <value>row 1 col 0</value> ! <value>row 1 col 1</value> ! </row> ! </table> ! <table name='EMPTY_TABLE'> ! <column>COLUMN0</column> ! <column>COLUMN1</column> ! <column>COLUMN2</column> ! <column>COLUMN3</column> ! </table> ! </dataset>]]></source></p> ! <h4><a name="DatabaseDataSet">DatabaseDataSet</a></h4> ! <p>The DatabaseDataSet is an adapter class that allows access to a database contents as a dataset. This class is not usually instantiated ! directly but from the factory method <code>IDatabaseConnection.createDataSet()</code>.</p> <h4><a name="DefaultDataSet">DefaultDataSet</a></h4> ! <p>The DefaultDataSet class can be used to create datasets ! programmatically.</p> <h4><a name="CompositeDataSet">CompositeDataSet</a></h4> ! <p>The CompositeDataSet class combines multiple datasets ! into a single one at runtime.</p> <h4><a name="FilteredDataSet">FilteredDataSet</a></h4> ! <p>The FileteredDataSet class is is a decorator which exposes ! only some tables from the decorated dataset.</p> <h4><a name="QueryDataSet">QueryDataSet</a></h4> ! <p>The QueryDataSet allows to easily manipulates multiple <a href="./api/org/dbunit/database/IDatabaseConnection.html#createQueryTable(java.lang.String,%20java.lang.String)">query ! tables</a>.</p> <h3><a name="databaseconnection">IDatabaseConnection</a></h3> ! <p>As its name implies, the IDatabaseConnection represent ! a connection to a database. ! </p> ! <p>The DbUnit framework provides two implementations: <ul> <li><a class="code">DatabaseConnection</a>, which is a JDBC Connection *************** *** 174,201 **** </li> </ul> ! <hr></hr> <h3><a name="databaseoperation">DatabaseOperation</a></h3> <p>The <a class="code">DatabaseOperation</a> abstract class defines operations ! performed on a target database before and after each test. Again, the ! framework provides several implementations. <br></br> ! </p> ! <ul> ! <li><a href="#update">UPDATE</a></li> ! <li><a href="#insert">INSERT</a></li> ! <li><a href="#delete">DELETE</a></li> ! <li><a href="#deleteall">DELETE_ALL</a></li> ! <li><a href="#refresh">REFRESH</a></li> ! <li><a href="#cleaninsert">CLEAN_INSERT</a></li> ! <li><a href="#none">NONE</a></li> ! <li><a href="#CompositeOperation">CompositeOperation</a></li> ! <li><a href="#TransactionOperation">TransactionOperation</a></li> ! <li><a href="#IdentityInsertOperation">IdentityInsertOperation</a> </li> ! </ul> ! <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and ! <a href="#cleanInsert">CLEAN_INSERT</a>. As you will shortly see, they ! are the ones you will deal with most of the time. They represent two opposite ! testing strategies with different benefits and tradeoffs. </p> ! <p>The <a class="code">DatabaseOperation</a> class declaration: </p> ! <pre> public abstract class DatabaseOperation { --- 187,195 ---- </li> </ul> ! </p> <h3><a name="databaseoperation">DatabaseOperation</a></h3> <p>The <a class="code">DatabaseOperation</a> abstract class defines operations ! performed on a target database before and after each test. ! <source><![CDATA[ public abstract class DatabaseOperation { *************** *** 211,218 **** ! /**<br></br> * Executes this operation on the specified database using the specified<br></br> * dataset contents.<br></br> *<br></br> * @param connection the database connection.<br></br> * @param dataSet the dataset to be used by this operation.<br></br> */<br></br> public abstract void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException; - private static class DummyAction extends DatabaseOperation { --- 205,218 ---- ! /** ! * Executes this operation on the specified database using the specified ! * dataset contents. ! * ! * @param connection the database connection. ! * @param dataSet the dataset to be used by this operation. ! */ ! public abstract void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException; private static class DummyAction extends DatabaseOperation { *************** *** 222,271 **** } } ! }</pre> <h4><a name="update">DatabaseOperation</a>.UPDATE</h4> ! This operation updates the database from the dataset contents. This operation assumes that table data already exists in the target database and fails ! if this is not the case.<br></br> ! <br></br> <h4><a name="insert">DatabaseOperation.INSERT</a></h4> ! This operation inserts the dataset contents into the database. This operation assumes that table data does not exist in the target database and fails if this is not the case. To prevent problems with foreign keys, tables must ! be sequenced appropriately in the dataset. <br></br> <h4><a name="delete">DatabaseOperation.DELETE</a></h4> ! This operation deletes only the dataset contents from the database. This operation does not delete the entire table contents but only data that are ! present in the dataset. <br></br> <h4><a name="deleteall">DatabaseOperation.DELETE_ALL</a></h4> ! This operation deletes entire target database table contents for each table contained in dataset. In other words, if a dataset does not contain a particular table, but that table exists in the database, the contents of that table ! is not deleted. Deletes are performed on table in reverse sequence.<br></br> <h4><a name="refresh">DatabaseOperation.REFRESH</a></h4> ! This operation literally refreshes dataset contents into the target database. This means that data of existing rows are updated and non-existing row get inserted. Any rows which exist in the database but not in dataset stay unaffected. This approach is more appropriate for tests that assume other data may exist ! in the database. <br></br> ! <br></br> ! As you understand, this is a very powerful operation. This strategy can help you deal more easily with foreign key constraints, as you don't necessarily ! need to insert data in a specific sequence. <br></br> ! <br></br> ! If they are correctly written, tests using this strategy can even be performed ! on a populated database like a copy of a production database. <br></br> <h4><a name="cleaninsert">DatabaseOperation.CLEAN_INSERT</a></h4> ! This composite operation performs a DELETE_ALL operation followed by an INSERT operation. This is the safest approach to ensure that the database is in a known state. This is appropriate for tests that require the database ! to only contain a specific set of data.<br></br> <h4><a name="none">DatabaseOperation.NONE</a></h4> ! This operation does absolutely nothing with the target database.<br></br> <h4><a name="CompositeOperation">CompositeOperation</a></h4> ! This operation combines multiple operations into a single one.<br></br> <h4><a name="TransactionOperation">TransactionOperation</a></h4> <p>This operation decorates an operation and executes it within the context of a transaction.</p> ! <h4><a name="IdentityInsertOperation">IdentityInsertOperation<a></a></a></h4> <p>This operation decorates an insert operation and disables the MS SQL Server automatic identifier generation (IDENTITY) during its execution. --- 222,288 ---- } } ! }]]></source> ! </p> ! <p>Again, the framework provides several implementations. ! <ul> ! <li><a href="#update">UPDATE</a></li> ! <li><a href="#insert">INSERT</a></li> ! <li><a href="#delete">DELETE</a></li> ! <li><a href="#deleteall">DELETE_ALL</a></li> ! <li><a href="#refresh">REFRESH</a></li> ! <li><a href="#cleaninsert">CLEAN_INSERT</a></li> ! <li><a href="#none">NONE</a></li> ! <li><a href="#CompositeOperation">CompositeOperation</a></li> ! <li><a href="#TransactionOperation">TransactionOperation</a></li> ! <li><a href="#IdentityInsertOperation">IdentityInsertOperation</a> </li> ! </ul> ! </p> ! <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and ! <a href="#cleanInsert">CLEAN_INSERT</a>. They ! are the ones you will deal usualy with. They represent two opposite ! testing strategies with different benefits and tradeoffs. </p> ! <p>The <a class="code">DatabaseOperation</a> class declaration: </p> <h4><a name="update">DatabaseOperation</a>.UPDATE</h4> ! <p>This operation updates the database from the dataset contents. This operation assumes that table data already exists in the target database and fails ! if this is not the case.</p> <h4><a name="insert">DatabaseOperation.INSERT</a></h4> ! <p>This operation inserts the dataset contents into the database. This operation assumes that table data does not exist in the target database and fails if this is not the case. To prevent problems with foreign keys, tables must ! be sequenced appropriately in the dataset.</p> <h4><a name="delete">DatabaseOperation.DELETE</a></h4> ! <p>This operation deletes only the dataset contents from the database. This operation does not delete the entire table contents but only data that are ! present in the dataset.</p> <h4><a name="deleteall">DatabaseOperation.DELETE_ALL</a></h4> ! <p>This operation deletes entire target database table contents for each table contained in dataset. In other words, if a dataset does not contain a particular table, but that table exists in the database, the contents of that table ! is not deleted. Deletes are performed on table in reverse sequence.</p> <h4><a name="refresh">DatabaseOperation.REFRESH</a></h4> ! <p>This operation literally refreshes dataset contents into the target database. This means that data of existing rows are updated and non-existing row get inserted. Any rows which exist in the database but not in dataset stay unaffected. This approach is more appropriate for tests that assume other data may exist ! in the database.</p> ! <p>As you understand, this is a very powerful operation. This strategy can help you deal more easily with foreign key constraints, as you don't necessarily ! need to insert data in a specific sequence.</p> ! <p>If they are correctly written, tests using this strategy can even be performed ! on a populated database like a copy of a production database.</p> <h4><a name="cleaninsert">DatabaseOperation.CLEAN_INSERT</a></h4> ! <p>This composite operation performs a DELETE_ALL operation followed by an INSERT operation. This is the safest approach to ensure that the database is in a known state. This is appropriate for tests that require the database ! to only contain a specific set of data.</p> <h4><a name="none">DatabaseOperation.NONE</a></h4> ! <p>This operation does absolutely nothing with the target database.</p> <h4><a name="CompositeOperation">CompositeOperation</a></h4> ! <p>This operation combines multiple operations into a single one.</p> <h4><a name="TransactionOperation">TransactionOperation</a></h4> <p>This operation decorates an operation and executes it within the context of a transaction.</p> ! <h4><a name="IdentityInsertOperation">IdentityInsertOperation</a></h4> <p>This operation decorates an insert operation and disables the MS SQL Server automatic identifier generation (IDENTITY) during its execution. Index: download.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/download.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** download.xml 13 Aug 2003 09:40:02 -0000 1.1 --- download.xml 14 Jan 2004 02:03:59 -0000 1.2 *************** *** 2,9 **** <document><properties><title>The Dbunit Framework - Download</title></properties><body><section> <h2>Download</h2> ! <p>The current Dbunit release is version 1.5.1. The distribution archive contains the compiled classes, the java code and the java API documentation.</p> ! <p><a href="http://sourceforge.net/project/showfiles.php?group_id=47439&release_id=150554">Download ! version 1.5.1</a></p> <p>If your are not reading this page online, please visit the <a href="http://www.dbunit.org/">online version</a> of this site since a more recent version of Dbunit might be --- 2,9 ---- <document><properties><title>The Dbunit Framework - Download</title></properties><body><section> <h2>Download</h2> ! <p>The current Dbunit release is version 1.5.6. The distribution archive contains the compiled classes, the java code and the java API documentation.</p> ! <p><a href="http://sourceforge.net/project/showfiles.php?group_id=47439&release_id=189117">Download ! version 1.5.6</a></p> <p>If your are not reading this page online, please visit the <a href="http://www.dbunit.org/">online version</a> of this site since a more recent version of Dbunit might be Index: intro.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/intro.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** intro.xml 12 Jan 2004 02:14:35 -0000 1.2 --- intro.xml 14 Jan 2004 02:03:59 -0000 1.3 *************** *** 41,49 **** make other people's code less scary when you need to change it, they reduce debugging time). ! </p><p>[...] ! </p><p>[B]ut how do we manage the testing data in the database so that it doesn't "mess up" live data? - </p><p> - </p><p> </p><h3>You need four databases</h3> <p>Some thoughts: A good test set is self-sufficient and creates all the --- 41,48 ---- make other people's code less scary when you need to change it, they reduce debugging time). ! </p> ! <p> [...]</p> ! <p>[B]ut how do we manage the testing data in the database so that it doesn't "mess up" live data? </p><h3>You need four databases</h3> <p>Some thoughts: A good test set is self-sufficient and creates all the *************** *** 51,63 **** a known state before a test is run. One ways to do this is to have a separate unit test database, which is under the control of the test cases: the ! test cases clean out the database before starting any tests.<br></br> ! [...] ! Deleting and inserting data for every test may seem like a big time over head, but as tests use relatively little data, I find this approach to ! be quick enough (especially if you're running against a local test database).<br></br> ! [...] ! The downside is that you need more than one database - but remember, they can all run on one server if necessary. The way I'm testing now needs ! four databases (well, two at a pinch): <br></br> <ol> <li>The <strong>production database</strong>. Live data. No testing on --- 50,64 ---- a known state before a test is run. One ways to do this is to have a separate unit test database, which is under the control of the test cases: the ! test cases clean out the database before starting any tests. ! </p> ! <p> [...]</p> ! <p>Deleting and inserting data for every test may seem like a big time over head, but as tests use relatively little data, I find this approach to ! be quick enough (especially if you're running against a local test database). ! </p> ! <p> [...]</p> ! <p> The downside is that you need more than one database - but remember, they can all run on one server if necessary. The way I'm testing now needs ! four databases (well, two at a pinch): <ol> <li>The <strong>production database</strong>. Live data. No testing on *************** *** 78,82 **** before you go live with your code. </li> </ol> ! With multiple database you have to make sure you keep the structure of the databases in sync: if you change a table definition or a stored procedure on your test machine, you'll have to remember to make those changes on the --- 79,84 ---- before you go live with your code. </li> </ol> ! </p> ! <p>With multiple database you have to make sure you keep the structure of the databases in sync: if you change a table definition or a stored procedure on your test machine, you'll have to remember to make those changes on the |
From: <mla...@us...> - 2004-01-12 18:32:49
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml In directory sc8-pr-cvs1:/tmp/cvs-serv9977a/src/test/org/dbunit/dataset/xml Modified Files: FlatXmlWriterTest.java Log Message: Fixed class header Index: FlatXmlWriterTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml/FlatXmlWriterTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FlatXmlWriterTest.java 8 Sep 2003 21:05:23 -0000 1.1 --- FlatXmlWriterTest.java 12 Jan 2004 18:32:46 -0000 1.2 *************** *** 1,2 **** --- 1,23 ---- + /* + * + * DbUnit Database Testing Framework + * Copyright (C)2002, Manuel Laflamme + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + package org.dbunit.dataset.xml; *************** *** 17,22 **** /** * ! * <p> Copyright (c) 2002 OZ.COM. All Rights Reserved. </p> ! * @author manuel.laflamme$ * @since Sep 8, 2003$ */ --- 38,43 ---- /** * ! * @author Manuel Laflamme ! * @version $Revision$ * @since Sep 8, 2003$ */ |
From: <mla...@us...> - 2004-01-12 18:18:22
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv6822/src/test/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactoryTest.java Log Message: Added OracleClobDataType Index: OracleDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleDataTypeFactoryTest.java 3 Sep 2003 19:55:55 -0000 1.2 --- OracleDataTypeFactoryTest.java 12 Jan 2004 18:18:19 -0000 1.3 *************** *** 59,63 **** String sqlTypeName = "CLOB"; ! DataType expected = DataType.CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); --- 59,63 ---- String sqlTypeName = "CLOB"; ! DataType expected = OracleDataTypeFactory.ORACLE_CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); *************** *** 69,73 **** String sqlTypeName = "NCLOB"; ! DataType expected = DataType.CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); --- 69,73 ---- String sqlTypeName = "NCLOB"; ! DataType expected = OracleDataTypeFactory.ORACLE_CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); |
From: <mla...@us...> - 2004-01-12 18:18:22
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv6822/src/test/org/dbunit/dataset/datatype Modified Files: BytesDataTypeTest.java StringDataTypeTest.java Log Message: Added OracleClobDataType Index: BytesDataTypeTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/BytesDataTypeTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BytesDataTypeTest.java 13 Aug 2003 01:53:58 -0000 1.7 --- BytesDataTypeTest.java 12 Jan 2004 18:18:19 -0000 1.8 *************** *** 38,42 **** DataType.VARBINARY, DataType.LONGVARBINARY, ! DataType.BLOB, }; --- 38,42 ---- DataType.VARBINARY, DataType.LONGVARBINARY, ! // DataType.BLOB, }; *************** *** 48,52 **** public void testToString() throws Exception { ! String[] expected = {"BINARY", "VARBINARY", "LONGVARBINARY", "BLOB"}; assertEquals("type count", expected.length, TYPES.length); --- 48,57 ---- public void testToString() throws Exception { ! String[] expected = { ! "BINARY", ! "VARBINARY", ! "LONGVARBINARY", ! // "BLOB", ! }; assertEquals("type count", expected.length, TYPES.length); *************** *** 217,221 **** public void testSqlType() throws Exception { ! int[] sqlTypes = {Types.BINARY, Types.VARBINARY, Types.LONGVARBINARY, Types.BLOB}; assertEquals("count", sqlTypes.length, TYPES.length); --- 222,231 ---- public void testSqlType() throws Exception { ! int[] sqlTypes = { ! Types.BINARY, ! Types.VARBINARY, ! Types.LONGVARBINARY, ! // Types.BLOB, ! }; assertEquals("count", sqlTypes.length, TYPES.length); Index: StringDataTypeTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/StringDataTypeTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StringDataTypeTest.java 13 Aug 2003 01:53:58 -0000 1.10 --- StringDataTypeTest.java 12 Jan 2004 18:18:19 -0000 1.11 *************** *** 37,41 **** DataType.VARCHAR, DataType.LONGVARCHAR, ! DataType.CLOB, }; --- 37,41 ---- DataType.VARCHAR, DataType.LONGVARCHAR, ! // DataType.CLOB, }; *************** *** 47,51 **** public void testToString() throws Exception { ! String[] expected = {"CHAR", "VARCHAR", "LONGVARCHAR", "CLOB"}; assertEquals("type count", expected.length, TYPES.length); --- 47,56 ---- public void testToString() throws Exception { ! String[] expected = { ! "CHAR", ! "VARCHAR", ! "LONGVARCHAR", ! // "CLOB", ! }; assertEquals("type count", expected.length, TYPES.length); *************** *** 238,242 **** public void testSqlType() throws Exception { ! int[] sqlTypes = {Types.CHAR, Types.VARCHAR, Types.LONGVARCHAR, Types.CLOB}; assertEquals("count", sqlTypes.length, TYPES.length); --- 243,252 ---- public void testSqlType() throws Exception { ! int[] sqlTypes = { ! Types.CHAR, ! Types.VARCHAR, ! Types.LONGVARCHAR, ! // Types.CLOB, ! }; assertEquals("count", sqlTypes.length, TYPES.length); |
From: <mla...@us...> - 2004-01-12 18:18:22
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv6822/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Added Files: OracleClobDataType.java Log Message: Added OracleClobDataType --- NEW FILE: OracleClobDataType.java --- package org.dbunit.ext.oracle; import org.dbunit.dataset.datatype.ClobDataType; import org.dbunit.dataset.datatype.TypeCastException; import java.io.IOException; import java.io.Writer; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /* * * DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; /** * @author Manuel Laflamme * @version $Revision: 1.1 $ * @since Jan 12, 2004 */ public class OracleClobDataType extends ClobDataType { private static final Integer DURATION_SESSION = new Integer(1); // private static final Integer DURATION_CALL = new Integer(2); // private static final Integer MODE_READONLY = new Integer(0); private static final Integer MODE_READWRITE = new Integer(1); public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { return typeCast(resultSet.getClob(column)); } public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { statement.setObject(column, getClob(value, statement.getConnection())); } private Object getClob(Object value, Connection connection) throws TypeCastException { Object tempClob = null; try { Class aClobClass = Class.forName("oracle.sql.CLOB"); // Create new temporary CLOB Method createTemporaryMethod = aClobClass.getMethod("createTemporary", new Class[]{Connection.class, Boolean.TYPE, Integer.TYPE}); tempClob = createTemporaryMethod.invoke(null, new Object[]{connection, Boolean.TRUE, DURATION_SESSION}); // Open the temporary CLOB in readwrite mode to enable writing Method openMethod = aClobClass.getMethod("open", new Class[]{Integer.TYPE}); openMethod.invoke(tempClob, new Object[]{MODE_READWRITE}); // Get the output stream to write Method getCharacterOutputStreamMethod = tempClob.getClass().getMethod( "getCharacterOutputStream", new Class[0]); Writer tempClobWriter = (Writer)getCharacterOutputStreamMethod.invoke( tempClob, new Object[0]); // Write the data into the temporary CLOB tempClobWriter.write((String)typeCast(value)); // Flush and close the stream tempClobWriter.flush(); tempClobWriter.close(); // Close the temporary CLOB Method closeMethod = tempClob.getClass().getMethod( "close", new Class[0]); closeMethod.invoke(tempClob, new Object[0]); } catch (IllegalAccessException e) { freeTemporaryClob(tempClob); throw new TypeCastException(e); } catch (NoSuchMethodException e) { freeTemporaryClob(tempClob); throw new TypeCastException(e); } catch (IOException e) { freeTemporaryClob(tempClob); throw new TypeCastException(e); } catch (InvocationTargetException e) { freeTemporaryClob(tempClob); throw new TypeCastException(e.getTargetException()); } catch (ClassNotFoundException e) { freeTemporaryClob(tempClob); throw new TypeCastException(e); } return tempClob; } private void freeTemporaryClob(Object tempClob) throws TypeCastException { if (tempClob == null) { return; } try { Method freeTemporaryMethod = tempClob.getClass().getMethod("freeTemporary", new Class[0]); freeTemporaryMethod.invoke(tempClob, new Object[0]); } catch (NoSuchMethodException e) { throw new TypeCastException(e); } catch (IllegalAccessException e) { throw new TypeCastException(e); } catch (InvocationTargetException e) { throw new TypeCastException(e); } } } Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OracleDataTypeFactory.java 9 Jan 2004 22:03:51 -0000 1.6 --- OracleDataTypeFactory.java 12 Jan 2004 18:18:19 -0000 1.7 *************** *** 34,40 **** * @version $Revision$ */ ! public class ! OracleDataTypeFactory extends DefaultDataTypeFactory { public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { --- 34,41 ---- * @version $Revision$ */ ! public class OracleDataTypeFactory extends DefaultDataTypeFactory { + public static final DataType ORACLE_CLOB = new OracleClobDataType(); + public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { *************** *** 50,54 **** if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) { ! return DataType.CLOB; } --- 51,55 ---- if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) { ! return ORACLE_CLOB; } |
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv6822/src/java/org/dbunit/dataset/datatype Modified Files: BytesDataType.java DataType.java StringDataType.java Added Files: BlobDataType.java ClobDataType.java Log Message: Added OracleClobDataType --- NEW FILE: BlobDataType.java --- /* * * DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.dataset.datatype; import java.sql.Types; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.PreparedStatement; /** * @author Manuel Laflamme * @version $Revision: 1.1 $ * @since Jan 12, 2004 */ public class BlobDataType extends BytesDataType { public BlobDataType() { super("BLOB", Types.BLOB); } public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { return typeCast(resultSet.getBlob(column)); } public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { statement.setObject(column, typeCast(value), DataType.LONGVARBINARY.getSqlType()); } } --- NEW FILE: ClobDataType.java --- /* * * DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.dataset.datatype; import java.sql.Types; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.PreparedStatement; /** * @author Manuel Laflamme * @version $Revision: 1.1 $ * @since Jan 12, 2004 */ public class ClobDataType extends StringDataType { public ClobDataType() { super("CLOB", Types.CLOB); } public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { return typeCast(resultSet.getClob(column)); } public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { statement.setObject(column, typeCast(value), DataType.LONGVARCHAR.getSqlType()); } } Index: BytesDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/BytesDataType.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BytesDataType.java 9 Oct 2003 18:42:53 -0000 1.11 --- BytesDataType.java 12 Jan 2004 18:18:18 -0000 1.12 *************** *** 149,158 **** throws SQLException, TypeCastException { - // Special BLOB handling - if (this == DataType.BLOB) - { - return typeCast(resultSet.getBlob(column)); - } - return resultSet.getBytes(column); } --- 149,152 ---- *************** *** 161,172 **** throws SQLException, TypeCastException { - // Special BLOB handling - if (this == DataType.BLOB) - { - statement.setObject(column, typeCast(value), - DataType.LONGVARBINARY.getSqlType()); - return; - } - super.setSqlValue(value, column, statement); } --- 155,158 ---- Index: DataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/DataType.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** DataType.java 1 Aug 2003 02:29:11 -0000 1.21 --- DataType.java 12 Jan 2004 18:18:18 -0000 1.22 *************** *** 42,47 **** public static final DataType LONGVARCHAR = new StringDataType( "LONGVARCHAR", Types.LONGVARCHAR); ! public static final DataType CLOB = new StringDataType( ! "CLOB", Types.CLOB); public static final DataType NUMERIC = new NumberDataType( --- 42,46 ---- public static final DataType LONGVARCHAR = new StringDataType( "LONGVARCHAR", Types.LONGVARCHAR); ! public static final DataType CLOB = new ClobDataType(); public static final DataType NUMERIC = new NumberDataType( *************** *** 78,83 **** public static final DataType LONGVARBINARY = new BytesDataType( "LONGVARBINARY", Types.LONGVARBINARY); ! public static final DataType BLOB = new BytesDataType( ! "BLOB", Types.BLOB); private static final DataType[] TYPES = { --- 77,81 ---- public static final DataType LONGVARBINARY = new BytesDataType( "LONGVARBINARY", Types.LONGVARBINARY); ! public static final DataType BLOB = new BlobDataType(); private static final DataType[] TYPES = { Index: StringDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/StringDataType.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** StringDataType.java 3 Sep 2003 19:55:54 -0000 1.18 --- StringDataType.java 12 Jan 2004 18:18:18 -0000 1.19 *************** *** 119,128 **** throws SQLException, TypeCastException { - // Special CLOB handling - if (this == DataType.CLOB) - { - return typeCast(resultSet.getClob(column)); - } - return resultSet.getString(column); } --- 119,122 ---- *************** *** 131,142 **** throws SQLException, TypeCastException { - // Special CLOB handling - if (this == DataType.CLOB) - { - statement.setObject(column, typeCast(value), - DataType.LONGVARCHAR.getSqlType()); - return; - } - statement.setString(column, asString(value)); } --- 125,128 ---- |
From: <mla...@us...> - 2004-01-12 02:16:08
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv453 Modified Files: project.xml Log Message: Added JDBC dependency Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.xml 4 Nov 2003 08:07:57 -0000 1.9 --- project.xml 12 Jan 2004 02:16:05 -0000 1.10 *************** *** 13,17 **** <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-dev --> ! <currentVersion>1.6-dev</currentVersion> <!-- details about the organization that 'owns' the project --> --- 13,17 ---- <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-dev --> ! <currentVersion>2.0-rc1</currentVersion> <!-- details about the organization that 'owns' the project --> *************** *** 111,114 **** --- 111,119 ---- </dependency> <dependency> + <id>jdbc</id> + <version>2.0</version> + <url>http://java.sun.com/products/jdbc/download.html#spec</url> + </dependency> + <dependency> <id>hsqldb</id> <version>1.7.1</version> *************** *** 132,139 **** --- 137,146 ---- <version>0.07</version> </dependency> + <!-- <dependency> <id>mm-mysql</id> <version>2.0.13-bin</version> </dependency> + --> </dependencies> |
From: <mla...@us...> - 2004-01-12 02:14:39
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv32616/xdocs Modified Files: anttask.xml bestpractices.xml intro.xml Log Message: Some xdoc reformating Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** anttask.xml 13 Aug 2003 09:40:02 -0000 1.1 --- anttask.xml 12 Jan 2004 02:14:35 -0000 1.2 *************** *** 4,14 **** <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 --- 4,12 ---- <h3>Installation</h3> The steps required to add the DbUnit task to your system are: ! <p>1. Add the DbUnit jar to Ant's classpath. </p> ! <p>2. Add a <taskdef> element to your build script as follows: ! <source><![CDATA[<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask"/>]]></source> ! </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 *************** *** 53,66 **** <tr> <td>useQualifiedTableNames</td> ! <td>Set System.property dbunit.qualified.table.names <br></br> ! equal to supplied boolean value</td> <td>No</td> </tr> <tr> <td>supportBatchStatement</td> ! <td>Set System.property<br></br> ! dbunit.support.batch.statement<br></br> ! equal to supplied boolean value</td> ! <td> No</td> </tr> </table> --- 51,61 ---- <tr> <td>useQualifiedTableNames</td> ! <td>Uses qualified table names. Defaults to false</td> <td>No</td> </tr> <tr> <td>supportBatchStatement</td> ! <td>JDBC driver supports batch statement. Defaults to false</td> ! <td>No</td> </tr> </table> *************** *** 89,96 **** <tr> <td>type</td> ! <td>Type of Database operation to perform. Supported types are<br></br> ! UPDATE, INSERT, DELETE, <br></br> ! DELETE_ALL, REFRESH, <br></br> ! CLEAN_INSERT, MSSQL_INSERT,<br></br> MSSQL_REFRESH, MSSQL_CLEAN_INSERT.</td> <td>Yes</td> --- 84,91 ---- <tr> <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> *************** *** 104,108 **** <td>format</td> <td>Format type of supplied source file. Possible values are "flat" ! or "xml". Defaults to <a class="code">"flat"</a></td> <td> <p>No</p> --- 99,103 ---- <td>format</td> <td>Format type of supplied source file. Possible values are "flat" ! or "xml". Defaults to <b>"flat"</b></td> <td> <p>No</p> *************** *** 116,125 **** <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 or queries to<br></br> ! <a class="code"><export></a> by nesting them under the <export> step.</p> <table width="100%" border="1"> --- 111,120 ---- <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 width="100%" border="1"> *************** *** 138,142 **** <td>Format type of supplied destination file. Possible values are "flat", "xml" or "dtd". Defaults ! to <a class="code">"flat"</a></td> <td> <p>No</p> --- 133,137 ---- <td>Format type of supplied destination file. Possible values are "flat", "xml" or "dtd". Defaults ! to <b>"flat"</b></td> <td> <p>No</p> *************** *** 149,153 **** <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"> --- 144,148 ---- <td>table</td> <td> ! <p>Use nested <table> elements to <export> specific tables. </p> <table border="1"> *************** *** 195,238 **** </table> <h3>Examples</h3> ! <pre> <dbunit driver="org.hsqldb.jdbcDriver"<br></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""> ! <classpath><br></br> <pathelement location="/some/jdbc.jar"/><br></br> </classpath><br></br> <operation type="UPDATE" src="updateFile.xml"/><br></br> </dbunit></pre> ! <p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver, ! searching it from /some/jdbc.jar as well from the system classpath, and ! executes the UPDATE operation contained within the FlatXmlDataSet file ! updateFile.xml.</p> ! <pre> <dbunit driver="org.hsqldb.jdbcDriver"<br></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <operation type="INSERT" src="insertFile.xml"/><br></br> <operation type="UPDATE" src="updateFile.xml"/><br></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></br> ! followed by the execution of the UPDATE operation contained within the ! FlatXmlDataSet file updateFile.xml.</p> ! <pre> <dbunit driver="org.hsqldb.jdbcDriver"<br></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <operation type="UPDATE" src="updateFile.xml" flat="false"/><br></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="sa"<br> password=""><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="sa"<br> password=""><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></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <export dest="exportFile.xml"/><br></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></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <export dest="exportNonFlatFile.xml" format="xml"/><br></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></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <export dest="export.dtd" format="dtd"/><br></br> </dbunit></pre> ! <p> Connects to the database given in url as the dbunit user using the org.hsqldb.jdbcDriver ! and <br></br> ! exports the document type definition (dtd) describing the flat xml format.</p> ! <pre> <dbunit driver="org.hsqldb.jdbcDriver"<br></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <export dest="exportFile.xml"><br></br> <table name="FOO"/><br></br> <table name="BAR"/><br></br> </export><br></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 FlatXmlDataSet. <br></br> ! </p> ! <pre> <dbunit driver="org.hsqldb.jdbcDriver"<br></br> url="jdbc:hsqldb:."<br></br> userid="sa"<br></br> password=""><br></br> <export dest="exportFile.xml"><br></br> <table name="FOO"/><br></br> <query name="BAR" sql="SELECT COL1, COL2, COL3 as 'COLSPECIAL' FROM BAR WHERE COL1=4"/><br></br> </export><br></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 FlatXmlDataSet. The contents of the BAR table are only shown ! where col1 is equal to 4. Col3 is renamed COLSPECIAL as well. <br></br> ! </p> </section></body></document> --- 190,244 ---- </table> <h3>Examples</h3> ! <h4>Update operation with specified JDBC driver</h4> ! <source><![CDATA[ ! <dbunit driver="org.hsqldb.jdbcDriver" ! url="jdbc:hsqldb:." ! userid="sa" ! password=""> ! <classpath> ! <pathelement location="/some/jdbc.jar"/> ! </classpath> ! <operation type="UPDATE" src="updateFile.xml"/> ! </dbunit>]]></source> ! ! <h4>Insert and update operations</h4> ! <source><![CDATA[ ! <dbunit driver="org.hsqldb.jdbcDriver" ! url="jdbc:hsqldb:." ! userid="sa" ! password=""> ! <operation type="INSERT" src="insertFile.xml"/> ! <operation type="UPDATE" src="updateFile.xml"/> ! </dbunit>]]></source> ! ! <h4>Database data export to XML</h4> ! <source><![CDATA[ ! <dbunit driver="org.hsqldb.jdbcDriver" ! url="jdbc:hsqldb:." ! userid="sa" ! password=""> ! <export dest="export.xml"/> ! </dbunit>]]></source> ! ! <h4>Database structure export to DTD</h4> ! <source><![CDATA[ ! <dbunit driver="org.hsqldb.jdbcDriver" ! url="jdbc:hsqldb:." ! userid="sa" ! password=""> ! <export dest="export.dtd" format="dtd"/> ! </dbunit>]]></source> ! ! <h4>Partial database data export</h4> ! <source><![CDATA[ ! <dbunit driver="org.hsqldb.jdbcDriver" ! url="jdbc:hsqldb:." ! userid="sa" ! password=""> ! <export dest="partial.xml"> ! <table name="FOO"/> ! <query name="BAR" sql="SELECT COL1, COL2, COL3 as 'COLSPECIAL' FROM BAR WHERE COL1=4"/> ! </export> ! </dbunit>]]></source> </section></body></document> Index: bestpractices.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/bestpractices.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bestpractices.xml 13 Aug 2003 09:40:02 -0000 1.1 --- bestpractices.xml 12 Jan 2004 02:14:35 -0000 1.2 *************** *** 14,53 **** <li><a href="#tableseq">Table sequence in dataset</a></li> </ul> - <hr></hr> <h3><a name="onedbperdev">Use one database copy per developer</a></h3> ! See <a href="intro.html">introduction</a>.<br></br> ! <br></br> <h3><a name="nocleanup"> Good setup for every tests do not require cleanup</a></h3> People versed in testcase design already know that a test should never depend on results from previous tests. If you always correctly initialize your database before each test you won't need to do any clean up at all after ! execution.<br></br> ! <br></br> <h3><a name="smalldatasets"> Use multiple small datasets</a></h3> Most of your tests do not require the entire database to be re-initialized. So, instead of putting your entire database data in one large dataset, try ! to break it into many smaller chunks.<br></br> ! <br></br> Those chunks could roughly corresponding to logical units, or components. This reduces the overhead caused by initializing your database for each test. This also facilitates team development since many developers working ! on different components can modify datasets independently.<br></br> ! <br></br> For integrated testing, you can still use the CompositeDataSet implementation ! to combine multiple datasets into one at run time.<br></br> ! <br></br> <h3><a name="staledata"> Perform setup of stale data once for entire test class or a test suite</a></h3> If several tests are using the same read-only data, this data could be initialized once for an entire test class or test suite. You need to be cautious and ensure you never modify this data. This can reduce the time required to run your tests but also introduces more risk. <br></br> ! <br></br> This feature is not yet integrated in Dbunit but may be added in the future. Something likes a DatabaseTestSuite class? <br></br> ! <br></br> <h3><a name="connections"> Connection management strategies</a></h3> Here are the recommended connection management strategies depending whether ! you test from a remote client or an in-container strategy:<br></br> <h4>Remote client with DatabaseTestCase</h4> <p>You should reuse the same connection for the entire test suite to reduce --- 14,59 ---- <li><a href="#tableseq">Table sequence in dataset</a></li> </ul> <h3><a name="onedbperdev">Use one database copy per developer</a></h3> ! <p>See <a href="intro.html">introduction.</a></p> <h3><a name="nocleanup"> Good setup for every tests do not require cleanup</a></h3> + <p> People versed in testcase design already know that a test should never depend on results from previous tests. If you always correctly initialize your database before each test you won't need to do any clean up at all after ! execution. ! </p> <h3><a name="smalldatasets"> Use multiple small datasets</a></h3> + <p> Most of your tests do not require the entire database to be re-initialized. So, instead of putting your entire database data in one large dataset, try ! to break it into many smaller chunks. ! </p> ! <p> Those chunks could roughly corresponding to logical units, or components. This reduces the overhead caused by initializing your database for each test. This also facilitates team development since many developers working ! on different components can modify datasets independently. ! </p> ! <p> For integrated testing, you can still use the CompositeDataSet implementation ! to combine multiple datasets into one at run time. ! </p> <h3><a name="staledata"> Perform setup of stale data once for entire test class or a test suite</a></h3> + <p> If several tests are using the same read-only data, this data could be initialized once for an entire test class or test suite. You need to be cautious and ensure you never modify this data. This can reduce the time required to run your tests but also introduces more risk. <br></br> ! </p> ! <p> This feature is not yet integrated in Dbunit but may be added in the future. Something likes a DatabaseTestSuite class? <br></br> ! </p> <h3><a name="connections"> Connection management strategies</a></h3> + <p> Here are the recommended connection management strategies depending whether ! you test from a remote client or an in-container strategy: ! </p> <h4>Remote client with DatabaseTestCase</h4> <p>You should reuse the same connection for the entire test suite to reduce *************** *** 57,72 **** to modify this behavior. </p> <h4>In-container with Cactus or JUnitEE</h4> If you use the in-container strategy you should use a DatabaseDataSourceConnection object to access the DataSource you configured for your application server. Jdbc connections are requested on demand from the DataSource. So you can rely on the built-in connection pooling capability of your application server ! to achieve better performance.<br></br> ! <pre> IDatabaseConnection connection = new DatabaseDataSourceConnection( ! new InitialContext(), "jdbc/myDataSource");</pre> <h3><a name="tableseq"> Table sequence in dataset</a></h3> To prevent problems with foreign keys, tables must be sequenced appropriately in dataset. The framework executes INSERT, UPDATE and REFRESH operations using the same sequence while DELETE and DELETE_ALL are executed in reverse ! order.<br></br> </section></body></document> --- 63,83 ---- to modify this behavior. </p> <h4>In-container with Cactus or JUnitEE</h4> + <p> If you use the in-container strategy you should use a DatabaseDataSourceConnection object to access the DataSource you configured for your application server. Jdbc connections are requested on demand from the DataSource. So you can rely on the built-in connection pooling capability of your application server ! to achieve better performance. ! <source>IDatabaseConnection connection = new DatabaseDataSourceConnection( ! new InitialContext(), "jdbc/myDataSource");</source> ! </p> <h3><a name="tableseq"> Table sequence in dataset</a></h3> + <p> To prevent problems with foreign keys, tables must be sequenced appropriately in dataset. The framework executes INSERT, UPDATE and REFRESH operations using the same sequence while DELETE and DELETE_ALL are executed in reverse ! order. ! </p> ! </section></body></document> Index: intro.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/intro.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** intro.xml 13 Aug 2003 09:40:02 -0000 1.1 --- intro.xml 12 Jan 2004 02:14:35 -0000 1.2 *************** *** 52,64 **** unit test database, which is under the control of the test cases: the test cases clean out the database before starting any tests.<br></br> ! <br></br> ! [...]<br></br> ! <br></br> Deleting and inserting data for every test may seem like a big time over head, but as tests use relatively little data, I find this approach to be quick enough (especially if you're running against a local test database).<br></br> ! <br></br> ! [...]<br></br> ! <br></br> The downside is that you need more than one database - but remember, they can all run on one server if necessary. The way I'm testing now needs --- 52,60 ---- unit test database, which is under the control of the test cases: the test cases clean out the database before starting any tests.<br></br> ! [...] Deleting and inserting data for every test may seem like a big time over head, but as tests use relatively little data, I find this approach to be quick enough (especially if you're running against a local test database).<br></br> ! [...] The downside is that you need more than one database - but remember, they can all run on one server if necessary. The way I'm testing now needs *************** *** 75,79 **** reassuring to see your app work with lots of data (i.e., a copy of the production database's data). </li> ! <li>A <strong>deployment databas</strong>e, or integration database, where the tests are run prior to deployment to make sure any local database changes have been applied. If you're working alone, you may be able --- 71,75 ---- reassuring to see your app work with lots of data (i.e., a copy of the production database's data). </li> ! <li>A <strong>deployment database</strong>, or integration database, where the tests are run prior to deployment to make sure any local database changes have been applied. If you're working alone, you may be able |
From: <mla...@us...> - 2004-01-12 02:12:16
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv32118/src/test/org/dbunit Modified Files: Main.java Log Message: Fixed imports Index: Main.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/Main.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Main.java 9 Aug 2003 11:23:32 -0000 1.32 --- Main.java 12 Jan 2004 02:12:10 -0000 1.33 *************** *** 35,40 **** import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.MockDataSetProducer; ! import org.dbunit.dataset.StreamingDataSet; import org.dbunit.dataset.excel.XlsDataSet; import org.dbunit.dataset.xml.FlatXmlDataSet; --- 35,40 ---- import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.stream.MockDataSetProducer; ! import org.dbunit.dataset.stream.StreamingDataSet; import org.dbunit.dataset.excel.XlsDataSet; import org.dbunit.dataset.xml.FlatXmlDataSet; |
From: <mla...@us...> - 2004-01-11 21:45:44
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/database In directory sc8-pr-cvs1:/tmp/cvs-serv13805/src/java/org/dbunit/database Modified Files: AbstractDatabaseConnection.java Log Message: Cleanup Index: AbstractDatabaseConnection.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/AbstractDatabaseConnection.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AbstractDatabaseConnection.java 1 Aug 2003 02:29:10 -0000 1.16 --- AbstractDatabaseConnection.java 11 Jan 2004 21:45:38 -0000 1.17 *************** *** 41,50 **** public abstract class AbstractDatabaseConnection implements IDatabaseConnection { - // static final String STATEMENT_FACTORY = "dbunit.statement.factory"; - // static final String DEFAULT_FACTORY = - // "org.dbunit.database.statement.PreparedStatementFactory"; - - // private final IStatementFactory _statementFactory; - // private final IDataTypeFactory _dataTypeFactory = new DefaultDataTypeFactory(); private IDataSet _dataSet = null; private DatabaseConfig _databaseConfig; --- 41,44 ---- |
From: <mla...@us...> - 2004-01-09 22:03:53
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv31524/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Log Message: Fixed Oracle Date & Timestamp datatype selection bug. Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OracleDataTypeFactory.java 5 Dec 2003 20:44:39 -0000 1.5 --- OracleDataTypeFactory.java 9 Jan 2004 22:03:51 -0000 1.6 *************** *** 60,64 **** // TIMESTAMP ! if (sqlType == Types.DATE && sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; --- 60,64 ---- // TIMESTAMP ! if (sqlType == Types.DATE || sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; |
From: <mla...@us...> - 2004-01-09 22:00:06
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/util/xml In directory sc8-pr-cvs1:/tmp/cvs-serv30562/src/java/org/dbunit/util/xml Modified Files: XmlWriter.java Log Message: Ability to write the DOCTYPE Index: XmlWriter.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/util/xml/XmlWriter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** XmlWriter.java 9 Aug 2003 11:23:22 -0000 1.4 --- XmlWriter.java 9 Jan 2004 22:00:02 -0000 1.5 *************** *** 545,547 **** --- 545,574 ---- } + public XmlWriter writeDoctype(String systemId, String publicId) throws IOException + { + if (systemId != null || publicId != null) + { + this.out.write("<!DOCTYPE dataset"); + + if (systemId != null) + { + this.out.write(" SYSTEM \""); + this.out.write(systemId); + this.out.write("\""); + } + + if (publicId != null) + { + this.out.write(" PUBLIC \""); + this.out.write(publicId); + this.out.write("\""); + } + + this.out.write(">"); + this.out.write(this.newline); + } + + return this; + } + } |
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation In directory sc8-pr-cvs1:/tmp/cvs-serv30297/src/java/org/dbunit/operation Modified Files: AbstractBatchOperation.java DeleteOperation.java InsertOperation.java RefreshOperation.java UpdateOperation.java Log Message: InsertOperation does not override database default values anymore when inserting null. Null values are now omitted from the insert statement. The InsertOperation might use multiple statements for the same table, as null values can vary from row to row. Index: AbstractBatchOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/AbstractBatchOperation.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AbstractBatchOperation.java 1 Aug 2003 02:29:11 -0000 1.19 --- AbstractBatchOperation.java 9 Jan 2004 21:58:31 -0000 1.20 *************** *** 33,36 **** --- 33,37 ---- import java.util.ArrayList; import java.util.List; + import java.math.BigInteger; /** *************** *** 42,45 **** --- 43,47 ---- public abstract class AbstractBatchOperation extends DatabaseOperation { + private static final BigInteger EMPTY_IGNORE_MAPPING = new BigInteger("0"); protected boolean _reverseRowOrder = false; *************** *** 110,115 **** } ! abstract public OperationData getOperationData( ! ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException; //////////////////////////////////////////////////////////////////////////// --- 112,137 ---- } ! /** ! * Returns mapping of columns to ignore by this operation. Each bit set represent ! * a column to ignore. ! */ ! BigInteger getIngnoreMapping(ITable table, int row) ! throws DataSetException ! { ! return EMPTY_IGNORE_MAPPING; ! } ! ! /** ! * Returns false if the specified table row have a different ignore mapping ! * than the specified mapping. ! */ ! boolean equalsIgnoreMapping(BigInteger ignoreMapping, ITable table, ! int row) throws DataSetException ! { ! return true; ! } ! ! abstract OperationData getOperationData(ITableMetaData metaData, ! BigInteger ignoreMapping, IDatabaseConnection connection) throws DataSetException; //////////////////////////////////////////////////////////////////////////// *************** *** 137,150 **** ITableMetaData metaData = getOperationMetaData(connection, table.getTableMetaData()); ! OperationData operationData = getOperationData( ! metaData, connection); ! ! IPreparedBatchStatement statement = factory.createPreparedBatchStatement( ! operationData.getSql(), connection); try { - Column[] columns = operationData.getColumns(); - // For each row int start = _reverseRowOrder ? table.getRowCount() - 1 : 0; --- 159,168 ---- ITableMetaData metaData = getOperationMetaData(connection, table.getTableMetaData()); ! BigInteger ignoreMapping = null; ! OperationData operationData = null; ! IPreparedBatchStatement statement = null; try { // For each row int start = _reverseRowOrder ? table.getRowCount() - 1 : 0; *************** *** 157,166 **** int row = i; // for each column for (int j = 0; j < columns.length; j++) { ! Column column = columns[j]; ! statement.addValue(table.getValue(row, ! column.getColumnName()), column.getDataType()); } statement.addBatch(); --- 175,208 ---- int row = i; + // If current row have a diffrent ignore value mapping than + // previous one, we generate a new statement + if (ignoreMapping == null || !equalsIgnoreMapping(ignoreMapping, table, row)) + { + // Execute and close previous statement + if (statement != null) + { + statement.executeBatch(); + statement.clearBatch(); + statement.close(); + } + + ignoreMapping = getIngnoreMapping(table, row); + operationData = getOperationData(metaData, ignoreMapping, connection); + statement = factory.createPreparedBatchStatement( + operationData.getSql(), connection); + } + + // for each column + Column[] columns = operationData.getColumns(); for (int j = 0; j < columns.length; j++) { ! // Bind value only if not in ignore mapping ! if (!ignoreMapping.testBit(j)) ! { ! Column column = columns[j]; ! statement.addValue(table.getValue(row, ! column.getColumnName()), column.getDataType()); ! } } statement.addBatch(); Index: DeleteOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/DeleteOperation.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DeleteOperation.java 1 Aug 2003 02:29:11 -0000 1.14 --- DeleteOperation.java 9 Jan 2004 21:58:31 -0000 1.15 *************** *** 27,30 **** --- 27,32 ---- import org.dbunit.dataset.*; + import java.math.BigInteger; + /** * Deletes only the dataset contents from the database. This operation does not *************** *** 50,55 **** } ! public OperationData getOperationData( ! ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException { // cannot construct where clause if no primary key --- 52,56 ---- } ! public OperationData getOperationData(ITableMetaData metaData, BigInteger ignoreMapping, IDatabaseConnection connection) throws DataSetException { // cannot construct where clause if no primary key Index: InsertOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/InsertOperation.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** InsertOperation.java 1 Aug 2003 02:29:11 -0000 1.13 --- InsertOperation.java 9 Jan 2004 21:58:31 -0000 1.14 *************** *** 25,28 **** --- 25,31 ---- import org.dbunit.dataset.*; import org.dbunit.database.IDatabaseConnection; + import org.dbunit.DatabaseUnitException; + + import java.math.BigInteger; /** *************** *** 44,49 **** // AbstractBatchOperation class ! public OperationData getOperationData( ! ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException { Column[] columns = metaData.getColumns(); --- 47,52 ---- // AbstractBatchOperation class ! public OperationData getOperationData(ITableMetaData metaData, ! BigInteger ignoreMapping, IDatabaseConnection connection) throws DataSetException { Column[] columns = metaData.getColumns(); *************** *** 57,82 **** // columns sqlBuffer.append(" ("); for (int i = 0; i < columns.length; i++) { ! if (i > 0) { ! sqlBuffer.append(", "); } - - // escape column name - String columnName = getQualifiedName(null, - columns[i].getColumnName(), connection); - sqlBuffer.append(columnName); } // values sqlBuffer.append(") values ("); for (int i = 0; i < columns.length; i++) { ! if (i > 0) { ! sqlBuffer.append(", "); } - sqlBuffer.append("?"); } sqlBuffer.append(")"); --- 60,88 ---- // columns sqlBuffer.append(" ("); + String columnSeparator = ""; for (int i = 0; i < columns.length; i++) { ! if (!ignoreMapping.testBit(i)) { ! // escape column name ! String columnName = getQualifiedName(null, ! columns[i].getColumnName(), connection); ! sqlBuffer.append(columnSeparator); ! sqlBuffer.append(columnName); ! columnSeparator = ", "; } } // values sqlBuffer.append(") values ("); + String valueSeparator = ""; for (int i = 0; i < columns.length; i++) { ! if (!ignoreMapping.testBit(i)) { ! sqlBuffer.append(valueSeparator); ! sqlBuffer.append("?"); ! valueSeparator = ", "; } } sqlBuffer.append(")"); *************** *** 85,88 **** --- 91,129 ---- } + protected BigInteger getIngnoreMapping(ITable table, int row) throws DataSetException + { + Column[] columns = table.getTableMetaData().getColumns(); + int n = columns.length; + int byteNum = n / 8; + byte[] result = new byte[byteNum + 2]; + + for (int i = 0; i < n; i++) + { + Object value = table.getValue(row, columns[i].getColumnName()); + if (value == null) + { + result[result.length - (i / 8) - 1] |= (1 << (i % 8)); + } + } + return new BigInteger(result); + } + + protected boolean equalsIgnoreMapping(BigInteger ignoreMapping, ITable table, + int row) throws DataSetException + { + Column[] columns = table.getTableMetaData().getColumns(); + + for (int i = 0; i < columns.length; i++) + { + boolean bit = ignoreMapping.testBit(i); + Object value = table.getValue(row, columns[i].getColumnName()); + if ((bit && value != null) || (!bit && value == null)) + { + return false; + } + } + + return true; + } } Index: RefreshOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/RefreshOperation.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RefreshOperation.java 9 Aug 2003 11:23:31 -0000 1.28 --- RefreshOperation.java 9 Jan 2004 21:58:31 -0000 1.29 *************** *** 25,33 **** import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; ! import org.dbunit.database.statement.*; ! import org.dbunit.dataset.*; import org.dbunit.dataset.datatype.DataType; ! import java.sql.*; /** --- 25,44 ---- import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; ! import org.dbunit.database.statement.IPreparedBatchStatement; ! import org.dbunit.database.statement.SimplePreparedStatement; ! import org.dbunit.dataset.Column; ! import org.dbunit.dataset.DataSetException; ! import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.ITable; ! import org.dbunit.dataset.ITableIterator; ! import org.dbunit.dataset.ITableMetaData; ! import org.dbunit.dataset.NoPrimaryKeyException; ! import org.dbunit.dataset.RowOutOfBoundsException; import org.dbunit.dataset.datatype.DataType; ! import java.math.BigInteger; ! import java.sql.PreparedStatement; ! import java.sql.ResultSet; ! import java.sql.SQLException; /** *************** *** 134,138 **** { protected IPreparedBatchStatement _statement; ! protected Column[] _columns; /** --- 145,150 ---- { protected IPreparedBatchStatement _statement; ! protected OperationData _operationData; ! protected BigInteger _ignoreMapping; /** *************** *** 143,150 **** throws DataSetException, SQLException { ! for (int i = 0; i < _columns.length; i++) { ! Object value = table.getValue(row, _columns[i].getColumnName()); ! _statement.addValue(value, _columns[i].getDataType()); } _statement.addBatch(); --- 155,167 ---- throws DataSetException, SQLException { ! Column[] columns = _operationData.getColumns(); ! for (int i = 0; i < columns.length; i++) { ! // Bind value only if not in ignore mapping ! if (_ignoreMapping == null || !_ignoreMapping.testBit(i)) ! { ! Object value = table.getValue(row, columns[i].getColumnName()); ! _statement.addValue(value, columns[i].getDataType()); ! } } _statement.addBatch(); *************** *** 160,164 **** public void close() throws SQLException { ! _statement.close(); } } --- 177,184 ---- public void close() throws SQLException { ! if (_statement != null) ! { ! _statement.close(); ! } } } *************** *** 169,183 **** private class InsertRowOperation extends RowOperation { public InsertRowOperation(IDatabaseConnection connection, ITableMetaData metaData) throws DataSetException, SQLException { ! // setup insert statement ! OperationData insertData = _insertOperation.getOperationData( ! metaData, connection); ! _statement = new SimplePreparedStatement(insertData.getSql(), ! connection.getConnection()); ! _columns = insertData.getColumns(); } } --- 189,227 ---- private class InsertRowOperation extends RowOperation { + private IDatabaseConnection _connection; + private ITableMetaData _metaData; + public InsertRowOperation(IDatabaseConnection connection, ITableMetaData metaData) throws DataSetException, SQLException { ! _connection = connection; ! _metaData = metaData; } + + public boolean execute(ITable table, int row) + throws DataSetException, SQLException + { + // If current row have a diffrent ignore value mapping than + // previous one, we generate a new statement + if (_ignoreMapping == null || + !_insertOperation.equalsIgnoreMapping(_ignoreMapping, table, row)) + { + // Execute and close previous statement + if (_statement != null) + { + _statement.close(); + } + + _ignoreMapping = _insertOperation.getIngnoreMapping(table, row); + _operationData = _insertOperation.getOperationData(_metaData, + _ignoreMapping, _connection); + _statement = new SimplePreparedStatement(_operationData.getSql(), + _connection.getConnection()); + } + + return super.execute(table, row); + } + } *************** *** 194,202 **** { // setup update statement ! OperationData updateData = _updateOperation.getOperationData( ! metaData, connection); ! _statement = new SimplePreparedStatement(updateData.getSql(), connection.getConnection()); - _columns = updateData.getColumns(); } } --- 238,245 ---- { // setup update statement ! _operationData = _updateOperation.getOperationData( ! metaData, null, connection); ! _statement = new SimplePreparedStatement(_operationData.getSql(), connection.getConnection()); } } *************** *** 214,221 **** { // setup select count statement ! OperationData countData = getSelectCountData(metaData, connection); _countStatement = connection.getConnection().prepareStatement( ! countData.getSql()); ! _columns = countData.getColumns(); } --- 257,263 ---- { // setup select count statement ! _operationData = getSelectCountData(metaData, connection); _countStatement = connection.getConnection().prepareStatement( ! _operationData.getSql()); } *************** *** 264,271 **** throws DataSetException, SQLException { ! for (int i = 0; i < _columns.length; i++) { ! Object value = table.getValue(row, _columns[i].getColumnName()); ! DataType dataType = _columns[i].getDataType(); dataType.setSqlValue(value, i + 1, _countStatement); } --- 306,314 ---- throws DataSetException, SQLException { ! Column[] columns = _operationData.getColumns(); ! for (int i = 0; i < columns.length; i++) { ! Object value = table.getValue(row, columns[i].getColumnName()); ! DataType dataType = columns[i].getDataType(); dataType.setSqlValue(value, i + 1, _countStatement); } Index: UpdateOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/UpdateOperation.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UpdateOperation.java 1 Aug 2003 02:29:11 -0000 1.10 --- UpdateOperation.java 9 Jan 2004 21:58:31 -0000 1.11 *************** *** 28,31 **** --- 28,32 ---- import java.util.ArrayList; import java.util.List; + import java.math.BigInteger; /** *************** *** 45,50 **** // AbstractBatchOperation class ! public OperationData getOperationData( ! ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException { Column[] columns = metaData.getColumns(); --- 46,50 ---- // AbstractBatchOperation class ! public OperationData getOperationData(ITableMetaData metaData, BigInteger ignoreMapping, IDatabaseConnection connection) throws DataSetException { Column[] columns = metaData.getColumns(); |
From: <mla...@us...> - 2004-01-09 21:58:35
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation In directory sc8-pr-cvs1:/tmp/cvs-serv30297/src/test/org/dbunit/operation Modified Files: DeleteOperationTest.java InsertOperationTest.java Log Message: InsertOperation does not override database default values anymore when inserting null. Null values are now omitted from the insert statement. The InsertOperation might use multiple statements for the same table, as null values can vary from row to row. Index: DeleteOperationTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation/DeleteOperationTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DeleteOperationTest.java 1 Aug 2003 02:29:12 -0000 1.16 --- DeleteOperationTest.java 9 Jan 2004 21:58:32 -0000 1.17 *************** *** 35,38 **** --- 35,39 ---- import java.util.ArrayList; import java.util.List; + import java.math.BigInteger; /** *************** *** 230,234 **** { new DeleteOperation().getOperationData( ! metaData, _connection); fail("Should throw a NoPrimaryKeyException"); } --- 231,235 ---- { new DeleteOperation().getOperationData( ! metaData, null, _connection); fail("Should throw a NoPrimaryKeyException"); } Index: InsertOperationTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation/InsertOperationTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** InsertOperationTest.java 1 Aug 2003 02:29:12 -0000 1.21 --- InsertOperationTest.java 9 Jan 2004 21:58:32 -0000 1.22 *************** *** 31,43 **** import org.dbunit.database.statement.MockBatchStatement; import org.dbunit.database.statement.MockStatementFactory; ! import org.dbunit.dataset.Column; ! import org.dbunit.dataset.DataSetUtils; ! import org.dbunit.dataset.DefaultDataSet; ! import org.dbunit.dataset.DefaultTable; ! import org.dbunit.dataset.DefaultTableMetaData; ! import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.ITable; ! import org.dbunit.dataset.LowerCaseDataSet; ! import org.dbunit.dataset.ForwardOnlyDataSet; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.xml.FlatXmlDataSet; --- 31,35 ---- import org.dbunit.database.statement.MockBatchStatement; import org.dbunit.database.statement.MockStatementFactory; ! import org.dbunit.dataset.*; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.xml.FlatXmlDataSet; *************** *** 67,71 **** String tableName = "table"; String[] expected = { ! "insert into schema.table (c1, c2, c3) values (NULL, 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", }; --- 59,63 ---- String tableName = "table"; String[] expected = { ! "insert into schema.table (c1, c2, c3) values ('toto', 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", }; *************** *** 73,77 **** // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{null, "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ --- 65,69 ---- // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{"toto", "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ *************** *** 108,111 **** --- 100,155 ---- } + public void testExecuteIgnoreNull() throws Exception + { + String schemaName = "schema"; + String tableName = "table"; + String[] expected = { + "insert into schema.table (c1, c2, c3) values ('toto', 1234, 'false')", + "insert into schema.table (c2, c3) values (123.45, 'true')", + "insert into schema.table (c1, c2, c3) values ('qwerty1', 1, 'true')", + "insert into schema.table (c1, c2, c3) values ('qwerty2', 2, 'false')", + "insert into schema.table (c3) values ('false')", + }; + + // setup table + List valueList = new ArrayList(); + valueList.add(new Object[]{"toto", "1234", Boolean.FALSE}); + valueList.add(new Object[]{null, new Double("123.45"), "true"}); + valueList.add(new Object[]{"qwerty1", "1", Boolean.TRUE}); + valueList.add(new Object[]{"qwerty2", "2", Boolean.FALSE}); + valueList.add(new Object[]{null, null, Boolean.FALSE}); + Column[] columns = new Column[]{ + new Column("c1", DataType.VARCHAR), + new Column("c2", DataType.NUMERIC), + new Column("c3", DataType.BOOLEAN), + }; + DefaultTable table = new DefaultTable(tableName, columns, valueList); + IDataSet dataSet = new DefaultDataSet(table); + + // setup mock objects + MockBatchStatement statement = new MockBatchStatement(); + statement.addExpectedBatchStrings(expected); + statement.setExpectedExecuteBatchCalls(4); + statement.setExpectedClearBatchCalls(4); + statement.setExpectedCloseCalls(4); + + MockStatementFactory factory = new MockStatementFactory(); + factory.setExpectedCreatePreparedStatementCalls(4); + factory.setupStatement(statement); + + MockDatabaseConnection connection = new MockDatabaseConnection(); + connection.setupDataSet(dataSet); + connection.setupSchema(schemaName); + connection.setupStatementFactory(factory); + connection.setExpectedCloseCalls(0); + + // execute operation + new InsertOperation().execute(connection, dataSet); + + statement.verify(); + factory.verify(); + connection.verify(); + } + public void testExecuteWithEscapedNames() throws Exception { *************** *** 113,117 **** String tableName = "table"; String[] expected = { ! "insert into 'schema'.'table' ('c1', 'c2', 'c3') values (NULL, 1234, 'false')", "insert into 'schema'.'table' ('c1', 'c2', 'c3') values ('qwerty', 123.45, 'true')", }; --- 157,161 ---- String tableName = "table"; String[] expected = { ! "insert into 'schema'.'table' ('c1', 'c2', 'c3') values ('toto', 1234, 'false')", "insert into 'schema'.'table' ('c1', 'c2', 'c3') values ('qwerty', 123.45, 'true')", }; *************** *** 119,123 **** // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{null, "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ --- 163,167 ---- // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{"toto", "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ *************** *** 161,167 **** String tableName = "table"; String[] expected = { ! "insert into schema.table (c1, c2, c3) values (NULL, 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", ! "insert into schema.table (c1, c2, c3) values (NULL, 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", }; --- 205,211 ---- String tableName = "table"; String[] expected = { ! "insert into schema.table (c1, c2, c3) values ('toto', 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", ! "insert into schema.table (c1, c2, c3) values ('toto', 1234, 'false')", "insert into schema.table (c1, c2, c3) values ('qwerty', 123.45, 'true')", }; *************** *** 169,173 **** // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{null, "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ --- 213,217 ---- // setup table List valueList = new ArrayList(); ! valueList.add(new Object[]{"toto", "1234", Boolean.FALSE}); valueList.add(new Object[]{"qwerty", new Double("123.45"), "true"}); Column[] columns = new Column[]{ *************** *** 383,387 **** else { ! Assertion.assertEquals(dataSet.getTable(name), table); } } --- 427,434 ---- else { ! SortedTable expectedTable = new SortedTable( ! dataSet.getTable(name), table.getTableMetaData()); ! SortedTable actualTable = new SortedTable(table); ! Assertion.assertEquals(expectedTable, actualTable); } } |
From: <mla...@us...> - 2004-01-09 21:58:35
|
Update of /cvsroot/dbunit/dbunit/src/xml In directory sc8-pr-cvs1:/tmp/cvs-serv30297/src/xml Modified Files: refreshOperationDuplicateTest.xml refreshOperationTest.xml refreshOperationTestExpected.xml Log Message: InsertOperation does not override database default values anymore when inserting null. Null values are now omitted from the insert statement. The InsertOperation might use multiple statements for the same table, as null values can vary from row to row. Index: refreshOperationDuplicateTest.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/refreshOperationDuplicateTest.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** refreshOperationDuplicateTest.xml 7 Aug 2002 01:32:12 -0000 1.3 --- refreshOperationDuplicateTest.xml 9 Jan 2004 21:58:32 -0000 1.4 *************** *** 3,6 **** --- 3,9 ---- <ONLY_PK_TABLE PK0="0"/> <PK_TABLE PK0="3" PK1="3" PK2="3" NORMAL0="3333" NORMAL1="33333"/> + <PK_TABLE PK0="4" PK1="4" PK2="4" NORMAL0="4444" /> + <PK_TABLE PK0="5" PK1="5" PK2="5" NORMAL0="5555" NORMAL1="55555"/> + <PK_TABLE PK0="6" PK1="6" PK2="6" NORMAL0="6666" NORMAL1="66666"/> <ONLY_PK_TABLE PK0="1"/> </dataset> Index: refreshOperationTest.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/refreshOperationTest.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** refreshOperationTest.xml 7 Aug 2002 01:32:12 -0000 1.5 --- refreshOperationTest.xml 9 Jan 2004 21:58:32 -0000 1.6 *************** *** 2,5 **** --- 2,8 ---- <PK_TABLE PK0="1" PK1="1" PK2="1" NORMAL0="toto" NORMAL1="qwerty"/> <PK_TABLE PK0="3" PK1="3" PK2="3" NORMAL0="3333" NORMAL1="33333"/> + <PK_TABLE PK0="4" PK1="4" PK2="4" NORMAL0="4444" /> + <PK_TABLE PK0="5" PK1="5" PK2="5" NORMAL0="5555" NORMAL1="55555"/> + <PK_TABLE PK0="6" PK1="6" PK2="6" NORMAL0="6666" NORMAL1="66666"/> <ONLY_PK_TABLE PK0="0"/> <ONLY_PK_TABLE PK0="1"/> Index: refreshOperationTestExpected.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/refreshOperationTestExpected.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** refreshOperationTestExpected.xml 7 Aug 2002 01:32:12 -0000 1.3 --- refreshOperationTestExpected.xml 9 Jan 2004 21:58:32 -0000 1.4 *************** *** 5,8 **** --- 5,11 ---- <PK_TABLE PK0="2" PK1="2" PK2="2" NORMAL0="row 2" NORMAL1="2 wor"/> <PK_TABLE PK0="3" PK1="3" PK2="3" NORMAL0="3333" NORMAL1="33333"/> + <PK_TABLE PK0="4" PK1="4" PK2="4" NORMAL0="4444" /> + <PK_TABLE PK0="5" PK1="5" PK2="5" NORMAL0="5555" NORMAL1="55555"/> + <PK_TABLE PK0="6" PK1="6" PK2="6" NORMAL0="6666" NORMAL1="66666"/> <ONLY_PK_TABLE PK0="0"/> <ONLY_PK_TABLE PK0="1"/> |
From: <mla...@us...> - 2003-12-05 20:44:42
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv26840/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Log Message: Modified Oracle DATE mapping to use the TIMESTAMP type instead. Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OracleDataTypeFactory.java 9 Oct 2003 17:48:37 -0000 1.4 --- OracleDataTypeFactory.java 5 Dec 2003 20:44:39 -0000 1.5 *************** *** 60,64 **** // TIMESTAMP ! if (sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; --- 60,64 ---- // TIMESTAMP ! if (sqlType == Types.DATE && sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; |
From: <mla...@us...> - 2003-12-05 09:26:39
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv11752/src/java/org/dbunit/dataset/datatype Modified Files: DateDataType.java TimestampDataType.java Log Message: Ability to typecast a string formated as a Timestamp to a Date and vice versa. Index: DateDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/DateDataType.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DateDataType.java 17 May 2003 15:38:52 -0000 1.10 --- DateDataType.java 5 Dec 2003 02:25:59 -0000 1.11 *************** *** 68,78 **** if (value instanceof String) { try { ! return java.sql.Date.valueOf((String)value); } catch (IllegalArgumentException e) { ! throw new TypeCastException((String)value, e); } } --- 68,95 ---- if (value instanceof String) { + String stringValue = (String)value; + + // Probably a Timestamp, try it just in case! + if (stringValue.length() > 10) + { + try + { + long time = java.sql.Timestamp.valueOf(stringValue).getTime(); + return new java.sql.Date(time); + // return java.sql.Date.valueOf(new java.sql.Date(time).toString()); + } + catch (IllegalArgumentException e) + { + // Was not a Timestamp, let java.sql.Date handle this value + } + } + try { ! return java.sql.Date.valueOf(stringValue); } catch (IllegalArgumentException e) { ! throw new TypeCastException(stringValue, e); } } Index: TimestampDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/TimestampDataType.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TimestampDataType.java 17 May 2003 15:38:52 -0000 1.10 --- TimestampDataType.java 5 Dec 2003 02:25:59 -0000 1.11 *************** *** 69,79 **** if (value instanceof String) { try { ! return java.sql.Timestamp.valueOf((String)value); } catch (IllegalArgumentException e) { ! throw new TypeCastException((String)value, e); } } --- 69,95 ---- if (value instanceof String) { + String stringValue = (String)value; + + // Probably a java.sql.Date, try it just in case! + if (stringValue.length() == 10) + { + try + { + long time = java.sql.Date.valueOf(stringValue).getTime(); + return new java.sql.Timestamp(time); + } + catch (IllegalArgumentException e) + { + // Was not a java.sql.Date, let Timestamp handle this value + } + } + try { ! return java.sql.Timestamp.valueOf(stringValue); } catch (IllegalArgumentException e) { ! throw new TypeCastException(stringValue, e); } } |
From: <mla...@us...> - 2003-12-05 09:26:38
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv11752/src/test/org/dbunit/dataset/datatype Modified Files: DateDataTypeTest.java TimestampDataTypeTest.java Log Message: Ability to typecast a string formated as a Timestamp to a Date and vice versa. Index: DateDataTypeTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/DateDataTypeTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DateDataTypeTest.java 13 Aug 2003 01:53:58 -0000 1.9 --- DateDataTypeTest.java 5 Dec 2003 02:26:00 -0000 1.10 *************** *** 72,75 **** --- 72,76 ---- new Timestamp(1234), new java.sql.Date(1234).toString(), + new Timestamp(1234).toString(), new java.util.Date(1234), }; *************** *** 81,84 **** --- 82,87 ---- new java.sql.Date(new Timestamp(1234).getTime()), java.sql.Date.valueOf(new java.sql.Date(1234).toString()), + new java.sql.Date( + Timestamp.valueOf(new Timestamp(1234).toString()).getTime()), new java.sql.Date(1234), }; Index: TimestampDataTypeTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/TimestampDataTypeTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TimestampDataTypeTest.java 13 Aug 2003 01:53:58 -0000 1.9 --- TimestampDataTypeTest.java 5 Dec 2003 02:26:00 -0000 1.10 *************** *** 72,75 **** --- 72,76 ---- new Time(1234), new Timestamp(1234).toString(), + new Date(1234).toString(), new java.util.Date(1234), }; *************** *** 80,84 **** new Timestamp(new Date(1234).getTime()), new Timestamp(new Time(1234).getTime()), ! Timestamp.valueOf(new Timestamp(1234).toString()), new Timestamp(1234), }; --- 81,86 ---- new Timestamp(new Date(1234).getTime()), new Timestamp(new Time(1234).getTime()), ! new Timestamp(1234), ! new Timestamp(Date.valueOf((new Date(1234).toString())).getTime()), new Timestamp(1234), }; |
From: <mla...@us...> - 2003-11-26 17:00:29
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/mssqlserver In directory sc8-pr-cvs1:/tmp/cvs-serv11700/src/java/org/dbunit/operation/mssqlserver Modified Files: InsertIdentityOperation.java Log Message: Modified InsertIdentityOperation.hasIdentityColumn() from private to protected to allow subclassing. Index: InsertIdentityOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/mssqlserver/InsertIdentityOperation.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** InsertIdentityOperation.java 9 Aug 2003 11:23:31 -0000 1.18 --- InsertIdentityOperation.java 26 Nov 2003 17:00:24 -0000 1.19 *************** *** 79,83 **** } ! private boolean hasIdentityColumn(ITableMetaData metaData) throws DataSetException { --- 79,83 ---- } ! protected boolean hasIdentityColumn(ITableMetaData metaData) throws DataSetException { |
From: <de...@us...> - 2003-11-04 08:08:01
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv12125 Modified Files: project.xml Log Message: Update mockobjects properties to download from ibiblio properly. Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** project.xml 10 Oct 2003 14:12:06 -0000 1.8 --- project.xml 4 Nov 2003 08:07:57 -0000 1.9 *************** *** 123,133 **** </dependency> <dependency> ! <id>mockobjects:mockobjects-0.07-core</id> ! <jar>mockobjects-0.07-core.jar</jar> </dependency> <dependency> ! <id>mockobjects:mockobjects-0.07-jdk1.3</id> ! <jar>mockobjects-0.07-jdk1.3.jar</jar> ! <version/> </dependency> <dependency> --- 123,134 ---- </dependency> <dependency> ! <groupId>mockobjects</groupId> ! <artifactId>mockobjects-core</artifactId> ! <version>0.07</version> </dependency> <dependency> ! <groupId>mockobjects</groupId> ! <artifactId>mockobjects-jdk1.3</artifactId> ! <version>0.07</version> </dependency> <dependency> |
From: <de...@us...> - 2003-11-04 08:07:08
|
Update of /cvsroot/dbunit/dbunit/docs In directory sc8-pr-cvs1:/tmp/cvs-serv11991/docs Added Files: index.html.off Removed Files: intro.html anttask.html support.html components.html changes.html resources.html bestpractices.html download.html howto.html faq.html Log Message: Remove .html files in favor of xdocs. --- NEW FILE: index.html.off --- <!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 - Home</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>The Dbunit Database Testing Framework</h2> <p>DbUnit is a JUnit extension (also usable from Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.</p> <p>DbUnit has the ability to export and import your database (or specified tables) content to and from XML datasets. This is targeted for functional testing, so this is not the perfect tool to backup a huge production database.</p> <p>DbUnit also provides assert facility to verify that your database content match some expected values.</p> <a name="intro"> <h2>News</h2> </a> <ul> <li>2003-04-04 - Version 1.5.1 released. See <a href="changes.html#1.5.1">changes</a>.</li> <li>2003-03-01 - Version 1.5 released. See <a href="changes.html#1.5">changes</a>.</li> <li>2002-11-07 - Eric Pugh joined the DbUnit developement team.</li> <li>2002-07-17 - The java API documentation is now available <a href="api/index.html">online</a>.</li> <li>2002-07-17 - Version 1.4 released. See <a href="changes.html#1.4">changes</a>.</li> <li>2002-05-10 - Timothy Ruppert and Ben Cox joined the DbUnit developement team.</li> <li>2002-04-04 - Version 1.3 released. See <a href="changes.html#1.3">changes</a>.</li> <li>2002-04-04 - New website design done by <a href="http://www.silphid.com/">Silphid Creations</a>.</li> <li>2002-03-19 - Version 1.2.4 released. See <a href="changes.html#1.2.4">changes</a>.</li> <li>2002-03-19 - Added Daedalos JUnit Extensions link in the <a href="resources.html">Resources</a> page.</li> <li>2002-03-17 - Added the <a href="support.html#knownissues">Known Issues</a> section in support page.</li> <li>2002-03-15 - Version 1.2 released. See <a href="changes.html#1.2">changes</a>.</li> <li>2002-03-10 - Modified the <a href="bestpractices.html#connections">connections management strategies</a> best practices.</li> <li>2002-03-10 - Version 1.1 released. See <a href="changes.html#1.1">changes</a>.</li> <li>2002-02-27 - Version 1.0 released. This is the first public release.</li> </ul> <p> </p> <!-- #EndEditable --> <hr> <div align="center"> <p><font size="2">Copyright ©2002-2003, 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.29 $ $Date: 2003/04/05 03:01:28 $</font> </div> </tr> </table> </body> <!-- #EndTemplate --></html> --- intro.html DELETED --- --- anttask.html DELETED --- --- support.html DELETED --- --- components.html DELETED --- --- changes.html DELETED --- --- resources.html DELETED --- --- bestpractices.html DELETED --- --- download.html DELETED --- --- howto.html DELETED --- --- faq.html DELETED --- |
From: <de...@us...> - 2003-11-04 08:06:25
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv11913 Added Files: .cvsignore Log Message: Update ignores to ignore maven generated artifacts. --- NEW FILE: .cvsignore --- *.log .classpath target *.ser junit*.properties .project |