|
From: <mla...@us...> - 2004-05-30 23:44:34
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1583/xdocs Modified Files: changes.xml faq.fml howto.xml index.xml properties.xml resources.xml Log Message: Documentations update for release of DbUnit 2.1 Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** changes.xml 23 Jan 2004 07:14:09 -0000 1.10 --- changes.xml 30 May 2004 23:44:03 -0000 1.11 *************** *** 8,11 **** --- 8,88 ---- <body> + <release version="2.1" date="May 31, 2004" description="Multiple bugfixes and enhancements."> + <action dev="" type="add"> + 741394 - New database compare Ant tag. See Ant task documentation. + </action> + <action dev="fspinazzi" type="add"> + New Comma Separated Values (CSV) dataset implementation. + </action> + <action dev="" type="add"> + 824328 & 948479 - Ability to add DOCTYPE declaration when writing a flat Xml dataset. See FAQ. + </action> + <action dev="" type="add"> + 884422 - FlatDtdWriter has now the ability to generate DTDs with choice model instead of sequence model. + </action> + <action dev="" type="add"> + Ability to import external file for binary data types like BLOB; the value can be either a qualified URL or a file path name. + </action> + <action dev="" type="update"> + Do not omit NULL values anymore in INSERT statements. Now only XmlDataSet's <none/> tag are omitted. With FlatXmlDataSet you must use the ReplacementDataSet to achieve the same behavior. + </action> + <action dev="" type="fix"> + 937732 - XlsDataSet now use UTF-16 encoding to support Asian characters. Patch submitted by Shuhei Kondo. + </action> + <action dev="" type="fix"> + Applied XlsTable empty table detection patch submitted by Deepak Kaimal. + </action> + <action dev="" type="fix"> + Added back FlatXmlDataSet constructors taking URL as argument missing in version 2.0. + </action> + <action dev="" type="fix"> + 918631 & 925585 - Fixed FlatXmlDataSet constructors taking InputStream/Reader for loading DTD. + </action> + <action dev="" type="fix"> + DELETE_ALL operation now deletes tables only *once* in reverse order they are encountered. Before, duplicate tables were resulting in multiple deletes. Patch submitted by John Hurst. + </action> + <action dev="" type="update"> + DELETE_ALL operation now compatible with StreamingDataSet. + </action> + <action dev="" type="fix"> + 947330 - Now closing ResultSet before Statement to fix exceptions thrown by the Firebird JDBC driver and the OpenBase 8.0 JDBC driver. + </action> + <action dev="" type="fix"> + 921869 - Fixed ParameterIndexOutOfBoundsException with InterBase. + </action> + <action dev="" type="update"> + 947809 - Moved createMetaData() static method from AbstractResultSet to DatabaseTableMetaData and made it public. Can now be used to create ITable from a ResultSet. + </action> + <action dev="" type="fix"> + Support for large Oracle BLOB. Must use OracleDataTypeFactory. + </action> + <action dev="" type="add"> + Oracle LONG RAW data type support via OracleDataTypeFactory. Original patch submitted by Markus Muller. + </action> + <action dev="" type="fix"> + Added back support for Oracle FLOAT missing in DbUnit 2.0. Must use OracleDataTypeFactory. + </action> + <action dev="" type="add"> + Support for Oracle NCHAR2 as proposed by Deepak Kaimal. Must use OracleDataTypeFactory. + </action> + <action dev="" type="update"> + Added DataType.isDateTime() method proposed by Ayman Mahfouz. + </action> + <action dev="" type="add"> + 726366 & 884422 - Added IColumnFilter interface. Can be used to filter out some table columns. See FAQ. + </action> + <action dev="" type="update"> + Renamed ITableFilter.isValidName() method to accept() to be consistent with the new IColumnFilter interface. + </action> + <action dev="" type="add"> + 955354 - Ability to determine the primary keys with IColumnFilter interface instead of DatabaseMetaData.getPrimaryKeys(). Primary keys sequence is not predictable when using filter. See FAQ. + </action> + <action dev="" type="add"> + Ability to plug custom IDENTITY column detection strategy for InsertIdentityOperation when using user defined types. See FAQ. + </action> + <action dev="" type="add"> + Added DefaultTableFilter class, which combines capability of the Include/ExcludeTableFilter classes. + </action> + </release> <release version="2.0" date="January 22, 2004" description="Major release."> <action dev="" type="update"> Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** faq.fml 28 May 2004 22:14:03 -0000 1.18 --- faq.fml 30 May 2004 23:44:15 -0000 1.19 *************** *** 168,172 **** <p> Be aware that REFRESH, DELETE and UPDATE operations are not compatible with tables without ! primary keys, thus are not usable with views. CLEAN_INSERT, INSERT and DELETE_ALL operations are compatible with views. </p> --- 168,172 ---- <p> Be aware that REFRESH, DELETE and UPDATE operations are not compatible with tables without ! primary keys. They are not usable with views without <a href="#customprimarykeys">overriding primary keys detection</a>. CLEAN_INSERT, INSERT and DELETE_ALL operations are compatible with views. </p> *************** *** 174,178 **** </faq> ! <faq id="views"> <question> How to enable batched statement? --- 174,178 ---- </faq> ! <faq id="batchstatement"> <question> How to enable batched statement? *************** *** 367,372 **** </answer> </faq> ! </part> <part id="use"> <title>Errors</title> --- 367,462 ---- </answer> </faq> ! <faq id="doctypeexport"> ! <question> ! How to add the DOCTYPE declaration when writing a flat XML dataset? ! </question> ! <answer> ! <p> ! Use the setDocType() method of the FlatXmlWriter class like this: ! <source> ! FlatXmlWriter datasetWriter = new FlatXmlWriter( ! new FileOutputStream("dataset.xml")); ! datasetWriter.setDocType("dataset.dtd"); ! datasetWriter.write(connection.createDataSet()); ! </source> ! This can also be done with the <a href="anttask.html">DbUnit Ant task</a>. ! </p> ! </answer> ! </faq> ! ! <faq id="columnfilter"> ! <question> ! How to exclude some table columns at runtime? ! </question> ! <answer> ! <p> ! The FilteredTableMetaData class, introduced in DbUnit 2.1, can be used in combination with the IColumnFilter interface to decide the inclusion or exclusion of table columns at runtime. ! <source> ! FilteredTableMetaData metaData = new FilteredTableMetaData( ! originalTable.getTableMetaData(), new MyColumnFilter()); ! ITable filteredTable = new CompositeTable(metaData, originalTable); ! </source> ! </p> ! <p> ! You can use your own IColumnFilter implementation or use the DefaultColumnFilter class provided by DbUnit. DefaultColumnFilter supports wildcards. This class also offers some convenience methods, includedColumnsTable() and excludedColumnsTable(), to ease creation of column filtered table. ! <br/> ! The following sample demonstrates the usage of DefaultColumnFilter to exclude all columns prefixed with "PK" or suffixed by "TIME". ! </p> ! <source> ! DefaultColumnFilter columnFilter = new DefaultColumnFilter(); ! columnFilter.excludeColumn("PK*"); ! columnFilter.excludeColumn("*TIME"); ! ! FilteredTableMetaData metaData = new FilteredTableMetaData( ! originalTable.getTableMetaData(), columnFilter); ! </source> ! <p> ! Same than above but using the excludedColumnsTable() convenience method. ! <source> ! ITable filteredTable = DefaultColumnFilter.excludedColumnsTable( ! originalTable, new String[]{"PK*", "*TIME"}); ! </source> ! </p> ! <p> ! See also <a href="howto.html#compareignorecolumns">Ignoring some columns in comparison</a>. ! </p> ! </answer> ! </faq> ! ! <faq id="usertypeidentity"> ! <question> ! How to use InsertIdentityOperation with user defined types? ! </question> ! <answer> ! <p> ! The IColumnFilter interface is now used by InsertIdentityOperation to detect identity columns. The default implementation assumes that type name of identity columns end with "identity". If you are using user defined types that does not follow this assumption you can now provide your own implementation via the <a href="properties.html#identitycolumnfilter">MS SQL identity column filter property</a>. ! <source> ! IDatabaseConnection connection = new DatabaseConnection(jdbcConnection); ! connection.getConfig().setProperty( ! "http://www.dbunit.org/properties/mssql/identityColumnFilter", ! new MyIndentityFilter()); ! </source> ! </p> ! </answer> ! </faq> ! ! <faq id="customprimarykeys"> ! <question> ! How to customize primary keys detection? ! </question> ! <answer> ! <p> ! The IColumnFilter interface can also be used to determine which columns are primary keys instead of using DatabaseMetaData.getPrimaryKeys(). This can be useful if your primary keys are not explicitly defined in your database model. ! <source> ! IDatabaseConnection connection = new DatabaseConnection(jdbcConnection); ! connection.getConfig().setProperty( ! "http://www.dbunit.org/properties/primaryKeyFilter", ! new MyPrimaryKeyFilter()); ! </source> ! </p> ! </answer> ! </faq> + </part> <part id="use"> <title>Errors</title> Index: howto.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/howto.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** howto.xml 15 Jan 2004 03:11:27 -0000 1.2 --- howto.xml 30 May 2004 23:44:15 -0000 1.3 *************** *** 162,170 **** // Load expected data from an XML dataset ! IDataSet expectedDataSet = new FlatXmlDataSet("expectedDataSet.xml"); ITable expectedTable = expectedDataSet.getTable("TABLE_NAME"); // Assert actual database table match expected table ! Assertion.assertEquals(expectedTable, databaseTable); } }</source> </p> --- 162,170 ---- // Load expected data from an XML dataset ! IDataSet expectedDataSet = new FlatXmlDataSet(new File("expectedDataSet.xml")); ITable expectedTable = expectedDataSet.getTable("TABLE_NAME"); // Assert actual database table match expected table ! Assertion.assertEquals(expectedTable, expectedTable); } }</source> </p> *************** *** 185,196 **** "SELECT * FROM TABLE1, TABLE2 WHERE ..."); </source> </p> ! <h4>Ignoring some columns </h4> ! <p>The following code snippet shows you how to ignore some columns in the ! comparison. To works, the actual table MUST contain at least ALL the columns ! from the expected table. Extra columns can exist in the actual table but ! not in the expected one. ! <source> Assertion.assertEquals(expected, ! new CompositeTable(expected.getTableMetaData(), actual)); </source> ! </p> <a name="roworder"><h4>Row ordering</h4></a> <p>By default, database table snapshot taken by DbUnit are sorted by primary --- 185,205 ---- "SELECT * FROM TABLE1, TABLE2 WHERE ..."); </source> </p> ! <a name="compareignorecolumns"><h4>Ignoring some columns in comparison</h4></a> ! <p> ! Sometimes this is desirable to ignore some columns to perform the comparison; particularly for primary keys, date or time columns having values generated by the code under test. ! One way to do this is to omit to declare unwanted columns in your expected table. You can then filter the actual database table to only expose the expected table columns. ! <br/> ! The following code snippet shows you how to filter the actual table. To works, the actual table MUST contain at least ALL the columns from the expected table. Extra columns can exist in the actual table but not in the expected one. ! <source> ! ITable filteredTable = DefaultColumnFilter.includedColumnsTable(actual, ! expected.getTableMetaData().getColumns()); ! Assertion.assertEquals(expected, filteredTable); ! </source> ! </p> ! <p> ! A major limitation of this technique is that you cannot use a DTD with your expected flat XML dataset. With a DTD you need to filter columns from both the expected and the actual table. See the FAQ about ! <a href="faq.html#columnfilter">excluding some table columns at runtime</a>. ! </p> ! <a name="roworder"><h4>Row ordering</h4></a> <p>By default, database table snapshot taken by DbUnit are sorted by primary Index: index.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/index.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** index.xml 28 Apr 2004 19:02:35 -0000 1.9 --- index.xml 30 May 2004 23:44:15 -0000 1.10 *************** *** 26,29 **** --- 26,33 ---- <table border="1"> <tr> + <td>2004-05-31</td> + <td><b>Version 2.1 released.</b> Multiple bugfixes and enhancements. See <a href="changes-report.html#2.1">changes</a>.</td> + </tr> + <tr> <td>2004-04-28</td> <td>DeveloperWorks article: <a href="http://www-106.ibm.com/developerworks/library/j-dbunit.html?ca=drs-j1604">Control your test-environement with DbUnit and Anthill</a>.</td> Index: properties.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/properties.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** properties.xml 9 Feb 2004 18:13:22 -0000 1.6 --- properties.xml 30 May 2004 23:44:15 -0000 1.7 *************** *** 179,181 **** --- 179,216 ---- </table> + <a name="primarykeysfilter"></a> + <h4>Primary keys filter</h4> + <table border="1"> + <tr> + <td>Property ID</td> + <td>http://www.dbunit.org/properties/primaryKeyFilter</td> + </tr> + <tr> + <td>Default</td> + <td><i>none</i></td> + </tr> + <tr> + <td>Description</td> + <td>Use to override primary keys detection. The Object must implement + org.dbunit.dataset.filter.IColumnFilter.</td> + </tr> + </table> + + <a name="identitycolumnfilter"></a> + <h4>MS SQL Server IDENTITY column filter</h4> + <table border="1"> + <tr> + <td>Property ID</td> + <td>http://www.dbunit.org/properties/mssql/identityColumnFilter</td> + </tr> + <tr> + <td>Default</td> + <td><i>none</i></td> + </tr> + <tr> + <td>Description</td> + <td>Use to override IDENTITY column detection. The Object must implement + org.dbunit.dataset.filter.IColumnFilter.</td> + </tr> + </table> </section></body></document> \ No newline at end of file Index: resources.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/resources.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** resources.xml 26 Jan 2004 16:48:03 -0000 1.5 --- resources.xml 30 May 2004 23:44:15 -0000 1.6 *************** *** 12,15 **** --- 12,19 ---- </tr> <tr> + <td><a name="controltestenv" href="http://www-106.ibm.com/developerworks/java/library/j-dbunit.html">Control your test-environment with DbUnit and Anthill</a></td> + <td>Learn how DbUnit can ease your testing and build process.</td> + </tr> + <tr> <td><a href="http://groups.yahoo.com/group/agileDatabases/">The Agile Database Mailing List</a></td> |