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
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv22463/src/java/org/dbunit Modified Files: Assertion.java DatabaseTestCase.java DatabaseUnitException.java DatabaseUnitRuntimeException.java Log Message: Standardized usage of "DbUnit.org" in license statement. Also optimized imports and added @since Javadoc tag to most files missing it. Index: Assertion.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/Assertion.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Assertion.java 9 Aug 2003 11:23:17 -0000 1.9 --- Assertion.java 22 Jan 2004 02:54:17 -0000 1.10 *************** *** 1,7 **** /* - * Assertion.java Mar 22, 2002 * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 1,6 ---- /* * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or *************** *** 23,31 **** package org.dbunit; - import java.util.Arrays; - import java.util.Comparator; - - import junit.framework.Assert; - import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; --- 22,25 ---- *************** *** 36,42 **** --- 30,42 ---- import org.dbunit.dataset.datatype.UnknownDataType; + import junit.framework.Assert; + + import java.util.Arrays; + import java.util.Comparator; + /** * @author Manuel Laflamme * @version $Revision$ + * @since Mar 22, 2002 */ public class Assertion Index: DatabaseTestCase.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/DatabaseTestCase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DatabaseTestCase.java 21 Jul 2003 21:01:03 -0000 1.9 --- DatabaseTestCase.java 22 Jan 2004 02:54:17 -0000 1.10 *************** *** 1,7 **** /* - * DatabaseTestCase.java Feb 17, 2002 * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 1,6 ---- /* * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or *************** *** 32,35 **** --- 31,35 ---- * @author Manuel Laflamme * @version $Revision$ + * @since Feb 17, 2002 */ public abstract class DatabaseTestCase extends TestCase Index: DatabaseUnitException.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/DatabaseUnitException.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DatabaseUnitException.java 13 Jun 2002 17:24:55 -0000 1.7 --- DatabaseUnitException.java 22 Jan 2004 02:54:17 -0000 1.8 *************** *** 2,6 **** * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 2,6 ---- * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or Index: DatabaseUnitRuntimeException.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/DatabaseUnitRuntimeException.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DatabaseUnitRuntimeException.java 13 Jun 2002 17:24:55 -0000 1.7 --- DatabaseUnitRuntimeException.java 22 Jan 2004 02:54:17 -0000 1.8 *************** *** 2,6 **** * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 2,6 ---- * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or |
From: <mla...@us...> - 2004-01-22 02:54:50
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv22463 Modified Files: LICENSE.txt Log Message: Standardized usage of "DbUnit.org" in license statement. Also optimized imports and added @since Javadoc tag to most files missing it. Index: LICENSE.txt =================================================================== RCS file: /cvsroot/dbunit/dbunit/LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LICENSE.txt 17 Jul 2003 00:54:50 -0000 1.1 --- LICENSE.txt 22 Jan 2004 02:54:17 -0000 1.2 *************** *** 1,4 **** The DbUnit Database Testing Framework ! Copyright (C)2002, Manuel Laflamme This library is free software; you can redistribute it and/or --- 1,4 ---- The DbUnit Database Testing Framework ! Copyright (C)2002-2004, DbUnit.org This library is free software; you can redistribute it and/or |
From: <mla...@us...> - 2004-01-22 01:55:47
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv12426/src/test/org/dbunit/dataset/datatype Modified Files: AbstractDataTypeFactoryTest.java Log Message: Fixed DATE mapping in OracleDataTypeFactory Index: AbstractDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/AbstractDataTypeFactoryTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractDataTypeFactoryTest.java 18 Aug 2003 11:13:08 -0000 1.1 --- AbstractDataTypeFactoryTest.java 22 Jan 2004 01:55:44 -0000 1.2 *************** *** 2,6 **** * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 2,6 ---- * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or *************** *** 60,64 **** DataType.FLOAT, DataType.DOUBLE, ! DataType.DATE, DataType.TIME, DataType.TIMESTAMP, --- 60,64 ---- DataType.FLOAT, DataType.DOUBLE, ! // DataType.DATE, DataType.TIME, DataType.TIMESTAMP, *************** *** 78,80 **** --- 78,90 ---- } + public void testCreateDateDataType() throws Exception + { + int sqlType = Types.DATE; + String sqlTypeName = "DATE"; + + DataType expected = DataType.DATE; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + } |
From: <mla...@us...> - 2004-01-22 00:11:45
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv25965/src/test/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactoryTest.java Log Message: Fixed DATE mapping in OracleDataTypeFactory Index: OracleDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OracleDataTypeFactoryTest.java 12 Jan 2004 18:18:19 -0000 1.3 --- OracleDataTypeFactoryTest.java 22 Jan 2004 00:11:42 -0000 1.4 *************** *** 2,6 **** * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 2,6 ---- * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or *************** *** 84,86 **** --- 84,96 ---- } + public void testCreateDateDataType() throws Exception + { + int sqlType = Types.DATE; + String sqlTypeName = "DATE"; + + DataType expected = DataType.TIMESTAMP; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + } |
From: <mla...@us...> - 2004-01-22 00:11:45
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv25965/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Log Message: Fixed DATE mapping in OracleDataTypeFactory Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OracleDataTypeFactory.java 12 Jan 2004 18:18:19 -0000 1.7 --- OracleDataTypeFactory.java 22 Jan 2004 00:11:42 -0000 1.8 *************** *** 2,6 **** * * The DbUnit Database Testing Framework ! * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or --- 2,6 ---- * * The DbUnit Database Testing Framework ! * Copyright (C)2002-2004, DbUnit.org * * This library is free software; you can redistribute it and/or *************** *** 40,43 **** --- 40,49 ---- public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { + // Map Oracle DATE to TIMESTAMP + if (sqlType == Types.DATE) + { + return DataType.TIMESTAMP; + } + if (sqlType == Types.OTHER) { *************** *** 61,65 **** // TIMESTAMP ! if (sqlType == Types.DATE || sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; --- 67,71 ---- // TIMESTAMP ! if (sqlTypeName.startsWith("TIMESTAMP")) { return DataType.TIMESTAMP; |
From: <mla...@us...> - 2004-01-21 00:20:12
|
Update of /cvsroot/dbunit/dbunit/lib In directory sc8-pr-cvs1:/tmp/cvs-serv10803/lib Removed Files: ant.jar crimson.jar hsqldb.jar j2ee.jar jakarta-poi-1.8.0-dev-20020919.jar junit.jar mockobjects-0.07-core.jar mockobjects-0.07-jdk1.3.jar mysql-connector-java-3.0.6-stable-bin.jar Log Message: Removed jars since we are now building with Maven. --- ant.jar DELETED --- --- crimson.jar DELETED --- --- hsqldb.jar DELETED --- --- j2ee.jar DELETED --- --- jakarta-poi-1.8.0-dev-20020919.jar DELETED --- --- junit.jar DELETED --- --- mockobjects-0.07-core.jar DELETED --- --- mockobjects-0.07-jdk1.3.jar DELETED --- --- mysql-connector-java-3.0.6-stable-bin.jar DELETED --- |
From: <mla...@us...> - 2004-01-20 14:45:48
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv13988/xdocs Modified Files: anttask.xml changes.xml components.xml faq.fml Log Message: Updated QueryDataSet samples Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** anttask.xml 19 Jan 2004 20:11:01 -0000 1.6 --- anttask.xml 20 Jan 2004 14:45:41 -0000 1.7 *************** *** 205,214 **** </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"/> --- 205,214 ---- </table> <h3>Examples</h3> ! <h4>Update operation with specified JDBC driver jar</h4> <source><![CDATA[ ! <dbunit driver="com.vendor.jdbc.Driver" ! url="jdbc:vendor:mydatabase" ! userid="user" ! password="password"> <classpath> <pathelement location="/some/jdbc.jar"/> *************** *** 219,226 **** <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"/> --- 219,226 ---- <h4>Insert and update operations</h4> <source><![CDATA[ ! <dbunit driver="com.vendor.jdbc.Driver" ! url="jdbc:vendor:mydatabase" ! userid="user" ! password="password"> <operation type="INSERT" src="insertFile.xml"/> <operation type="UPDATE" src="updateFile.xml"/> *************** *** 229,236 **** <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> --- 229,236 ---- <h4>Database data export to XML</h4> <source><![CDATA[ ! <dbunit driver="com.vendor.jdbc.Driver" ! url="jdbc:vendor:mydatabase" ! userid="user" ! password="password"> <export dest="export.xml"/> </dbunit>]]></source> *************** *** 238,257 **** <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> --- 238,259 ---- <h4>Database structure export to DTD</h4> <source><![CDATA[ ! <dbunit driver="com.vendor.jdbc.Driver" ! url="jdbc:vendor:mydatabase" ! userid="user" ! password="password"> <export dest="export.dtd" format="dtd"/> </dbunit>]]></source> ! <h4><a name="partialexport">Partial database data export</a></h4> ! <p>Export two tables: FOO, resulting from specified query and BAR, resulting from generated query "SELECT * FROM BAR"</p> <source><![CDATA[ ! <dbunit driver="com.vendor.jdbc.Driver" ! url="jdbc:vendor:mydatabase" ! userid="user" ! password="password"> <export dest="partial.xml"> ! <query name="FOO" sql="SELECT COL1, COL2, COL3 as 'COLSPECIAL' ! FROM BAR WHERE COL1=4"/> ! <table name="BAR"/> </export> </dbunit>]]></source> Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** changes.xml 19 Jan 2004 21:34:36 -0000 1.8 --- changes.xml 20 Jan 2004 14:45:41 -0000 1.9 *************** *** 16,20 **** </action> <action dev="" type="update"> ! Dramatic memory usage improvements to get rid of the infamous OutOfMemoryError. Need some setup to take advantage of some of them. See "OutOfMemoryError" FAQ. </action> <action dev="" type="add"> --- 16,20 ---- </action> <action dev="" type="update"> ! Dramatic memory usage improvements to get rid of the infamous OutOfMemoryError. May need setup to take advantage of some improved features. See "OutOfMemoryError" FAQ. </action> <action dev="" type="add"> *************** *** 22,26 **** </action> <action dev="" type="add"> ! New <code>ITableIterator</code> interface used to iterate thru dataset tables. Allows usage of efficient lazy tables initialization for some dataset implementations. The <code>IDataSet.getTables</code> method have been deprecated and should not be used anymore. </action> <action dev="" type="add"> --- 22,26 ---- </action> <action dev="" type="add"> ! New <code>ITableIterator</code> interface used to iterate thru dataset tables. Allows lazy tables initialization for some dataset implementations. The <code>IDataSet.getTables</code> method have been deprecated and usage should be avoided. </action> <action dev="" type="add"> *************** *** 31,35 **** </action> <action dev="" type="add"> ! New configurable DataType factory to easily integrates new custom data type with the DbUnit core. Multiple factory implementations available for some database vendors. Submit your own! </action> <action dev="" type="add"> --- 31,35 ---- </action> <action dev="" type="add"> ! Configurable data type factory to easily integrates new data types with the DbUnit core. Factory implementations available for some database vendors. Submit your own! </action> <action dev="" type="add"> *************** *** 58,62 **** </action> <action dev="" type="add"> ! New <code>ReplacementDataSet</code> decorator, which can replace decorated dataset values on the fly. Can be used as a new way to specify null values for flat XML dataset. </action> <action dev="" type="add"> --- 58,62 ---- </action> <action dev="" type="add"> ! New <code>ReplacementDataSet</code> decorator, which can replace decorated dataset values on the fly. Can be used with flat XML dataset as a new way to specify null values. </action> <action dev="" type="add"> Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** components.xml 19 Jan 2004 21:34:36 -0000 1.8 --- components.xml 20 Jan 2004 14:45:41 -0000 1.9 *************** *** 156,160 **** </tr> <tr> ! <td><a href="apidocs/org/dbunit/database/DatabaseDataSet.html">DatabaseDataSet</a></td> <td>Adapter that provides access to a database instance as a dataset. This class is not usually instantiated --- 156,160 ---- </tr> <tr> ! <td><a name="databasedataset" href="apidocs/org/dbunit/database/DatabaseDataSet.html">DatabaseDataSet</a></td> <td>Adapter that provides access to a database instance as a dataset. This class is not usually instantiated *************** *** 162,174 **** </tr> <tr> ! <td><a href="apidocs/org/dbunit/database/QueryDataSet.html">QueryDataSet</a></td> ! <td>Holds collection of tables resulting from database query.</td> </tr> <tr> ! <td><a href="apidocs/org/dbunit/dataset/DefaultDataSet.html">DefaultDataSet</a></td> <td>Uses to create datasets programmatically.</td> </tr> <tr> ! <td><a href="apidocs/org/dbunit/dataset/CompositeDataSet.html">CompositeDataSet</a></td> <td>Combines multiple datasets into a single logical dataset.</td> --- 162,183 ---- </tr> <tr> ! <td><a name="querydataset" href="apidocs/org/dbunit/database/QueryDataSet.html">QueryDataSet</a></td> ! <td>Holds collection of tables resulting from database queries. ! <br/> ! Following sample snippet creates a dataset containing two tables: FOO, resulting from specified query and BAR, resulting from generated query "SELECT * FROM BAR". ! <source> ! QueryDataSet dataSet = new QueryDataSet(connection); ! dataSet.addTable("FOO", "SELECT * FROM TABLE WHERE COL='VALUE'"); ! dataSet.addTable("BAR"); ! </source> ! ! </td> </tr> <tr> ! <td><a name="defaultdataset" href="apidocs/org/dbunit/dataset/DefaultDataSet.html">DefaultDataSet</a></td> <td>Uses to create datasets programmatically.</td> </tr> <tr> ! <td><a name="compositedataset" href="apidocs/org/dbunit/dataset/CompositeDataSet.html">CompositeDataSet</a></td> <td>Combines multiple datasets into a single logical dataset.</td> *************** *** 188,201 **** <tr> ! <td> ExcludeTableFilter </td> ! <td> Hides matching tables pattern without modifying the original table order. Support wildcards.</td> </tr> <tr> ! <td> SequenceTableFilter </td> ! <td> Exposes a configured table sequence and can be used to reorder dataset table. This is the original filtering strategy from DbUnit 1.x. </td> </tr> <tr> ! <td> DatabaseSequenceFilter ! </td> <td> Automatically determine the tables order using foreign/exported keys information. This strategy is vendor --- 197,209 ---- <tr> ! <td>ExcludeTableFilter </td> ! <td>Hides matching tables pattern without modifying the original table order. Support wildcards.</td> </tr> <tr> ! <td>SequenceTableFilter </td> ! <td>Exposes a configured table sequence and can be used to reorder dataset table. This is the original filtering strategy from DbUnit 1.x. </td> </tr> <tr> ! <td>DatabaseSequenceFilter</td> <td> Automatically determine the tables order using foreign/exported keys information. This strategy is vendor Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** faq.fml 19 Jan 2004 20:11:01 -0000 1.7 --- faq.fml 20 Jan 2004 14:45:41 -0000 1.8 *************** *** 82,87 **** // partial database export ! String[] tableNames = {"TABLE1", "TABLE2", "TABLE2"}; ! IDataSet partialDataSet = connection.createDataSet(tableNames); FlatXmlDataSet.write(partialDataSet, new FileOutputStream("partial.xml")); --- 82,88 ---- // partial database export ! QueryDataSet partialDataSet = new QueryDataSet(connection); ! partialDataSet.addTable("FOO", "SELECT * FROM TABLE WHERE COL='VALUE'"); ! partialDataSet.addTable("BAR"); FlatXmlDataSet.write(partialDataSet, new FileOutputStream("partial.xml")); *************** *** 172,176 **** <faq id="dateformat"> <question> ! What are the dates formats used by XML dataset implementations? </question> <answer> --- 173,177 ---- <faq id="dateformat"> <question> ! What are the dates formats supported by DbUnit? </question> <answer> *************** *** 208,212 **** </p> <p> ! Here is how to use the Oracle factory: <source> IDatabaseConnection connection = new DatabaseConnection( --- 209,213 ---- </p> <p> ! Here is how to setup the Oracle factory: <source> IDatabaseConnection connection = new DatabaseConnection( |
From: <mla...@us...> - 2004-01-19 21:38:07
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssqlserver In directory sc8-pr-cvs1:/tmp/cvs-serv4463/src/java/org/dbunit/ext/mssqlserver Removed Files: MsSqlConnection.java MsSqlDataTypeFactory.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. --- MsSqlConnection.java DELETED --- --- MsSqlDataTypeFactory.java DELETED --- |
From: <mla...@us...> - 2004-01-19 21:38:07
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql In directory sc8-pr-cvs1:/tmp/cvs-serv4463/src/java/org/dbunit/ext/mssql Added Files: InsertIdentityOperation.java MsSqlConnection.java MsSqlDataTypeFactory.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. --- NEW FILE: InsertIdentityOperation.java --- /* * InsertIdentityOperation.java * * The 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.ext.mssql; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.DefaultDataSet; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; import org.dbunit.dataset.ITableIterator; import org.dbunit.dataset.ITableMetaData; import org.dbunit.operation.CompositeOperation; import org.dbunit.operation.DatabaseOperation; import org.dbunit.operation.ExclusiveTransactionException; import org.dbunit.operation.AbstractOperation; /** * This class disable the MS SQL Server automatic identifier generation for * the execution of inserts. * <p> * If you are using the Microsoft driver (i.e. * <code>com.microsoft.jdbc.sqlserver.SQLServerDriver</code>), you'll need to * use the <code>SelectMethod=cursor</code> parameter in the JDBC connection * string. Your databaseUrl would look something like the following: * <p> * <code>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor</code> * <p> * Thanks to Jeremy Stein how have submited multiple patches. * * @author Manuel Laflamme * @author Eric Pugh * @version $Revision: 1.1 $ * @since Apr 9, 2002 */ public class InsertIdentityOperation extends AbstractOperation { public static final DatabaseOperation INSERT = new InsertIdentityOperation(DatabaseOperation.INSERT); public static final DatabaseOperation CLEAN_INSERT = new CompositeOperation(DatabaseOperation.DELETE_ALL, new InsertIdentityOperation(DatabaseOperation.INSERT)); public static final DatabaseOperation REFRESH = new InsertIdentityOperation(DatabaseOperation.REFRESH); private final DatabaseOperation _operation; /** * Creates a new InsertIdentityOperation object that decorates the * specified operation. */ public InsertIdentityOperation(DatabaseOperation operation) { _operation = operation; } protected boolean hasIdentityColumn(ITableMetaData metaData) throws DataSetException { // check all columns to see if they are an identity column Column[] columns = metaData.getColumns(); for (int i = 0; i < columns.length; i++) { if (columns[i].getSqlTypeName().endsWith("identity")) { return true; } } return false; } //////////////////////////////////////////////////////////////////////////// // DatabaseOperation class public void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException { Connection jdbcConnection = connection.getConnection(); Statement statement = jdbcConnection.createStatement(); try { IDataSet databaseDataSet = connection.createDataSet(); // INSERT_IDENTITY need to be enabled/disabled inside the // same transaction if (jdbcConnection.getAutoCommit() == false) { throw new ExclusiveTransactionException(); } jdbcConnection.setAutoCommit(false); // Execute decorated operation one table at a time ITableIterator iterator = dataSet.iterator(); while(iterator.next()) { ITable table = iterator.getTable(); String tableName = table.getTableMetaData().getTableName(); ITableMetaData metaData = databaseDataSet.getTableMetaData(tableName); // enable identity insert boolean hasIdentityColumn = hasIdentityColumn(metaData); if (hasIdentityColumn) { StringBuffer sqlBuffer = new StringBuffer(128); sqlBuffer.append("SET IDENTITY_INSERT "); sqlBuffer.append(getQualifiedName(connection.getSchema(), metaData.getTableName(), connection)); sqlBuffer.append(" ON"); statement.execute(sqlBuffer.toString()); } try { _operation.execute(connection, new DefaultDataSet(table)); } finally { // disable identity insert if (hasIdentityColumn) { StringBuffer sqlBuffer = new StringBuffer(128); sqlBuffer.append("SET IDENTITY_INSERT "); sqlBuffer.append(getQualifiedName(connection.getSchema(), metaData.getTableName(), connection)); sqlBuffer.append(" OFF"); statement.execute(sqlBuffer.toString()); } jdbcConnection.commit(); } } } finally { jdbcConnection.setAutoCommit(true); statement.close(); } } } --- NEW FILE: MsSqlConnection.java --- /* * * The 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.ext.mssql; import org.dbunit.database.DatabaseConfig; import org.dbunit.database.DatabaseConnection; import org.dbunit.dataset.FilteredDataSet; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.filter.ExcludeTableFilter; import org.dbunit.dataset.filter.ITableFilter; import java.sql.Connection; import java.sql.SQLException; /** * @author Manuel Laflamme * @since May 19, 2003 * @version $Revision: 1.1 $ */ public class MsSqlConnection extends DatabaseConnection { private final ITableFilter _filter = new ExcludeTableFilter( new String[] {"dtproperties"}); /** * Creates a new <code>MsSqlConnection</code>. * * @param connection the adapted JDBC connection * @param schema the database schema */ public MsSqlConnection(Connection connection, String schema) { super(connection, schema); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MsSqlDataTypeFactory()); } /** * Creates a new <code>MsSqlConnection</code>. * * @param connection the adapted JDBC connection */ public MsSqlConnection(Connection connection) { super(connection); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MsSqlDataTypeFactory()); } //////////////////////////////////////////////////////////////////////////// // IDatabaseConnection public IDataSet createDataSet() throws SQLException { IDataSet dataSet = super.createDataSet(); return new FilteredDataSet(_filter, dataSet); } public IDataSet createDataSet(String[] tableNames) throws SQLException { IDataSet dataSet = super.createDataSet(tableNames); return new FilteredDataSet(_filter, dataSet); } } --- NEW FILE: MsSqlDataTypeFactory.java --- /* * * The 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.ext.mssql; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.DataTypeException; import org.dbunit.dataset.datatype.DefaultDataTypeFactory; /** * Specialized factory that recognizes MS SQL Server data types. * * @author Manuel Laflamme * @since May 19, 2003 * @version $Revision: 1.1 $ */ public class MsSqlDataTypeFactory extends DefaultDataTypeFactory { public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { // TODO : Process MS SQL Server custom datatype here // if (sqlType == custom1) // { // return CUSTOM1; // } // // if (sqlType == custom2) // { // return CUSTOM2; // } return super.createDataType(sqlType, sqlTypeName); } } |
From: <mla...@us...> - 2004-01-19 21:37:38
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql In directory sc8-pr-cvs1:/tmp/cvs-serv4283/mssql Log Message: Directory /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql added to the repository |
From: <mla...@us...> - 2004-01-19 21:34:39
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation/mssqlserver In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/test/org/dbunit/operation/mssqlserver Removed Files: AllTests.java InsertIdentityOperationTest.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. --- AllTests.java DELETED --- --- InsertIdentityOperationTest.java DELETED --- |
From: <mla...@us...> - 2004-01-19 21:34:39
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mssql In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/test/org/dbunit/ext/mssql Added Files: AllTests.java InsertIdentityOperationTest.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. --- NEW FILE: AllTests.java --- /* * * The 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.ext.mssql; import org.dbunit.DatabaseEnvironment; import org.dbunit.TestFeature; import junit.framework.Test; import junit.framework.TestSuite; /** * @author Manuel Laflamme * @since Apr 11, 2003 * @version $Revision: 1.1 $ */ public class AllTests { public static Test suite() throws Exception { TestSuite suite = new TestSuite(); DatabaseEnvironment environment = DatabaseEnvironment.getInstance(); if (environment.support(TestFeature.INSERT_IDENTITY)) { suite.addTest(new TestSuite(InsertIdentityOperationTest.class)); } return suite; } } --- NEW FILE: InsertIdentityOperationTest.java --- /* * InsertIdentityOperationTest.java Feb 19, 2002 * * 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.ext.mssql; import org.dbunit.AbstractDatabaseTest; import org.dbunit.Assertion; import org.dbunit.dataset.DataSetUtils; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; import org.dbunit.dataset.LowerCaseDataSet; import org.dbunit.dataset.ForwardOnlyDataSet; import org.dbunit.dataset.xml.FlatXmlDataSet; import org.dbunit.dataset.xml.XmlDataSet; import java.io.FileReader; import java.io.Reader; /** * @author Manuel Laflamme * @author Eric Pugh * @version $Revision: 1.1 $ */ public class InsertIdentityOperationTest extends AbstractDatabaseTest { public InsertIdentityOperationTest(String s) { super(s); } public void testExecuteXML() throws Exception { Reader in = new FileReader("src/xml/insertIdentityOperationTest.xml"); IDataSet dataSet = new XmlDataSet(in); testExecute(dataSet); } public void testExecuteFlatXML() throws Exception { Reader in = new FileReader("src/xml/insertIdentityOperationTestFlat.xml"); IDataSet dataSet = new FlatXmlDataSet(in); testExecute(dataSet); } public void testExecuteLowerCase() throws Exception { Reader in = new FileReader("src/xml/insertIdentityOperationTestFlat.xml"); IDataSet dataSet = new LowerCaseDataSet(new FlatXmlDataSet(in)); testExecute(dataSet); } public void testExecuteForwardOnly() throws Exception { Reader in = new FileReader("src/xml/insertIdentityOperationTestFlat.xml"); IDataSet dataSet = new ForwardOnlyDataSet(new FlatXmlDataSet(in)); testExecute(dataSet); } private void testExecute(IDataSet dataSet) throws Exception { ITable[] tablesBefore = DataSetUtils.getTables(_connection.createDataSet()); // InsertIdentityOperation.CLEAN_INSERT.execute(_connection, dataSet); InsertIdentityOperation.INSERT.execute(_connection, dataSet); ITable[] tablesAfter = DataSetUtils.getTables(_connection.createDataSet()); assertEquals("table count", tablesBefore.length, tablesAfter.length); // Verify tables after for (int i = 0; i < tablesAfter.length; i++) { ITable tableBefore = tablesBefore[i]; ITable tableAfter = tablesAfter[i]; String name = tableAfter.getTableMetaData().getTableName(); if (name.startsWith("IDENTITY")) { assertEquals("row count before: " + name, 0, tableBefore.getRowCount()); if (dataSet instanceof ForwardOnlyDataSet) { assertTrue(name, tableAfter.getRowCount() > 0); } else { Assertion.assertEquals(dataSet.getTable(name), tableAfter); } } else { // Other tables should have not been affected Assertion.assertEquals(tableBefore, tableAfter); } } } /* test case was added to validate the bug that tables with Identity columns that are not one of the primary keys are able to figure out if an IDENTITY_INSERT is needed. Thanks to Gaetano Di Gregorio for finding the bug. */ public void testIdentityInsertNoPK() throws Exception { Reader in = new FileReader("src/xml/insertIdentityOperationTestNoPK.xml"); IDataSet xmlDataSet = new FlatXmlDataSet(in); ITable[] tablesBefore = DataSetUtils.getTables(_connection.createDataSet()); InsertIdentityOperation.CLEAN_INSERT.execute(_connection, xmlDataSet); ITable[] tablesAfter = DataSetUtils.getTables(_connection.createDataSet()); // Verify tables after for (int i = 0; i < tablesAfter.length; i++) { ITable tableBefore = tablesBefore[i]; ITable tableAfter = tablesAfter[i]; String name = tableAfter.getTableMetaData().getTableName(); if (name.equals("TEST_IDENTITY_NOT_PK")) { assertEquals("row count before: " + name, 0, tableBefore.getRowCount()); Assertion.assertEquals(xmlDataSet.getTable(name), tableAfter); } else { // Other tables should have not been affected Assertion.assertEquals(tableBefore, tableAfter); } } } } |
From: <mla...@us...> - 2004-01-19 21:34:39
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv3315/xdocs Modified Files: changes.xml components.xml Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** changes.xml 19 Jan 2004 20:11:01 -0000 1.7 --- changes.xml 19 Jan 2004 21:34:36 -0000 1.8 *************** *** 69,72 **** --- 69,75 ---- INSERT, CLEAN_INSERT and REFRESH operations do not override database default values anymore with null values. Null values are now omitted from insert statements. Operations use multiple prepared statements for the same table, when null values vary from row to row. </action> + <action dev="" type="update"> + Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. + </action> </release> Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** components.xml 19 Jan 2004 20:11:01 -0000 1.7 --- components.xml 19 Jan 2004 21:34:36 -0000 1.8 *************** *** 320,324 **** </tr> <tr> ! <td><a name="InsertIdentityOperation" href="apidocs/org/dbunit/operation/mssqlserver/InsertIdentityOperation.html">IdentityInsertOperation</a></td> <td>This operation decorates an insert operation and disables the MS SQL Server automatic identifier generation (IDENTITY) during its execution. --- 320,324 ---- </tr> <tr> ! <td><a name="InsertIdentityOperation" href="apidocs/org/dbunit/ext/mssql/InsertIdentityOperation.html">IdentityInsertOperation</a></td> <td>This operation decorates an insert operation and disables the MS SQL Server automatic identifier generation (IDENTITY) during its execution. |
From: <mla...@us...> - 2004-01-19 21:34:39
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/test/org/dbunit/operation Modified Files: AllTests.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation/AllTests.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AllTests.java 13 Apr 2003 17:46:11 -0000 1.9 --- AllTests.java 19 Jan 2004 21:34:35 -0000 1.10 *************** *** 39,43 **** TestSuite suite = new TestSuite(); - suite.addTest(org.dbunit.operation.mssqlserver.AllTests.suite()); suite.addTest(new TestSuite(AbstractBatchOperationTest.class)); suite.addTest(new TestSuite(CloseConnectionOperationTest.class)); --- 39,42 ---- |
From: <mla...@us...> - 2004-01-19 21:34:38
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/test/org/dbunit/ext Modified Files: AllTests.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/AllTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AllTests.java 4 Sep 2003 16:50:17 -0000 1.2 --- AllTests.java 19 Jan 2004 21:34:35 -0000 1.3 *************** *** 31,38 **** public class AllTests { ! public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(org.dbunit.ext.db2.AllTests.suite()); suite.addTest(org.dbunit.ext.mysql.AllTests.suite()); suite.addTest(org.dbunit.ext.oracle.AllTests.suite()); --- 31,39 ---- public class AllTests { ! public static Test suite() throws Exception { TestSuite suite = new TestSuite(); suite.addTest(org.dbunit.ext.db2.AllTests.suite()); + suite.addTest(org.dbunit.ext.mssql.AllTests.suite()); suite.addTest(org.dbunit.ext.mysql.AllTests.suite()); suite.addTest(org.dbunit.ext.oracle.AllTests.suite()); |
From: <mla...@us...> - 2004-01-19 21:34:38
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/test/org/dbunit/ant Modified Files: DbUnitTaskTest.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: DbUnitTaskTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant/DbUnitTaskTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DbUnitTaskTest.java 9 Sep 2003 17:58:48 -0000 1.11 --- DbUnitTaskTest.java 19 Jan 2004 21:34:35 -0000 1.12 *************** *** 29,33 **** import org.dbunit.database.DatabaseConfig; import org.dbunit.operation.DatabaseOperation; ! import org.dbunit.operation.mssqlserver.InsertIdentityOperation; import java.io.File; --- 29,33 ---- import org.dbunit.database.DatabaseConfig; import org.dbunit.operation.DatabaseOperation; ! import org.dbunit.ext.mssql.InsertIdentityOperation; import java.io.File; |
From: <mla...@us...> - 2004-01-19 21:34:38
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/mssqlserver In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/java/org/dbunit/operation/mssqlserver Modified Files: InsertIdentityOperation.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: InsertIdentityOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/mssqlserver/InsertIdentityOperation.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** InsertIdentityOperation.java 18 Jan 2004 16:39:24 -0000 1.20 --- InsertIdentityOperation.java 19 Jan 2004 21:34:35 -0000 1.21 *************** *** 1,4 **** /* ! * InsertIdentityOperation.java Apr 9, 2002 * * The DbUnit Database Testing Framework --- 1,4 ---- /* ! * InsertIdentityOperation.java * * The DbUnit Database Testing Framework *************** *** 50,74 **** * <code>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor</code> * <p> ! * Thanks to <a href="mailto:ep...@up...">Eric Pugh</a> for having ! * submitted the original patch and for the beta testing. ! * Another special thanks to Jeremy Stein how have submited multiple patches. * * @author Manuel Laflamme * @version $Revision$ */ ! public class InsertIdentityOperation extends AbstractOperation { - public static final DatabaseOperation INSERT = - new InsertIdentityOperation(DatabaseOperation.INSERT); - - public static final DatabaseOperation CLEAN_INSERT = - new CompositeOperation(DatabaseOperation.DELETE_ALL, - new InsertIdentityOperation(DatabaseOperation.INSERT)); - - public static final DatabaseOperation REFRESH = - new InsertIdentityOperation(DatabaseOperation.REFRESH); - - private final DatabaseOperation _operation; - /** * Creates a new InsertIdentityOperation object that decorates the --- 50,63 ---- * <code>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor</code> * <p> ! * Thanks to Jeremy Stein who have submited multiple patches. * * @author Manuel Laflamme + * @author Eric Pugh * @version $Revision$ + * @since Apr 9, 2002 + * @deprecated Replaced by {@link org.dbunit.ext.mssql.InsertIdentityOperation}. Be warned, this class will eventually be removed. */ ! public class InsertIdentityOperation extends org.dbunit.ext.mssql.InsertIdentityOperation { /** * Creates a new InsertIdentityOperation object that decorates the *************** *** 77,170 **** public InsertIdentityOperation(DatabaseOperation operation) { ! _operation = operation; ! } ! ! protected boolean hasIdentityColumn(ITableMetaData metaData) ! throws DataSetException ! { ! // check all columns to see if they are an identity column ! Column[] columns = metaData.getColumns(); ! ! for (int i = 0; i < columns.length; i++) ! { ! if (columns[i].getSqlTypeName().endsWith("identity")) ! { ! return true; ! } ! } ! ! return false; ! } ! ! //////////////////////////////////////////////////////////////////////////// ! // DatabaseOperation class ! ! public void execute(IDatabaseConnection connection, IDataSet dataSet) ! throws DatabaseUnitException, SQLException ! { ! Connection jdbcConnection = connection.getConnection(); ! Statement statement = jdbcConnection.createStatement(); ! ! try ! { ! IDataSet databaseDataSet = connection.createDataSet(); ! ! ! // INSERT_IDENTITY need to be enabled/disabled inside the ! // same transaction ! if (jdbcConnection.getAutoCommit() == false) ! { ! throw new ExclusiveTransactionException(); ! } ! jdbcConnection.setAutoCommit(false); ! ! // Execute decorated operation one table at a time ! ITableIterator iterator = dataSet.iterator(); ! while(iterator.next()) ! { ! ITable table = iterator.getTable(); ! String tableName = table.getTableMetaData().getTableName(); ! ! ITableMetaData metaData = ! databaseDataSet.getTableMetaData(tableName); ! ! // enable identity insert ! boolean hasIdentityColumn = hasIdentityColumn(metaData); ! ! if (hasIdentityColumn) ! { ! StringBuffer sqlBuffer = new StringBuffer(128); ! sqlBuffer.append("SET IDENTITY_INSERT "); ! sqlBuffer.append(getQualifiedName(connection.getSchema(), ! metaData.getTableName(), connection)); ! sqlBuffer.append(" ON"); ! statement.execute(sqlBuffer.toString()); ! } ! ! try ! { ! _operation.execute(connection, new DefaultDataSet(table)); ! } ! finally ! { ! // disable identity insert ! if (hasIdentityColumn) ! { ! StringBuffer sqlBuffer = new StringBuffer(128); ! sqlBuffer.append("SET IDENTITY_INSERT "); ! sqlBuffer.append(getQualifiedName(connection.getSchema(), ! metaData.getTableName(), connection)); ! sqlBuffer.append(" OFF"); ! statement.execute(sqlBuffer.toString()); ! } ! jdbcConnection.commit(); ! } ! } ! } ! finally ! { ! jdbcConnection.setAutoCommit(true); ! statement.close(); ! } } } --- 66,70 ---- public InsertIdentityOperation(DatabaseOperation operation) { ! super(operation); } } |
From: <mla...@us...> - 2004-01-19 21:34:38
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1:/tmp/cvs-serv3315/src/java/org/dbunit/ant Modified Files: Operation.java Log Message: Moved InsertIdentityOperation to "org.dbunit.ext.mssql" package to be consistent with other vendor extensions. Temporary keep a deprecated copy in "org.dbunit.operation.mssqlserver" to ease transition to DbUnit 2. Should be the last major refactoring before DbUnit 2.0 release. Index: Operation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Operation.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Operation.java 10 Oct 2003 21:12:37 -0000 1.9 --- Operation.java 19 Jan 2004 21:34:35 -0000 1.10 *************** *** 34,38 **** import org.dbunit.dataset.xml.FlatXmlProducer; import org.dbunit.operation.DatabaseOperation; ! import org.dbunit.operation.mssqlserver.InsertIdentityOperation; import org.xml.sax.InputSource; --- 34,38 ---- import org.dbunit.dataset.xml.FlatXmlProducer; import org.dbunit.operation.DatabaseOperation; ! import org.dbunit.ext.mssql.InsertIdentityOperation; import org.xml.sax.InputSource; |
From: <mla...@us...> - 2004-01-19 21:15:02
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mssql In directory sc8-pr-cvs1:/tmp/cvs-serv27634/mssql Log Message: Directory /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mssql added to the repository |
From: <mla...@us...> - 2004-01-19 20:11:04
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv9413/xdocs Modified Files: anttask.xml changes.xml components.xml faq.fml index.xml resources.xml Log Message: Multiple minor xdoc update for release 2. Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** anttask.xml 18 Jan 2004 18:26:23 -0000 1.5 --- anttask.xml 19 Jan 2004 20:11:01 -0000 1.6 *************** *** 1,4 **** <?xml version="1.0" encoding="ISO-8859-1"?> ! <document><properties><title>The Dbunit Framework - Ant Task</title></properties><body><section> <h3>Ant Integration</h3> <h4>Installation</h4> --- 1,4 ---- <?xml version="1.0" encoding="ISO-8859-1"?> ! <document><properties><title>Ant Integration</title></properties><body><section> <h3>Ant Integration</h3> <h4>Installation</h4> Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** changes.xml 18 Jan 2004 18:26:23 -0000 1.6 --- changes.xml 19 Jan 2004 20:11:01 -0000 1.7 *************** *** 10,14 **** <release version="2.0" date="January ?, 2004" description="Major release."> <action dev="" type="update"> ! DbUnit is now build with Maven! </action> <action dev="" type="update"> --- 10,14 ---- <release version="2.0" date="January ?, 2004" description="Major release."> <action dev="" type="update"> ! Mavenized the build and the website! </action> <action dev="" type="update"> Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** components.xml 18 Jan 2004 18:26:23 -0000 1.6 --- components.xml 19 Jan 2004 20:11:01 -0000 1.7 *************** *** 48,93 **** <h3><a name="dataset">IDataSet</a></h3> <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection ! of tables. ! <source> ! public interface IDataSet ! { ! /** ! * Returns table names from this dataset in proper order. ! * multiple occurence of the same name may be returned if ! * more 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) ! throws DataSetException; ! ! /** ! * Returns the specified table. ! */ ! public ITable getTable(String tableName) ! throws DataSetException; ! ! /** ! * Returns an iterator over the tables in this dataset ! * in proper order. ! */ ! public ITableIterator iterator() ! throws DataSetException; ! ! /** ! * Returns an iterator over the tables in this dataset ! * in reverse order. ! */ ! public ITableIterator reverseIterator() ! throws DataSetException; ! }</source> </p> ! <p>IDataSet implemetations provided by DbUnit: ! <table border="1"> <tr> --- 48,54 ---- <h3><a name="dataset">IDataSet</a></h3> <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection ! of tables. This is the primary abstraction used by DbUnit to manipulate tabular data. </p> ! <p>Most commonly used implemetations: <table border="1"> <tr> *************** *** 96,100 **** </tr> <tr> ! <td><a href="apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a></td> <td> Reads and writes flat XML dataset document. Each XML element corresponds to a table row. --- 57,61 ---- </tr> <tr> ! <td><a name="FlatXmlDataSet" href="apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a></td> <td> Reads and writes flat XML dataset document. Each XML element corresponds to a table row. *************** *** 244,252 **** Support simple multilevel dependency like this: <source> ! A ! / \ ! B C ! / \ ! D E </source> </td> --- 205,213 ---- Support simple multilevel dependency like this: <source> ! A ! / \ ! B C ! / \ ! D E </source> </td> Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** faq.fml 18 Jan 2004 18:26:23 -0000 1.6 --- faq.fml 19 Jan 2004 20:11:01 -0000 1.7 *************** *** 5,8 **** --- 5,9 ---- <title>General</title> + <!-- <faq id="supportedvendors"> <question> *************** *** 16,19 **** --- 17,21 ---- </answer> </faq> + --> <faq id="build"> *************** *** 22,26 **** </question> <answer> ! <p>DbUnit is build with <a href="http://maven.apache.org/">Maven 1.0-rc1</a>. The default goal will build the DbUnit jar.</p> </answer> </faq> --- 24,28 ---- </question> <answer> ! <p>Since version 2.0, DbUnit is build with <a href="http://maven.apache.org/">Maven 1.0-rc1</a>. See project <a href="dependencies.html">dependencies</a>.</p> </answer> </faq> Index: index.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.xml 17 Jan 2004 04:41:40 -0000 1.4 --- index.xml 19 Jan 2004 20:11:01 -0000 1.5 *************** *** 25,31 **** <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> --- 25,34 ---- <section name="News"> <table border="1"> <tr> + <td>2004-01-??</td> + <td>Version 2.0 released. See <a href="changes-report.html#2.0">changes</a>.</td> + </tr> + <tr> <td>2003-10-05</td> <td>Version 1.5.6 released. See <a href="changes-report.html#1.5.6">changes</a>.</td> *************** *** 90,94 **** </tr> </table> - </p> </section> --- 93,96 ---- Index: resources.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/resources.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** resources.xml 15 Jan 2004 03:11:27 -0000 1.3 --- resources.xml 19 Jan 2004 20:11:01 -0000 1.4 *************** *** 1,6 **** <?xml version="1.0" encoding="ISO-8859-1"?> ! <document><properties><title>The Dbunit Framework - Ressources</title></properties><body><section> <h3>External Ressources</h3> - <p> <table border="1"> <tr> --- 1,5 ---- <?xml version="1.0" encoding="ISO-8859-1"?> ! <document><properties><title>Ressources</title></properties><body><section> <h3>External Ressources</h3> <table border="1"> <tr> *************** *** 45,48 **** </tr> </table> - </p> </section></body></document> \ No newline at end of file --- 44,46 ---- |
From: <mla...@us...> - 2004-01-19 20:09:13
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv8950 Modified Files: todo.txt Log Message: TODO: Convert todo.txt to xdoc. ;) Index: todo.txt =================================================================== RCS file: /cvsroot/dbunit/dbunit/todo.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** todo.txt 20 Mar 2003 04:09:07 -0000 1.10 --- todo.txt 19 Jan 2004 20:09:10 -0000 1.11 *************** *** 1,13 **** Documentation: - * Convert existing website documentation to Jakarta-site2 XML format and - generate HTML using Anakia. Maven and Cocoon are possible alternative. - Actually the website is edited with Dreamweaver. - - * Improve Javadoc. Many classes have no or very little javadoc documentation. - http://sourceforge.net/tracker/index.php?func=detail&aid=589218&group_id=47439&atid=449494 - - * Document DbUnit dependency (library + version + license). - --- --- 1,4 ---- *************** *** 18,28 **** http://sourceforge.net/mailarchive/message.php?msg_id=4148318 - * Replace system properties with a DatabaseConfig class pushed to the - DatabaseConnection. This is possible to replace all system properties with - this class because they are all related to database connection. - - * Make TABLE_TYPE configurable in DatabaseDataSet. - http://sourceforge.net/mailarchive/message.php?msg_id=4179160 - * Add configuration to limits the number of rows fetched from the database http://sourceforge.net/tracker/index.php?func=detail&aid=561202&group_id=47439&atid=449491 --- 9,12 ---- *************** *** 39,44 **** http://sourceforge.net/mailarchive/message.php?msg_id=4159237 ! * Validate XML against its DTD. This can greatly degrade XML loading performance. ! http://sourceforge.net/tracker/index.php?func=detail&aid=677408&group_id=47439&atid=449494 --- --- 23,28 ---- http://sourceforge.net/mailarchive/message.php?msg_id=4159237 ! * Ability to add reference to DTD when exporting a flat XML dataset. ! http://sourceforge.net/mailarchive/forum.php?thread_id=3071649&forum_id=8154 --- *************** *** 48,59 **** * Profile and improve DbUnit performance. - * Improve performance/memory usage of XML datasets implementation. Use SAX??? - Is it necessary??? I have some doubt since unit testing should use fairly - small datasets. - --- Environment: - * Perform some cleanup in the DbUnit test suite. - http://sourceforge.net/mailarchive/message.php?msg_id=3866272 --- 32,37 ---- |
From: <mla...@us...> - 2004-01-19 20:07:35
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv8486 Modified Files: maven.xml project.xml Removed Files: build.properties build.xml dbunit.jpl readme.txt Log Message: Build update. Now correctly copy profile.properties to source distribution. Index: maven.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/maven.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** maven.xml 17 Jan 2004 04:41:40 -0000 1.2 --- maven.xml 19 Jan 2004 20:07:32 -0000 1.3 *************** *** 12,23 **** </preGoal> ! <postGoal name="dist:build-setup"> ! <attainGoal name="copy:profile"/> </postGoal> ! <goal name="copy:profile"> <echo message="${maven.dist.src.archive.dir}"/> <copy file="${basedir}/profile.properties" toDir="${maven.dist.src.archive.dir}/${maven.final.name}" /> </goal> --- 12,35 ---- </preGoal> ! <postGoal name="dist:prepare-src-filesystem"> ! <attainGoal name="dbunit:copy-profile"/> </postGoal> ! <goal name="dbunit:copy-profile"> <echo message="${maven.dist.src.archive.dir}"/> <copy file="${basedir}/profile.properties" toDir="${maven.dist.src.archive.dir}/${maven.final.name}" /> </goal> + + <preGoal name="dbunit:docs"> + <attainGoal name="site"/> + <!-- <attainGoal name="dist"/> --> + </preGoal> + + <goal name="dbunit:docs"> + <echo message="${maven.docs.dest}"/> + <tar basedir="${maven.docs.dest}" destfile="${maven.build.dir}/docs.tar"> + </tar> + <gzip src="${maven.build.dir}/docs.tar" zipfile="${maven.build.dir}/docs.tar.gz"/> + </goal> Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** project.xml 18 Jan 2004 18:27:19 -0000 1.15 --- project.xml 19 Jan 2004 20:07:32 -0000 1.16 *************** *** 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 --> --- 13,17 ---- <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-dev --> ! <currentVersion>2.0</currentVersion> <!-- details about the organization that 'owns' the project --> *************** *** 236,241 **** <reports> - <report>maven-jdepend-plugin</report> <!-- <report>maven-checkstyle-plugin</report> --> --- 236,241 ---- <reports> <!-- + <report>maven-jdepend-plugin</report> <report>maven-checkstyle-plugin</report> --> --- build.properties DELETED --- --- build.xml DELETED --- --- dbunit.jpl DELETED --- --- readme.txt DELETED --- |
From: <mla...@us...> - 2004-01-18 18:27:25
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv24874 Modified Files: project.xml Log Message: Added name of some significant contributors. Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** project.xml 17 Jan 2004 23:27:31 -0000 1.14 --- project.xml 18 Jan 2004 18:27:19 -0000 1.15 *************** *** 108,112 **** <name>Manuel Laflamme</name> <id>mlaflamm</id> - <email>mla...@us...</email> <organization>Oz Communication</organization> <roles> --- 108,111 ---- *************** *** 125,128 **** --- 124,162 ---- </developers> + <contributors> + <contributor> + <name>Erik Price</name> + <!-- + <roles> + <role>DatabaseSequenceOperation</role> + </roles> + --> + </contributor> + <contributor> + <name>Jeremy Stein</name> + <!-- + <roles> + <role>InsertIndentityOperation</role> + </roles> + --> + </contributor> + <contributor> + <name>Keven Kizer</name> + <!-- + <roles> + <role>Early guinea pig</role> + </roles> + --> + </contributor> + <contributor> + <name>Mike Bresnahan</name> + <!-- + <roles> + <role>DbUnit evangelist</role> + </roles> + --> + </contributor> + </contributors> + <!-- jar files the project is dependent on --> <dependencies> |
From: <mla...@us...> - 2004-01-18 18:26:27
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv24730/xdocs Modified Files: anttask.xml changes.xml components.xml faq.fml navigation.xml properties.xml Log Message: Mostly completed documenting new DbUnit 2.0 features. Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** anttask.xml 17 Jan 2004 23:27:31 -0000 1.4 --- anttask.xml 18 Jan 2004 18:26:23 -0000 1.5 *************** *** 51,60 **** <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> --- 51,75 ---- <tr> <td>useQualifiedTableNames</td> ! <td>Set the <a href="properties.html#qualifiedtablenames">qualified table names</a> feature. Defaults to false</td> <td>No</td> </tr> <tr> <td>supportBatchStatement</td> ! <td>Set the <a href="properties.html#batchstatement">batched statement</a> feature. Defaults to false</td> ! <td>No</td> ! </tr> ! <tr> ! <td>datatypeWarning</td> ! <td>Set the <a href="properties.html#typewarning">data type warning</a> feature. Defaults to true</td> ! <td>No</td> ! </tr> ! <tr> ! <td>escapePattern</td> ! <td>Set the <a href="properties.html#escapepattern">escape pattern</a> property.</td> ! <td>No</td> ! </tr> ! <tr> ! <td>datatypeFactory</td> ! <td>Set the <a href="properties.html#typefactory">datatype factory</a> property.</td> <td>No</td> </tr> Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** changes.xml 17 Jan 2004 23:27:31 -0000 1.5 --- changes.xml 18 Jan 2004 18:26:23 -0000 1.6 *************** *** 16,20 **** </action> <action dev="" type="update"> ! Dramatic memory usage improvements to get rid of the infamous OutOfMemoryError. Need some setup to take advantage of some of them. See FAQ (TODO!). </action> <action dev="" type="add"> --- 16,20 ---- </action> <action dev="" type="update"> ! Dramatic memory usage improvements to get rid of the infamous OutOfMemoryError. Need some setup to take advantage of some of them. See "OutOfMemoryError" FAQ. </action> <action dev="" type="add"> *************** *** 25,29 **** </action> <action dev="" type="add"> ! <code>StreamingDataSet</code>. Provides high performance and memory friendly flat XML loading. </action> <action dev="" type="update"> --- 25,29 ---- </action> <action dev="" type="add"> ! <code>StreamingDataSet</code>. Provides high performance and memory friendly XML document loading. </action> <action dev="" type="update"> *************** *** 66,69 **** --- 66,72 ---- <code>Assertion.assertEquals</code> is now performing typed comparison instead of string representation comparison. </action> + <action dev="" type="update"> + INSERT, CLEAN_INSERT and REFRESH operations do not override database default values anymore with null values. Null values are now omitted from insert statements. Operations use multiple prepared statements for the same table, when null values vary from row to row. + </action> </release> Index: components.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/components.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** components.xml 17 Jan 2004 04:41:40 -0000 1.5 --- components.xml 18 Jan 2004 18:26:23 -0000 1.6 *************** *** 3,29 **** <h3>Core Components</h3> ! <p>The following walks you through the core classes that make up DbUnit: ! <ol> ! <li><a href="#dataset">IDataSet</a></li> ! <li><a href="#databaseconnection">IDatabaseConnection</a></li> ! <li><a href="#databaseoperation">DatabaseOperation</a></li> ! </ol> </p> ! <p>All the above are interfaces or abstract classes and you will find yourself ! using implementations or subclasses.</p> ! <hr></hr> <h3><a name="dataset">IDataSet</a></h3> ! <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; /** --- 3,63 ---- <h3>Core Components</h3> ! <p>This document attemps to give you an overview of the core classes that make up DbUnit. ! Following are the core interfaces or abstract classes: ! ! <table border="1"> ! <tr> ! <th>Class</th> ! <th>Description</th> ! </tr> ! <tr> ! <td><a href="#databaseconnection">IDatabaseConnection</a></td> ! <td>Interface representing a DbUnit connection to a database.</td> ! </tr> ! <tr> ! <td><a href="#dataset">IDataSet</a></td> ! <td>Interface representing a collection of tables.</td> ! </tr> ! <tr> ! <td><a href="#databaseoperation">DatabaseOperation</a></td> ! <td>Abstract class representing an operation performed on the database before and after each test.</td> ! </tr> ! </table> </p> ! ! <h3><a name="databaseconnection">IDatabaseConnection</a></h3> ! <p>The <a href="apidocs/org/dbunit/database/IDatabaseConnection.html">IDatabaseConnection</a> interface represents ! a DbUnit connection to a database. ! ! <table border="1"> ! <tr> ! <th>Class</th> ! <th>Description</th> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/database/DatabaseConnection.html">DatabaseConnection</a></td> ! <td>Wraps a JDBC connection.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/database/DatabaseDataSourceConnection.html">DatabaseDataSourceConnection</a></td> ! <td>Wraps a JDBC DataSource.</td> ! </tr> ! </table> ! </p> ! <h3><a name="dataset">IDataSet</a></h3> ! <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection ! of tables. <source> public interface IDataSet { /** ! * Returns table names from this dataset in proper order. ! * multiple occurence of the same name may be returned if ! * more tables having the same name are present in the ! * dataset. */ ! public String[] getTableNames() ! throws DataSetException; /** *************** *** 36,99 **** * Returns the specified table. */ ! 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>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[ <!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>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>Read how to <a href="faq.html#extract">export</a> your database data to this format ! and how to <a href="faq.html#generatedtd">generate a DTD</a> representing your database schema. ! 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> ! </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[ --- 70,134 ---- * Returns the specified table. */ ! public ITable getTable(String tableName) ! throws DataSetException; /** ! * Returns an iterator over the tables in this dataset ! * in proper order. */ ! public ITableIterator iterator() ! throws DataSetException; /** ! * Returns an iterator over the tables in this dataset ! * in reverse order. */ ! public ITableIterator reverseIterator() ! throws DataSetException; }</source> </p> ! <p>IDataSet implemetations provided by DbUnit: ! ! <table border="1"> ! <tr> ! <th>Implementation</th> ! <th>Description</th> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a></td> ! <td> ! Reads and writes flat XML dataset document. Each XML element corresponds to a table row. Each XML element name corresponds to a table name. The XML attributes ! correspond to table columns.<br/> ! Flat XML dataset document sample: <source><![CDATA[ <!DOCTYPE dataset SYSTEM "my-dataset.dtd"> <dataset> ! <TEST_TABLE COL0="row 0 col 0" ! COL1="row 0 col 1" ! COL2="row 0 col 2"/> ! <TEST_TABLE COL1="row 1 col 1"/> ! <SECOND_TABLE COL0="row 0 col 0" ! COL1="row 0 col 1" /> <EMPTY_TABLE/> </dataset>]]></source> ! <br/> ! To specify null values, omit corresponding attribute. ! In the above example, missing COL0 and COL2 attributes of TEST_TABLE second row represents null values. ! <br/> ! Table metadata is deduced from the first row of each table. <b>Beware you may get a NoSuchColumnException ! if the first row of a table has one or more null values.</b> ! Because of that, 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. ! <br/> ! Another way to cope with this problem is to use the <a href= "#replacementdataset">ReplacementDataSet</a>. ! ! </td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/dataset/xml/XmlDataSet.html">XmlDataSet</a></td> ! <td> ! Reads and writes original XML dataset document. This format is very verbiose and must conform to the following DTD: <source><![CDATA[ *************** *** 108,132 **** <!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> --- 143,165 ---- <!ELEMENT value (#PCDATA)> <!ELEMENT null EMPTY> ! ]]></source> ! <br/> ! <a name="originalxmlsample">XML dataset document sample:</a> <source><![CDATA[ <!DOCTYPE dataset SYSTEM "dataset.dtd"> <dataset> <table name="TEST_TABLE"> ! <column>COL0</column> ! <column>COL1</column> ! <column>COL2</column> <row> <value>row 0 col 0</value> <value>row 0 col 1</value> <value>row 0 col 2</value> </row> <row> <null/> + <value>row 1 col 1</value> <null/> </row> </table> *************** *** 138,283 **** <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 ! adapter.</li> ! <li><a class="code">DatabaseDataSourceConnection</a>, which is a JDBC ! DataSource adapter.<br></br> ! </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 ! { ! public static final IDatabaseOperation NONE = new DummyAction(); ! public static final IDatabaseOperation UPDATE = new UpdateOperation(); ! public static final IDatabaseOperation INSERT = new InsertOperation(); ! public static final IDatabaseOperation REFRESH = new RefreshOperation(); ! public static final IDatabaseOperation DELETE = new DeleteOperation(); ! public static final IDatabaseOperation DELETE_ALL = ! new DeleteAllOperation(); ! public static final IDatabaseOperation CLEAN_INSERT = ! new CompositeOperation(DELETE_ALL, INSERT); ! /** ! * 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 ! { ! public void execute(IDatabaseConnection connection, ! IDataSet dataSet) ! { ! } ! } ! }]]></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. Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT ! or InsertIdentityOperation.REFRESH instead of those defined in DatabaseOperation.</p> </section></body></document> \ No newline at end of file --- 171,369 ---- <value>row 0 col 1</value> </row> </table> <table name='EMPTY_TABLE'> <column>COLUMN0</column> <column>COLUMN1</column> </table> ! </dataset>]]></source> ! <br/> ! </td> ! </tr> ! <tr> ! <td><a name="streamingdataset" href="apidocs/org/dbunit/database/StreamingDataSet.html">StreamingDataSet</a></td> ! <td>Consumes a producer and expose its content as a dataset. Provides cursor like forward only access to it and only keeps the active row in memory. Can be used with FlatXmlProducer and XmlProvider. ! <br/> ! This is a very efficient way to load XML dataset document when working with forward only database operations (UPDATE, INSERT, REFRESH). ! <br/> ! Following sample shows how to load a flat XML dataset with the StreamingDataSet: ! <source> ! IDataSetProducer producer = new FlatXmlProducer( ! new InputSource("dataset.xml")); ! IDataSet dataSet = new StreamingDataSet(producer); ! </source> ! </td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/database/DatabaseDataSet.html">DatabaseDataSet</a></td> ! <td>Adapter that provides access ! to a database instance as a dataset. This class is not usually instantiated ! directly but from the factory method <code>IDatabaseConnection.createDataSet()</code>.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/database/QueryDataSet.html">QueryDataSet</a></td> ! <td>Holds collection of tables resulting from database query.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/dataset/DefaultDataSet.html">DefaultDataSet</a></td> ! <td>Uses to create datasets programmatically.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/dataset/CompositeDataSet.html">CompositeDataSet</a></td> ! <td>Combines multiple datasets ! into a single logical dataset.</td> ! </tr> ! <tr> ! <td><a name="filtereddataset" href="apidocs/org/dbunit/dataset/FilteredDataSet.html">FilteredDataSet</a></td> ! <td>Decorator that exposes only some tables from decorated dataset. Can be used with different filtering strategies. Some strategies can include/exclude tables without altering their order while others expose tables with a different order. ! <table border="1"> ! <tr> ! <th>Strategy</th> ! <th>Description</th> ! </tr> ! <tr> ! <td>IncludeTableFilter</td> ! <td>Exposes only matching tables pattern without modifying the original table order. Support wildcards. </td> ! </tr> + <tr> + <td> ExcludeTableFilter </td> + <td> Hides matching tables pattern without modifying the original table order. Support wildcards.</td> + </tr> + <tr> + <td> SequenceTableFilter </td> + <td> Exposes a configured table sequence and can be used to reorder dataset table. This is the original filtering strategy from DbUnit 1.x. </td> + </tr> + <tr> + <td> DatabaseSequenceFilter + </td> + <td> Automatically determine the tables order using foreign/exported keys information. + This strategy is vendor + independent and should work with any JDBC driver that implement the + <code>DatabaseMetaData.getExportedKeys()</code> method. + <br/> + Support simple multilevel dependency like this: + <source> + A + / \ + B C + / \ + D E + </source> + </td> + </tr> + </table> ! </td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/dataset/excel/XlsDataSet.html">XlsDataSet</a></td> ! <td>Read and writes MS Excel dataset documents. Each ! sheet represents a table. The first row of a sheet defines the columns names ! and remaining rows contains the data.</td> ! </tr> ! <tr> ! <td><a name= "replacementdataset" href="apidocs/org/dbunit/dataset/ReplacementDataSet.html">ReplacementDataSet</a></td> ! <td>Decorator that replaces placeholder objects from the decorated dataset with replacement objects. Substring substitution is also possible. ! <br/> ! Interestingly this provides a new way to specify null values in flat XML datasets. For example you can use a placeholder value, like "[NULL]" in your flat XML dataset and replace it with <code>null</code> at runtime. ! <source><![CDATA[ ! <?xml version="1.0"?> ! <dataset> ! <TEST_TABLE COL0="row 0 col 0" ! COL1="[null]"/> ! <TEST_TABLE COL1="row 1 col 0" ! COL2="row 1 col 1"/> ! </dataset>]]></source> ! <br/> ! Loading the flat XML dataset: ! <source><![CDATA[ ! ReplacementDataSet dataSet = new ReplacementDataSet( ! new FlatXmlDataSet( )); ! dataSet.addReplacementObject("[NULL]", null);]]></source> ! <br/> ! </td> ! </tr> ! </table> </p> + <h3><a name="databaseoperation">DatabaseOperation</a></h3> + <p><a href="apidocs/org/dbunit/operation/DatabaseOperation.html">DatabaseOperation</a> is an abstract class that represents an operation performed on the database before and after each test. </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 testing strategies with different benefits and tradeoffs. </p> ! ! <table border="1"> ! <tr> ! <th>Operation</th> ! <th>Description</th> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/operation/UpdateOperation.html">DatabaseOperation.UPDATE</a></td> ! <td>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.</td> ! </tr> ! <tr> ! <td><a name="insert" href="apidocs/org/dbunit/operation/InsertOperation.html">DatabaseOperation.INSERT</a></td> ! <td>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.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/operation/DeleteOperation.html">DatabaseOperation.DELETE</a></td> ! <td>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.</td> ! </tr> ! <tr> ! <td><a name="deleteall" href="apidocs/org/dbunit/operation/DeleteAllOperation.html">DatabaseOperation.DELETE_ALL</a></td> ! <td>Deletes all rows of tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/operation/TruncateTableOperation.html">DatabaseOperation.TRUNCATE</a></td> ! <td>Truncate tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence. ! ! </td> ! </tr> ! <tr> ! <td><a name="#refresh" href="apidocs/org/dbunit/operation/RefreshOperation.html">DatabaseOperation.REFRESH</a></td> ! <td>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/> ! if they are correctly written, tests using this strategy can even be performed ! on a populated database like a copy of a production database.</td> ! </tr> ! <tr> ! <td><a name="#cleanInsert">DatabaseOperation.CLEAN_INSERT</a></td> ! <td>This composite operation performs a <a href="#deleteall">DELETE_ALL</a> operation followed by an ! <a href="#insert">INSERT</a> 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.</td> ! </tr> ! <tr> ! <td>DatabaseOperation.NONE</td> ! <td>Empty operation that does absolutely nothing.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/operation/CompositeOperation.html">CompositeOperation</a></td> ! <td>This operation combines multiple operations into a single one.</td> ! </tr> ! <tr> ! <td><a href="apidocs/org/dbunit/operation/TransactionOperation.html">TransactionOperation</a></td> ! <td>This operation decorates an operation and executes it within the context ! of a transaction.</td> ! </tr> ! <tr> ! <td><a name="InsertIdentityOperation" href="apidocs/org/dbunit/operation/mssqlserver/InsertIdentityOperation.html">IdentityInsertOperation</a></td> ! <td>This operation decorates an insert operation and disables the MS SQL Server automatic identifier generation (IDENTITY) during its execution. Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT ! or InsertIdentityOperation.REFRESH instead of those defined in DatabaseOperation.</td> ! </tr> ! </table> ! </section></body></document> \ No newline at end of file Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** faq.fml 17 Jan 2004 23:27:31 -0000 1.5 --- faq.fml 18 Jan 2004 18:26:23 -0000 1.6 *************** *** 154,158 **** <faq id="views"> <question> ! Can I use DbUnit with views or with synonyms? </question> <answer> --- 154,158 ---- <faq id="views"> <question> ! Can I use DbUnit with database views? </question> <answer> *************** *** 162,166 **** </p> <p> ! For example, use <code>{"TABLE", "VIEW"}</code> for views and <code>{"TABLE", "SYNONYM"}</code> for synonyms. </p> --- 162,166 ---- </p> <p> ! For example, use <code>{"TABLE", "VIEW"}</code> for views. </p> *************** *** 195,198 **** --- 195,224 ---- </answer> </faq> + + <faq id="typefactory"> + <question> + How to replace the default data type factory? + </question> + <answer> + <p> + You can replace the default DbUnit <a href="properties.html#typefactory">data type factory</a> to get support for custom data type. + DbUnit provides extended factories for some vendors, which are located in <code>org.dbunit.ext</code> subpackages. + </p> + <p> + Here is how to use the Oracle factory: + <source> + IDatabaseConnection connection = new DatabaseConnection( + jdbcConnection, schema); + DatabaseConfig config = connection.getConfig(); + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, + new OracleDataTypeFactory()); + </source> + </p> + <p> + Don't hesitate to submit your own implementation if you encounter types not currently supported by DbUnit. + </p> + </answer> + </faq> + </part> *************** *** 200,203 **** --- 226,277 ---- <title>Errors</title> + <faq id="outofmemory"> + <question> + How to get rid of the infamous "OutOfMemoryError"? + </question> + <answer> + <p> + Historically, DbUnit has some memory consumption issues; especially when working with very large + dataset files. DbUnit 2.0 includes many improvements, like using SAX2 instead of the Electric XML + parser and and streamed XML dataset writing, to overcome the memory consumption problems. + </p> + <p> + For compatibility reason, not all improvements are enabled by default. Depending of your + utilisation, some additional setup can makes a huge difference. + </p> + <h5> + Database Export: + </h5> + + <p> + You should configure your DbUnit connection to use ForwardOnlyResultSetTable when exporting very + large dataset. ForwardOnlyResultSetTable is a very efficient database table implemtation useful + when random data access is not required. By default, DbUnit uses CachedResultSetTable which consume + more memory but provides random data access. + </p> + + <p> + Following sample shows how to configure your DbUnit connection to use + ForwardOnlyResultSetTable: + <source> + IDatabaseConnection connection = new DatabaseConnection( + jdbcConnection, schema); + DatabaseConfig config = connection.getConfig(); + + config.setProperty(DatabaseConfig.PROPERTY_RESULTSET_TABLE_FACTORY, + new ForwardOnlyResultSetTableFactory()); + </source> + </p> + <h5> + Forward Database Operations: + </h5> + <p> + Use the very efficient <a href="components.html#streamingdataset">StreamingDataSet</a> to load your XML dataset when + working with forward only database operations like UPDATE, INSERT, REFRESH. + </p> + + </answer> + </faq> + <faq id="tableseq"> <question> *************** *** 208,214 **** --- 282,316 ---- dataset and delete are done in reverse order. You must order your tables and rows appropriately in your datasets to prevent foreign keys constraint violation. + <br/> + The <a href="components.html#filtereddataset">DatabaseSequenceFilter</a> can now be used to automatically determine the tables order using foreign/exported keys information. + <br/> + The following sample demonstrate how to use this class to export a flat XML dataset: + <source> + IDatabaseConnection conn = new DatabaseConnection(jdbcConn); + + ITableFilter filter = new DatabaseTableFilter(conn); + IDataSet dataset = new FilteredDataSet(filter, + conn.createDataSet()); + + FlatXmlDataSet.write(dataset, new File(fileName)); + </source> </answer> </faq> + <faq id="typenotrecognized"> + <question> + Why I get a "data type not recognized" warning? + </question> + <answer> + <p> + By default, DbUnit only support standard JDBC data types. You will get this warning message if you are using vendor specific data types. + </p> + <p> + Read how to <a href="#typefactory"> replace the default data type factory</a> and how to <a href="properties.html#typewarning">disable this warning message</a>. + </p> + + </answer> + </faq> + <faq id="clonedconnection"> <question> *************** *** 251,255 **** <p>You can solve this problem in three different ways: <ol> ! <li>Provide the schema name when creating the database connection.</li> <li>Ensure that the connection is restricted to access only one schema.</li> <li>Enable the <a href="properties.html#qualifiedtablenames">qualified table names</a> feature.</li> --- 353,357 ---- <p>You can solve this problem in three different ways: <ol> ! <li>Provide the schema name when creating the database connection. Note that for Oracle you must specify a all uppercase schema name.</li> <li>Ensure that the connection is restricted to access only one schema.</li> <li>Enable the <a href="properties.html#qualifiedtablenames">qualified table names</a> feature.</li> Index: navigation.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/navigation.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** navigation.xml 17 Jan 2004 23:27:31 -0000 1.6 --- navigation.xml 18 Jan 2004 18:26:23 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- <item name="Get Support" href="https://sourceforge.net/support/getsupport.php?group_id=47439"/> <item name="Source" href="/cvs-usage.html"/> + <item name="JavaDocs" href="apidocs/index.html"/> </menu> <menu name="Overview"> *************** *** 25,29 **** <item name="Properties" href="/properties.html"/> <item name="Ant Task" href="/anttask.html"/> - <item name="JavaDocs" href="apidocs/index.html"/> <item name="Resources" href="/resources.html"/> </menu> --- 26,29 ---- Index: properties.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/properties.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** properties.xml 17 Jan 2004 23:27:31 -0000 1.4 --- properties.xml 18 Jan 2004 18:26:23 -0000 1.5 *************** *** 23,26 **** --- 23,27 ---- ]]></source></p> <h3>Feature Flags</h3> + <a name="batchstatement"></a> <h4>Batched statements</h4> <table border="1"> *************** *** 59,62 **** --- 60,81 ---- </tr> </table> + + <a name="typewarning"></a> + <h4>DataType warning</h4> + <table border="1"> + <tr> + <td>Feature ID</td> + <td>http://www.dbunit.org/features/datatypeWarning</td> + </tr> + <tr> + <td>Default</td> + <td>true</td> + </tr> + <tr> + <td>Description</td> + <td>Enable or disable the warning message displayed when DbUnit encounter an unsupported data type.</td> + </tr> + </table> + <h3>Properties</h3> <h4><a name="escapepattern">Escape pattern</a></h4> *************** *** 107,110 **** --- 126,130 ---- + <a name="typefactory"></a> <h4>DataType factory</h4> <table border="1"> |
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/database In directory sc8-pr-cvs1:/tmp/cvs-serv23989/src/java/org/dbunit/database Modified Files: DatabaseConfig.java DatabaseTableMetaData.java ForwardOnlyResultSetTable.java ScrollableResultSetTable.java Log Message: Added warning when encounter unrecognized data type. This warning can be disabled by a DatabaseConfig feature. Index: DatabaseConfig.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/DatabaseConfig.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatabaseConfig.java 13 Aug 2003 04:28:02 -0000 1.2 --- DatabaseConfig.java 18 Jan 2004 18:22:43 -0000 1.3 *************** *** 52,55 **** --- 52,57 ---- public static final String FEATURE_BATCHED_STATEMENTS = "http://www.dbunit.org/features/batchedStatements"; + public static final String FEATURE_DATATYPE_WARNING = + "http://www.dbunit.org/features/datatypeWarning"; private static final DefaultDataTypeFactory DEFAULT_DATA_TYPE_FACTORY = *************** *** 69,72 **** --- 71,75 ---- setFeature(FEATURE_BATCHED_STATEMENTS, false); setFeature(FEATURE_QUALIFIED_TABLE_NAMES, false); + setFeature(FEATURE_DATATYPE_WARNING, true); setProperty(PROPERTY_STATEMENT_FACTORY, PREPARED_STATEMENT_FACTORY); Index: DatabaseTableMetaData.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/DatabaseTableMetaData.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DatabaseTableMetaData.java 1 Aug 2003 02:29:11 -0000 1.16 --- DatabaseTableMetaData.java 18 Jan 2004 18:22:43 -0000 1.17 *************** *** 165,168 **** --- 165,170 ---- IDataTypeFactory dataTypeFactory = (IDataTypeFactory)config.getProperty( DatabaseConfig.PROPERTY_DATATYPE_FACTORY); + boolean datatypeWarning = config.getFeature( + DatabaseConfig.FEATURE_DATATYPE_WARNING); List columnList = new ArrayList(); *************** *** 184,187 **** --- 186,196 ---- columnList.add(column); } + else if (datatypeWarning) + { + System.out.println( + "WARNING - " + tableName + "." + columnName + + " data type (" + sqlType + ", " + sqlTypeName + + ") not recognized and will be ignored. See FAQ for more information."); + } } Index: ForwardOnlyResultSetTable.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/ForwardOnlyResultSetTable.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ForwardOnlyResultSetTable.java 16 Sep 2003 05:08:31 -0000 1.5 --- ForwardOnlyResultSetTable.java 18 Jan 2004 18:22:43 -0000 1.6 *************** *** 21,30 **** package org.dbunit.database; ! import org.dbunit.dataset.ITableMetaData; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.RowOutOfBoundsException; - import org.dbunit.dataset.Column; - import org.dbunit.dataset.datatype.DefaultDataTypeFactory; - import org.dbunit.dataset.datatype.IDataTypeFactory; import java.sql.ResultSet; --- 21,28 ---- package org.dbunit.database; ! import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; + import org.dbunit.dataset.ITableMetaData; import org.dbunit.dataset.RowOutOfBoundsException; import java.sql.ResultSet; Index: ScrollableResultSetTable.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/ScrollableResultSetTable.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScrollableResultSetTable.java 16 Sep 2003 05:08:31 -0000 1.4 --- ScrollableResultSetTable.java 18 Jan 2004 18:22:43 -0000 1.5 *************** *** 23,30 **** package org.dbunit.database; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.ITableMetaData; - import org.dbunit.dataset.Column; - import org.dbunit.dataset.datatype.DefaultDataTypeFactory; import java.sql.ResultSet; --- 23,29 ---- package org.dbunit.database; + import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.ITableMetaData; import java.sql.ResultSet; |