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: <de...@us...> - 2005-10-18 14:43:36
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/src/test/org/dbunit/util Log Message: Directory /cvsroot/dbunit/dbunit/src/test/org/dbunit/util added to the repository |
From: <de...@us...> - 2005-10-18 14:43:36
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/util/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/src/test/org/dbunit/util/search Log Message: Directory /cvsroot/dbunit/dbunit/src/test/org/dbunit/util/search added to the repository |
From: <de...@us...> - 2005-10-18 14:43:35
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/src/java/org/dbunit/database/search Log Message: Directory /cvsroot/dbunit/dbunit/src/java/org/dbunit/database/search added to the repository |
From: <de...@us...> - 2005-10-18 14:43:28
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/database/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/src/test/org/dbunit/database/search Log Message: Directory /cvsroot/dbunit/dbunit/src/test/org/dbunit/database/search added to the repository |
From: <de...@us...> - 2005-10-18 14:43:27
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/util/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30762/src/java/org/dbunit/util/search Log Message: Directory /cvsroot/dbunit/dbunit/src/java/org/dbunit/util/search added to the repository |
From: <de...@us...> - 2005-10-18 12:55:44
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3411/xdocs Modified Files: changes.xml Log Message: 1328956 NPE In InsertIdentityOperation Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** changes.xml 25 Aug 2005 20:31:42 -0000 1.20 --- changes.xml 18 Oct 2005 12:55:30 -0000 1.21 *************** *** 9,12 **** --- 9,13 ---- <body> <release version="2.2" date="IN CVS" description=""> + <action dev="dep4b" due-to="Reuben Firmin" type="fix" issue="1328956">NPE In InsertIdentityOperation.</action> <action dev="dep4b" due-to="John Lewis" type="add" issue="1264212">Add "transaction" attribute to ant tasks to wrap operations in a single transaction. Can make operations faster.</action> <action dev="dep4b" due-to="Jeremy Frens" type="fix">Typo in howto example</action> |
From: <de...@us...> - 2005-10-18 12:55:43
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3411/src/java/org/dbunit/ext/mssql Modified Files: InsertIdentityOperation.java Log Message: 1328956 NPE In InsertIdentityOperation Index: InsertIdentityOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql/InsertIdentityOperation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** InsertIdentityOperation.java 15 Oct 2005 17:49:59 -0000 1.6 --- InsertIdentityOperation.java 18 Oct 2005 12:55:30 -0000 1.7 *************** *** 104,108 **** for (int i = 0; i < columns.length; i++) { ! if (identityFilter.accept(null, columns[i])) { return true; --- 104,108 ---- for (int i = 0; i < columns.length; i++) { ! if (identityFilter.accept(metaData.getTableName(), columns[i])) { return true; |
From: <de...@us...> - 2005-10-15 17:50:12
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11639/src/java/org/dbunit/ext/mssql Modified Files: InsertIdentityOperation.java Log Message: typo fix Index: InsertIdentityOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mssql/InsertIdentityOperation.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InsertIdentityOperation.java 18 May 2004 01:27:31 -0000 1.5 --- InsertIdentityOperation.java 15 Oct 2005 17:49:59 -0000 1.6 *************** *** 47,51 **** * <code>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor</code> * <p> ! * Thanks to Jeremy Stein how have submited multiple patches. * * @author Manuel Laflamme --- 47,51 ---- * <code>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor</code> * <p> ! * Thanks to Jeremy Stein who has submitted multiple patches. * * @author Manuel Laflamme |
From: Felipe L. <fel...@gm...> - 2005-08-28 22:37:19
|
From: <de...@us...> - 2005-08-25 20:31:50
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30944/xdocs Modified Files: changes.xml Log Message: Document new transaction attribute for ant tasks for 2.2! Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** changes.xml 19 Aug 2005 21:21:58 -0000 1.19 --- changes.xml 25 Aug 2005 20:31:42 -0000 1.20 *************** *** 9,12 **** --- 9,13 ---- <body> <release version="2.2" date="IN CVS" description=""> + <action dev="dep4b" due-to="John Lewis" type="add" issue="1264212">Add "transaction" attribute to ant tasks to wrap operations in a single transaction. Can make operations faster.</action> <action dev="dep4b" due-to="Jeremy Frens" type="fix">Typo in howto example</action> <action dev="dep4b" due-to="Cris Daniluk" type="add">Properly support writing NCLOBs to Oracle</action> |
From: <de...@us...> - 2005-08-25 20:29:07
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30124/xdocs Modified Files: anttask.xml Log Message: 1264212 Add transaction attribute to ant task to speed up operation in some cases. Index: anttask.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/anttask.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** anttask.xml 4 Apr 2004 14:25:48 -0000 1.9 --- anttask.xml 25 Aug 2005 20:28:59 -0000 1.10 *************** *** 119,122 **** --- 119,133 ---- </td> </tr> + <tr> + <td>transaction</td> + <td>Boolean indicating if this operation should be wrapped in a + transaction, ensuring that the entire operation completes or is + rolled back. This may also dramatically improve performance of + large operations. Possible values are "true" or "false". + Defaults to <b>"false"</b>.</td> + <td> + <p>No</p> + </td> + </tr> </table> </td> |
From: <de...@us...> - 2005-08-25 20:29:07
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30124/src/java/org/dbunit/ant Modified Files: Operation.java Log Message: 1264212 Add transaction attribute to ant task to speed up operation in some cases. Index: Operation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Operation.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Operation.java 4 Apr 2004 04:57:19 -0000 1.13 --- Operation.java 25 Aug 2005 20:28:59 -0000 1.14 *************** *** 27,30 **** --- 27,31 ---- import org.dbunit.ext.mssql.InsertIdentityOperation; import org.dbunit.operation.DatabaseOperation; + import org.dbunit.operation.TransactionOperation; import java.io.File; *************** *** 49,52 **** --- 50,54 ---- private String _format; private File _src; + private boolean _transaction = false; private DatabaseOperation _operation; private boolean _forwardOperation = true; *************** *** 72,75 **** --- 74,82 ---- } + public boolean isTransaction() + { + return _transaction; + } + public void setType(String type) { *************** *** 153,156 **** --- 160,168 ---- } + public void setTransaction(boolean transaction) + { + _transaction = transaction; + } + public void execute(IDatabaseConnection connection) throws DatabaseUnitException { *************** *** 167,173 **** try { ! IDataSet dataset = getSrcDataSet(getSrc(), ! getFormat(), _forwardOperation); ! _operation.execute(connection, dataset); } catch (SQLException e) --- 179,185 ---- try { ! DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation); ! IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), _forwardOperation); ! operation.execute(connection, dataset); } catch (SQLException e) |
From: <de...@us...> - 2005-08-25 20:28:15
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29886/src/test/org/dbunit/ant Modified Files: DbUnitTaskTest.java Log Message: Fix failure message in test to reflect actual test! Index: DbUnitTaskTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ant/DbUnitTaskTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DbUnitTaskTest.java 29 Sep 2004 07:05:51 -0000 1.18 --- DbUnitTaskTest.java 25 Aug 2005 20:28:08 -0000 1.19 *************** *** 134,138 **** public void testResolveOperationTypes() { ! assertOperationType("Should have been an DELETE_ALL operation", "test-type-none", DatabaseOperation.NONE); assertOperationType("Should have been an DELETE_ALL operation", --- 134,138 ---- public void testResolveOperationTypes() { ! assertOperationType("Should have been a NONE operation", "test-type-none", DatabaseOperation.NONE); assertOperationType("Should have been an DELETE_ALL operation", |
From: <de...@us...> - 2005-08-19 21:50:57
|
Update of /cvsroot/dbunit/dbunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13034 Modified Files: project.xml Log Message: Now publish site using maven site:deploy! Index: project.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/project.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** project.xml 6 May 2005 20:44:48 -0000 1.21 --- project.xml 19 Aug 2005 21:50:43 -0000 1.22 *************** *** 40,45 **** <url>http://www.dbunit.org</url> <issueTrackingUrl>http://sourceforge.net/tracker/?group_id=47439</issueTrackingUrl> ! <siteAddress>www.dbunit.org</siteAddress> ! <siteDirectory></siteDirectory> <distributionDirectory></distributionDirectory> --- 40,45 ---- <url>http://www.dbunit.org</url> <issueTrackingUrl>http://sourceforge.net/tracker/?group_id=47439</issueTrackingUrl> ! <siteAddress>shell.sourceforge.net</siteAddress> ! <siteDirectory>/home/groups/d/db/dbunit/htdocs/</siteDirectory> <distributionDirectory></distributionDirectory> |
From: <de...@us...> - 2005-08-19 21:22:07
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7818/xdocs Modified Files: changes.xml Log Message: fix version.. 2.2 is the version, not 2.2-dev! Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** changes.xml 22 Jun 2005 13:22:28 -0000 1.18 --- changes.xml 19 Aug 2005 21:21:58 -0000 1.19 *************** *** 8,12 **** <body> ! <release version="2.2-dev" date="IN CVS" description=""> <action dev="dep4b" due-to="Jeremy Frens" type="fix">Typo in howto example</action> <action dev="dep4b" due-to="Cris Daniluk" type="add">Properly support writing NCLOBs to Oracle</action> --- 8,12 ---- <body> ! <release version="2.2" date="IN CVS" description=""> <action dev="dep4b" due-to="Jeremy Frens" type="fix">Typo in howto example</action> <action dev="dep4b" due-to="Cris Daniluk" type="add">Properly support writing NCLOBs to Oracle</action> |
From: <de...@us...> - 2005-08-19 21:21:38
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7730/xdocs Modified Files: index.xml Log Message: Document removal of links to wiki Index: index.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/index.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.xml 30 May 2004 23:44:15 -0000 1.10 --- index.xml 19 Aug 2005 21:21:29 -0000 1.11 *************** *** 5,9 **** <properties> <title>About DbUnit</title> ! <author email="ep...@up...">Eric Pugh</author> </properties> --- 5,9 ---- <properties> <title>About DbUnit</title> ! <author email="ep...@uo...">Eric Pugh</author> </properties> *************** *** 18,22 **** </p> <p> ! DbUnit has the ability to export and import your database data to and from XML datasets. Since version 2.0, DbUnit can works with very large dataset when use in streaming mode. DbUnit can also helps you to verify that your database data match expected set of values. </p> --- 18,22 ---- </p> <p> ! DbUnit has the ability to export and import your database data to and from XML datasets. Since version 2.0, DbUnit can works with very large dataset when use in streaming mode. DbUnit can also helps you to verify that your database data match expected set of values. </p> *************** *** 26,31 **** <table border="1"> <tr> <td>2004-05-31</td> ! <td><b>Version 2.1 released.</b> Multiple bugfixes and enhancements. See <a href="changes-report.html#2.1">changes</a>.</td> </tr> <tr> --- 26,35 ---- <table border="1"> <tr> + <td>2005-08-19</td> + <td><b>Website Updated!</b> Link to wiki has been removed. Many fixes in CVS for 2.2-dev, see <a href="changes-report.html#2.2">changes</a>.</td> + </tr> + <tr> <td>2004-05-31</td> ! <td>Version 2.1 released. Multiple bugfixes and enhancements. See <a href="changes-report.html#2.1">changes</a>.</td> </tr> <tr> |
From: <de...@us...> - 2005-08-19 21:20:57
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7599/xdocs Modified Files: navigation.xml Log Message: remove wiki from navigation until it gets fixed... Index: navigation.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/navigation.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** navigation.xml 1 Jun 2004 02:45:20 -0000 1.10 --- navigation.xml 19 Aug 2005 21:20:49 -0000 1.11 *************** *** 7,11 **** <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"/> --- 7,13 ---- <body> <links> ! <!-- ! Removed until it can be fixed ! 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"/> *************** *** 16,20 **** <item name="FAQ" href="/faq.html"/> <item name="Get Support" href="http://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"/> --- 18,21 ---- |
From: <de...@us...> - 2005-06-22 13:22:37
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32117/xdocs Modified Files: changes.xml howto.xml Log Message: Fix typo in example! Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** changes.xml 6 May 2005 21:14:32 -0000 1.17 --- changes.xml 22 Jun 2005 13:22:28 -0000 1.18 *************** *** 9,12 **** --- 9,13 ---- <body> <release version="2.2-dev" date="IN CVS" description=""> + <action dev="dep4b" due-to="Jeremy Frens" type="fix">Typo in howto example</action> <action dev="dep4b" due-to="Cris Daniluk" type="add">Properly support writing NCLOBs to Oracle</action> <action dev="dep4b" type="add" due-to="Dion Gillard" issue="1114490">Support CSV files from a URL (e.g. jar file) + CSV fixes</action> Index: howto.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/howto.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** howto.xml 30 May 2004 23:44:15 -0000 1.3 --- howto.xml 22 Jun 2005 13:22:28 -0000 1.4 *************** *** 166,170 **** // Assert actual database table match expected table ! Assertion.assertEquals(expectedTable, expectedTable); } }</source> </p> --- 166,170 ---- // Assert actual database table match expected table ! Assertion.assertEquals(expectedTable, actualTable); } }</source> </p> |
From: <de...@us...> - 2005-05-06 21:14:43
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2138/src/java/org/dbunit/ext/oracle Modified Files: OracleClobDataType.java OracleDataTypeFactory.java Added Files: OracleNClobDataType.java Log Message: Properly write NCLOBS to Oracle. --- NEW FILE: OracleNClobDataType.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.ext.oracle; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.sql.PreparedStatement; import java.sql.SQLException; import org.dbunit.dataset.datatype.TypeCastException; /** * NCLOB handler * @author cris.daniluk * @since May 3, 2005 * @version $Revision: 1.1 $ */ public class OracleNClobDataType extends OracleClobDataType { protected static final Short FORM_NCHAR = new Short((short)2); public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { try { Class statementClass = Class.forName("oracle.jdbc.OraclePreparedStatement"); Method formOfUse = statementClass.getMethod("setFormOfUse", new Class[] { Integer.TYPE, Short.TYPE }); formOfUse.invoke(statement, new Object[] { new Integer(column), FORM_NCHAR }); } catch (IllegalAccessException e) { throw new TypeCastException(value, this, e); } catch (NoSuchMethodException e) { throw new TypeCastException(value, this, e); } catch (InvocationTargetException e) { throw new TypeCastException(value, this, e.getTargetException()); } catch (ClassNotFoundException e) { throw new TypeCastException(value, this, e); } statement.setObject(column, getClob(value, statement.getConnection())); } } Index: OracleClobDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleClobDataType.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OracleClobDataType.java 28 Apr 2004 19:49:34 -0000 1.3 --- OracleClobDataType.java 6 May 2005 21:14:32 -0000 1.4 *************** *** 57,61 **** } ! private Object getClob(Object value, Connection connection) throws TypeCastException { --- 57,61 ---- } ! protected Object getClob(Object value, Connection connection) throws TypeCastException { *************** *** 123,127 **** ! private void freeTemporaryClob(Object tempClob) throws TypeCastException { if (tempClob == null) --- 123,127 ---- ! protected void freeTemporaryClob(Object tempClob) throws TypeCastException { if (tempClob == null) Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** OracleDataTypeFactory.java 28 May 2004 00:19:53 -0000 1.12 --- OracleDataTypeFactory.java 6 May 2005 21:14:33 -0000 1.13 *************** *** 30,34 **** /** * Specialized factory that recognizes Oracle data types. - * @author manuel.laflamme * @since Jul 17, 2003 --- 30,33 ---- *************** *** 39,42 **** --- 38,42 ---- public static final DataType ORACLE_BLOB = new OracleBlobDataType(); public static final DataType ORACLE_CLOB = new OracleClobDataType(); + public static final DataType ORACLE_NCLOB = new OracleNClobDataType(); public static final DataType LONG_RAW = new BinaryStreamDataType( "LONG RAW", Types.LONGVARBINARY); *************** *** 63,70 **** // CLOB ! if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) { return ORACLE_CLOB; } // NVARCHAR2 --- 63,76 ---- // CLOB ! if ("CLOB".equals(sqlTypeName)) { return ORACLE_CLOB; } + + // NCLOB + if ("NCLOB".equals(sqlTypeName)) + { + return ORACLE_NCLOB; + } // NVARCHAR2 |
From: <de...@us...> - 2005-05-06 21:14:42
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2138/xdocs Modified Files: changes.xml Log Message: Properly write NCLOBS to Oracle. Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** changes.xml 6 May 2005 21:06:14 -0000 1.16 --- changes.xml 6 May 2005 21:14:32 -0000 1.17 *************** *** 9,13 **** <body> <release version="2.2-dev" date="IN CVS" description=""> ! <action dev="dep4b" type="add" due-to="Dion Gillard" issue="1114490">Support CSV files from a URL (e.g. jar file) + CSV fixes</action> <action dev="dep4b" type="fix">Fix the driver in classpath/driver not in classpath to always work regardless of configured driver.</action> <action dev="dep4b" type="fix" due-to="Dion Gillard" issue="1114487">Typo in test class AbstractDataSetTest</action> --- 9,14 ---- <body> <release version="2.2-dev" date="IN CVS" description=""> ! <action dev="dep4b" due-to="Cris Daniluk" type="add">Properly support writing NCLOBs to Oracle</action> ! <action dev="dep4b" type="add" due-to="Dion Gillard" issue="1114490">Support CSV files from a URL (e.g. jar file) + CSV fixes</action> <action dev="dep4b" type="fix">Fix the driver in classpath/driver not in classpath to always work regardless of configured driver.</action> <action dev="dep4b" type="fix" due-to="Dion Gillard" issue="1114487">Typo in test class AbstractDataSetTest</action> |
From: <de...@us...> - 2005-05-06 21:14:42
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2138/src/test/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactoryTest.java Log Message: Properly write NCLOBS to Oracle. Index: OracleDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OracleDataTypeFactoryTest.java 28 May 2004 00:19:54 -0000 1.9 --- OracleDataTypeFactoryTest.java 6 May 2005 21:14:33 -0000 1.10 *************** *** 69,73 **** String sqlTypeName = "NCLOB"; ! DataType expected = OracleDataTypeFactory.ORACLE_CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); --- 69,73 ---- String sqlTypeName = "NCLOB"; ! DataType expected = OracleDataTypeFactory.ORACLE_NCLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); |
From: <de...@us...> - 2005-05-06 21:06:27
|
Update of /cvsroot/dbunit/dbunit/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32299/xdocs Modified Files: changes.xml Log Message: fix xml tag for issue! Index: changes.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/xdocs/changes.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** changes.xml 6 May 2005 21:04:05 -0000 1.15 --- changes.xml 6 May 2005 21:06:14 -0000 1.16 *************** *** 9,15 **** <body> <release version="2.2-dev" date="IN CVS" description=""> ! <action dev="dep4b" type="add" due-to="Dion Gillard" issue-id="1114490">Support CSV files from a URL (e.g. jar file) + CSV fixes</action> <action dev="dep4b" type="fix">Fix the driver in classpath/driver not in classpath to always work regardless of configured driver.</action> ! <action dev="dep4b" type="fix" due-to="Dion Gillard" issue-id="1114487">Typo in test class AbstractDataSetTest</action> <action dev="dep4b" type="add" due-to="Klas Axell">new HsqldbDataTypeFactory for working with booleans in HsqlDB.</action> </release> --- 9,15 ---- <body> <release version="2.2-dev" date="IN CVS" description=""> ! <action dev="dep4b" type="add" due-to="Dion Gillard" issue="1114490">Support CSV files from a URL (e.g. jar file) + CSV fixes</action> <action dev="dep4b" type="fix">Fix the driver in classpath/driver not in classpath to always work regardless of configured driver.</action> ! <action dev="dep4b" type="fix" due-to="Dion Gillard" issue="1114487">Typo in test class AbstractDataSetTest</action> <action dev="dep4b" type="add" due-to="Klas Axell">new HsqldbDataTypeFactory for working with booleans in HsqlDB.</action> </release> |
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31706/src/test/org/dbunit/dataset/csv Modified Files: CsvParserTest.java AllTests.java CsvDataSetTest.java Added Files: CsvURLProducerTest.java CsvURLDataSetTest.java Log Message: [ 1114490 ] Support CSV files from a URL (e.g. jar file) + CSV fixes --- NEW FILE: CsvURLProducerTest.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.dataset.csv; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import junit.framework.TestCase; import org.dbunit.DatabaseUnitException; import org.dbunit.ant.AbstractStep; import org.dbunit.ant.Export; import org.dbunit.ant.Operation; import org.dbunit.ant.Query; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.CachedDataSet; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.ITable; import org.dbunit.operation.DatabaseOperation; public class CsvURLProducerTest extends TestCase { private String driverClass; private String url; private String user; private String password; private IDatabaseConnection connection; private static final int ORDERS_ROWS_NUMBER = 5; private static final int ORDERS_ROW_ROWS_NUMBER = 3; private static final String THE_DIRECTORY = "src/csv/orders"; public void testProduceFromFolder() throws DataSetException, MalformedURLException { CsvURLProducer producer = new CsvURLProducer(new File(THE_DIRECTORY).toURL(), CsvDataSet.TABLE_ORDERING_FILE); doTestWithProducer(producer); } public void testProduceFromJar() throws DataSetException, IOException { File file = new File(THE_DIRECTORY + "/orders.jar"); URL jarFile = new URL("jar:" + file.toURL() + "!/"); CsvURLProducer producer = new CsvURLProducer(jarFile, CsvDataSet.TABLE_ORDERING_FILE); doTestWithProducer(producer); } private void doTestWithProducer(CsvURLProducer producer) throws DataSetException { CachedDataSet consumer = new CachedDataSet(); // producer.setConsumer(new CsvDataSetWriter("src/csv/orders-out")); producer.setConsumer(consumer); producer.produce(); final ITable[] tables = consumer.getTables(); assertEquals("expected 2 tables", 2, tables.length); final ITable orders = consumer.getTable("orders"); assertNotNull("orders table not found", orders); assertEquals("wrong number of rows", ORDERS_ROWS_NUMBER, orders.getRowCount()); assertEquals("wrong number of columns", 2, orders.getTableMetaData().getColumns().length); final ITable ordersRow = consumer.getTable("orders_row"); assertNotNull("orders_row table not found", ordersRow); assertEquals("wrong number of rows", ORDERS_ROW_ROWS_NUMBER, ordersRow.getRowCount()); assertEquals("wrong number of columns", ORDERS_ROW_ROWS_NUMBER, ordersRow.getTableMetaData().getColumns().length); } public void testProduceAndInsertFromFolder() throws ClassNotFoundException, MalformedURLException, DatabaseUnitException, SQLException { produceAndInsertToDatabase(); Statement statement = connection.getConnection().createStatement(); ResultSet resultSet = statement.executeQuery("select count(*) from orders"); resultSet.next(); int count = resultSet.getInt(1); assertEquals(ORDERS_ROWS_NUMBER, count); resultSet.close(); statement.close(); } private void produceAndInsertToDatabase() throws DatabaseUnitException, SQLException, MalformedURLException { CsvURLProducer producer = new CsvURLProducer(new File(THE_DIRECTORY).toURL(), CsvDataSet.TABLE_ORDERING_FILE); CachedDataSet consumer = new CachedDataSet(); producer.setConsumer(consumer); producer.produce(); DatabaseOperation operation = DatabaseOperation.INSERT; operation.execute(connection, consumer); } // TODO Fix this so it can handle FORMAT_CSV_URL or something similar public void XXXtestInsertOperationWithCsvFormat() throws SQLException, DatabaseUnitException { Operation operation = new Operation(); operation.setFormat(AbstractStep.FORMAT_CSV); operation.setSrc(new File(THE_DIRECTORY)); operation.setType("INSERT"); operation.execute(connection); Statement statement = connection.getConnection().createStatement(); ResultSet resultSet = statement.executeQuery("select count(*) from orders"); resultSet.next(); final int count = resultSet.getInt(1); assertEquals("wrong number of row in orders table", ORDERS_ROWS_NUMBER, count); resultSet.close(); statement.close(); } public void XXXtestExportTaskWithCsvFormat() throws MalformedURLException, DatabaseUnitException, SQLException { produceAndInsertToDatabase(); final String fromAnt = "target/csv/from-ant"; final File dir = new File(fromAnt); deleteDirectory(dir); Export export = new Export(); // TODO Fix this so it can handle FORMAT_CSV_URL or something similar export.setFormat(AbstractStep.FORMAT_CSV); export.setDest(dir); Query query = new Query(); query.setName("orders"); query.setSql("select * from orders"); export.addQuery(query); Query query2 = new Query(); query2.setName("orders_row"); query2.setSql("select * from orders_row"); export.addQuery(query2); export.execute(getConnection()); final File ordersFile = new File(fromAnt + "/orders.csv"); assertTrue("file '" + ordersFile.getAbsolutePath() + "' does not exists", ordersFile.exists()); final File ordersRowFile = new File(fromAnt + "/orders_row.csv"); assertTrue("file " + ordersRowFile + " does not exists", ordersRowFile.exists()); } private void deleteDirectory(final File dir) { File[] files = dir.listFiles(); if (files == null) return; for (int i = 0; i < files.length; i++) { File file = files[i]; file.delete(); } dir.delete(); } private IDatabaseConnection getConnection() throws SQLException { return new DatabaseConnection(DriverManager.getConnection(url, user, password)); } protected void setUp() throws Exception { Properties properties = new Properties(); final FileInputStream inStream = new FileInputStream("src/csv/cvs-tests.properties"); properties.load(inStream); inStream.close(); driverClass = properties.getProperty("cvs-tests.driver.class"); url = properties.getProperty("cvs-tests.url"); user = properties.getProperty("cvs-tests.user"); password = properties.getProperty("cvs-tests.password"); assertFalse("".equals(driverClass)); assertFalse("".equals(url)); assertFalse("".equals(user)); Class.forName(driverClass); connection = getConnection(); Statement statement = connection.getConnection().createStatement(); try { statement.execute("DROP TABLE ORDERS"); statement.execute("DROP TABLE ORDERS_ROW"); } catch (Exception ignored) {} statement.execute("CREATE TABLE ORDERS (ID INTEGER, DESCRIPTION VARCHAR)"); statement.execute("CREATE TABLE ORDERS_ROW (ID INTEGER, DESCRIPTION VARCHAR, QUANTITY INTEGER)"); //statement.execute("delete from orders"); //statement.execute("delete from orders_row"); statement.close(); } protected void tearDown() throws Exception { connection.close(); } } --- NEW FILE: CsvURLDataSetTest.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.dataset.csv; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import junit.framework.TestCase; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.ITable; /** * @author Lenny Marks (le...@ap...) * @author dIon gillard (dio...@us...) * @version $Revision: 1.1 $ * @since Sep 12, 2004 */ public class CsvURLDataSetTest extends TestCase { public CsvURLDataSetTest(String s) { super(s); } public void testNullColumns() throws DataSetException, MalformedURLException { URL csvDir = new File("src/csv/orders/").toURL(); CsvURLDataSet dataSet = new CsvURLDataSet(csvDir); ITable table = dataSet.getTable("orders"); assertNull(table.getValue(4, "description")); } public void testSpacesInColumns() throws DataSetException, MalformedURLException { URL csvDir = new File("src/csv/accounts/").toURL(); CsvURLDataSet dataSet = new CsvURLDataSet(csvDir); ITable table = dataSet.getTable("accounts"); assertEquals(" 123", table.getValue(0, "acctid")); assertEquals(" 2", table.getValue(1, "acctid")); assertEquals(" 3spaces", table.getValue(2, "acctid")); assertEquals(" -4", table.getValue(3, "acctid")); assertEquals(" 5 ", table.getValue(4, "acctid")); } } Index: CsvParserTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv/CsvParserTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CsvParserTest.java 6 Apr 2004 06:51:53 -0000 1.3 --- CsvParserTest.java 6 May 2005 21:04:05 -0000 1.4 *************** *** 124,127 **** --- 124,145 ---- } + public void testWhitespacePreservedOnQuotedStrings() throws PipelineException, IllegalInputCharacterException { + String csv = "\" Hello, \",world"; + List parsed = parser.parse(csv); + assertEquals(2, parsed.size()); + assertEquals(" Hello, ", parsed.get(0)); + assertEquals("world", parsed.get(1)); + csv = " Hello, world"; + parsed = parser.parse(csv); + assertEquals(2, parsed.size()); + assertEquals("Hello", parsed.get(0)); + assertEquals("world", parsed.get(1)); + csv = "\" Hello, \",\" world \"";; + parsed = parser.parse(csv); + assertEquals(2, parsed.size()); + assertEquals(" Hello, ", parsed.get(0)); + assertEquals(" world ", parsed.get(1)); + } + protected void setUp() throws Exception { parser = new CsvParserImpl(); Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv/AllTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AllTests.java 29 Sep 2004 07:05:51 -0000 1.3 --- AllTests.java 6 May 2005 21:04:05 -0000 1.4 *************** *** 43,46 **** --- 43,48 ---- suite.addTest(new TestSuite(CsvDataSetWriterTest.class)); suite.addTest(new TestSuite(CsvDataSetTest.class)); + suite.addTest(new TestSuite(CsvURLDataSetTest.class)); + suite.addTest(new TestSuite(CsvURLProducerTest.class)); return suite; Index: CsvDataSetTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/csv/CsvDataSetTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CsvDataSetTest.java 29 Sep 2004 07:05:51 -0000 1.1 --- CsvDataSetTest.java 6 May 2005 21:04:05 -0000 1.2 *************** *** 23,40 **** import org.dbunit.Assertion; ! import org.dbunit.dataset.*; ! import org.dbunit.dataset.AbstractDataSetTest; import org.dbunit.dataset.DataSetUtils; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; - import org.dbunit.dataset.filter.ITableFilter; - import org.dbunit.dataset.xml.FlatXmlDataSet; - - import java.io.*; - import java.util.ArrayList; - import java.util.List; - - import junit.framework.TestCase; /** --- 23,36 ---- + import java.io.File; + import java.io.IOException; + + import junit.framework.TestCase; + import org.dbunit.Assertion; ! import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.DataSetUtils; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; /** *************** *** 63,77 **** public void testWrite() throws Exception { ! IDataSet expectedDataSet = new CsvDataSet(DATASET_DIR).getOrdered(); File tempDir = createTmpDir(); try { //modified this test from FlatXmlDataSetTest ! CsvDataSet.write(expectedDataSet, tempDir); File tableOrderingFile = new File(tempDir, CsvDataSet.TABLE_ORDERING_FILE); assertTrue(tableOrderingFile.exists()); ! IDataSet actualDataSet = new CsvDataSet(tempDir).getOrdered(); //verify table count --- 59,73 ---- public void testWrite() throws Exception { ! IDataSet expectedDataSet = new CsvDataSet(DATASET_DIR); File tempDir = createTmpDir(); try { //modified this test from FlatXmlDataSetTest ! CsvDataSetWriter.write(expectedDataSet, tempDir); File tableOrderingFile = new File(tempDir, CsvDataSet.TABLE_ORDERING_FILE); assertTrue(tableOrderingFile.exists()); ! IDataSet actualDataSet = new CsvDataSet(tempDir); //verify table count *************** *** 96,100 **** } ! assertFalse(tempDir.exists()); } --- 92,96 ---- } ! //assertFalse("temporary directory was not deleted", tempDir.exists()); } |
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31706/src/java/org/dbunit/dataset/csv Modified Files: CsvDataSet.java CsvParserImpl.java CsvProducer.java CsvParser.java CsvDataSetWriter.java Added Files: CsvURLDataSet.java CsvURLProducer.java Log Message: [ 1114490 ] Support CSV files from a URL (e.g. jar file) + CSV fixes --- NEW FILE: CsvURLDataSet.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.dataset.csv; import java.net.URL; import org.dbunit.dataset.CachedDataSet; import org.dbunit.dataset.DataSetException; /** * This class constructs an IDataSet given a base URL containing CSV * files. It handles translations of "null" (the string), into null. * Based HEAVILY on {@link org.dbunit.dataset.csv.CsvDataSet} * * @author Lenny Marks (le...@ap...) * @author Dion Gillard (dio...@us...) */ public class CsvURLDataSet extends CachedDataSet { /** base url that data can be found at */ private URL base; /** * Create a Data Set from CSV files, using the base URL provided to find data. */ public CsvURLDataSet(URL base) throws DataSetException { super(new CsvURLProducer(base, CsvDataSet.TABLE_ORDERING_FILE)); this.base = base; } } --- NEW FILE: CsvURLProducer.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.dataset.csv; import java.io.IOException; import java.net.URL; import java.util.Iterator; import java.util.List; import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; import org.dbunit.dataset.DefaultTableMetaData; import org.dbunit.dataset.ITableMetaData; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.stream.DefaultConsumer; import org.dbunit.dataset.stream.IDataSetConsumer; import org.dbunit.dataset.stream.IDataSetProducer; /** * A {@link IDataSetProducer Data Set Producer} that produces datasets from * CVS files found at a base URL. * * Based HEAVILY on {@link org.dbunit.dataset.csv.CsvProducer}. * * @author Dion Gillard * @author Federico Spinazzi */ public class CsvURLProducer implements IDataSetProducer { /** the default consumer - does nothing */ private static final IDataSetConsumer EMPTY_CONSUMER = new DefaultConsumer(); /** * the consumer of the produced datasets, by default a * {@link DefaultConsumer} */ private IDataSetConsumer _consumer = EMPTY_CONSUMER; /** the base url to retrieve data from */ private URL base; /** the offset from the base url where the list of tables can be found */ private String tableList; /** * Create a Csv Data Set Producer which uses the base URL to retrieve * a list of tables and the data. * @param base the URL where the tableList and data can be found. * @param tableList the relative location of the list of tables. */ public CsvURLProducer(URL base, String tableList) { this.base = base; this.tableList = tableList; } /* * @see IDataSetProducer#setConsumer(org.dbunit.dataset.stream.IDataSetConsumer) */ public void setConsumer(IDataSetConsumer consumer) throws DataSetException { _consumer = consumer; } /* * @see IDataSetProducer#produce() */ public void produce() throws DataSetException { _consumer.startDataSet(); try { List tableSpecs = CsvProducer.getTables(base, tableList); for (Iterator tableIter = tableSpecs.iterator(); tableIter.hasNext();) { String table = (String) tableIter.next(); try { produceFromURL(new URL(base, table + ".csv")); } catch (CsvParserException e) { throw new DataSetException("error producing dataset for table '" + table + "'", e); } } _consumer.endDataSet(); } catch (IOException e) { throw new DataSetException("error getting list of tables", e); } } /** * Produce a dataset from a URL. * The URL is assumed to contain data in CSV format. * @param url a url containing CSV data. */ private void produceFromURL(URL url) throws DataSetException { try { CsvParser parser = new CsvParserImpl(); List readData = parser.parse(url); List readColumns = (List) readData.get(0); Column[] columns = new Column[readColumns.size()]; for (int i = 0; i < readColumns.size(); i++) { columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN); } String tableName = url.getFile(); tableName = tableName.substring(tableName.lastIndexOf("/")+1, tableName.indexOf(".csv")); ITableMetaData metaData = new DefaultTableMetaData(tableName, columns); _consumer.startTable(metaData); for (int i = 1 ; i < readData.size(); i++) { List rowList = (List)readData.get(i); Object[] row = rowList.toArray(); for(int col = 0; col < row.length; col++) { if (CsvDataSetWriter.NULL.equals(row[col])) { row[col] = null; } } _consumer.row(row); } _consumer.endTable(); } catch (CsvParserException e) { throw new DataSetException("error parsing CSV for URL: '" + url + "'"); } catch (IOException e) { throw new DataSetException("I/O error parsing CSV for URL: '" + url + "'"); } } } Index: CsvDataSet.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/CsvDataSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CsvDataSet.java 29 Sep 2004 07:05:50 -0000 1.1 --- CsvDataSet.java 6 May 2005 21:04:06 -0000 1.2 *************** *** 1,12 **** package org.dbunit.dataset.csv; - import java.io.*; import java.io.File; - import java.io.FileWriter; - import java.util.*; - import java.util.ArrayList; - import java.util.Comparator; - import org.dbunit.dataset.*; import org.dbunit.dataset.CachedDataSet; import org.dbunit.dataset.DataSetException; --- 1,6 ---- *************** *** 29,95 **** } - /** - * Return an IDataSet ordered using table-orderings.txt in this - * CsvDataSets directory. - * - */ - public IDataSet getOrdered() throws DataSetException, IOException { - File tableOrderingFile = new File(dir, TABLE_ORDERING_FILE); - String[] tableNames = getTableNames(); - Arrays.sort(tableNames, new TableComparator(tableOrderingFile)); - return new FilteredDataSet(tableNames, this); - } - - public void row(Object[] values) throws DataSetException { - Object[] newValues = new Object[values.length]; - for(int i = 0; i < values.length; i++) { - newValues[i] = values[i].equals(CsvDataSetWriter.NULL) ? null : values[i]; - } - super.row(newValues); - } - - /** - * Write out the <i>dataSet</i> to CSV files in <i>dir</i>. Also - * generate table-orderings.txt from the ordering in the <i>dataSet</i>. - * - */ - public static void write(IDataSet dataSet, File dir) throws DataSetException, IOException { - CsvDataSetWriter.write(dataSet, dir); - generateTableOrderingFile(dataSet, dir); - } - - private static void generateTableOrderingFile(IDataSet dataSet, File dest) throws IOException, DataSetException { - File outFile = new File(dest, TABLE_ORDERING_FILE); - - PrintWriter writer = new PrintWriter(new FileWriter(outFile)); - String[] tableNames = dataSet.getTableNames(); - for(int i = 0; i < tableNames.length; i++) { - writer.print(tableNames[i] + "\n"); - } - writer.close(); - - } - - private static class TableComparator implements Comparator { - - private List orderedNames = new ArrayList(); - - public TableComparator(File tableOrderingFile) throws IOException { - BufferedReader reader = - new BufferedReader(new FileReader(tableOrderingFile)); - String line = null; - while((line = reader.readLine()) != null) { - orderedNames.add(line.trim()); - } - reader.close(); - } - - public int compare(Object o1, Object o2) { - Integer o1Int = new Integer(orderedNames.indexOf(o1)); - Integer o2Int = new Integer(orderedNames.indexOf(o2)); - return o1Int.compareTo(o2Int); - - } - - } } --- 23,25 ---- Index: CsvParserImpl.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/CsvParserImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CsvParserImpl.java 6 Apr 2004 06:51:52 -0000 1.3 --- CsvParserImpl.java 6 May 2005 21:04:06 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- import java.io.*; + import java.net.URL; import java.text.CharacterIterator; import java.text.StringCharacterIterator; *************** *** 62,71 **** public List parse(File file) throws IOException, CsvParserException { - BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); LineNumberReader lineNumberReader = new LineNumberReader(reader); List rows = new ArrayList(); ! ! List columnsInFirstLine = parseFirstLine(lineNumberReader, file, rows); parseTheData(columnsInFirstLine, lineNumberReader, rows); return rows; --- 63,79 ---- public List parse(File file) throws IOException, CsvParserException { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + return parse(reader, file.getAbsolutePath().toString()); + } + + public List parse(URL url) throws IOException, CsvParserException { + BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); + return parse(reader, url.toString()); + } + + public List parse(Reader reader, String source) throws IOException, CsvParserException { LineNumberReader lineNumberReader = new LineNumberReader(reader); List rows = new ArrayList(); ! List columnsInFirstLine = parseFirstLine(lineNumberReader, source, rows); parseTheData(columnsInFirstLine, lineNumberReader, rows); return rows; *************** *** 73,79 **** private List parseFirstLine(LineNumberReader lineNumberReader, File file, List rows) throws IOException, CsvParserException { String firstLine = lineNumberReader.readLine(); if (firstLine == null) ! throw new CsvParserException("The null first line in file " + file.getAbsolutePath()); final List columnsInFirstLine = parse(firstLine); --- 81,92 ---- private List parseFirstLine(LineNumberReader lineNumberReader, File file, List rows) throws IOException, CsvParserException { + return parseFirstLine(lineNumberReader, file.getAbsolutePath().toString(), rows); + } + + /** parse the first line of data from the given source */ + private List parseFirstLine(LineNumberReader lineNumberReader, String source, List rows) throws IOException, CsvParserException { String firstLine = lineNumberReader.readLine(); if (firstLine == null) ! throw new CsvParserException("The first line of " + source + " is null"); final List columnsInFirstLine = parse(firstLine); Index: CsvProducer.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/CsvProducer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CsvProducer.java 6 Apr 2004 06:51:52 -0000 1.3 --- CsvProducer.java 6 May 2005 21:04:06 -0000 1.4 *************** *** 22,25 **** --- 22,35 ---- package org.dbunit.dataset.csv; + import java.io.BufferedReader; + import java.io.File; + import java.io.IOException; + import java.io.InputStream; + import java.io.InputStreamReader; + import java.net.URL; + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; + import org.dbunit.dataset.Column; import org.dbunit.dataset.DataSetException; *************** *** 32,40 **** import org.dbunit.dataset.stream.IDataSetProducer; - import java.io.File; - import java.io.FilenameFilter; - import java.io.IOException; - import java.util.List; - /** * @author Federico Spinazzi --- 42,45 ---- *************** *** 69,92 **** } - // @todo: move in a class by itself, somewhere - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.endsWith(".csv") && !dir.isFile(); - } - }; - _consumer.startDataSet(); ! File[] children = dir.listFiles(filter); ! for (int i = 0; i < children.length; i++) { ! try { ! produceFromFile(children[i]); ! } catch (CsvParserException e) { ! throw new DataSetException(e); ! } } - - _consumer.endDataSet(); - } --- 74,95 ---- } _consumer.startDataSet(); + try { + List tableSpecs = CsvProducer.getTables(dir.toURL(), "table-ordering.txt"); + for (Iterator tableIter = tableSpecs.iterator(); tableIter.hasNext();) { + String table = (String) tableIter.next(); + try { + produceFromFile(new File(dir, table + ".csv")); + } catch (CsvParserException e) { + throw new DataSetException("error producing dataset for table '" + table + "'", e); + } catch (DataSetException e) { + throw new DataSetException("error producing dataset for table '" + table + "'", e); + } ! } ! _consumer.endDataSet(); ! } catch (IOException e) { ! throw new DataSetException("error getting list of tables", e); } } *************** *** 107,111 **** for (int i = 1 ; i < readData.size(); i++) { List rowList = (List)readData.get(i); ! _consumer.row(rowList.toArray()); } _consumer.endTable(); --- 110,118 ---- for (int i = 1 ; i < readData.size(); i++) { List rowList = (List)readData.get(i); ! Object[] row = rowList.toArray(); ! for(int col = 0; col < row.length; col++) { ! row[col] = row[col].equals(CsvDataSetWriter.NULL) ? null : row[col]; ! } ! _consumer.row(row); } _consumer.endTable(); *************** *** 119,121 **** --- 126,148 ---- } + /** + * Get a list of tables that this producer will create + * @return a list of Strings, where each item is a CSV file relative to the base URL + * @throws IOException when IO on the base URL has issues. + */ + public static List getTables(URL base, String tableList) throws IOException { + List orderedNames = new ArrayList(); + InputStream tableListStream = new URL(base, tableList).openStream(); + BufferedReader reader = new BufferedReader(new InputStreamReader(tableListStream)); + String line = null; + while((line = reader.readLine()) != null) { + String table = line.trim(); + if (table.length() > 0) { + orderedNames.add(table); + } + } + reader.close(); + return orderedNames; + } + } Index: CsvParser.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/CsvParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CsvParser.java 6 Apr 2004 06:51:52 -0000 1.3 --- CsvParser.java 6 May 2005 21:04:06 -0000 1.4 *************** *** 1,10 **** package org.dbunit.dataset.csv; - import org.dbunit.dataset.csv.handlers.PipelineException; - import java.io.File; import java.io.IOException; import java.util.List; /** * Created By: fede --- 1,11 ---- package org.dbunit.dataset.csv; import java.io.File; import java.io.IOException; + import java.net.URL; import java.util.List; + import org.dbunit.dataset.csv.handlers.PipelineException; + /** * Created By: fede *************** *** 18,22 **** public interface CsvParser { List parse(File file) throws IOException, CsvParserException; ! List parse(String csv) throws PipelineException, IllegalInputCharacterException; } --- 19,23 ---- public interface CsvParser { List parse(File file) throws IOException, CsvParserException; ! List parse(URL url) throws IOException, CsvParserException; List parse(String csv) throws PipelineException, IllegalInputCharacterException; } Index: CsvDataSetWriter.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/csv/CsvDataSetWriter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CsvDataSetWriter.java 29 Sep 2004 07:05:50 -0000 1.4 --- CsvDataSetWriter.java 6 May 2005 21:04:06 -0000 1.5 *************** *** 21,34 **** package org.dbunit.dataset.csv; - import org.dbunit.dataset.*; - import org.dbunit.dataset.datatype.DataType; - import org.dbunit.dataset.datatype.TypeCastException; - import org.dbunit.dataset.stream.DataSetProducerAdapter; - import org.dbunit.dataset.stream.IDataSetConsumer; - import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; /** --- 21,42 ---- package org.dbunit.dataset.csv; import java.io.File; import java.io.FileWriter; import java.io.IOException; + import java.io.PrintWriter; import java.io.Writer; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; + + import org.dbunit.dataset.Column; + import org.dbunit.dataset.DataSetException; + import org.dbunit.dataset.IDataSet; + import org.dbunit.dataset.ITable; + import org.dbunit.dataset.ITableMetaData; + import org.dbunit.dataset.datatype.DataType; + import org.dbunit.dataset.datatype.TypeCastException; + import org.dbunit.dataset.stream.DataSetProducerAdapter; + import org.dbunit.dataset.stream.IDataSetConsumer; /** *************** *** 53,56 **** --- 61,66 ---- private String theDirectory; private static char testExport; + /** list of tables */ + private List tableList; public CsvDataSetWriter(String theDirectory) { *************** *** 70,73 **** --- 80,84 ---- public void startDataSet() throws DataSetException { try { + tableList = new LinkedList(); new File(getTheDirectory()).mkdirs(); } catch (Exception e) { *************** *** 76,80 **** } ! public void endDataSet() throws DataSetException {} public void startTable(ITableMetaData metaData) throws DataSetException { --- 87,105 ---- } ! public void endDataSet() throws DataSetException { ! // write out table ordering file ! File orderingFile = new File(getTheDirectory(), "table-ordering.txt"); ! ! try { ! PrintWriter pw = new PrintWriter(new FileWriter(orderingFile)); ! for (Iterator fileNames = tableList.iterator(); fileNames.hasNext();) { ! String file = (String) fileNames.next(); ! pw.println(file); ! } ! pw.close(); ! } catch (IOException e) { ! throw new DataSetException("problems writing the table ordering file", e); ! } ! } public void startTable(ITableMetaData metaData) throws DataSetException { *************** *** 103,106 **** --- 128,132 ---- try { getWriter().close(); + tableList.add(_activeMetaData.getTableName()); _activeMetaData = null; } catch (IOException e) { |
From: <de...@us...> - 2005-05-06 21:04:16
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31706/src/java/org/dbunit/operation Modified Files: AbstractBatchOperation.java Log Message: [ 1114490 ] Support CSV files from a URL (e.g. jar file) + CSV fixes Index: AbstractBatchOperation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/operation/AbstractBatchOperation.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractBatchOperation.java 29 May 2004 00:02:24 -0000 1.28 --- AbstractBatchOperation.java 6 May 2005 21:04:06 -0000 1.29 *************** *** 34,37 **** --- 34,38 ---- import org.dbunit.dataset.ITableMetaData; import org.dbunit.dataset.RowOutOfBoundsException; + import org.dbunit.dataset.datatype.TypeCastException; import java.sql.SQLException; *************** *** 172,177 **** { Column column = columns[j]; ! statement.addValue(table.getValue(row, ! column.getColumnName()), column.getDataType()); } } --- 173,186 ---- { Column column = columns[j]; ! try ! { ! statement.addValue(table.getValue(row, ! column.getColumnName()), column.getDataType()); ! } ! catch (TypeCastException e) ! { ! throw new TypeCastException("Error casting value for table '" + table.getTableMetaData().getTableName() ! +"' and column '" + column.getColumnName() + "'", e); ! } } } |