You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(7) |
Aug
(37) |
Sep
|
Oct
|
Nov
(1) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(8) |
Feb
(68) |
Mar
(72) |
Apr
(149) |
May
(32) |
Jun
(46) |
Jul
(26) |
Aug
(59) |
Sep
(25) |
Oct
(18) |
Nov
(4) |
Dec
(3) |
2004 |
Jan
(90) |
Feb
(19) |
Mar
(38) |
Apr
(41) |
May
(44) |
Jun
(2) |
Jul
(10) |
Aug
|
Sep
(14) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(15) |
Jun
(1) |
Jul
|
Aug
(9) |
Sep
|
Oct
(17) |
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
(16) |
Mar
|
Apr
(1) |
May
(48) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(29) |
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(23) |
Mar
(31) |
Apr
|
May
(26) |
Jun
(6) |
Jul
(1) |
Aug
|
Sep
(7) |
Oct
(1) |
Nov
(8) |
Dec
(8) |
2009 |
Jan
(5) |
Feb
(9) |
Mar
(1) |
Apr
|
May
(23) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(9) |
Oct
(28) |
Nov
(18) |
Dec
(8) |
2010 |
Jan
(19) |
Feb
(24) |
Mar
(3) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(11) |
Oct
|
Nov
(2) |
Dec
(1) |
2011 |
Jan
|
Feb
(7) |
Mar
|
Apr
(6) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(32) |
Oct
(6) |
Nov
|
Dec
|
From: <mla...@us...> - 2003-09-09 17:58:53
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant In directory sc8-pr-cvs1:/tmp/cvs-serv7695/src/java/org/dbunit/ant Modified Files: DbUnitTask.java Operation.java Log Message: Added 'datatypeFactory' and 'escapePattern' attributes to <DbUnit> ant task. Index: DbUnitTask.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/DbUnitTask.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DbUnitTask.java 1 Aug 2003 02:29:10 -0000 1.7 --- DbUnitTask.java 9 Sep 2003 17:58:48 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- import org.dbunit.DatabaseUnitException; + import org.dbunit.dataset.datatype.IDataTypeFactory; import org.dbunit.database.IDatabaseConnection; import org.dbunit.database.DatabaseConnection; *************** *** 97,100 **** --- 98,105 ---- private boolean supportBatchStatement = false; + private String escapePattern = null; + + private String dataTypeFactory = "org.dbunit.dataset.datatype.DefaultDataTypeFactory"; + /** * Set the JDBC driver to be used. *************** *** 155,158 **** --- 160,173 ---- } + public void setDatatypeFactory(String datatypeFactory) + { + this.dataTypeFactory = datatypeFactory; + } + + public void setEscapePattern(String escapePattern) + { + this.escapePattern = escapePattern; + } + /** * Set the classpath for loading the driver. *************** *** 227,230 **** --- 242,282 ---- public void execute() throws BuildException { + try + { + IDatabaseConnection connection = createConnection(); + + Iterator stepIter = steps.listIterator(); + while (stepIter.hasNext()) + { + DbUnitTaskStep step = (DbUnitTaskStep)stepIter.next(); + log(step.getLogMessage(), Project.MSG_INFO); + step.execute(connection); + } + } + catch (DatabaseUnitException e) + { + throw new BuildException(e, location); + } + catch (SQLException e) + { + throw new BuildException(e, location); + } + finally + { + try + { + if (conn != null) + { + conn.close(); + } + } + catch (SQLException e) + { + } + } + } + + IDatabaseConnection createConnection() throws SQLException + { if (driver == null) { *************** *** 248,251 **** --- 300,304 ---- } + // Instanciate JDBC driver Driver driverInstance = null; try *************** *** 275,335 **** { throw new BuildException("Illegal Access: JDBC driver " ! + driver + " could not be loaded", location); } catch (InstantiationException e) { throw new BuildException("Instantiation Exception: JDBC driver " ! + driver + " could not be loaded", location); } ! try ! { ! log("connecting to " + url, Project.MSG_VERBOSE); ! Properties info = new Properties(); ! info.put("user", userId); ! info.put("password", password); ! conn = driverInstance.connect(url, info); ! if (conn == null) ! { ! // Driver doesn't understand the URL ! throw new SQLException("No suitable Driver for " + url); ! } ! conn.setAutoCommit(true); ! IDatabaseConnection connection = new DatabaseConnection(conn, schema); ! DatabaseConfig config = connection.getConfig(); ! config.setFeature(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, supportBatchStatement); ! config.setFeature(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, useQualifiedTableNames); ! Iterator stepIter = steps.listIterator(); ! while (stepIter.hasNext()) ! { ! DbUnitTaskStep step = (DbUnitTaskStep)stepIter.next(); ! log(step.getLogMessage(), Project.MSG_INFO); ! step.execute(connection); ! } } ! catch (DatabaseUnitException e) { ! throw new BuildException(e, location); } ! catch (SQLException e) { ! throw new BuildException(e, location); } ! finally { ! try ! { ! if (conn != null) ! { ! conn.close(); ! } ! } ! catch (SQLException e) ! { ! } } } } --- 328,382 ---- { throw new BuildException("Illegal Access: JDBC driver " ! + driver + " could not be loaded", e, location); } catch (InstantiationException e) { throw new BuildException("Instantiation Exception: JDBC driver " ! + driver + " could not be loaded", e, location); } ! log("connecting to " + url, Project.MSG_VERBOSE); ! Properties info = new Properties(); ! info.put("user", userId); ! info.put("password", password); ! conn = driverInstance.connect(url, info); ! if (conn == null) ! { ! // Driver doesn't understand the URL ! throw new SQLException("No suitable Driver for " + url); ! } ! conn.setAutoCommit(true); ! IDatabaseConnection connection = new DatabaseConnection(conn, schema); ! DatabaseConfig config = connection.getConfig(); ! config.setFeature(DatabaseConfig.FEATURE_BATCHED_STATEMENTS, supportBatchStatement); ! config.setFeature(DatabaseConfig.FEATURE_QUALIFIED_TABLE_NAMES, useQualifiedTableNames); ! config.setProperty(DatabaseConfig.PROPERTY_ESCAPE_PATTERN, escapePattern); ! // Setup data type factory ! try ! { ! IDataTypeFactory dataTypeFactory = (IDataTypeFactory)Class.forName( ! this.dataTypeFactory).newInstance(); ! config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, dataTypeFactory); } ! catch (ClassNotFoundException e) { ! throw new BuildException("Class Not Found: DataType factory " ! + driver + " could not be loaded", e, location); } ! catch (IllegalAccessException e) { ! throw new BuildException("Illegal Access: DataType factory " ! + driver + " could not be loaded", e, location); } ! catch (InstantiationException e) { ! throw new BuildException("Instantiation Exception: DataType factory " ! + driver + " could not be loaded", e, location); } + + return connection; } } Index: Operation.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ant/Operation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Operation.java 10 Apr 2003 02:52:05 -0000 1.6 --- Operation.java 9 Sep 2003 17:58:48 -0000 1.7 *************** *** 118,121 **** --- 118,125 ---- dbOperation = DatabaseOperation.CLEAN_INSERT; } + else if ("NONE".equals(type)) + { + dbOperation = DatabaseOperation.NONE; + } else if ("MSSQL_CLEAN_INSERT".equals(type)) { *************** *** 159,193 **** public void execute(IDatabaseConnection connection) throws DatabaseUnitException { ! if (dbOperation != null) { ! try { ! IDataSet dataset; ! if (format == null) ! { ! format = DEFAULT_FORMAT; ! } ! if (format.equalsIgnoreCase("xml")) ! { ! dataset = new XmlDataSet(new FileReader(src)); ! } ! else ! { ! dataset = new FlatXmlDataSet(src); ! } ! dbOperation.execute(connection, dataset); } ! catch (IOException e) { ! throw new DatabaseUnitException(e); } ! catch (SQLException e) { ! throw new DatabaseUnitException(e); } } ! else { ! throw new DatabaseUnitException("Operation.execute(): setType(String) must be called before execute()!"); } } --- 163,200 ---- public void execute(IDatabaseConnection connection) throws DatabaseUnitException { ! if (dbOperation == null) { ! throw new DatabaseUnitException("Operation.execute(): setType(String) must be called before execute()!"); ! } ! ! if (dbOperation == DatabaseOperation.NONE) ! { ! return; ! } ! ! try ! { ! IDataSet dataset; ! if (format == null) { ! format = DEFAULT_FORMAT; } ! if (format.equalsIgnoreCase("xml")) { ! dataset = new XmlDataSet(new FileReader(src)); } ! else { ! dataset = new FlatXmlDataSet(src); } + dbOperation.execute(connection, dataset); } ! catch (IOException e) { ! throw new DatabaseUnitException(e); ! } ! catch (SQLException e) ! { ! throw new DatabaseUnitException(e); } } *************** *** 196,200 **** { return "Executing operation: " + type ! + "\n on file: " + src.getAbsolutePath() + "\n with format: " + format; } --- 203,207 ---- { return "Executing operation: " + type ! + "\n on file: " + ((src == null) ? null : src.getAbsolutePath()) + "\n with format: " + format; } *************** *** 207,211 **** result.append(" type=" + type); result.append(", format=" + format); ! result.append(", src=" + src.getAbsolutePath()); result.append(", dbOperation = " + dbOperation); --- 214,218 ---- result.append(" type=" + type); result.append(", format=" + format); ! result.append(", src=" + src == null ? null : src.getAbsolutePath()); result.append(", dbOperation = " + dbOperation); |
From: <mla...@us...> - 2003-09-09 17:58:53
|
Update of /cvsroot/dbunit/dbunit/src/xml In directory sc8-pr-cvs1:/tmp/cvs-serv7695/src/xml Modified Files: antTestBuildFile.xml Log Message: Added 'datatypeFactory' and 'escapePattern' attributes to <DbUnit> ant task. Index: antTestBuildFile.xml =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/xml/antTestBuildFile.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** antTestBuildFile.xml 10 Apr 2003 02:52:07 -0000 1.6 --- antTestBuildFile.xml 9 Sep 2003 17:58:48 -0000 1.7 *************** *** 64,72 **** </target> ! <target name="set-type-insert"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> <operation type="INSERT" src="${testDataSet}"/> </dbunit> --- 64,81 ---- </target> ! <target name="set-type-none"> <dbunit driver="${dbunit.profile.driverClass}" url="${dbunit.profile.connectionUrl}" userid="${dbunit.profile.user}" password="${dbunit.profile.password}"> + <operation type="NONE" src="${testDataSet}"/> + </dbunit> + </target> + + <target name="set-type-insert"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.connectionUrl}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="INSERT" src="${testDataSet}"/> </dbunit> *************** *** 303,306 **** --- 312,335 ---- </dbunit> </target> + + <target name="test-datatypefactory"> + <dbunit driver="${dbunit.profile.driverClass}" + datatypeFactory="org.dbunit.ext.oracle.OracleDataTypeFactory" + url="${dbunit.profile.connectionUrl}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> + <operation type="NONE"/> + </dbunit> + </target> + + <target name="test-escapepattern"> + <dbunit driver="${dbunit.profile.driverClass}" + escapePattern="[?]" + url="${dbunit.profile.connectionUrl}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> + <operation type="NONE" src="${testDataSet}"/> + </dbunit> + </target> </project> |
From: <mla...@us...> - 2003-09-09 00:56:43
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml In directory sc8-pr-cvs1:/tmp/cvs-serv9435/src/test/org/dbunit/dataset/xml Modified Files: AllTests.java Added Files: FlatXmlWriterTest.java Log Message: * Fixed NullPointerException when writing null value to flat XML (bug 802401). * Added some mutator to DefaultTable. --- NEW FILE: FlatXmlWriterTest.java --- package org.dbunit.dataset.xml; import org.dbunit.dataset.DefaultTableMetaData; import org.dbunit.dataset.Column; import org.dbunit.dataset.DefaultTable; import org.dbunit.dataset.DefaultDataSet; import org.dbunit.dataset.datatype.DataType; import junit.framework.TestCase; import java.io.StringWriter; import java.io.Writer; import java.io.OutputStreamWriter; import org.xml.sax.InputSource; /** * * <p> Copyright (c) 2002 OZ.COM. All Rights Reserved. </p> * @author manuel.laflamme$ * @since Sep 8, 2003$ */ public class FlatXmlWriterTest extends TestCase { public FlatXmlWriterTest(String name) { super(name); } public void testWrite() throws Exception { String expectedOutput = "<dataset>\n" + " <TABLE1 COL0=\"t1v1\" COL1=\"t1v2\"/>\n" + " <TABLE2 COL0=\"t2v1\" COL1=\"t2v2\"/>\n" + "</dataset>\n"; String col0 = "COL0"; String col1 = "COL1"; Column[] columns = new Column[]{ new Column(col0, DataType.UNKNOWN), new Column(col1, DataType.UNKNOWN) }; DefaultTable table1 = new DefaultTable("TABLE1", columns); table1.addRow(); table1.setValue(0, col0, "t1v1"); table1.setValue(0, col1, "t1v2"); DefaultTable table2 = new DefaultTable("TABLE2", columns); table2.addRow(); table2.setValue(0, col0, "t2v1"); table2.setValue(0, col1, "t2v2"); StringWriter stringWriter = new StringWriter(); FlatXmlWriter xmlWriter = new FlatXmlWriter(stringWriter); xmlWriter.write(new DefaultDataSet(table1, table2)); String actualOutput = stringWriter.toString(); assertEquals("output", expectedOutput, actualOutput); } public void testWriteExcludeEmptyTable() throws Exception { String expectedOutput = "<dataset>\n" + " <TEST_TABLE COL0=\"value\"/>\n" + "</dataset>\n"; String col0 = "COL0"; Column[] columns = new Column[]{ new Column(col0, DataType.UNKNOWN), }; DefaultTable table1 = new DefaultTable("TEST_TABLE", columns); table1.addRow(); table1.setValue(0, col0, "value"); DefaultTable table2 = new DefaultTable("EMPTY_TABLE", columns); StringWriter stringWriter = new StringWriter(); FlatXmlWriter datasetWriter = new FlatXmlWriter(stringWriter); datasetWriter.setIncludeEmptyTable(false); datasetWriter.write(new DefaultDataSet(table1, table2)); String actualOutput = stringWriter.toString(); assertEquals("output", expectedOutput, actualOutput); } public void testWriteIncludeEmptyTable() throws Exception { String expectedOutput = "<dataset>\n" + " <TEST_TABLE COL0=\"value\"/>\n" + " <EMPTY_TABLE/>\n" + "</dataset>\n"; String col0 = "COL0"; Column[] columns = new Column[]{ new Column(col0, DataType.UNKNOWN), }; DefaultTable table1 = new DefaultTable("TEST_TABLE", columns); table1.addRow(); table1.setValue(0, col0, "value"); DefaultTable table2 = new DefaultTable("EMPTY_TABLE", columns); StringWriter stringWriter = new StringWriter(); FlatXmlWriter datasetWriter = new FlatXmlWriter(stringWriter); datasetWriter.setIncludeEmptyTable(true); datasetWriter.write(new DefaultDataSet(table1, table2)); String actualOutput = stringWriter.toString(); assertEquals("output", expectedOutput, actualOutput); } public void testWriteNullValue() throws Exception { String expectedOutput = "<dataset>\n" + " <TEST_TABLE COL0=\"c0r0\" COL1=\"c1r0\"/>\n" + " <TEST_TABLE COL0=\"c0r1\"/>\n" + "</dataset>\n"; String col0 = "COL0"; String col1 = "COL1"; Column[] columns = new Column[]{ new Column(col0, DataType.UNKNOWN), new Column(col1, DataType.UNKNOWN) }; DefaultTable table = new DefaultTable("TEST_TABLE", columns); table.addRow(); table.setValue(0, col0, "c0r0"); table.setValue(0, col1, "c1r0"); table.addRow(); table.setValue(1, col0, "c0r1"); table.setValue(1, col1, null); StringWriter stringWriter = new StringWriter(); FlatXmlWriter xmlWriter = new FlatXmlWriter(stringWriter); xmlWriter.write(new DefaultDataSet(table)); String actualOutput = stringWriter.toString(); assertEquals("output", expectedOutput, actualOutput); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/xml/AllTests.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AllTests.java 19 Jun 2003 03:17:17 -0000 1.7 --- AllTests.java 8 Sep 2003 21:05:23 -0000 1.8 *************** *** 41,44 **** --- 41,45 ---- suite.addTest(new TestSuite(FlatXmlTableTest.class)); suite.addTest(new TestSuite(FlatXmlTableWriteTest.class)); + suite.addTest(new TestSuite(FlatXmlWriterTest.class)); suite.addTest(new TestSuite(XmlDataSetTest.class)); suite.addTest(new TestSuite(XmlTableTest.class)); |
From: <mla...@us...> - 2003-09-09 00:46:57
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset In directory sc8-pr-cvs1:/tmp/cvs-serv9435/src/java/org/dbunit/dataset Modified Files: DefaultTable.java Log Message: * Fixed NullPointerException when writing null value to flat XML (bug 802401). * Added some mutator to DefaultTable. Index: DefaultTable.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/DefaultTable.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultTable.java 13 Apr 2003 02:40:10 -0000 1.7 --- DefaultTable.java 8 Sep 2003 21:05:23 -0000 1.8 *************** *** 48,52 **** { _metaData = new DefaultTableMetaData(tableName, new Column[0]); ! _rowList = Arrays.asList(new Object[0]); } --- 48,52 ---- { _metaData = new DefaultTableMetaData(tableName, new Column[0]); ! _rowList = new ArrayList(); } *************** *** 57,64 **** --- 57,89 ---- } + public DefaultTable(String tableName, Column[] columns) + { + _metaData = new DefaultTableMetaData(tableName, columns); + _rowList = new ArrayList(); + } + protected DefaultTable(ITableMetaData metaData) { _metaData = metaData; _rowList = new ArrayList(); + } + + public void addRow() throws DataSetException + { + int columnCount = _metaData.getColumns().length; + _rowList.add(new Object[columnCount]); + } + + public void addRow(Object[] values) throws DataSetException + { + _rowList.add(values); + } + + public void setValue(int row, String column, Object value) throws DataSetException + { + assertValidRowIndex(row); + + Object[] rowValues = (Object[])_rowList.get(row); + rowValues[getColumnIndex(column)] = value; } |
From: <mla...@us...> - 2003-09-08 23:56:37
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/xml In directory sc8-pr-cvs1:/tmp/cvs-serv9435/src/java/org/dbunit/dataset/xml Modified Files: FlatXmlWriter.java Log Message: * Fixed NullPointerException when writing null value to flat XML (bug 802401). * Added some mutator to DefaultTable. Index: FlatXmlWriter.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/xml/FlatXmlWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FlatXmlWriter.java 19 Jun 2003 03:17:16 -0000 1.2 --- FlatXmlWriter.java 8 Sep 2003 21:05:23 -0000 1.3 *************** *** 138,141 **** --- 138,148 ---- String columnName = columns[i].getColumnName(); Object value = values[i]; + + // Skip null value + if (value == null) + { + continue; + } + try { |
From: <mla...@us...> - 2003-09-06 01:40:19
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset In directory sc8-pr-cvs1:/tmp/cvs-serv14492/src/java/org/dbunit/dataset Modified Files: AbstractTableMetaData.java Log Message: * Fixed failling tests. Index: AbstractTableMetaData.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/AbstractTableMetaData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractTableMetaData.java 15 Feb 2003 05:42:42 -0000 1.7 --- AbstractTableMetaData.java 6 Sep 2003 01:40:12 -0000 1.8 *************** *** 32,37 **** --- 32,44 ---- public abstract class AbstractTableMetaData implements ITableMetaData { + private static final Column[] EMPTY_COLUMNS = new Column[0]; + protected static Column[] getPrimaryKeys(Column[] columns, String[] keyNames) { + if (keyNames == null || keyNames.length == 0) + { + return EMPTY_COLUMNS; + } + List keyList = new ArrayList(); for (int i = 0; i < keyNames.length; i++) |
From: <mla...@us...> - 2003-09-04 16:50:34
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mysql In directory sc8-pr-cvs1:/tmp/cvs-serv11932/src/test/org/dbunit/ext/mysql Added Files: AllTests.java MySqlDataTypeFactoryTest.java Log Message: Added MySQL data type factory to support "longtext". --- NEW FILE: AllTests.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.mysql; import junit.framework.Test; import junit.framework.TestSuite; /** * @author Manuel Laflamme * @since Sep 3, 2003 * @version $Revision: 1.1 $ */ public class AllTests { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(MySqlDataTypeFactoryTest.class)); return suite; } } --- NEW FILE: MySqlDataTypeFactoryTest.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.mysql; import org.dbunit.dataset.datatype.AbstractDataTypeFactoryTest; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.IDataTypeFactory; import java.sql.Types; /** * @author Manuel Laflamme * @since Sep 3, 2003 * @version $Revision: 1.1 $ */ public class MySqlDataTypeFactoryTest extends AbstractDataTypeFactoryTest { public MySqlDataTypeFactoryTest(String s) { super(s); } public IDataTypeFactory createFactory() throws Exception { return new MySqlDataTypeFactory(); } public void testCreateLongtextDataType() throws Exception { int sqlType = Types.OTHER; String sqlTypeName = "longtext"; DataType expected = DataType.CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); } } |
From: <mla...@us...> - 2003-09-04 16:50:34
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mysql In directory sc8-pr-cvs1:/tmp/cvs-serv11932/src/java/org/dbunit/ext/mysql Added Files: MySqlConnection.java MySqlDataTypeFactory.java Log Message: Added MySQL data type factory to support "longtext". --- NEW FILE: MySqlConnection.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.mysql; import org.dbunit.database.DatabaseConfig; import org.dbunit.database.DatabaseConnection; import java.sql.Connection; /** * * @author manuel.laflamme * @since Sep 4, 2003 * @version $Revision: 1.1 $ */ public class MySqlConnection extends DatabaseConnection { public MySqlConnection(Connection connection, String schema) { super(connection, schema); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory()); } } --- NEW FILE: MySqlDataTypeFactory.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.mysql; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.DataTypeException; import org.dbunit.dataset.datatype.DefaultDataTypeFactory; import java.sql.Types; /** * Specialized factory that recognizes MySql data types. * @author manuel.laflamme * @since Sep 3, 2003 * @version $Revision: 1.1 $ */ public class MySqlDataTypeFactory extends DefaultDataTypeFactory { public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { if (sqlType == Types.OTHER) { // CLOB if ("longtext".equals(sqlTypeName)) { return DataType.CLOB; } } return super.createDataType(sqlType, sqlTypeName); } } |
From: <mla...@us...> - 2003-09-04 16:50:30
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv11932/src/java/org/dbunit/ext/oracle Modified Files: OracleConnection.java Log Message: Added MySQL data type factory to support "longtext". Index: OracleConnection.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleConnection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleConnection.java 4 Sep 2003 16:39:45 -0000 1.2 --- OracleConnection.java 4 Sep 2003 16:50:17 -0000 1.3 *************** *** 21,27 **** package org.dbunit.ext.oracle; - import org.dbunit.database.DatabaseConnection; import org.dbunit.database.DatabaseConfig; ! import org.dbunit.ext.db2.Db2DataTypeFactory; import java.sql.Connection; --- 21,26 ---- package org.dbunit.ext.oracle; import org.dbunit.database.DatabaseConfig; ! import org.dbunit.database.DatabaseConnection; import java.sql.Connection; |
From: <mla...@us...> - 2003-09-04 16:50:30
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext In directory sc8-pr-cvs1:/tmp/cvs-serv11932/src/test/org/dbunit/ext Modified Files: AllTests.java Log Message: Added MySQL data type factory to support "longtext". Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/AllTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AllTests.java 18 Aug 2003 11:13:09 -0000 1.1 --- AllTests.java 4 Sep 2003 16:50:17 -0000 1.2 *************** *** 21,26 **** package org.dbunit.ext; - import org.dbunit.ext.oracle.OracleDataTypeFactoryTest; - import junit.framework.Test; import junit.framework.TestSuite; --- 21,24 ---- *************** *** 37,40 **** --- 35,39 ---- TestSuite suite = new TestSuite(); suite.addTest(org.dbunit.ext.db2.AllTests.suite()); + suite.addTest(org.dbunit.ext.mysql.AllTests.suite()); suite.addTest(org.dbunit.ext.oracle.AllTests.suite()); return suite; |
From: <mla...@us...> - 2003-09-04 16:44:46
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mysql In directory sc8-pr-cvs1:/tmp/cvs-serv10765/mysql Log Message: Directory /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/mysql added to the repository |
From: <mla...@us...> - 2003-09-04 16:44:43
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mysql In directory sc8-pr-cvs1:/tmp/cvs-serv10705/mysql Log Message: Directory /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/mysql added to the repository |
From: <mla...@us...> - 2003-09-04 16:39:59
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv9677/src/java/org/dbunit/ext/oracle Modified Files: OracleConnection.java Log Message: Fixed usage of wrong data type factory. Index: OracleConnection.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleConnection.java 3 Sep 2003 20:04:42 -0000 1.1 --- OracleConnection.java 4 Sep 2003 16:39:45 -0000 1.2 *************** *** 39,43 **** super(connection, schema); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, ! new Db2DataTypeFactory()); } } --- 39,43 ---- super(connection, schema); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, ! new OracleDataTypeFactory()); } } |
From: <mla...@us...> - 2003-09-04 13:58:00
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv9812/src/java/org/dbunit/dataset/datatype Modified Files: Tag: branch-1-5 StringDataType.java Log Message: Fixed Oracle CLOB issue. Index: StringDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/StringDataType.java,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** StringDataType.java 13 Aug 2003 02:03:59 -0000 1.14.2.2 --- StringDataType.java 4 Sep 2003 13:57:57 -0000 1.14.2.3 *************** *** 119,122 **** --- 119,128 ---- throws SQLException, TypeCastException { + // Special CLOB handling + if (this == DataType.CLOB) + { + return typeCast(resultSet.getClob(column)); + } + return resultSet.getString(column); } |
From: <mla...@us...> - 2003-09-03 20:04:45
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv21913/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Added Files: OracleConnection.java Log Message: Added OracleConnection class. --- NEW FILE: OracleConnection.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.oracle; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.DatabaseConfig; import org.dbunit.ext.db2.Db2DataTypeFactory; import java.sql.Connection; /** * * @author manuel.laflamme * @since Sep 3, 2003 * @version $Revision: 1.1 $ */ public class OracleConnection extends DatabaseConnection { public OracleConnection(Connection connection, String schema) { super(connection, schema); getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Db2DataTypeFactory()); } } Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleDataTypeFactory.java 3 Sep 2003 19:55:55 -0000 1.2 --- OracleDataTypeFactory.java 3 Sep 2003 20:04:42 -0000 1.3 *************** *** 1,2 **** --- 1,22 ---- + /* + * + * The DbUnit Database Testing Framework + * Copyright (C)2002, Manuel Laflamme + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package org.dbunit.ext.oracle; *************** *** 9,16 **** /** * Specialized factory that recognizes Oracle data types. ! * ! * <p> Copyright (c) 2002 OZ.COM. All Rights Reserved. </p> * @author manuel.laflamme * @since Jul 17, 2003 */ public class --- 29,36 ---- /** * Specialized factory that recognizes Oracle data types. ! * @author manuel.laflamme * @since Jul 17, 2003 + * @version $Revision$ */ public class |
From: <mla...@us...> - 2003-09-03 19:55:59
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv19879/src/test/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactoryTest.java Log Message: Added support for Oracle NCLOB. Index: OracleDataTypeFactoryTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleDataTypeFactoryTest.java 18 Aug 2003 11:13:09 -0000 1.1 --- OracleDataTypeFactoryTest.java 3 Sep 2003 19:55:55 -0000 1.2 *************** *** 64,67 **** --- 64,77 ---- } + public void testCreateNClobDataType() throws Exception + { + int sqlType = Types.OTHER; + String sqlTypeName = "NCLOB"; + + DataType expected = DataType.CLOB; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + public void testCreateTimestampDataType() throws Exception { |
From: <mla...@us...> - 2003-09-03 19:55:59
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv19879/src/java/org/dbunit/dataset/datatype Modified Files: StringDataType.java Log Message: Added support for Oracle NCLOB. Index: StringDataType.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/dataset/datatype/StringDataType.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** StringDataType.java 23 Jul 2003 01:04:52 -0000 1.17 --- StringDataType.java 3 Sep 2003 19:55:54 -0000 1.18 *************** *** 119,122 **** --- 119,128 ---- throws SQLException, TypeCastException { + // Special CLOB handling + if (this == DataType.CLOB) + { + return typeCast(resultSet.getClob(column)); + } + return resultSet.getString(column); } |
From: <mla...@us...> - 2003-09-03 19:55:59
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv19879/src/java/org/dbunit/ext/oracle Modified Files: OracleDataTypeFactory.java Log Message: Added support for Oracle NCLOB. Index: OracleDataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OracleDataTypeFactory.java 1 Aug 2003 02:31:52 -0000 1.1 --- OracleDataTypeFactory.java 3 Sep 2003 19:55:55 -0000 1.2 *************** *** 14,18 **** * @since Jul 17, 2003 */ ! public class OracleDataTypeFactory extends DefaultDataTypeFactory { public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException --- 14,19 ---- * @since Jul 17, 2003 */ ! public class ! OracleDataTypeFactory extends DefaultDataTypeFactory { public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException *************** *** 27,31 **** // CLOB ! if ("CLOB".equals(sqlTypeName)) { return DataType.CLOB; --- 28,32 ---- // CLOB ! if ("CLOB".equals(sqlTypeName) || "NCLOB".equals(sqlTypeName)) { return DataType.CLOB; |
From: <mla...@us...> - 2003-08-18 11:33:16
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/db2/xmlextender In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit/ext/db2/xmlextender Removed Files: XmlExtenderTest.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. --- XmlExtenderTest.java DELETED --- |
From: <mla...@us...> - 2003-08-18 11:22:34
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext/oracle In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit/ext/oracle Added Files: AllTests.java OracleDataTypeFactoryTest.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. --- NEW FILE: AllTests.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.oracle; import junit.framework.Test; import junit.framework.TestSuite; /** * @author Manuel Laflamme * @since Aug 13, 2003 * @version $Revision: 1.1 $ */ public class AllTests { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(OracleDataTypeFactoryTest.class)); return suite; } } --- NEW FILE: OracleDataTypeFactoryTest.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext.oracle; import org.dbunit.dataset.datatype.AbstractDataTypeFactoryTest; import org.dbunit.dataset.datatype.IDataTypeFactory; import org.dbunit.dataset.datatype.DataType; import java.sql.Types; /** * @author Manuel Laflamme * @since Aug 13, 2003 * @version $Revision: 1.1 $ */ public class OracleDataTypeFactoryTest extends AbstractDataTypeFactoryTest { public OracleDataTypeFactoryTest(String s) { super(s); } public IDataTypeFactory createFactory() throws Exception { return new OracleDataTypeFactory(); } public void testCreateBlobDataType() throws Exception { int sqlType = Types.OTHER; 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.OTHER; String sqlTypeName = "CLOB"; DataType expected = DataType.CLOB; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); } public void testCreateTimestampDataType() throws Exception { int sqlType = Types.OTHER; String sqlTypeName = "TIMESTAMP(6)"; DataType expected = DataType.TIMESTAMP; DataType actual = createFactory().createDataType(sqlType, sqlTypeName); assertSame("type", expected, actual); } } |
From: <mla...@us...> - 2003-08-18 11:22:34
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit/dataset/datatype Modified Files: AllTests.java Added Files: AbstractDataTypeFactoryTest.java DefaultDataTypeFactoryTest.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. --- NEW FILE: AbstractDataTypeFactoryTest.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.dataset.datatype; import junit.framework.TestCase; import java.sql.Types; /** * @author Manuel Laflamme * @since Aug 13, 2003 * @version $Revision: 1.1 $ */ public class AbstractDataTypeFactoryTest extends TestCase { public AbstractDataTypeFactoryTest(String s) { super(s); } public IDataTypeFactory createFactory() throws Exception { return new DefaultDataTypeFactory(); } public void testCreateDataType() throws Exception { DataType[] expectedTypes = new DataType[] { DataType.UNKNOWN, DataType.CHAR, DataType.VARCHAR, DataType.LONGVARCHAR, DataType.CLOB, DataType.NUMERIC, DataType.DECIMAL, DataType.BOOLEAN, DataType.TINYINT, DataType.SMALLINT, DataType.INTEGER, DataType.BIGINT, DataType.REAL, DataType.FLOAT, DataType.DOUBLE, DataType.DATE, DataType.TIME, DataType.TIMESTAMP, DataType.BINARY, DataType.VARBINARY, DataType.LONGVARBINARY, DataType.BLOB, }; IDataTypeFactory factory = createFactory(); for (int i = 0; i < expectedTypes.length; i++) { DataType expected = expectedTypes[i]; DataType actual = factory.createDataType(expected.getSqlType(), expected.toString()); assertSame("type", expected, actual); } } } --- NEW FILE: DefaultDataTypeFactoryTest.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.dataset.datatype; import junit.framework.TestCase; import java.sql.Types; /** * @author Manuel Laflamme * @since Aug 13, 2003 * @version $Revision: 1.1 $ */ public class DefaultDataTypeFactoryTest extends AbstractDataTypeFactoryTest { public DefaultDataTypeFactoryTest(String s) { super(s); } public IDataTypeFactory createFactory() throws Exception { return new DefaultDataTypeFactory(); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/datatype/AllTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AllTests.java 13 Jun 2002 17:25:00 -0000 1.6 --- AllTests.java 18 Aug 2003 11:13:08 -0000 1.7 *************** *** 38,41 **** --- 38,42 ---- suite.addTest(new TestSuite(BytesDataTypeTest.class)); suite.addTest(new TestSuite(DateDataTypeTest.class)); + suite.addTest(new TestSuite(DefaultDataTypeFactoryTest.class)); suite.addTest(new TestSuite(DoubleDataTypeTest.class)); suite.addTest(new TestSuite(FloatDataTypeTest.class)); |
From: <mla...@us...> - 2003-08-18 11:22:33
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit/dataset Modified Files: DefaultTableMetaDataTest.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. Index: DefaultTableMetaDataTest.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/dataset/DefaultTableMetaDataTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DefaultTableMetaDataTest.java 13 Jun 2002 17:25:00 -0000 1.6 --- DefaultTableMetaDataTest.java 18 Aug 2003 11:13:08 -0000 1.7 *************** *** 38,46 **** } public void testGetTableName() throws Exception { String expected = "tableName"; ! ITableMetaData metaData = new DefaultTableMetaData( ! expected, null); assertEquals("table name", expected, metaData.getTableName()); --- 38,52 ---- } + protected ITableMetaData createMetaData(String tableName, + Column[] columns, String[] keyNames) throws Exception + { + return new DefaultTableMetaData( + tableName, columns, keyNames); + } + public void testGetTableName() throws Exception { String expected = "tableName"; ! ITableMetaData metaData = createMetaData(expected, null, null); assertEquals("table name", expected, metaData.getTableName()); *************** *** 55,60 **** }; ! ITableMetaData metaData = new DefaultTableMetaData( ! "toto", columns); assertEquals("column count", columns.length, metaData.getColumns().length); --- 61,65 ---- }; ! ITableMetaData metaData = createMetaData("toto", columns, null); assertEquals("column count", columns.length, metaData.getColumns().length); *************** *** 77,82 **** ! ITableMetaData metaData = new DefaultTableMetaData( ! "toto", columns, keyNames); Column[] keys = metaData.getPrimaryKeys(); --- 82,86 ---- ! ITableMetaData metaData = createMetaData("toto", columns, keyNames); Column[] keys = metaData.getPrimaryKeys(); *************** *** 98,108 **** ! ITableMetaData metaData = new DefaultTableMetaData( ! "toto", columns, keyNames); Column[] keys = metaData.getPrimaryKeys(); assertEquals("key count", 0, keys.length); } - } --- 102,110 ---- ! ITableMetaData metaData = createMetaData("toto", columns, keyNames); Column[] keys = metaData.getPrimaryKeys(); assertEquals("key count", 0, keys.length); } } |
From: <mla...@us...> - 2003-08-18 11:22:33
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit Modified Files: AllTests.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. Index: AllTests.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/test/org/dbunit/AllTests.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AllTests.java 13 Aug 2003 08:52:29 -0000 1.11 --- AllTests.java 18 Aug 2003 11:13:08 -0000 1.12 *************** *** 38,41 **** --- 38,42 ---- suite.addTest(org.dbunit.database.AllTests.suite()); suite.addTest(org.dbunit.dataset.AllTests.suite()); + suite.addTest(org.dbunit.ext.AllTests.suite()); suite.addTest(org.dbunit.operation.AllTests.suite()); suite.addTest(new TestSuite(AssertionTest.class)); |
From: <mla...@us...> - 2003-08-18 11:22:33
|
Update of /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/db2 In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/java/org/dbunit/ext/db2 Modified Files: Db2DataTypeFactory.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. Index: Db2DataTypeFactory.java =================================================================== RCS file: /cvsroot/dbunit/dbunit/src/java/org/dbunit/ext/db2/Db2DataTypeFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db2DataTypeFactory.java 17 Jul 2003 12:06:57 -0000 1.1 --- Db2DataTypeFactory.java 18 Aug 2003 11:13:08 -0000 1.2 *************** *** 23,37 **** package org.dbunit.ext.db2; - import org.dbunit.dataset.datatype.DefaultDataTypeFactory; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.DataTypeException; ! import org.dbunit.ext.db2.xmlextender.*; ! public class Db2DataTypeFactory extends DefaultDataTypeFactory { ! public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException { ! if (XmlExtenderDataType.defineDataType(sqlTypeName, sqlType)) { ! return XmlExtenderDataType.createDataType(sqlTypeName, sqlType); } --- 23,60 ---- package org.dbunit.ext.db2; import org.dbunit.dataset.datatype.DataType; import org.dbunit.dataset.datatype.DataTypeException; ! import org.dbunit.dataset.datatype.DefaultDataTypeFactory; ! import org.dbunit.dataset.datatype.StringDataType; ! import java.sql.Types; ! public class Db2DataTypeFactory extends DefaultDataTypeFactory ! { ! static final DataType DB2XML_XMLVARCHAR = new StringDataType( ! "DB2XML.XMLVARCHAR", Types.DISTINCT); ! static final DataType DB2XML_XMLCLOB = new StringDataType( ! "DB2XML.XMLCLOB", Types.DISTINCT); ! static final DataType DB2XML_XMLFILE = new StringDataType( ! "DB2XML.XMLFILE", Types.DISTINCT); ! public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException ! { ! if (sqlType == Types.DISTINCT) ! { ! if (sqlTypeName.equals(DB2XML_XMLVARCHAR.toString())) ! { ! return DB2XML_XMLVARCHAR; ! } ! ! if (sqlTypeName.equals(DB2XML_XMLCLOB.toString())) ! { ! return DB2XML_XMLCLOB; ! } ! ! if (sqlTypeName.equals(DB2XML_XMLFILE.toString())) ! { ! return DB2XML_XMLFILE; ! } } |
From: <mla...@us...> - 2003-08-18 11:22:16
|
Update of /cvsroot/dbunit/dbunit/src/test/org/dbunit/ext In directory sc8-pr-cvs1:/tmp/cvs-serv4708/src/test/org/dbunit/ext Added Files: AllTests.java Log Message: * DB2 data types refactoring. * Added tests on data type factories. --- NEW FILE: AllTests.java --- /* * * The DbUnit Database Testing Framework * Copyright (C)2002, Manuel Laflamme * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.dbunit.ext; import org.dbunit.ext.oracle.OracleDataTypeFactoryTest; import junit.framework.Test; import junit.framework.TestSuite; /** * @author Manuel Laflamme * @since Aug 13, 2003 * @version $Revision: 1.1 $ */ public class AllTests { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(org.dbunit.ext.db2.AllTests.suite()); suite.addTest(org.dbunit.ext.oracle.AllTests.suite()); return suite; } } |