You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(7) |
Aug
(37) |
Sep
|
Oct
|
Nov
(1) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(8) |
Feb
(68) |
Mar
(72) |
Apr
(149) |
May
(32) |
Jun
(46) |
Jul
(26) |
Aug
(59) |
Sep
(25) |
Oct
(18) |
Nov
(4) |
Dec
(3) |
2004 |
Jan
(90) |
Feb
(19) |
Mar
(38) |
Apr
(41) |
May
(44) |
Jun
(2) |
Jul
(10) |
Aug
|
Sep
(14) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(15) |
Jun
(1) |
Jul
|
Aug
(9) |
Sep
|
Oct
(17) |
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
(16) |
Mar
|
Apr
(1) |
May
(48) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(29) |
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(23) |
Mar
(31) |
Apr
|
May
(26) |
Jun
(6) |
Jul
(1) |
Aug
|
Sep
(7) |
Oct
(1) |
Nov
(8) |
Dec
(8) |
2009 |
Jan
(5) |
Feb
(9) |
Mar
(1) |
Apr
|
May
(23) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(9) |
Oct
(28) |
Nov
(18) |
Dec
(8) |
2010 |
Jan
(19) |
Feb
(24) |
Mar
(3) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(11) |
Oct
|
Nov
(2) |
Dec
(1) |
2011 |
Jan
|
Feb
(7) |
Mar
|
Apr
(6) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(32) |
Oct
(6) |
Nov
|
Dec
|
From: <fsp...@us...> - 2004-04-06 06:41:37
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/handlers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7843/src/java/org/dbunit/dataset/csv/handlers Modified Files: PipelineException.java Log Message: - temporary, non consistent commit to change file names case from a widows machine Index: PipelineException.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/handlers/PipelineException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PipelineException.java 15 Mar 2004 16:44:23 -0000 1.1 --- PipelineException.java 6 Apr 2004 06:28:51 -0000 1.2 *************** *** 22,28 **** package org.dbunit.dataset.csv.handlers; ! import org.dbunit.dataset.csv.CSVParserException; ! public class PipelineException extends CSVParserException { public PipelineException(String message) { super(message); --- 22,28 ---- package org.dbunit.dataset.csv.handlers; ! import org.dbunit.dataset.csv.CsvParserException; ! public class PipelineException extends CsvParserException { public PipelineException(String message) { super(message); |
From: <fsp...@us...> - 2004-04-06 06:41:36
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7843/src/java/org/dbunit/ant Modified Files: AbstractStep.java Export.java Log Message: - temporary, non consistent commit to change file names case from a widows machine Index: AbstractStep.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/AbstractStep.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractStep.java 4 Apr 2004 04:57:19 -0000 1.1 --- AbstractStep.java 6 Apr 2004 06:28:51 -0000 1.2 *************** *** 23,27 **** import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.CachedDataSet; ! import org.dbunit.dataset.csv.CSVProducer; import org.dbunit.dataset.xml.XmlProducer; import org.dbunit.dataset.xml.FlatXmlProducer; --- 23,27 ---- import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.CachedDataSet; ! import org.dbunit.dataset.csv.CsvProducer; import org.dbunit.dataset.xml.XmlProducer; import org.dbunit.dataset.xml.FlatXmlProducer; *************** *** 118,122 **** else if (format.equalsIgnoreCase(FORMAT_CSV)) { ! producer = new CSVProducer(src); } else if (format.equalsIgnoreCase(FORMAT_FLAT)) --- 118,122 ---- else if (format.equalsIgnoreCase(FORMAT_CSV)) { ! producer = new CsvProducer(src); } else if (format.equalsIgnoreCase(FORMAT_FLAT)) Index: Export.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Export.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Export.java 4 Apr 2004 14:25:42 -0000 1.15 --- Export.java 6 Apr 2004 06:28:51 -0000 1.16 *************** *** 25,29 **** import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.csv.CSVDataSetWriter; import org.dbunit.dataset.xml.FlatDtdDataSet; import org.dbunit.dataset.xml.FlatXmlWriter; --- 25,29 ---- import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.csv.CsvDataSetWriter; import org.dbunit.dataset.xml.FlatDtdDataSet; import org.dbunit.dataset.xml.FlatXmlWriter; *************** *** 135,139 **** if (_format.equals(FORMAT_CSV)) { ! CSVDataSetWriter.write(dataset, _dest); } else --- 135,139 ---- if (_format.equals(FORMAT_CSV)) { ! CsvDataSetWriter.write(dataset, _dest); } else |
From: <mla...@us...> - 2004-04-04 14:38:44
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8441/src/test/org/dbunit/ant Modified Files: DbUnitTaskTest.java Log Message: Added new doctype attribute to <export> substask (FR # 824328). Index: DbUnitTaskTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant/DbUnitTaskTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DbUnitTaskTest.java 4 Apr 2004 04:57:20 -0000 1.15 --- DbUnitTaskTest.java 4 Apr 2004 14:25:42 -0000 1.16 *************** *** 188,193 **** Export export = (Export)getFirstStepFromTarget(targetName); List tables = export.getTables(); ! assertTrue("Export should have had two subtables, but has: " ! + tables.size(), tables.size() == 2); Table testTable = (Table)tables.get(0); Table pkTable = (Table)tables.get(1); --- 188,192 ---- Export export = (Export)getFirstStepFromTarget(targetName); List tables = export.getTables(); ! assertEquals("table count", 2, tables.size()); Table testTable = (Table)tables.get(0); Table pkTable = (Table)tables.get(1); *************** *** 202,208 **** String targetName = "test-export-format-flat"; Export export = (Export)getFirstStepFromTarget(targetName); ! assertTrue("Should have been a flat format, " ! + "but was: " + export.getFormat(), ! export.getFormat().equalsIgnoreCase("flat")); } --- 201,213 ---- String targetName = "test-export-format-flat"; Export export = (Export)getFirstStepFromTarget(targetName); ! assertEquals("format", "flat", export.getFormat()); ! } ! ! public void testExportFlatWithDocytpe() ! { ! String targetName = "test-export-format-flat-with-doctype"; ! Export export = (Export)getFirstStepFromTarget(targetName); ! assertEquals("format", "flat", export.getFormat()); ! assertEquals("doctype", "dataset.dtd", export.getDoctype()); } |
From: <mla...@us...> - 2004-04-04 14:38:44
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8441/src/java/org/dbunit/ant Modified Files: Export.java Log Message: Added new doctype attribute to <export> substask (FR # 824328). Index: Export.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Export.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Export.java 4 Apr 2004 04:57:19 -0000 1.14 --- Export.java 4 Apr 2004 14:25:42 -0000 1.15 *************** *** 27,31 **** import org.dbunit.dataset.csv.CSVDataSetWriter; import org.dbunit.dataset.xml.FlatDtdDataSet; ! import org.dbunit.dataset.xml.FlatXmlDataSet; import org.dbunit.dataset.xml.XmlDataSet; --- 27,31 ---- import org.dbunit.dataset.csv.CSVDataSetWriter; import org.dbunit.dataset.xml.FlatDtdDataSet; ! import org.dbunit.dataset.xml.FlatXmlWriter; import org.dbunit.dataset.xml.XmlDataSet; *************** *** 54,57 **** --- 54,58 ---- private File _dest; private String _format = FORMAT_FLAT; + private String _doctype = null; private List _tables = new ArrayList(); *************** *** 110,113 **** --- 111,124 ---- } + public String getDoctype() + { + return _doctype; + } + + public void setDoctype(String doctype) + { + _doctype = doctype; + } + public void execute(IDatabaseConnection connection) throws DatabaseUnitException { *************** *** 133,137 **** if (_format.equalsIgnoreCase(FORMAT_FLAT)) { ! FlatXmlDataSet.write(dataset, out); } else if (_format.equalsIgnoreCase(FORMAT_XML)) --- 144,150 ---- if (_format.equalsIgnoreCase(FORMAT_FLAT)) { ! FlatXmlWriter writer = new FlatXmlWriter(out); ! writer.setDocType(_doctype); ! writer.write(dataset); } else if (_format.equalsIgnoreCase(FORMAT_XML)) *************** *** 159,163 **** { return "Executing export: " ! + "\n in _format: " + _format + " to datafile: " + getAbsolutePath(_dest); } --- 172,176 ---- { return "Executing export: " ! + "\n in format: " + _format + " to datafile: " + getAbsolutePath(_dest); } *************** *** 168,174 **** StringBuffer result = new StringBuffer(); result.append("Export: "); ! result.append(" _dest=" + getAbsolutePath(_dest)); ! result.append(", _format= " + _format); ! result.append(", _tables= " + _tables); return result.toString(); --- 181,188 ---- StringBuffer result = new StringBuffer(); result.append("Export: "); ! result.append(" dest=" + getAbsolutePath(_dest)); ! result.append(", format= " + _format); ! result.append(", doctype= " + _doctype); ! result.append(", tables= " + _tables); return result.toString(); |
From: <mla...@us...> - 2004-04-04 14:38:16
|
Update of /cvsroot/dbunit/dbunit/src/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8441/src/xml Modified Files: antTestBuildFile.xml Log Message: Added new doctype attribute to <export> substask (FR # 824328). Index: antTestBuildFile.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/antTestBuildFile.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** antTestBuildFile.xml 4 Apr 2004 04:57:20 -0000 1.9 --- antTestBuildFile.xml 4 Apr 2004 14:25:42 -0000 1.10 *************** *** 12,20 **** <taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask"/> ! <target name="all" depends="no-driver, no-db-url, no-userid, no-password"/> <target name="no-driver"> ! <dbunit url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 12,20 ---- <taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask"/> ! <target name="all" depends="no-driver, no-db-url, no-userid, no-password"/> <target name="no-driver"> ! <dbunit url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 33,38 **** <target name="no-userid"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" ! password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> --- 33,38 ---- <target name="no-userid"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" ! password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> *************** *** 42,46 **** <target name="no-password"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> --- 42,46 ---- <target name="no-password"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> *************** *** 50,54 **** <target name="invalid-db-info"> <dbunit driver="${dbunit.profile.driverClass}" ! url="jdbc:foobar://localhost/dbunittest" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 50,54 ---- <target name="invalid-db-info"> <dbunit driver="${dbunit.profile.driverClass}" ! url="jdbc:foobar://localhost/dbunittest" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 59,63 **** <target name="set-format-xml"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 59,63 ---- <target name="set-format-xml"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 68,72 **** <target name="test-type-none"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 68,72 ---- <target name="test-type-none"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 86,90 **** <target name="test-type-update"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 86,90 ---- <target name="test-type-update"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 95,99 **** <target name="test-type-refresh"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 95,99 ---- <target name="test-type-refresh"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 104,108 **** <target name="test-type-delete"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 104,108 ---- <target name="test-type-delete"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 113,117 **** <target name="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 113,117 ---- <target name="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 122,126 **** <target name="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 122,126 ---- <target name="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 131,135 **** <target name="test-type-mssql-insert" depends="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 131,135 ---- <target name="test-type-mssql-insert" depends="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 140,144 **** <target name="test-type-mssql-refresh"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 140,144 ---- <target name="test-type-mssql-refresh"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 149,153 **** <target name="test-type-mssql-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 149,153 ---- <target name="test-type-mssql-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 158,162 **** <target name="invalid-type"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 158,162 ---- <target name="invalid-type"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 169,173 **** <target name="test-export-full" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 169,173 ---- <target name="test-export-full" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 179,183 **** <target name="test-export-partial" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 179,183 ---- <target name="test-export-partial" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 193,197 **** <target name="test-export-format-flat" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 193,197 ---- <target name="test-export-format-flat" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 202,208 **** </target> <target name="test-export-format-xml" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 202,218 ---- </target> + <target name="test-export-format-flat-with-doctype" depends="test-type-clean-insert"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.connectionUrl}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> + <export dest="${exportDataSet}" format="flat" doctype="dataset.dtd"/> + </dbunit> + <delete file="${exportDataSet}"/> + </target> + <target name="test-export-format-xml" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 215,219 **** <target name="test-export-format-dtd"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 225,229 ---- <target name="test-export-format-dtd"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 236,240 **** <target name="invalid-export-format"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 246,250 ---- <target name="invalid-export-format"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 242,249 **** </dbunit> </target> ! <target name="test-export-query" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 252,259 ---- </dbunit> </target> ! <target name="test-export-query" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 259,263 **** <target name="test-export-query-mixed" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> --- 269,273 ---- <target name="test-export-query-mixed" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> *************** *** 273,277 **** <delete file="${exportDataSet}"/> </target> ! <target name="test-classpath"> <dbunit driver="org.gjt.mm.mysql.Driver" --- 283,287 ---- <delete file="${exportDataSet}"/> </target> ! <target name="test-classpath"> <dbunit driver="org.gjt.mm.mysql.Driver" *************** *** 280,288 **** password=""> <operation type="INSERT" src="${testDataSet}" format="xml"/> ! <classpath> <pathelement location="./lib/mm.mysql-2.0.11-bin.jar"/> </classpath> </dbunit> ! </target> <target name="test-drivernotinclasspath"> --- 290,298 ---- password=""> <operation type="INSERT" src="${testDataSet}" format="xml"/> ! <classpath> <pathelement location="./lib/mm.mysql-2.0.11-bin.jar"/> </classpath> </dbunit> ! </target> <target name="test-drivernotinclasspath"> |
From: <mla...@us...> - 2004-04-04 14:38:16
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8441/xdocs Modified Files: anttask.xml Log Message: Added new doctype attribute to <export> substask (FR # 824328). Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** anttask.xml 4 Apr 2004 04:57:20 -0000 1.8 --- anttask.xml 4 Apr 2004 14:25:48 -0000 1.9 *************** *** 148,154 **** are "flat", "xml" or "dtd". Defaults to <b>"flat"</b></td> - <td> <td>No</td> ! </td> </tr> </table> --- 148,157 ---- are "flat", "xml" or "dtd". Defaults to <b>"flat"</b></td> <td>No</td> ! </tr> ! <tr> ! <td>doctype</td> ! <td>If set and format is "flat", add DOCTYPE declaration referencing specified DTD to exported dataset. The DTD path can be absolute or relative. </td> ! <td>No</td> </tr> </table> |
From: <mla...@us...> - 2004-04-04 05:09:45
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/xdocs Modified Files: anttask.xml Log Message: Added Ant <compare> step. See update doc for usage. Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** anttask.xml 20 Jan 2004 14:45:41 -0000 1.7 --- anttask.xml 4 Apr 2004 04:57:20 -0000 1.8 *************** *** 122,126 **** </td> </tr> - <!-- <tr> <td>composite</td> <td> <p>Use nested <a class="code"><composite></a> operation elements to combine multiple <a class="code"><operation></a>s (on the same file) into a single one.</p> <table border="1"> <tr> <th>Attribute</th> <th>Description</th> <th>Required</th> </tr> <tr> <td>src</td> <td>The xml source upon which the operation is to be performed</td> <td>Yes</td> </tr> <tr> <td>flat</td> <td>If true, use <a class="code">FlatXmlDataSet</a> type in the supplied src file. Otherwise use <a class="code">XmlDataSet</a>. Defaults to <a class="code">true</a></td> <td> <p>No</p> </td> </tr> </table> <h4>Parameters specified as nested elements </h4> <table border="1"> <tr> <td>operation</td> <td>See above definition for details. The src and flat attributes are supplied as attributes to the <a class="code"><composite></a> step and should not be attempted to be overridden by the nested <a class="code"><operation></a> step.</td> </tr> </table> </td> </tr> --> <tr> <td>export</td> --- 122,125 ---- *************** *** 150,154 **** to <b>"flat"</b></td> <td> ! <p>No</p> </td> </tr> --- 149,153 ---- to <b>"flat"</b></td> <td> ! <td>No</td> </td> </tr> *************** *** 159,163 **** <td>table</td> <td> ! <p>Use nested <table> elements to <export> specific tables. </p> <table border="1"> --- 158,162 ---- <td>table</td> <td> ! <p>Use nested <table> elements to export specific tables. </p> <table border="1"> *************** *** 178,182 **** <td>query</td> <td> ! <p>Use nested <a class="code"><query></a> elements to <a class="code"><export></a> data according to a sql statement. </p> <table border="1"> --- 177,181 ---- <td>query</td> <td> ! <p>Use nested <a class="code"><query></a> elements to export data according to a sql statement. </p> <table border="1"> *************** *** 203,206 **** --- 202,282 ---- </td> </tr> + <tr> + <td>compare</td> + <td> + <p>Use nested <compare> elements to validate the content of the database against the specified dataset file. + </p> + <table border="1"> + <tr> + <th>Attribute</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td>src</td> + <td>The xml source upon which the comparison is to be performed</td> + <td>Yes</td> + </tr> + <tr> + <td>format</td> + <td>Format type of supplied source file. Possible values are "flat" + or "xml". Defaults to <b>"flat"</b></td> + <td>No</td> + </tr> + <tr> + <td>sort</td> + <td>Sorts tables prior comparison. Defaults to <b>"false".</b></td> + <td>No</td> + </tr> + </table> + <h4>Parameters specified as nested elements </h4> + <table border="1"> + <tr> + <td>table</td> + <td> + <p>Use nested <table> elements to compare + specific tables. </p> + <table border="1"> + <tr> + <th>Attribute</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td>name</td> + <td>Name of the database table to compare.</td> + <td>Yes</td> + </tr> + </table> + </td> + </tr> + <tr> + <td>query</td> + <td> + <p>Use nested <a class="code"><query></a> elements to compare + data according to a sql statement. </p> + <table border="1"> + <tr> + <th>Attribute</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td>name</td> + <td>Name of the database table to compare.</td> + <td>Yes</td> + </tr> + <tr> + <td>sql</td> + <td>The sql to execute. You can use either SELECT * from + Mytable or SELECT col1, col4 from MyTable</td> + <td>Yes</td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> </table> <h3>Examples</h3> *************** *** 246,250 **** <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" --- 322,326 ---- <h4><a name="partialexport">Partial database data export</a></h4> ! <p>Export two tables: FOO, resulting from specified query and BAR entire content</p> <source><![CDATA[ <dbunit driver="com.vendor.jdbc.Driver" *************** *** 253,261 **** 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> </section></body></document> \ No newline at end of file --- 329,357 ---- password="password"> <export dest="partial.xml"> ! <query name="FOO" sql="SELECT COL1, COL2 FROM FOO WHERE COL1=4"/> <table name="BAR"/> </export> </dbunit>]]></source> + <h4>Database data comparison</h4> + <source><![CDATA[ + <dbunit driver="com.vendor.jdbc.Driver" + url="jdbc:vendor:mydatabase" + userid="user" + password="password"> + <compare src="expectedData.xml"/> + </dbunit>]]></source> + + <h4><a name="partialcompare">Partial database data comparison</a></h4> + <source><![CDATA[ + <dbunit driver="com.vendor.jdbc.Driver" + url="jdbc:vendor:mydatabase" + userid="user" + password="password"> + <compare src="expectedData.xml"> + <query name="FOO" sql="SELECT COL1, COL2 FROM FOO WHERE COL1=4"/> + <table name="BAR"/> + </compare> + </dbunit>]]></source> + </section></body></document> \ No newline at end of file |
From: <mla...@us...> - 2004-04-04 05:09:45
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/test/org/dbunit/dataset/csv Modified Files: CSVProducerTest.java Log Message: Added Ant <compare> step. See update doc for usage. Index: CSVProducerTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv/CSVProducerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CSVProducerTest.java 15 Mar 2004 16:44:23 -0000 1.1 --- CSVProducerTest.java 4 Apr 2004 04:57:20 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- import org.dbunit.ant.Operation; import org.dbunit.ant.Query; + import org.dbunit.ant.AbstractStep; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; *************** *** 95,99 **** public void testInsertOperationWithCsvFormat() throws SQLException, DatabaseUnitException { Operation operation = new Operation(); ! operation.setFormat(Export.FORMAT_CSV); operation.setSrc(new File(THE_DIRECTORY)); operation.setType("INSERT"); --- 96,100 ---- public void testInsertOperationWithCsvFormat() throws SQLException, DatabaseUnitException { Operation operation = new Operation(); ! operation.setFormat(AbstractStep.FORMAT_CSV); operation.setSrc(new File(THE_DIRECTORY)); operation.setType("INSERT"); *************** *** 116,120 **** Export export = new Export(); ! export.setFormat(Export.FORMAT_CSV); export.setDest(dir); --- 117,121 ---- Export export = new Export(); ! export.setFormat(AbstractStep.FORMAT_CSV); export.setDest(dir); |
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/java/org/dbunit/ant Modified Files: DbUnitTask.java Export.java Operation.java Added Files: AbstractStep.java Compare.java Removed Files: Composite.java Log Message: Added Ant <compare> step. See update doc for usage. --- NEW FILE: AbstractStep.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002-2004, DbUnit.org * * 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.ant; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.CachedDataSet; import org.dbunit.dataset.csv.CSVProducer; import org.dbunit.dataset.xml.XmlProducer; import org.dbunit.dataset.xml.FlatXmlProducer; import org.dbunit.dataset.xml.FlatDtdProducer; import org.dbunit.dataset.stream.IDataSetProducer; import org.dbunit.dataset.stream.StreamingDataSet; import org.dbunit.database.IDatabaseConnection; import org.dbunit.database.IResultSetTableFactory; import org.dbunit.database.ForwardOnlyResultSetTableFactory; import org.dbunit.database.CachedResultSetTableFactory; import org.dbunit.database.DatabaseConfig; import org.dbunit.database.QueryDataSet; import org.dbunit.DatabaseUnitException; import org.xml.sax.InputSource; import java.util.List; import java.util.Iterator; import java.sql.SQLException; import java.io.File; import java.io.IOException; /** * @author Manuel Laflamme * @since Apr 3, 2004 * @version $Revision: 1.1 $ */ public abstract class AbstractStep implements DbUnitTaskStep { public static final String FORMAT_FLAT = "flat"; public static final String FORMAT_XML = "xml"; public static final String FORMAT_DTD = "dtd"; public static final String FORMAT_CSV = "csv"; protected IDataSet getDatabaseDataSet(IDatabaseConnection connection, List tables, boolean forwardonly) throws DatabaseUnitException { try { // Setup the ResultSet table factory IResultSetTableFactory factory = null; if (forwardonly) { factory = new ForwardOnlyResultSetTableFactory(); } else { factory = new CachedResultSetTableFactory(); } DatabaseConfig config = connection.getConfig(); config.setProperty(DatabaseConfig.PROPERTY_RESULTSET_TABLE_FACTORY, factory); // Retrieve the complete database if no tables or queries specified. if (tables.size() == 0) { return connection.createDataSet(); } QueryDataSet queryDataset = new QueryDataSet(connection); for (Iterator it = tables.iterator(); it.hasNext();) { Object item = it.next(); if (item instanceof Query) { Query queryItem = (Query)item; queryDataset.addTable(queryItem.getName(), queryItem.getSql()); } else { Table tableItem = (Table)item; queryDataset.addTable(tableItem.getName()); } } return queryDataset; } catch (SQLException e) { throw new DatabaseUnitException(e); } } protected IDataSet getSrcDataSet(File src, String format, boolean forwardonly) throws DatabaseUnitException { try { IDataSetProducer producer = null; if (format.equalsIgnoreCase(FORMAT_XML)) { producer = new XmlProducer(new InputSource(src.toURL().toString())); } else if (format.equalsIgnoreCase(FORMAT_CSV)) { producer = new CSVProducer(src); } else if (format.equalsIgnoreCase(FORMAT_FLAT)) { producer = new FlatXmlProducer(new InputSource(src.toURL().toString())); } else if (format.equalsIgnoreCase(FORMAT_DTD)) { producer = new FlatDtdProducer(new InputSource(src.toURL().toString())); } else { throw new IllegalArgumentException("Type must be either 'flat'(default), 'xml', 'csv' or 'dtd' but was: " + format); } if (forwardonly) { return new StreamingDataSet(producer); } return new CachedDataSet(producer); } catch (IOException e) { throw new DatabaseUnitException(e); } } } --- NEW FILE: Compare.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002-2004, DbUnit.org * * 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.ant; import org.dbunit.Assertion; import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.CompositeTable; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; import org.dbunit.dataset.SortedTable; import java.io.File; import java.util.ArrayList; import java.util.List; /** * The <code>Compare</code> class is the step that compare the content of the * database against the specified dataset. * * @author Manuel Laflamme * @version $Revision: 1.1 $ * @since Apr 3, 2004 * @see DbUnitTaskStep */ public class Compare extends AbstractStep { private static final String DEFAULT_FORMAT = FORMAT_FLAT; private String _format; private File _src; private List _tables = new ArrayList(); private boolean _sort = false; public File getSrc() { return _src; } public void setSrc(File src) { _src = src; } public void setSort(boolean sort) { _sort = sort; } public String getFormat() { return _format != null ? _format : DEFAULT_FORMAT; } public void setFormat(String format) { if (format.equalsIgnoreCase(FORMAT_FLAT) || format.equalsIgnoreCase(FORMAT_XML) || format.equalsIgnoreCase(FORMAT_CSV) ) { _format = format; } else { throw new IllegalArgumentException("Type must be either 'flat'(default) csv or 'xml' but was: " + format); } } public List getTables() { return _tables; } public void addTable(Table table) { _tables.add(table); } public void addQuery(Query query) { _tables.add(query); } public void execute(IDatabaseConnection connection) throws DatabaseUnitException { IDataSet expectedDataset = getSrcDataSet(_src, getFormat(), false); IDataSet actualDataset = getDatabaseDataSet(connection, _tables, false); String[] tableNames = null; if (_tables.size() > 0) { tableNames = actualDataset.getTableNames(); } else { tableNames = expectedDataset.getTableNames(); } for (int i = 0; i < tableNames.length; i++) { String tableName = tableNames[i]; ITable expectedTable = expectedDataset.getTable(tableName); ITable actualTable = actualDataset.getTable(tableName); actualTable = new CompositeTable( expectedTable.getTableMetaData(), actualTable); if (_sort) { expectedTable = new SortedTable(expectedTable); actualTable = new SortedTable(actualTable); } Assertion.assertEquals(expectedTable, actualTable); } } public String getLogMessage() { return "Executing compare: " + "\n from file: " + ((_src == null) ? null : _src.getAbsolutePath()) + "\n with format: " + _format; } public String toString() { StringBuffer result = new StringBuffer(); result.append("Compare: "); result.append(" src=" + _src.getAbsolutePath()); result.append(", format= " + _format); result.append(", tables= " + _tables); return result.toString(); } } Index: DbUnitTask.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/DbUnitTask.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DbUnitTask.java 15 Mar 2004 16:44:16 -0000 1.12 --- DbUnitTask.java 4 Apr 2004 04:57:19 -0000 1.13 *************** *** 241,249 **** /** ! * Adds a Composite to the steps List. */ ! public void addComposite(Composite composite) { ! steps.add(composite); } --- 241,249 ---- /** ! * Adds a Compare to the steps List. */ ! public void addCompare(Compare compare) { ! steps.add(compare); } Index: Export.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Export.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Export.java 15 Mar 2004 16:44:16 -0000 1.13 --- Export.java 4 Apr 2004 04:57:19 -0000 1.14 *************** *** 24,28 **** import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; - import org.dbunit.database.QueryDataSet; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.csv.CSVDataSetWriter; --- 24,27 ---- *************** *** 35,41 **** import java.io.IOException; import java.io.OutputStream; - import java.sql.SQLException; import java.util.ArrayList; - import java.util.Iterator; import java.util.List; --- 34,38 ---- *************** *** 46,50 **** * specific table names are identified. * ! * @author Timothy Ruppert * @author Ben Cox * @version $Revision$ --- 43,47 ---- * specific table names are identified. * ! * @author Timothy Ruppert * @author Ben Cox * @version $Revision$ *************** *** 52,61 **** * @see DbUnitTaskStep */ ! public class Export implements DbUnitTaskStep { - public static final String FORMAT_FLAT = "flat"; - public static final String FORMAT_XML = "xml"; - public static final String FORMAT_DTD = "dtd"; - public static final String FORMAT_CSV = "csv"; private File _dest; --- 49,54 ---- * @see DbUnitTaskStep */ ! public class Export extends AbstractStep { private File _dest; *************** *** 121,126 **** try { - IDataSet dataset = null; - if (_dest == null) { --- 114,117 ---- *************** *** 128,161 **** } ! // Retrieve the complete database if no tables or queries specified. ! if (_tables.size() == 0) { ! dataset = connection.createDataSet(); } else { - QueryDataSet queryDataset = new QueryDataSet(connection); - for (Iterator it = _tables.iterator(); it.hasNext();) - { - Object item = it.next(); - if (item instanceof Query) - { - Query queryItem = (Query)item; - queryDataset.addTable(queryItem.getName(), queryItem.getSql()); - } - else - { - Table tableItem = (Table)item; - queryDataset.addTable(tableItem.getName()); - } - } - - dataset = queryDataset; - } - - // Write the dataset - if (_format.equals(FORMAT_CSV)) { - CSVDataSetWriter.write(dataset, _dest); - } else { OutputStream out = new FileOutputStream(_dest); try --- 119,131 ---- } ! IDataSet dataset = getDatabaseDataSet(connection, _tables, true); ! ! // Write the dataset ! if (_format.equals(FORMAT_CSV)) { ! CSVDataSetWriter.write(dataset, _dest); } else { OutputStream out = new FileOutputStream(_dest); try *************** *** 184,191 **** throw new DatabaseUnitException(e); } - catch (SQLException e) - { - throw new DatabaseUnitException(e); - } } --- 154,157 ---- Index: Operation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Operation.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Operation.java 15 Mar 2004 16:44:16 -0000 1.12 --- Operation.java 4 Apr 2004 04:57:19 -0000 1.13 *************** *** 24,40 **** import org.dbunit.DatabaseUnitException; import org.dbunit.database.IDatabaseConnection; - import org.dbunit.dataset.CachedDataSet; import org.dbunit.dataset.IDataSet; - import org.dbunit.dataset.csv.CSVProducer; - import org.dbunit.dataset.stream.IDataSetProducer; - import org.dbunit.dataset.stream.StreamingDataSet; - import org.dbunit.dataset.xml.FlatXmlProducer; - import org.dbunit.dataset.xml.XmlProducer; import org.dbunit.ext.mssql.InsertIdentityOperation; import org.dbunit.operation.DatabaseOperation; - import org.xml.sax.InputSource; import java.io.File; - import java.io.IOException; import java.sql.SQLException; --- 24,32 ---- *************** *** 50,60 **** * @see org.dbunit.ant.DbUnitTaskStep */ ! public class Operation implements DbUnitTaskStep { ! private static final String DEFAULT_FORMAT = Export.FORMAT_FLAT; ! protected String type = "CLEAN_INSERT"; ! private String format; ! private File src; private DatabaseOperation _operation; private boolean _forwardOperation = true; --- 42,52 ---- * @see org.dbunit.ant.DbUnitTaskStep */ ! public class Operation extends AbstractStep { ! private static final String DEFAULT_FORMAT = FORMAT_FLAT; ! protected String _type = "CLEAN_INSERT"; ! private String _format; ! private File _src; private DatabaseOperation _operation; private boolean _forwardOperation = true; *************** *** 62,71 **** public String getType() { ! return type; } public File getSrc() { ! return src; } --- 54,63 ---- public String getType() { ! return _type; } public File getSrc() { ! return _src; } *************** *** 77,94 **** public String getFormat() { ! return format != null ? format : DEFAULT_FORMAT; ! } ! ! /** ! * This returns the actual value of the <code>format</code> field, ! * which makes it possible to determine whether the setFormat() method was ever called ! * despite the fact that the <code>getFormat()</code> method returns a default. ! * ! * @return a <code>String</code>, the actual value of the <code>format</code> field. ! * If <code>setFormat()</code> has not been called, this method will return null. ! */ ! String getRawFormat() ! { ! return format; } --- 69,73 ---- public String getFormat() { ! return _format != null ? _format : DEFAULT_FORMAT; } *************** *** 151,174 **** + " or MSSQL_REFRESH but was: " + type); } ! this.type = type; } public void setSrc(File src) { ! this.src = src; } public void setFormat(String format) { ! if (format.equalsIgnoreCase(Export.FORMAT_FLAT) ! || format.equalsIgnoreCase(Export.FORMAT_XML) ! || format.equalsIgnoreCase(Export.FORMAT_CSV) ) { ! this.format = format; } else { ! throw new IllegalArgumentException("Type must be either 'flat'(default) csv or 'xml' but was: " + format); } } --- 130,153 ---- + " or MSSQL_REFRESH but was: " + type); } ! _type = type; } public void setSrc(File src) { ! _src = src; } public void setFormat(String format) { ! if (format.equalsIgnoreCase(FORMAT_FLAT) ! || format.equalsIgnoreCase(FORMAT_XML) ! || format.equalsIgnoreCase(FORMAT_CSV) ) { ! _format = format; } else { ! throw new IllegalArgumentException("Type must be either 'flat'(default), 'xml' or 'csv' but was: " + format); } } *************** *** 188,225 **** try { ! if (format == null) ! { ! format = DEFAULT_FORMAT; ! } ! ! IDataSetProducer producer = null; ! if (format.equalsIgnoreCase(Export.FORMAT_XML)) ! { ! producer = new XmlProducer(new InputSource(src.toURL().toString())); ! } ! else if (format.equalsIgnoreCase(Export.FORMAT_CSV)) { ! producer = new CSVProducer(src); ! } ! else ! { ! producer = new FlatXmlProducer(new InputSource(src.toURL().toString())); ! } ! ! IDataSet dataset = null; ! if (_forwardOperation) ! { ! dataset = new StreamingDataSet(producer); ! } ! else ! { ! dataset = new CachedDataSet(producer); ! } ! _operation.execute(connection, dataset); } - catch (IOException e) - { - throw new DatabaseUnitException(e); - } catch (SQLException e) { --- 167,174 ---- try { ! IDataSet dataset = getSrcDataSet(getSrc(), ! getFormat(), _forwardOperation); _operation.execute(connection, dataset); } catch (SQLException e) { *************** *** 230,236 **** public String getLogMessage() { ! return "Executing operation: " + type ! + "\n on file: " + ((src == null) ? null : src.getAbsolutePath()) ! + "\n with format: " + format; } --- 179,185 ---- public String getLogMessage() { ! return "Executing operation: " + _type ! + "\n on file: " + ((_src == null) ? null : _src.getAbsolutePath()) ! + "\n with format: " + _format; } *************** *** 240,247 **** StringBuffer result = new StringBuffer(); result.append("Operation: "); ! result.append(" type=" + type); ! result.append(", format=" + format); ! result.append(", src=" + src == null ? null : src.getAbsolutePath()); ! result.append(", _operation = " + _operation); return result.toString(); --- 189,196 ---- StringBuffer result = new StringBuffer(); result.append("Operation: "); ! result.append(" type=" + _type); ! result.append(", format=" + _format); ! result.append(", src=" + _src == null ? null : _src.getAbsolutePath()); ! result.append(", operation = " + _operation); return result.toString(); --- Composite.java DELETED --- |
From: <mla...@us...> - 2004-04-04 05:09:45
|
Update of /cvsroot/dbunit/dbunit/src/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/xml Modified Files: antTestBuildFile.xml Log Message: Added Ant <compare> step. See update doc for usage. Index: antTestBuildFile.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/antTestBuildFile.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** antTestBuildFile.xml 15 Mar 2004 16:44:22 -0000 1.8 --- antTestBuildFile.xml 4 Apr 2004 04:57:20 -0000 1.9 *************** *** 5,9 **** <property file="profile.properties"/> ! <property name="testDataSet" value="src/xml/antTestDataSet.xml"/> <property name="exportDataSet" value="src/xml/antExportDataSet.xml"/> <property name="exportDtd" value="src/xml/antExport.dtd"/> --- 5,10 ---- <property file="profile.properties"/> ! <property name="testDataSet" value="src/xml/flatXmlDataSetTest.xml"/> ! <property name="updateDataSet" value="src/xml/antTestDataSet.xml"/> <property name="exportDataSet" value="src/xml/antExportDataSet.xml"/> <property name="exportDtd" value="src/xml/antExport.dtd"/> *************** *** 65,69 **** </target> ! <target name="set-type-none"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 66,70 ---- </target> ! <target name="test-type-none"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 74,78 **** </target> ! <target name="set-type-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 75,79 ---- </target> ! <target name="test-type-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 83,114 **** </target> ! <target name="set-type-update"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="UPDATE" src="${testDataSet}"/> </dbunit> </target> ! <target name="set-type-refresh"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="REFRESH" src="${testDataSet}"/> </dbunit> </target> ! <target name="set-type-delete"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="DELETE" src="${testDataSet}"/> </dbunit> </target> ! <target name="set-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 84,115 ---- </target> ! <target name="test-type-update"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="UPDATE" src="${updateDataSet}"/> </dbunit> </target> ! <target name="test-type-refresh"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="REFRESH" src="${updateDataSet}"/> </dbunit> </target> ! <target name="test-type-delete"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="DELETE" src="${updateDataSet}"/> </dbunit> </target> ! <target name="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 119,123 **** </target> ! <target name="set-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 120,124 ---- </target> ! <target name="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 128,132 **** </target> ! <target name="set-type-mssql-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 129,133 ---- </target> ! <target name="test-type-mssql-insert" depends="test-type-delete-all"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 137,150 **** </target> ! <target name="set-type-mssql-refresh"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="MSSQL_REFRESH" src="${testDataSet}"/> </dbunit> </target> ! <target name="set-type-mssql-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 138,151 ---- </target> ! <target name="test-type-mssql-refresh"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> ! <operation type="MSSQL_REFRESH" src="${updateDataSet}"/> </dbunit> </target> ! <target name="test-type-mssql-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 161,206 **** password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> ! <operation type="DELETE" src="${testDataSet}"/> <operation type="RIDICULOUS" src="${testDataSet}"/> </dbunit> </target> ! <target name="composite-tests"> ! <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" ! userid="${dbunit.profile.user}" ! password="${dbunit.profile.password}"> ! <composite src="${testDataSet}" format="xml"> ! <operation type="CLEAN_INSERT"/> ! <operation type="DELETE"/> ! </composite> ! </dbunit> ! </target> ! ! <target name="invalid-composite-operation-src"> ! <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" ! userid="${dbunit.profile.user}" ! password="${dbunit.profile.password}"> ! <composite src="${testDataSet}" format="xml"> ! <operation type="CLEAN_INSERT" src="${testDataSet}"/> ! <operation type="DELETE"/> ! </composite> ! </dbunit> ! </target> ! ! <target name="invalid-composite-operation-format-xml"> ! <dbunit driver="${dbunit.profile.driverClass}" ! url="${dbunit.profile.connectionUrl}" ! userid="${dbunit.profile.user}" ! password="${dbunit.profile.password}"> ! <composite src="${testDataSet}"> ! <operation type="CLEAN_INSERT" format="xml"/> ! <operation type="DELETE"/> ! </composite> ! </dbunit> ! </target> ! ! <target name="test-export-full"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 162,171 ---- password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> ! <operation type="DELETE" src="${updateDataSet}"/> <operation type="RIDICULOUS" src="${testDataSet}"/> </dbunit> </target> ! <target name="test-export-full" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 212,216 **** </target> ! <target name="test-export-partial"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 177,181 ---- </target> ! <target name="test-export-partial" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 221,229 **** <table name="PK_TABLE"/> </export> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-format-flat"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 186,195 ---- <table name="PK_TABLE"/> </export> + <compare src="${exportDataSet}" format="flat"/> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-format-flat" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 231,239 **** password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat"/> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-format-xml"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 197,206 ---- password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat"/> + <compare src="${exportDataSet}" format="flat"/> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-format-xml" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 241,244 **** --- 208,212 ---- password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="xml"/> + <compare src="${exportDataSet}" format="xml"/> </dbunit> <delete file="${exportDataSet}"/> *************** *** 255,259 **** </target> ! <target name="test-export-format-csv"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 223,227 ---- </target> ! <target name="test-export-format-csv" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 261,266 **** password="${dbunit.profile.password}"> <export dest="${exportCsv}" format="csv"/> </dbunit> ! <delete file="${exportCsv}"/> </target> --- 229,235 ---- password="${dbunit.profile.password}"> <export dest="${exportCsv}" format="csv"/> + <compare src="${exportCsv}" format="csv"/> </dbunit> ! <delete dir="${exportCsv}"/> </target> *************** *** 274,278 **** </target> ! <target name="test-export-query"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 243,247 ---- </target> ! <target name="test-export-query" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 280,291 **** password="${dbunit.profile.password}"> <export dest="${exportDataSet}"> ! <query name="TEST_TABLE" sql="SELECT * FROM test_table"/> <query name="PK_TABLE" sql="SELECT * FROM pk_table"/> </export> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-query-mixed"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" --- 249,261 ---- password="${dbunit.profile.password}"> <export dest="${exportDataSet}"> ! <query name="TEST_TABLE" sql="SELECT * FROM test_table ORDER BY column0 DESC"/> <query name="PK_TABLE" sql="SELECT * FROM pk_table"/> </export> + <compare src="${exportDataSet}" sort="true"/> </dbunit> <delete file="${exportDataSet}"/> </target> ! <target name="test-export-query-mixed" depends="test-type-clean-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" *************** *** 296,299 **** --- 266,273 ---- <query name="PK_TABLE" sql="SELECT * FROM pk_table WHERE normal1='0 wor'"/> </export> + <compare src="${exportDataSet}"> + <query name="PK_TABLE" sql="SELECT * FROM pk_table WHERE normal1='0 wor'"/> + <table name="TEST_TABLE" /> + </compare> </dbunit> <delete file="${exportDataSet}"/> |
From: <mla...@us...> - 2004-04-04 05:09:44
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/test/org/dbunit/ant Modified Files: DbUnitTaskTest.java Log Message: Added Ant <compare> step. See update doc for usage. Index: DbUnitTaskTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant/DbUnitTaskTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DbUnitTaskTest.java 15 Mar 2004 16:44:20 -0000 1.14 --- DbUnitTaskTest.java 4 Apr 2004 04:57:20 -0000 1.15 *************** *** 22,30 **** package org.dbunit.ant; - import junit.framework.Test; - import junit.framework.TestSuite; - import org.apache.tools.ant.BuildException; - import org.apache.tools.ant.Target; - import org.apache.tools.ant.taskdefs.TaskdefsTest; import org.dbunit.DatabaseEnvironment; import org.dbunit.database.DatabaseConfig; --- 22,25 ---- *************** *** 35,39 **** import org.dbunit.operation.DatabaseOperation; ! import java.io.File; import java.sql.SQLException; import java.util.Hashtable; --- 30,39 ---- import org.dbunit.operation.DatabaseOperation; ! import junit.framework.Test; ! import junit.framework.TestSuite; ! import org.apache.tools.ant.BuildException; ! import org.apache.tools.ant.Target; ! import org.apache.tools.ant.taskdefs.TaskdefsTest; ! import java.sql.SQLException; import java.util.Hashtable; *************** *** 135,189 **** { assertOperationType("Should have been an DELETE_ALL operation", ! "set-type-none", DatabaseOperation.NONE); assertOperationType("Should have been an DELETE_ALL operation", ! "set-type-delete-all", DatabaseOperation.DELETE_ALL); assertOperationType("Should have been an INSERT operation", ! "set-type-insert", DatabaseOperation.INSERT); assertOperationType("Should have been an UPDATE operation", ! "set-type-update", DatabaseOperation.UPDATE); assertOperationType("Should have been an REFRESH operation", ! "set-type-refresh", DatabaseOperation.REFRESH); assertOperationType("Should have been an CLEAN_INSERT operation", ! "set-type-clean-insert", DatabaseOperation.CLEAN_INSERT); assertOperationType("Should have been an DELETE operation", ! "set-type-delete", DatabaseOperation.DELETE); assertOperationType("Should have been an MSSQL_INSERT operation", ! "set-type-mssql-insert", InsertIdentityOperation.INSERT); assertOperationType("Should have been an MSSQL_REFRESH operation", ! "set-type-mssql-refresh", InsertIdentityOperation.REFRESH); assertOperationType("Should have been an MSSQL_CLEAN_INSERT operation", ! "set-type-mssql-clean-insert", InsertIdentityOperation.CLEAN_INSERT); ! } ! ! public void testCompositeOrder() ! { ! String targetName = "composite-tests"; ! Composite composite = (Composite)getFirstStepFromTarget(targetName); ! List operations = composite.getOperations(); ! assertTrue("Composite should have had two suboperations, but has: " ! + operations.size(), operations.size() == 2); ! Operation cleanInsert = (Operation)operations.get(0); ! Operation delete = (Operation)operations.get(1); ! assertTrue("Should have been a CLEAN_INSERT, but was: " + cleanInsert.getType(), ! cleanInsert.getType().equals("CLEAN_INSERT")); ! assertTrue("Should have been a DELETE, but was: " + delete.getType(), ! delete.getType().equals("DELETE")); ! } ! ! public void testCompositeSrc() ! { ! String targetName = "composite-tests"; ! Composite composite = (Composite)getFirstStepFromTarget(targetName); ! List operations = composite.getOperations(); ! Iterator operIter = operations.listIterator(); ! while (operIter.hasNext()) ! { ! Operation operation = (Operation)operIter.next(); ! File src = operation.getSrc(); ! assertNotNull("Operation shouldn't have a null src!", src); ! assertTrue("Operation should have src from composite: " + composite.getSrc() ! + ", but was: " + src, ! src.equals(composite.getSrc())); ! } } --- 135,157 ---- { assertOperationType("Should have been an DELETE_ALL operation", ! "test-type-none", DatabaseOperation.NONE); assertOperationType("Should have been an DELETE_ALL operation", ! "test-type-delete-all", DatabaseOperation.DELETE_ALL); assertOperationType("Should have been an INSERT operation", ! "test-type-insert", DatabaseOperation.INSERT); assertOperationType("Should have been an UPDATE operation", ! "test-type-update", DatabaseOperation.UPDATE); assertOperationType("Should have been an REFRESH operation", ! "test-type-refresh", DatabaseOperation.REFRESH); assertOperationType("Should have been an CLEAN_INSERT operation", ! "test-type-clean-insert", DatabaseOperation.CLEAN_INSERT); assertOperationType("Should have been an DELETE operation", ! "test-type-delete", DatabaseOperation.DELETE); assertOperationType("Should have been an MSSQL_INSERT operation", ! "test-type-mssql-insert", InsertIdentityOperation.INSERT); assertOperationType("Should have been an MSSQL_REFRESH operation", ! "test-type-mssql-refresh", InsertIdentityOperation.REFRESH); assertOperationType("Should have been an MSSQL_CLEAN_INSERT operation", ! "test-type-mssql-clean-insert", InsertIdentityOperation.CLEAN_INSERT); } *************** *** 282,286 **** Query testTable = (Query)queries.get(0); assertEquals("name", "TEST_TABLE", testTable.getName()); ! assertEquals("sql", "SELECT * FROM test_table", testTable.getSql()); Query pkTable = (Query)queries.get(1); --- 250,254 ---- Query testTable = (Query)queries.get(0); assertEquals("name", "TEST_TABLE", testTable.getName()); ! assertEquals("sql", "SELECT * FROM test_table ORDER BY column0 DESC", testTable.getSql()); Query pkTable = (Query)queries.get(1); |
From: <mla...@us...> - 2004-04-04 05:09:43
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15947/src/java/org/dbunit Modified Files: Assertion.java Log Message: Added Ant <compare> step. See update doc for usage. Index: Assertion.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/Assertion.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Assertion.java 15 Mar 2004 16:44:16 -0000 1.11 --- Assertion.java 4 Apr 2004 04:57:19 -0000 1.12 *************** *** 48,52 **** */ public static void assertEquals(IDataSet expectedDataSet, ! IDataSet actualDataSet) throws Exception { // do not continue if same instance --- 48,52 ---- */ public static void assertEquals(IDataSet expectedDataSet, ! IDataSet actualDataSet) throws DatabaseUnitException { // do not continue if same instance *************** *** 91,95 **** */ public static void assertEquals(ITable expectedTable, ITable actualTable) ! throws Exception { // Do not continue if same instance --- 91,95 ---- */ public static void assertEquals(ITable expectedTable, ITable actualTable) ! throws DatabaseUnitException { // Do not continue if same instance |
From: <mla...@us...> - 2004-04-03 18:28:59
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16182/src/java/org/dbunit/dataset/datatype Modified Files: AbstractDataType.java BlobDataType.java BytesDataType.java ClobDataType.java DateDataType.java NumberDataType.java StringDataType.java TimeDataType.java TimestampDataType.java Log Message: Now all data types are calling ResultSet.wasNull() to verify if a value is NULL. Only primitive types were calling this method before. Index: AbstractDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/AbstractDataType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AbstractDataType.java 22 Jan 2004 02:54:18 -0000 1.9 --- AbstractDataType.java 3 Apr 2004 18:16:33 -0000 1.10 *************** *** 98,102 **** throws SQLException, TypeCastException { ! return resultSet.getObject(column); } --- 98,107 ---- throws SQLException, TypeCastException { ! Object value = resultSet.getObject(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: BlobDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/BlobDataType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BlobDataType.java 22 Jan 2004 02:54:18 -0000 1.2 --- BlobDataType.java 3 Apr 2004 18:16:33 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- import java.sql.SQLException; import java.sql.Types; + import java.sql.Blob; /** *************** *** 41,45 **** public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { ! return typeCast(resultSet.getBlob(column)); } --- 42,51 ---- public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { ! Blob value = resultSet.getBlob(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return typeCast(value); } Index: BytesDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/BytesDataType.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BytesDataType.java 15 Mar 2004 16:44:17 -0000 1.16 --- BytesDataType.java 3 Apr 2004 18:16:33 -0000 1.17 *************** *** 228,232 **** throws SQLException, TypeCastException { ! return resultSet.getBytes(column); } --- 228,237 ---- throws SQLException, TypeCastException { ! byte[] value = resultSet.getBytes(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: ClobDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/ClobDataType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClobDataType.java 22 Jan 2004 02:54:18 -0000 1.2 --- ClobDataType.java 3 Apr 2004 18:16:33 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- import java.sql.SQLException; import java.sql.Types; + import java.sql.Clob; /** *************** *** 41,45 **** public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { ! return typeCast(resultSet.getClob(column)); } --- 42,51 ---- public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { ! Clob value = resultSet.getClob(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return typeCast(value); } Index: DateDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/DateDataType.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DateDataType.java 22 Feb 2004 23:27:20 -0000 1.13 --- DateDataType.java 3 Apr 2004 18:16:33 -0000 1.14 *************** *** 103,107 **** throws SQLException, TypeCastException { ! return resultSet.getDate(column); } --- 103,112 ---- throws SQLException, TypeCastException { ! java.sql.Date value = resultSet.getDate(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: NumberDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/NumberDataType.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NumberDataType.java 22 Feb 2004 23:27:20 -0000 1.12 --- NumberDataType.java 3 Apr 2004 18:16:33 -0000 1.13 *************** *** 77,81 **** throws SQLException, TypeCastException { ! return resultSet.getBigDecimal(column); } --- 77,86 ---- throws SQLException, TypeCastException { ! BigDecimal value = resultSet.getBigDecimal(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: StringDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/StringDataType.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** StringDataType.java 15 Mar 2004 16:44:17 -0000 1.22 --- StringDataType.java 3 Apr 2004 18:16:33 -0000 1.23 *************** *** 120,124 **** throws SQLException, TypeCastException { ! return resultSet.getString(column); } --- 120,129 ---- throws SQLException, TypeCastException { ! String value = resultSet.getString(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: TimeDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/TimeDataType.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TimeDataType.java 15 Mar 2004 16:44:17 -0000 1.13 --- TimeDataType.java 3 Apr 2004 18:16:33 -0000 1.14 *************** *** 83,87 **** throws SQLException, TypeCastException { ! return resultSet.getTime(column); } --- 83,92 ---- throws SQLException, TypeCastException { ! Time value = resultSet.getTime(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } Index: TimestampDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/TimestampDataType.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TimestampDataType.java 15 Mar 2004 16:44:17 -0000 1.14 --- TimestampDataType.java 3 Apr 2004 18:16:33 -0000 1.15 *************** *** 99,103 **** throws SQLException, TypeCastException { ! return resultSet.getTimestamp(column); } --- 99,108 ---- throws SQLException, TypeCastException { ! Timestamp value = resultSet.getTimestamp(column); ! if (value == null || resultSet.wasNull()) ! { ! return null; ! } ! return value; } |
From: <mla...@us...> - 2004-04-03 18:26:29
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15746/src/java/org/dbunit/dataset/datatype Added Files: BinaryStreamDataType.java Log Message: Added support for Oracle LONG RAW data type. Thanks to Markus Müller for submitting the original patch. --- NEW FILE: BinaryStreamDataType.java --- package org.dbunit.dataset.datatype; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class BinaryStreamDataType extends BytesDataType { public BinaryStreamDataType(String name, int sqlType) { super(name, sqlType); } public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { InputStream in = resultSet.getBinaryStream(column); if (in == null || resultSet.wasNull()) { return null; } try { ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[32]; int length = in.read(buffer); while (length != -1) { out.write(buffer, 0, length); length = in.read(buffer); } return out.toByteArray(); } catch (IOException e) { throw new TypeCastException(e); } } public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { byte[] bytes = (byte[])typeCast(value); ByteArrayInputStream in = new ByteArrayInputStream(bytes); statement.setBinaryStream(column, in, bytes.length); } } |
From: <mla...@us...> - 2004-04-03 18:26:29
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15746/src/test/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactoryTest.java Log Message: Added support for Oracle LONG RAW data type. Thanks to Markus Müller for submitting the original patch. Index: OracleDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OracleDataTypeFactoryTest.java 2 Feb 2004 23:07:25 -0000 1.6 --- OracleDataTypeFactoryTest.java 3 Apr 2004 18:14:08 -0000 1.7 *************** *** 74,77 **** --- 74,87 ---- } + public void testCreateLongRawDataType() throws Exception + { + int sqlType = Types.LONGVARBINARY; + String sqlTypeName = "LONG RAW"; + + DataType expected = OracleDataTypeFactory.LONG_RAW; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + public void testCreateTimestampDataType() throws Exception { |
From: <mla...@us...> - 2004-04-03 18:26:28
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15746/src/test/org/dbunit/dataset/datatype Modified Files: AbstractDataTypeFactoryTest.java Log Message: Added support for Oracle LONG RAW data type. Thanks to Markus Müller for submitting the original patch. Index: AbstractDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/AbstractDataTypeFactoryTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractDataTypeFactoryTest.java 22 Jan 2004 01:55:44 -0000 1.2 --- AbstractDataTypeFactoryTest.java 3 Apr 2004 18:14:08 -0000 1.3 *************** *** 49,53 **** DataType.VARCHAR, DataType.LONGVARCHAR, ! DataType.CLOB, DataType.NUMERIC, DataType.DECIMAL, --- 49,53 ---- DataType.VARCHAR, DataType.LONGVARCHAR, ! // DataType.CLOB, DataType.NUMERIC, DataType.DECIMAL, *************** *** 66,70 **** DataType.VARBINARY, DataType.LONGVARBINARY, ! DataType.BLOB, }; --- 66,70 ---- DataType.VARBINARY, DataType.LONGVARBINARY, ! // DataType.BLOB, }; *************** *** 88,90 **** --- 88,110 ---- } + public void testCreateBlobDataType() throws Exception + { + int sqlType = Types.BLOB; + String sqlTypeName = "BLOB"; + + DataType expected = DataType.BLOB; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + + public void testCreateClobDataType() throws Exception + { + int sqlType = Types.CLOB; + String sqlTypeName = "CLOB"; + + DataType expected = DataType.CLOB; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + } |
From: <mla...@us...> - 2004-04-03 18:26:28
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15746/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Log Message: Added support for Oracle LONG RAW data type. Thanks to Markus Müller for submitting the original patch. Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OracleDataTypeFactory.java 2 Feb 2004 23:07:24 -0000 1.9 --- OracleDataTypeFactory.java 3 Apr 2004 18:14:07 -0000 1.10 *************** *** 24,27 **** --- 24,28 ---- import org.dbunit.dataset.datatype.DataTypeException; import org.dbunit.dataset.datatype.DefaultDataTypeFactory; + import org.dbunit.dataset.datatype.BinaryStreamDataType; import java.sql.Types; *************** *** 38,41 **** --- 39,44 ---- public static final DataType ORACLE_BLOB = new OracleBlobDataType(); public static final DataType ORACLE_CLOB = new OracleClobDataType(); + public static final DataType LONG_RAW = new BinaryStreamDataType( + "LONG RAW", Types.LONGVARBINARY); public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException *************** *** 47,75 **** } ! if (sqlType == Types.OTHER) { ! // BLOB ! if ("BLOB".equals(sqlTypeName)) ! { ! return ORACLE_BLOB; ! } ! // CLOB ! if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) ! { ! return ORACLE_CLOB; ! } ! // NVARCHAR2 ! if ("NVARCHAR2".equals(sqlTypeName)) ! { ! return DataType.VARCHAR; ! } ! // TIMESTAMP ! if (sqlTypeName.startsWith("TIMESTAMP")) ! { ! return DataType.TIMESTAMP; ! } } --- 50,81 ---- } ! // TIMESTAMP ! if (sqlTypeName.startsWith("TIMESTAMP")) { ! return DataType.TIMESTAMP; ! } ! // BLOB ! if ("BLOB".equals(sqlTypeName)) ! { ! return ORACLE_BLOB; ! } ! // CLOB ! if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) ! { ! return ORACLE_CLOB; ! } ! // NVARCHAR2 ! if ("NVARCHAR2".equals(sqlTypeName)) ! { ! return DataType.VARCHAR; ! } ! ! // LONG RAW ! if (LONG_RAW.toString().equals(sqlTypeName)) ! { ! return LONG_RAW; } |
From: <mla...@us...> - 2004-04-03 18:26:28
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15746/src/test/org/dbunit/database Modified Files: ForwardOnlyResultSetTableTest.java Log Message: Added support for Oracle LONG RAW data type. Thanks to Markus Müller for submitting the original patch. Index: ForwardOnlyResultSetTableTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ForwardOnlyResultSetTableTest.java 15 Mar 2004 16:44:20 -0000 1.4 --- ForwardOnlyResultSetTableTest.java 3 Apr 2004 18:14:08 -0000 1.5 *************** *** 21,27 **** package org.dbunit.database; - import com.mockobjects.sql.MockMultiRowResultSet; import org.dbunit.DatabaseEnvironment; ! import org.dbunit.dataset.*; import org.dbunit.operation.DatabaseOperation; --- 21,30 ---- package org.dbunit.database; import org.dbunit.DatabaseEnvironment; ! import org.dbunit.dataset.Column; ! import org.dbunit.dataset.ForwardOnlyTableTest; ! import org.dbunit.dataset.ITable; ! import org.dbunit.dataset.MockTableMetaData; ! import org.dbunit.dataset.RowOutOfBoundsException; import org.dbunit.operation.DatabaseOperation; *************** *** 66,70 **** // Setup resultset ! MockMultiRowResultSet resultSet = new MockMultiRowResultSet(); resultSet.setExpectedCloseCalls(1); resultSet.setupColumnNames(columnNames); --- 69,73 ---- // Setup resultset ! ExtendedMockMultiRowResultSet resultSet = new ExtendedMockMultiRowResultSet(); resultSet.setExpectedCloseCalls(1); resultSet.setupColumnNames(columnNames); |
From: <mla...@us...> - 2004-04-02 18:29:44
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/src/test/org/dbunit/operation Modified Files: DeleteAllOperationTest.java Log Message: DeleteAllOperation: * Delete tables only once in reverse order they are encountered. Before they were deleted every time encountered. Thanks to John Hurst who submitted this patch. * New test with empty tables. Index: DeleteAllOperationTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/operation/DeleteAllOperationTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DeleteAllOperationTest.java 15 Mar 2004 16:44:21 -0000 1.16 --- DeleteAllOperationTest.java 2 Apr 2004 18:17:34 -0000 1.17 *************** *** 27,31 **** import org.dbunit.database.statement.MockBatchStatement; import org.dbunit.database.statement.MockStatementFactory; ! import org.dbunit.dataset.*; /** --- 27,38 ---- import org.dbunit.database.statement.MockBatchStatement; import org.dbunit.database.statement.MockStatementFactory; ! import org.dbunit.dataset.AbstractDataSetTest; ! import org.dbunit.dataset.DataSetUtils; ! import org.dbunit.dataset.DefaultDataSet; ! import org.dbunit.dataset.DefaultTable; ! import org.dbunit.dataset.EmptyTableDataSet; ! import org.dbunit.dataset.IDataSet; ! import org.dbunit.dataset.ITable; ! import org.dbunit.dataset.LowerCaseDataSet; /** *************** *** 43,46 **** --- 50,61 ---- } + protected void setUp() throws Exception + { + super.setUp(); + + DatabaseOperation.CLEAN_INSERT.execute(_connection, + getEnvironment().getInitDataSet()); + } + protected DatabaseOperation getDeleteAllOperation() { *************** *** 124,137 **** { String schemaName = "schema"; ! String tableName = "table"; ! String expected = getExpectedStament(schemaName + "." + tableName); ! ITable table = new DefaultTable(tableName); ! IDataSet dataSet = new DefaultDataSet(new ITable[] {table, table}); // setup mock objects MockBatchStatement statement = new MockBatchStatement(); ! statement.addExpectedBatchString(expected); ! statement.addExpectedBatchString(expected); statement.setExpectedExecuteBatchCalls(1); statement.setExpectedClearBatchCalls(1); --- 139,156 ---- { String schemaName = "schema"; ! String tableName1 = "table1"; ! String tableName2 = "table2"; ! String expected1 = getExpectedStament(schemaName + "." + tableName1); ! String expected2 = getExpectedStament(schemaName + "." + tableName2); ! ITable table1 = new DefaultTable(tableName1); ! ITable table2 = new DefaultTable(tableName2); ! IDataSet dataSet = new DefaultDataSet( ! new ITable[] {table1, table2, table1}); // setup mock objects MockBatchStatement statement = new MockBatchStatement(); ! statement.addExpectedBatchString(expected2); ! statement.addExpectedBatchString(expected1); statement.setExpectedExecuteBatchCalls(1); statement.setExpectedClearBatchCalls(1); *************** *** 143,147 **** MockDatabaseConnection connection = new MockDatabaseConnection(); ! connection.setupDataSet(new DefaultDataSet(table)); connection.setupSchema(schemaName); connection.setupStatementFactory(factory); --- 162,166 ---- MockDatabaseConnection connection = new MockDatabaseConnection(); ! connection.setupDataSet(new DefaultDataSet(table1, table2)); connection.setupSchema(schemaName); connection.setupStatementFactory(factory); *************** *** 158,167 **** public void testExecute() throws Exception { IDataSet dataSet = AbstractDataSetTest.removeExtraTestTables( ! _connection.createDataSet()); testExecute(dataSet); } public void testExecuteCaseInsentive() throws Exception { --- 177,196 ---- public void testExecute() throws Exception { + IDataSet databaseDataSet = _connection.createDataSet(); IDataSet dataSet = AbstractDataSetTest.removeExtraTestTables( ! databaseDataSet); testExecute(dataSet); } + public void testExecuteEmpty() throws Exception + { + IDataSet databaseDataSet = _connection.createDataSet(); + IDataSet dataSet = AbstractDataSetTest.removeExtraTestTables( + databaseDataSet); + + testExecute(new EmptyTableDataSet(dataSet)); + } + public void testExecuteCaseInsentive() throws Exception { |
From: <mla...@us...> - 2004-04-02 18:29:44
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/src/test/org/dbunit/dataset Added Files: EmptyTableDataSet.java Log Message: DeleteAllOperation: * Delete tables only once in reverse order they are encountered. Before they were deleted every time encountered. Thanks to John Hurst who submitted this patch. * New test with empty tables. --- NEW FILE: EmptyTableDataSet.java --- package org.dbunit.dataset; /** * <p> Copyright (c) 2003 OZ.COM. All Rights Reserved. </p> * * @author manuel.laflamme * @since Mar 30, 2004 */ public class EmptyTableDataSet extends AbstractDataSet { private final IDataSet _dataSet; public EmptyTableDataSet(IDataSet dataSet) { _dataSet = dataSet; } //////////////////////////////////////////////////////////////////////////// // IDataSet interface public String[] getTableNames() throws DataSetException { return _dataSet.getTableNames(); } public ITableMetaData getTableMetaData(String tableName) throws DataSetException { return _dataSet.getTableMetaData(tableName); } public ITable getTable(String tableName) throws DataSetException { return new DefaultTable(_dataSet.getTableMetaData(tableName)); } //////////////////////////////////////////////////////////////////////////// // AbstractDataSet class protected ITableIterator createIterator(boolean reversed) throws DataSetException { return new EmptyTableIterator(reversed ? _dataSet.reverseIterator() : _dataSet.iterator()); } public static class EmptyTableIterator implements ITableIterator { private final ITableIterator _iterator; public EmptyTableIterator(ITableIterator iterator) { _iterator = iterator; } public boolean next() throws DataSetException { return _iterator.next(); } public ITableMetaData getTableMetaData() throws DataSetException { return _iterator.getTableMetaData(); } public ITable getTable() throws DataSetException { return new DefaultTable(_iterator.getTableMetaData()); } } } |
From: <mla...@us...> - 2004-04-02 18:29:44
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10452/src/java/org/dbunit/operation Modified Files: DeleteAllOperation.java Log Message: DeleteAllOperation: * Delete tables only once in reverse order they are encountered. Before they were deleted every time encountered. Thanks to John Hurst who submitted this patch. * New test with empty tables. Index: DeleteAllOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/DeleteAllOperation.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DeleteAllOperation.java 22 Jan 2004 02:54:19 -0000 1.18 --- DeleteAllOperation.java 2 Apr 2004 18:17:33 -0000 1.19 *************** *** 31,34 **** --- 31,37 ---- import java.sql.SQLException; + import java.util.HashSet; + import java.util.Set; + import java.util.Stack; /** *************** *** 37,41 **** * the database table is not affected. Table are truncated in * reverse sequence. ! * <p> * This operation has the same effect of as {@link TruncateTableOperation}. * TruncateTableOperation is faster, and it is non-logged, meaning it cannot be --- 40,44 ---- * the database table is not affected. Table are truncated in * reverse sequence. ! * <p/> * This operation has the same effect of as {@link TruncateTableOperation}. * TruncateTableOperation is faster, and it is non-logged, meaning it cannot be *************** *** 44,50 **** * * @author Manuel Laflamme - * @since Feb 18, 2002 * @version $Revision$ * @see TruncateTableOperation */ public class DeleteAllOperation extends AbstractOperation --- 47,53 ---- * * @author Manuel Laflamme * @version $Revision$ * @see TruncateTableOperation + * @since Feb 18, 2002 */ public class DeleteAllOperation extends AbstractOperation *************** *** 68,81 **** DatabaseConfig databaseConfig = connection.getConfig(); ! IStatementFactory statementFactory = (IStatementFactory)databaseConfig.getProperty( ! DatabaseConfig.PROPERTY_STATEMENT_FACTORY); IBatchStatement statement = statementFactory.createBatchStatement(connection); try { int count = 0; ! ITableIterator iterator = dataSet.reverseIterator(); ! while(iterator.next()) { String tableName = iterator.getTableMetaData().getTableName(); // Use database table name. Required to support case sensitive database. --- 71,97 ---- DatabaseConfig databaseConfig = connection.getConfig(); ! IStatementFactory statementFactory = (IStatementFactory)databaseConfig.getProperty(DatabaseConfig.PROPERTY_STATEMENT_FACTORY); IBatchStatement statement = statementFactory.createBatchStatement(connection); try { int count = 0; ! ! Stack tableNames = new Stack(); ! Set tablesSeen = new HashSet(); ! ITableIterator iterator = dataSet.iterator(); ! while (iterator.next()) { String tableName = iterator.getTableMetaData().getTableName(); + if (!tablesSeen.contains(tableName)) + { + tableNames.push(tableName); + tablesSeen.add(tableName); + } + } + + // delete tables once each in reverse order of seeing them. + while (!tableNames.isEmpty()) + { + String tableName = (String)tableNames.pop(); // Use database table name. Required to support case sensitive database. *************** *** 92,96 **** } - if (count > 0) { --- 108,111 ---- |
From: <mla...@us...> - 2004-03-31 02:54:39
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19792/xdocs Modified Files: faq.fml index.xml navigation.xml Log Message: Updated xdoc about Wiki Index: faq.fml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/faq.fml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** faq.fml 18 Feb 2004 19:36:44 -0000 1.14 --- faq.fml 31 Mar 2004 02:42:55 -0000 1.15 *************** *** 4,8 **** <part id="general"> <title>General</title> - <!-- <faq id="supportedvendors"> <question> --- 4,7 ---- *************** *** 10,17 **** </question> <answer> ! <p>See the publicly maintained <a href="http://www.dbunit.org/cgi-bin/wiki.pl?SupportedRDBMS">list of compatible RDBMS</a> at the <a href="http://www.dbunit.org/wiki/">DbUnit Wiki.</a></p> </answer> </faq> - --> <faq id="build"> --- 9,15 ---- </question> <answer> ! <p>See the publicly maintained <a href="http://www.dbunit.org/cgi-bin/wiki.pl?SupportedRDBMS">list of compatible RDBMS</a> at the <a href="http://www.dbunit.org/wiki/">DbUnit Wiki.</a> Don't hesitate to contribute to this list, particularly for database not listed yet.</p> </answer> </faq> <faq id="build"> Index: index.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/index.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** index.xml 26 Jan 2004 16:48:03 -0000 1.7 --- index.xml 31 Mar 2004 02:42:55 -0000 1.8 *************** *** 4,8 **** <properties> ! <title>About DbUnit and News</title> <author email="ep...@up...">Eric Pugh</author> </properties> --- 4,8 ---- <properties> ! <title>About DbUnit</title> <author email="ep...@up...">Eric Pugh</author> </properties> *************** *** 26,29 **** --- 26,33 ---- <table border="1"> <tr> + <td>2004-03-16</td> + <td>The <a href="http://www.dbunit.org/wiki/">DbUnit Wiki</a> is now officially online. Please contribute to the <a href=" http://www.dbunit.org/cgi-bin/wiki.pl?SupportedRDBMS">SupportedRDBMS</a> page.</td> + </tr> + <tr> <td>2004-01-26</td> <td>ONJava article: <a href="http://www.onjava.com/pub/a/onjava/2004/01/21/dbunit.html">Effective Unit Testing with DbUnit</a>.</td> Index: navigation.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/navigation.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** navigation.xml 23 Jan 2004 07:14:17 -0000 1.8 --- navigation.xml 31 Mar 2004 02:42:56 -0000 1.9 *************** *** 7,11 **** <body> <links> ! <item name="SourceForge.net Project Page" href="http://www.sf.net/projects/dbunit"/> <item name="Maven Plugin" href="http://maven-plugins.sourceforge.net/maven-dbunit-plugin/index.html"/> </links> --- 7,12 ---- <body> <links> ! <item name="Wiki" href="http://www.dbunit.org/wiki/"/> ! <item name="SF.net Project Page" href="http://www.sf.net/projects/dbunit"/> <item name="Maven Plugin" href="http://maven-plugins.sourceforge.net/maven-dbunit-plugin/index.html"/> </links> *************** *** 15,18 **** --- 16,20 ---- <item name="FAQ" href="/faq.html"/> <item name="Get Support" href="https://sourceforge.net/support/getsupport.php?group_id=47439"/> + <item name="Wiki" href="http://www.dbunit.org/wiki/"/> <item name="Source" href="/cvs-usage.html"/> <item name="JavaDocs" href="apidocs/index.html"/> |
From: <mla...@us...> - 2004-03-31 01:34:10
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7111/src/java/org/dbunit/database Modified Files: DatabaseTableMetaData.java Log Message: Fixed ParameterIndexOutOfBoundsException with InterBase (#921869). Index: DatabaseTableMetaData.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/DatabaseTableMetaData.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DatabaseTableMetaData.java 15 Mar 2004 16:44:16 -0000 1.20 --- DatabaseTableMetaData.java 31 Mar 2004 01:22:27 -0000 1.21 *************** *** 184,188 **** DatabaseMetaData databaseMetaData = jdbcConnection.getMetaData(); ResultSet resultSet = databaseMetaData.getColumns( ! null, schemaName, tableName, null); try --- 184,188 ---- DatabaseMetaData databaseMetaData = jdbcConnection.getMetaData(); ResultSet resultSet = databaseMetaData.getColumns( ! null, schemaName, tableName, "%"); try |
From: <mla...@us...> - 2004-03-30 19:24:42
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4063/src/test/org/dbunit/dataset/xml Modified Files: FlatXmlWriterTest.java Log Message: Added new FlatXmlWriter constrctor taking an OutputStream Index: FlatXmlWriterTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml/FlatXmlWriterTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FlatXmlWriterTest.java 30 Mar 2004 18:01:19 -0000 1.5 --- FlatXmlWriterTest.java 30 Mar 2004 19:13:02 -0000 1.6 *************** *** 27,32 **** --- 27,36 ---- import org.dbunit.dataset.DefaultTable; import org.dbunit.dataset.datatype.DataType; + import org.dbunit.database.IDatabaseConnection; import java.io.StringWriter; + import java.io.File; + import java.io.FileWriter; + import java.io.FileOutputStream; /** *************** *** 130,134 **** assertEquals("output", expectedOutput, actualOutput); } ! public void testWriteIncludeEmptyTable() throws Exception { --- 134,138 ---- assertEquals("output", expectedOutput, actualOutput); } ! public void testWriteIncludeEmptyTable() throws Exception { |
From: <mla...@us...> - 2004-03-30 19:24:42
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4063/src/java/org/dbunit/dataset/xml Modified Files: FlatXmlDataSet.java FlatXmlWriter.java Log Message: Added new FlatXmlWriter constrctor taking an OutputStream Index: FlatXmlDataSet.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/xml/FlatXmlDataSet.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FlatXmlDataSet.java 30 Mar 2004 17:33:15 -0000 1.27 --- FlatXmlDataSet.java 30 Mar 2004 19:13:01 -0000 1.28 *************** *** 25,33 **** import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.IDataSet; ! import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; - import org.xml.sax.SAXException; ! import java.io.*; /** --- 25,37 ---- import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.IDataSet; ! import org.xml.sax.InputSource; ! import java.io.File; ! import java.io.IOException; ! import java.io.InputStream; ! import java.io.OutputStream; ! import java.io.Reader; ! import java.io.Writer; /** *************** *** 65,70 **** public class FlatXmlDataSet extends CachedDataSet { - private static final String DEFAULT_ENCODING = "UTF8"; - /** * Creates an FlatXmlDataSet object with the specifed InputSource. --- 69,72 ---- *************** *** 208,213 **** throws IOException, DataSetException { ! OutputStreamWriter writer = new OutputStreamWriter(out, DEFAULT_ENCODING); ! write(dataSet, writer); } --- 210,216 ---- throws IOException, DataSetException { ! FlatXmlWriter datasetWriter = new FlatXmlWriter(out); ! datasetWriter.setIncludeEmptyTable(true); ! datasetWriter.write(dataSet); } Index: FlatXmlWriter.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/xml/FlatXmlWriter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FlatXmlWriter.java 30 Mar 2004 18:01:19 -0000 1.6 --- FlatXmlWriter.java 30 Mar 2004 19:13:01 -0000 1.7 *************** *** 32,35 **** --- 32,37 ---- import java.io.IOException; + import java.io.OutputStream; + import java.io.OutputStreamWriter; import java.io.Writer; *************** *** 41,44 **** --- 43,47 ---- public class FlatXmlWriter implements IDataSetConsumer { + private static final String DEFAULT_ENCODING = "UTF8"; private static final String DATASET = "dataset"; *************** *** 55,58 **** --- 58,67 ---- } + public FlatXmlWriter(OutputStream out) throws IOException + { + _xmlWriter = new XmlWriter(new OutputStreamWriter(out, DEFAULT_ENCODING)); + _xmlWriter.enablePrettyPrint(true); + } + public FlatXmlWriter(Writer writer, String encoding) { |