|
From: <jb...@us...> - 2009-11-06 02:07:33
|
Revision: 1098
http://dbunit.svn.sourceforge.net/dbunit/?rev=1098&view=rev
Author: jbhurst
Date: 2009-11-06 02:07:25 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
[2215029] - Move dbunit-maven-plugin from codehaus to DBUnit - added target directories to ignore list
Property Changed:
----------------
trunk/dbunit/
trunk/dbunit-maven-plugin/
Property changes on: trunk/dbunit
___________________________________________________________________
Modified: svn:ignore
- .classpath
.project
.settings
+ .classpath
.project
.settings
target
Property changes on: trunk/dbunit-maven-plugin
___________________________________________________________________
Modified: svn:ignore
- .classpath
.project
.settings
+ .classpath
.project
.settings
target
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2009-11-06 02:51:57
|
Revision: 1100
http://dbunit.svn.sourceforge.net/dbunit/?rev=1100&view=rev
Author: jbhurst
Date: 2009-11-06 02:51:43 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
[2875235] - integration tests working with derby profile
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/site/apt/integrationtests.apt
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2009-11-06 02:44:43 UTC (rev 1099)
+++ trunk/dbunit/pom.xml 2009-11-06 02:51:43 UTC (rev 1100)
@@ -789,7 +789,7 @@
<properties>
<dbunit.profile>derby</dbunit.profile>
<dbunit.profile.driverClass>org.apache.derby.jdbc.EmbeddedDriver</dbunit.profile.driverClass>
- <dbunit.profile.url>jdbc\:derby\:target\/derby_db;create\=true</dbunit.profile.url>
+ <dbunit.profile.url>jdbc:derby:target/derby_db;create=true</dbunit.profile.url>
<dbunit.profile.schema>APP</dbunit.profile.schema>
<dbunit.profile.user>APP</dbunit.profile.user>
<dbunit.profile.password>APP</dbunit.profile.password>
Modified: trunk/dbunit/src/site/apt/integrationtests.apt
===================================================================
--- trunk/dbunit/src/site/apt/integrationtests.apt 2009-11-06 02:44:43 UTC (rev 1099)
+++ trunk/dbunit/src/site/apt/integrationtests.apt 2009-11-06 02:51:43 UTC (rev 1100)
@@ -176,5 +176,17 @@
<<Note:>> currently the oracle-default profile is required, along with the mysql profile, to ensure all JARs required on the compile-time classpath in Maven.
+Running Apache Derby Integration Tests
+
+ Nothing special is required.
+
+ Run the full test suite, including integration tests, with this command:
+
+---
+mvn clean test -Poracle-default,derby
+---
+
+ <<Note:>> currently the oracle-default profile is required, along with the derby profile, to ensure all JARs required on the compile-time classpath in Maven.
+
TODO: Other databases.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2009-11-06 03:27:00
|
Revision: 1101
http://dbunit.svn.sourceforge.net/dbunit/?rev=1101&view=rev
Author: jbhurst
Date: 2009-11-06 03:26:49 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
[2875235] - integration tests working with h2 profile
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/test/org/dbunit/DatabaseEnvironment.java
trunk/dbunit/src/test/org/dbunit/H2Environment.java
Added Paths:
-----------
trunk/dbunit/src/sql/h2.sql
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2009-11-06 02:51:43 UTC (rev 1100)
+++ trunk/dbunit/pom.xml 2009-11-06 03:26:49 UTC (rev 1101)
@@ -808,13 +808,20 @@
<id>h2</id>
<properties>
<dbunit.profile>h2</dbunit.profile>
- <dbunit.profile.driverClass>TODO</dbunit.profile.driverClass>
- <dbunit.profile.url>TODO</dbunit.profile.url>
- <dbunit.profile.schema>TODO</dbunit.profile.schema>
- <dbunit.profile.user>TODO</dbunit.profile.user>
- <dbunit.profile.password>TODO</dbunit.profile.password>
- <dbunit.profile.unsupportedFeatures>TODO</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.driverClass>org.h2.Driver</dbunit.profile.driverClass>
+ <dbunit.profile.url>jdbc:h2:target/h2/test</dbunit.profile.url>
+ <dbunit.profile.schema>PUBLIC</dbunit.profile.schema>
+ <dbunit.profile.user>sa</dbunit.profile.user>
+ <dbunit.profile.password></dbunit.profile.password>
+ <dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
</properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.1.118</version>
+ </dependency>
+ </dependencies>
</profile>
</profiles>
Added: trunk/dbunit/src/sql/h2.sql
===================================================================
--- trunk/dbunit/src/sql/h2.sql (rev 0)
+++ trunk/dbunit/src/sql/h2.sql 2009-11-06 03:26:49 UTC (rev 1101)
@@ -0,0 +1,93 @@
+-----------------------------------------------------------------------------
+-- TEST_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS TEST_TABLE;
+CREATE TABLE TEST_TABLE
+ (COLUMN0 VARCHAR(32),
+ COLUMN1 VARCHAR(32),
+ COLUMN2 VARCHAR(32),
+ COLUMN3 VARCHAR(32));
+
+-----------------------------------------------------------------------------
+-- SECOND_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS SECOND_TABLE;
+CREATE TABLE SECOND_TABLE
+ (COLUMN0 VARCHAR(32),
+ COLUMN1 VARCHAR(32),
+ COLUMN2 VARCHAR(32),
+ COLUMN3 VARCHAR(32));
+
+-----------------------------------------------------------------------------
+-- EMPTY_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS EMPTY_TABLE;
+CREATE TABLE EMPTY_TABLE
+ (COLUMN0 VARCHAR(32),
+ COLUMN1 VARCHAR(32),
+ COLUMN2 VARCHAR(32),
+ COLUMN3 VARCHAR(32));
+
+/*
+-----------------------------------------------------------------------------
+-- ESCAPED TABLE
+-----------------------------------------------------------------------------
+
+CREATE TABLE "ESCAPED TABLE"
+ (COLUMN0 VARCHAR(32),
+ COLUMN1 VARCHAR(32),
+ COLUMN2 VARCHAR(32),
+ "COLUMN 3" VARCHAR(32));
+*/
+
+-----------------------------------------------------------------------------
+-- PK_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS PK_TABLE;
+CREATE TABLE PK_TABLE
+ (PK0 NUMERIC(38, 0) NOT NULL,
+ PK1 NUMERIC(38, 0) NOT NULL,
+ PK2 NUMERIC(38, 0) NOT NULL,
+ NORMAL0 VARCHAR(32),
+ NORMAL1 VARCHAR(32), PRIMARY KEY (PK0, PK1, PK2));
+
+-----------------------------------------------------------------------------
+-- ONLY_PK_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS ONLY_PK_TABLE;
+CREATE TABLE ONLY_PK_TABLE
+ (PK0 NUMERIC(38, 0) NOT NULL PRIMARY KEY);
+
+-----------------------------------------------------------------------------
+-- EMPTY_MULTITYPE_TABLE
+-----------------------------------------------------------------------------
+
+DROP TABLE IF EXISTS EMPTY_MULTITYPE_TABLE;
+CREATE TABLE EMPTY_MULTITYPE_TABLE
+ (VARCHAR_COL VARCHAR(32),
+ NUMERIC_COL NUMERIC(38, 0),
+ TIMESTAMP_COL TIMESTAMP,
+ VARBINARY_COL VARBINARY(254));
+
+-----------------------------------------------------------------------------
+-- IDENTITY_TABLE
+-----------------------------------------------------------------------------
+DROP TABLE IF EXISTS IDENTITY_TABLE;
+CREATE TABLE IDENTITY_TABLE
+ (IDENTITY_TABLE_ID IDENTITY NOT NULL,
+ COLUMN0 VARCHAR(32),
+ COLUMN1 VARCHAR(32),
+ PRIMARY KEY (IDENTITY_TABLE_ID));
+
+-----------------------------------------------------------------------------
+-- TEST_IDENTITY_NOT_PK
+-----------------------------------------------------------------------------
+DROP TABLE IF EXISTS TEST_IDENTITY_NOT_PK;
+CREATE TABLE TEST_IDENTITY_NOT_PK
+ (COL01 IDENTITY NOT NULL,
+ COL02 VARCHAR(64));
Property changes on: trunk/dbunit/src/sql/h2.sql
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: trunk/dbunit/src/test/org/dbunit/DatabaseEnvironment.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/DatabaseEnvironment.java 2009-11-06 02:51:43 UTC (rev 1100)
+++ trunk/dbunit/src/test/org/dbunit/DatabaseEnvironment.java 2009-11-06 03:26:49 UTC (rev 1101)
@@ -78,6 +78,10 @@
{
INSTANCE = new DerbyEnvironment(profile);
}
+ else if (profileName.equals("h2"))
+ {
+ INSTANCE = new H2Environment(profile);
+ }
else
{
INSTANCE = new DatabaseEnvironment(profile);
Modified: trunk/dbunit/src/test/org/dbunit/H2Environment.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/H2Environment.java 2009-11-06 02:51:43 UTC (rev 1100)
+++ trunk/dbunit/src/test/org/dbunit/H2Environment.java 2009-11-06 03:26:49 UTC (rev 1101)
@@ -44,7 +44,7 @@
super(profile);
// Creates required tables into the hypersonic in-memory database
- File ddlFile = new File("src/sql/hypersonic.sql");
+ File ddlFile = new File("src/sql/h2.sql");
Connection connection = getConnection().getConnection();
executeDdlFile(ddlFile, connection);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2009-12-01 07:21:15
|
Revision: 1123
http://dbunit.svn.sourceforge.net/dbunit/?rev=1123&view=rev
Author: jbhurst
Date: 2009-12-01 07:21:06 +0000 (Tue, 01 Dec 2009)
Log Message:
-----------
[2875235] - removed static dependency on hsqldb from test code base.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/test/org/dbunit/dataset/datatype/BlobDataTypeTest.java
Added Paths:
-----------
trunk/dbunit/src/test/org/dbunit/dataset/datatype/TestBlob.java
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2009-11-24 00:10:26 UTC (rev 1122)
+++ trunk/dbunit/pom.xml 2009-12-01 07:21:06 UTC (rev 1123)
@@ -287,12 +287,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.1.113</version>
@@ -634,9 +628,17 @@
<dbunit.profile.url>jdbc:hsqldb:mem:.</dbunit.profile.url>
<dbunit.profile.schema>PUBLIC</dbunit.profile.schema>
<dbunit.profile.user>sa</dbunit.profile.user>
- <dbunit.profile.password />
+ <dbunit.profile.password></dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
</properties>
+ <dependencies>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</profile>
<!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 -->
<profile>
Modified: trunk/dbunit/src/test/org/dbunit/dataset/datatype/BlobDataTypeTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/dataset/datatype/BlobDataTypeTest.java 2009-11-24 00:10:26 UTC (rev 1122)
+++ trunk/dbunit/src/test/org/dbunit/dataset/datatype/BlobDataTypeTest.java 2009-12-01 07:21:06 UTC (rev 1123)
@@ -20,13 +20,13 @@
*/
package org.dbunit.dataset.datatype;
+import java.sql.Blob;
import java.sql.Types;
import junit.framework.TestCase;
import junitx.framework.ArrayAssert;
import org.dbunit.database.statement.MockPreparedStatement;
-import org.hsqldb.jdbc.jdbcBlob;
/**
* @author gommma
@@ -50,9 +50,9 @@
{
// Create a hsqldb specific blob
byte[] byteArray = new byte[]{1, 2, 3, 4, 5, 6};
- jdbcBlob jdbcBlob = new jdbcBlob(byteArray);
+ Blob blob = new TestBlob(byteArray);
MockPreparedStatement statement = new MockPreparedStatement();
- TYPE.setSqlValue(jdbcBlob, 1, statement);
+ TYPE.setSqlValue(blob, 1, statement);
assertEquals(1, statement.getLastSetObjectParamIndex());
assertEquals(Types.BLOB, statement.getLastSetObjectTargetSqlType());
assertEquals(byte[].class, statement.getLastSetObjectParamValue().getClass());
Added: trunk/dbunit/src/test/org/dbunit/dataset/datatype/TestBlob.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/dataset/datatype/TestBlob.java (rev 0)
+++ trunk/dbunit/src/test/org/dbunit/dataset/datatype/TestBlob.java 2009-12-01 07:21:06 UTC (rev 1123)
@@ -0,0 +1,99 @@
+/*
+ *
+ * The DbUnit Database Testing Framework
+ * Copyright (C)2002-2009, 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.datatype;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+
+/**
+ * @author John Hurst
+ * @version $Revision$
+ * @since 2.4.8
+ */
+public class TestBlob implements Blob
+{
+ private byte[] data = new byte[0];
+
+ public TestBlob(byte[] data)
+ {
+ this.data = data;
+ }
+
+ public long length() throws SQLException
+ { // used in DbUnit
+ return data.length;
+ }
+
+ public byte[] getBytes(long pos, int length) throws SQLException
+ { // used in DbUnit
+ byte[] result = new byte[length];
+ System.arraycopy(data, (int) pos - 1, result, 0, length);
+ return result;
+ }
+
+ public InputStream getBinaryStream() throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support getBinaryStream()");
+ }
+
+ public long position(byte[] pattern, long start) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support position(byte[], long)");
+ }
+
+ public long position(Blob pattern, long start) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support position(Blob, long)");
+ }
+
+ public int setBytes(long pos, byte[] bytes) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support setBytes(long, byte[])");
+ }
+
+ public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support setBytes(long, byte[], int, int)");
+ }
+
+ public OutputStream setBinaryStream(long pos) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support setBinaryStream(long)");
+ }
+
+ public void truncate(long len) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support truncate(long)");
+ }
+
+ public void free() throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support free()");
+ }
+
+ public InputStream getBinaryStream(long pos, long length) throws SQLException
+ {
+ throw new SQLFeatureNotSupportedException("TestBlob does not support getBinaryStream(long, long)");
+ }
+}
Property changes on: trunk/dbunit/src/test/org/dbunit/dataset/datatype/TestBlob.java
___________________________________________________________________
Added: svn:keywords
+ Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2009-12-27 21:36:27
|
Revision: 1132
http://dbunit.svn.sourceforge.net/dbunit/?rev=1132&view=rev
Author: jbhurst
Date: 2009-12-27 21:36:20 +0000 (Sun, 27 Dec 2009)
Log Message:
-----------
[2905970] - Upgrade to POI Version 3.5-FINAL. Thanks pkamm.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/changes/changes.xml
trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java
trunk/dbunit/src/site/xdoc/components.xml
trunk/dbunit/src/site/xdoc/migration.xml
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2009-12-27 19:22:13 UTC (rev 1131)
+++ trunk/dbunit/pom.xml 2009-12-27 21:36:20 UTC (rev 1132)
@@ -256,7 +256,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
- <version>3.2-FINAL</version>
+ <version>3.5-FINAL</version>
<optional>true</optional>
</dependency>
Modified: trunk/dbunit/src/changes/changes.xml
===================================================================
--- trunk/dbunit/src/changes/changes.xml 2009-12-27 19:22:13 UTC (rev 1131)
+++ trunk/dbunit/src/changes/changes.xml 2009-12-27 21:36:20 UTC (rev 1132)
@@ -14,6 +14,7 @@
<action dev="gommma" type="fix" issue="2887115" due-to="unwissender2009">SQL: "Create Domain" ... Data Types are not supported.</action>
<action dev="jbhurst" type="add" issue="2875253" due-to="caseylucas">Additional refinements for Oracle SDO_GEOMETRY datatype</action>
<action dev="jbhurst" type="add" issue="2921131" due-to="vlamp">Add timezone support for timestamp data type</action>
+ <action dev="jbhurst" type="add" issue="2905970" due-to="pkamm">Upgrade to POI Version 3.5-FINAL</action>
</release>
<release version="2.4.7" date="Nov 09, 2009" description="Bugfixes and some non breaking refactoring">
<action dev="gommma" type="fix" issue="2685615" due-to="lumpynose">dtd for XmlDataSet</action>
Modified: trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java
===================================================================
--- trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java 2009-12-27 19:22:13 UTC (rev 1131)
+++ trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java 2009-12-27 21:36:20 UTC (rev 1132)
@@ -30,9 +30,9 @@
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.ss.usermodel.DateUtil;
import org.dbunit.dataset.AbstractTable;
import org.dbunit.dataset.Column;
import org.dbunit.dataset.DataSetException;
@@ -150,7 +150,7 @@
{
case HSSFCell.CELL_TYPE_NUMERIC:
HSSFCellStyle style = cell.getCellStyle();
- if (HSSFDateUtil.isCellDateFormatted(cell))
+ if (DateUtil.isCellDateFormatted(cell))
{
return getDateValue(cell);
}
@@ -203,7 +203,7 @@
logger.debug("getDateValue(cell={}) - start", cell);
double numericValue = cell.getNumericCellValue();
- Date date = HSSFDateUtil.getJavaDate(numericValue);
+ Date date = DateUtil.getJavaDate(numericValue);
// Add the timezone offset again because it was subtracted automatically by Apache-POI (we need UTC)
long tzOffset = TimeZone.getDefault().getOffset(date.getTime());
date = new Date(date.getTime() + tzOffset);
Modified: trunk/dbunit/src/site/xdoc/components.xml
===================================================================
--- trunk/dbunit/src/site/xdoc/components.xml 2009-12-27 19:22:13 UTC (rev 1131)
+++ trunk/dbunit/src/site/xdoc/components.xml 2009-12-27 21:36:20 UTC (rev 1132)
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<document><properties><title>Core Components</title></properties><body><section>
-
+
<h3>Core Components</h3>
- <p>This document attemps to give you an overview of the core classes that make up DbUnit.
+ <p>This document attemps to give you an overview of the core classes that make up DbUnit.
Following are the core interfaces or abstract classes:
-
+
<table border="1">
- <tr>
+ <tr>
<th>Class</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="#databaseconnection">IDatabaseConnection</a></td>
<td>Interface representing a DbUnit connection to a database.</td>
</tr>
- <tr>
+ <tr>
<td><a href="#dataset">IDataSet</a></td>
<td>Interface representing a collection of tables.</td>
</tr>
- <tr>
+ <tr>
<td><a href="#databaseoperation">DatabaseOperation</a></td>
<td>Abstract class representing an operation performed on the database before and after each test.</td>
</tr>
@@ -26,72 +26,72 @@
</p>
<h3><a name="databaseconnection">IDatabaseConnection</a></h3>
- <p>The <a href="apidocs/org/dbunit/database/IDatabaseConnection.html">IDatabaseConnection</a> interface represents
- a DbUnit connection to a database.
-
+ <p>The <a href="apidocs/org/dbunit/database/IDatabaseConnection.html">IDatabaseConnection</a> interface represents
+ a DbUnit connection to a database.
+
<table border="1">
- <tr>
+ <tr>
<th>Class</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/database/DatabaseConnection.html">DatabaseConnection</a></td>
<td>Wraps a JDBC connection.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/database/DatabaseDataSourceConnection.html">DatabaseDataSourceConnection</a></td>
<td>Wraps a JDBC DataSource.</td>
</tr>
</table>
</p>
-
+
<h3><a name="dataset">IDataSet</a></h3>
- <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection
- of tables. This is the primary abstraction used by DbUnit to manipulate tabular data.
+ <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection
+ of tables. This is the primary abstraction used by DbUnit to manipulate tabular data.
</p>
- <p>Most commonly used implemetations:
+ <p>Most commonly used implemetations:
<table border="1">
- <tr>
+ <tr>
<th>Implementation</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a name="flatxmldataset" href="apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a></td>
- <td>
- Reads and writes flat XML dataset document. Each XML element corresponds to a table row.
- Each XML element name corresponds to a table name. The XML attributes
+ <td>
+ Reads and writes flat XML dataset document. Each XML element corresponds to a table row.
+ Each XML element name corresponds to a table name. The XML attributes
correspond to table columns.<br/>
Flat XML dataset document sample:
<source><![CDATA[
<!DOCTYPE dataset SYSTEM "my-dataset.dtd">
<dataset>
- <TEST_TABLE COL0="row 0 col 0"
+ <TEST_TABLE COL0="row 0 col 0"
COL1="row 0 col 1"
- COL2="row 0 col 2"/>
+ COL2="row 0 col 2"/>
<TEST_TABLE COL1="row 1 col 1"/>
- <SECOND_TABLE COL0="row 0 col 0"
+ <SECOND_TABLE COL0="row 0 col 0"
COL1="row 0 col 1" />
<EMPTY_TABLE/>
</dataset>]]></source>
<br/>
- To specify null values, omit corresponding attribute.
+ To specify null values, omit corresponding attribute.
In the above example, missing COL0 and COL2 attributes of TEST_TABLE second row represents null values.
<br/>
Table metadata is deduced from the first row of each table by default, whereas it is possible to enable the
<i>column sensing</i> feature as described in <a name="FAQ-differentcolumnnumber" href="faq.html#differentcolumnnumber">differentcolumnnumber</a>
<b>Beware you may get a NoSuchColumnException if the first row of a table has one or more null values.</b>
- Because of that, this is highly recommended to use DTD. DbUnit will use the
- columns declared in the DTD as table metadata. DbUnit only support external system URI.
+ Because of that, this is highly recommended to use DTD. DbUnit will use the
+ columns declared in the DTD as table metadata. DbUnit only support external system URI.
The URI can be absolute or relative.
<br/>
Another way to cope with this problem is to use the <a href= "#replacementdataset">ReplacementDataSet</a>.
-
+
</td>
</tr>
- <tr>
+ <tr>
<td><a name="xmldataset" href="apidocs/org/dbunit/dataset/xml/XmlDataSet.html">XmlDataSet</a></td>
<td>
- Reads and writes original XML dataset document. This format
+ Reads and writes original XML dataset document. This format
is very verbose and must conform to the following DTD:
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
@@ -141,13 +141,13 @@
<br/>
</td>
</tr>
- <tr>
+ <tr>
<td><a name="streamingdataset" href="apidocs/org/dbunit/database/StreamingDataSet.html">StreamingDataSet</a></td>
<td>Consumes a producer and expose its content as a dataset. Provides cursor like forward only access to it and only keeps the active row in memory. Can be used with FlatXmlProducer and XmlProvider.
<br/>
This is a very efficient way to load XML dataset document when working with forward only database operations (UPDATE, INSERT, REFRESH).
<br/>
-Following sample shows how to load a flat XML dataset with the StreamingDataSet:
+Following sample shows how to load a flat XML dataset with the StreamingDataSet:
<source>
IDataSetProducer producer = new FlatXmlProducer(
new InputSource("dataset.xml"));
@@ -155,13 +155,13 @@
</source>
</td>
</tr>
- <tr>
+ <tr>
<td><a name="databasedataset" href="apidocs/org/dbunit/database/DatabaseDataSet.html">DatabaseDataSet</a></td>
- <td>Adapter that provides access
- to a database instance as a dataset. This class is not usually instantiated
+ <td>Adapter that provides access
+ to a database instance as a dataset. This class is not usually instantiated
directly but from the factory method <code>IDatabaseConnection.createDataSet()</code>.</td>
</tr>
- <tr>
+ <tr>
<td><a name="querydataset" href="apidocs/org/dbunit/database/QueryDataSet.html">QueryDataSet</a></td>
<td>Holds collection of tables resulting from database queries.
<br/>
@@ -174,41 +174,41 @@
</td>
</tr>
- <tr>
+ <tr>
<td><a name="defaultdataset" href="apidocs/org/dbunit/dataset/DefaultDataSet.html">DefaultDataSet</a></td>
<td>Uses to create datasets programmatically.</td>
</tr>
- <tr>
+ <tr>
<td><a name="compositedataset" href="apidocs/org/dbunit/dataset/CompositeDataSet.html">CompositeDataSet</a></td>
<td>Combines multiple datasets into a single logical dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="filtereddataset" href="apidocs/org/dbunit/dataset/FilteredDataSet.html">FilteredDataSet</a></td>
<td>Decorator that exposes only some tables from decorated dataset. Can be used with different filtering strategies. Some strategies can include/exclude tables without altering their order while others expose tables with a different order.
<table border="1">
- <tr>
+ <tr>
<th>Strategy</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td>IncludeTableFilter</td>
<td>Exposes only matching tables pattern without modifying the original table order. Support wildcards. </td>
</tr>
- <tr>
+ <tr>
<td>ExcludeTableFilter </td>
<td>Hides matching tables pattern without modifying the original table order. Support wildcards.</td>
</tr>
- <tr>
+ <tr>
<td>SequenceTableFilter </td>
<td>Exposes a configured table sequence and can be used to reorder dataset table. This is the original filtering strategy from DbUnit 1.x. </td>
</tr>
- <tr>
+ <tr>
<td>DatabaseSequenceFilter</td>
- <td> Automatically determine the tables order using foreign/exported keys information.
- This strategy is vendor
- independent and should work with any JDBC driver that implement the
- <code>DatabaseMetaData.getExportedKeys()</code> method.
+ <td> Automatically determine the tables order using foreign/exported keys information.
+ This strategy is vendor
+ independent and should work with any JDBC driver that implement the
+ <code>DatabaseMetaData.getExportedKeys()</code> method.
<br/>
Support simple multi-level dependency like this:
<source>
@@ -224,13 +224,14 @@
</td>
</tr>
- <tr>
+ <tr>
<td><a name="xlsdataset" href="apidocs/org/dbunit/dataset/excel/XlsDataSet.html">XlsDataSet</a></td>
<td>Read and writes MS Excel dataset documents. Each
sheet represents a table. The first row of a sheet defines the columns names
and remaining rows contains the data.</td>
+ <td><b>Note:</b> You need to include Apache POI version 3.5-FINAL or later in your classpath to use XmlDataSet.</td>
</tr>
- <tr>
+ <tr>
<td><a name= "replacementdataset" href="apidocs/org/dbunit/dataset/ReplacementDataSet.html">ReplacementDataSet</a></td>
<td>Decorator that replaces placeholder objects from the decorated dataset with replacement objects. Substring substitution is also possible.
<br/>
@@ -239,19 +240,19 @@
<source><![CDATA[
<?xml version="1.0"?>
<dataset>
- <TEST_TABLE COL0="row 0 col 0"
- COL1="[null]"/>
+ <TEST_TABLE COL0="row 0 col 0"
+ COL1="[null]"/>
<TEST_TABLE COL1="row 1 col 0"
- COL2="row 1 col 1"/>
+ COL2="row 1 col 1"/>
</dataset>]]></source>
<br/>
Loading the flat XML dataset:
<source><![CDATA[
ReplacementDataSet dataSet = new ReplacementDataSet(
- new FlatXmlDataSet(\x85));
+ new FlatXmlDataSet(\x85));
dataSet.addReplacementObject("[NULL]", null);]]></source>
<br/>
- You can choose to use a fail-fast replacement to ensure that all placeholders are actually set
+ You can choose to use a fail-fast replacement to ensure that all placeholders are actually set
and no one is missing in the replacement map. If one is missing the replacement will fail immediately throwing an exception.
(Note that the default behaviour is to leave the non-replaced placeholder there and proceeding work silently):
<source>replacementDataSet.setStrictReplacement(true);</source>
@@ -262,80 +263,80 @@
</p>
<h3><a name="databaseoperation">DatabaseOperation</a></h3>
<p><a href="apidocs/org/dbunit/operation/DatabaseOperation.html">DatabaseOperation</a> is an abstract class that represents an operation performed on the database before and after each test. </p>
- <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and
- <a href="#cleanInsert">CLEAN_INSERT</a>. They
- are the ones you will deal usualy with. They represent two
+ <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and
+ <a href="#cleanInsert">CLEAN_INSERT</a>. They
+ are the ones you will deal usualy with. They represent two
testing strategies with different benefits and tradeoffs. </p>
<table border="1">
- <tr>
+ <tr>
<th>Operation</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/UpdateOperation.html">DatabaseOperation.UPDATE</a></td>
- <td>This operation updates the database from the dataset contents. This operation
- assumes that table data already exists in the target database and fails
+ <td>This operation updates the database from the dataset contents. This operation
+ assumes that table data already exists in the target database and fails
if this is not the case.</td>
</tr>
- <tr>
+ <tr>
<td><a name="insert" href="apidocs/org/dbunit/operation/InsertOperation.html">DatabaseOperation.INSERT</a></td>
- <td>This operation inserts the dataset contents into the database. This operation
- assumes that table data does not exist in the target database and fails
- if this is not the case. To prevent problems with foreign keys, tables must
+ <td>This operation inserts the dataset contents into the database. This operation
+ assumes that table data does not exist in the target database and fails
+ if this is not the case. To prevent problems with foreign keys, tables must
be sequenced appropriately in the dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="delete" href="apidocs/org/dbunit/operation/DeleteOperation.html">DatabaseOperation.DELETE</a></td>
- <td>This operation deletes only the dataset contents from the database. This
- operation does not delete the entire table contents but only data that are
+ <td>This operation deletes only the dataset contents from the database. This
+ operation does not delete the entire table contents but only data that are
present in the dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="deleteall" href="apidocs/org/dbunit/operation/DeleteAllOperation.html">DatabaseOperation.DELETE_ALL</a></td>
<td>Deletes all rows of tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.</td>
</tr>
- <tr>
+ <tr>
<td><a name="truncate" href="apidocs/org/dbunit/operation/TruncateTableOperation.html">DatabaseOperation.TRUNCATE</a></td>
- <td>Truncate tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.
+ <td>Truncate tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.
</td>
</tr>
- <tr>
+ <tr>
<td><a name="refresh" href="apidocs/org/dbunit/operation/RefreshOperation.html">DatabaseOperation.REFRESH</a></td>
- <td>This operation literally refreshes dataset contents into the target database.
- This means that data of existing rows are updated and non-existing row get
- inserted. Any rows which exist in the database but not in dataset stay unaffected.
- This approach is more appropriate for tests that assume other data may exist
+ <td>This operation literally refreshes dataset contents into the target database.
+ This means that data of existing rows are updated and non-existing row get
+ inserted. Any rows which exist in the database but not in dataset stay unaffected.
+ This approach is more appropriate for tests that assume other data may exist
in the database.<br/>
- if they are correctly written, tests using this strategy can even be performed
+ if they are correctly written, tests using this strategy can even be performed
on a populated database like a copy of a production database.</td>
</tr>
- <tr>
+ <tr>
<td><a name="cleanInsert">DatabaseOperation.CLEAN_INSERT</a></td>
- <td>This composite operation performs a <a href="#deleteall">DELETE_ALL</a> operation followed by an
- <a href="#insert">INSERT</a> operation. This is the safest approach to ensure that the database
- is in a known state. This is appropriate for tests that require the database
+ <td>This composite operation performs a <a href="#deleteall">DELETE_ALL</a> operation followed by an
+ <a href="#insert">INSERT</a> operation. This is the safest approach to ensure that the database
+ is in a known state. This is appropriate for tests that require the database
to only contain a specific set of data.</td>
</tr>
- <tr>
+ <tr>
<td>DatabaseOperation.NONE</td>
<td>Empty operation that does absolutely nothing.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/CompositeOperation.html">CompositeOperation</a></td>
<td>This operation combines multiple operations into a single one.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/TransactionOperation.html">TransactionOperation</a></td>
- <td>This operation decorates an operation and executes it within the context
+ <td>This operation decorates an operation and executes it within the context
of a transaction.</td>
</tr>
- <tr>
+ <tr>
<td><a name="InsertIdentityOperation" href="apidocs/org/dbunit/ext/mssql/InsertIdentityOperation.html">InsertIdentityOperation</a></td>
- <td>This operation decorates an insert operation and disables the MS SQL
- Server automatic identifier generation (IDENTITY) during its execution.
- Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT
+ <td>This operation decorates an insert operation and disables the MS SQL
+ Server automatic identifier generation (IDENTITY) during its execution.
+ Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT
or InsertIdentityOperation.REFRESH instead of those defined in DatabaseOperation.</td>
</tr>
</table>
Modified: trunk/dbunit/src/site/xdoc/migration.xml
===================================================================
--- trunk/dbunit/src/site/xdoc/migration.xml 2009-12-27 19:22:13 UTC (rev 1131)
+++ trunk/dbunit/src/site/xdoc/migration.xml 2009-12-27 21:36:20 UTC (rev 1132)
@@ -6,7 +6,31 @@
<h2>Migration guide</h2>
<p>To migrate from an older DbUnit release to a newer one you can find some useful information here.</p>
-
+
+ <subsection name="2.4.7 to 2.4.8">
+ <p>There is a change to dependencies.
+ <table border="1">
+ <tr>
+ <th>Tracker #</th>
+ <th>Affects</th>
+ <th>Migration</th>
+ <th>Background information</th>
+ </tr>
+
+ <tr>
+ <td>2905970</td>
+ <td>XlsDataSet</td>
+ <td>Upgrade to POI 3.5-FINAL or later.
+ <td>POI moved static utility methods from org.apache.poi.hssf.usermodel.HSSFDateUtil to a superclass.
+ This required a recompile against the new version, and clients will need to use the new version.
+ </td>
+ </td>
+ </tr>
+ </table>
+ </p>
+ </subsection>
+
+ </subsection>
<subsection name="2.4.3 to 2.4.4">
<p>There has been a very small change to the API.</p>
<table border="1">
@@ -17,42 +41,42 @@
<th>Background information</th>
</tr>
- <tr>
+ <tr>
<td>2567724</td>
<td><code>new method org.dbunit.IDatabaseTester#setOperationListener()</code></td>
<td>If you extend from AbstractDatabaseTester then there is nothing to do. If you implement
the IDatabaseTester interface then you must support the methods of IOperationListener. As
reference implementation you can look at the AbstractDatabaseTester.</td>
- <td>This change was necessary to ensure that the user defined IDatabaseConnection setup provided by
+ <td>This change was necessary to ensure that the user defined IDatabaseConnection setup provided by
<code>DatabaseTestCase#setUpDatabaseConfig(DatabaseConfig databaseConfig)</code> is also used in
the setUp and tearDown operations.
</td>
</tr>
- <tr>
+ <tr>
<td>1956543</td>
<td><code>new method org.dbunit.database.IDatabaseConnection#createTable(String tableName, PreparedStatement preparedStatement)</code></td>
<td>If you extend from AbstractDatabaseConnection then there is nothing to do. If you implement
the IDatabaseConnection interface then you must implement the new method. As
reference implementation you can look into AbstractDatabaseConnection.</td>
- <td>This addition comes from the feature request
+ <td>This addition comes from the feature request
<a href='https://sourceforge.net/tracker/index.php?func=detail&aid=1956543&group_id=47439&atid=449494'>1956543</a>
where you can read details about why this is useful.
</td>
</tr>
- <tr>
+ <tr>
<td>1956543</td>
<td><code>new method org.dbunit.database.IResultSetTableFactory#createTable(String tableName,
PreparedStatement preparedStatement, IDatabaseConnection connection)</code></td>
<td>If you provide a custom IResultSetTableFactory then you have to implement this new method.
As reference implementation you can look into ForwardOnlyResultSetTableFactory.</td>
- <td>This addition comes from the feature request
+ <td>This addition comes from the feature request
<a href='https://sourceforge.net/tracker/index.php?func=detail&aid=1956543&group_id=47439&atid=449494'>1956543</a>
where you can read details about why this is useful.
</td>
</tr>
</table>
</subsection>
-
+
<subsection name="2.4.2 to 2.4.3">
<p>There has been a very small change to the API.</p>
<table border="1">
@@ -63,20 +87,20 @@
<th>Background information</th>
</tr>
- <tr>
+ <tr>
<td>2023994</td>
<td><code>org.dbunit.DBTestCase#getConnection() is final</code></td>
- <td>To control the creation of the IDatabaseConnection, override method DBTestCase#newDatabaseTester() which provides
+ <td>To control the creation of the IDatabaseConnection, override method DBTestCase#newDatabaseTester() which provides
the connection via IDatabaseTester#getConnection()</td>
- <td>The method DBTestCase#getConnection() is now final and the master object for retrieving a
- connection here is the IDatabaseTester. It is created via the DBTestCase#newDatabaseTester()
- method and provides the database connection via IDatabaseTester#getConnection. The reason for
+ <td>The method DBTestCase#getConnection() is now final and the master object for retrieving a
+ connection here is the IDatabaseTester. It is created via the DBTestCase#newDatabaseTester()
+ method and provides the database connection via IDatabaseTester#getConnection. The reason for
this change is firstly to provide a consistent access to the database connection
- and secondly to allow the user to easily configure dbunit properties by overriding the
+ and secondly to allow the user to easily configure dbunit properties by overriding the
method setUpDatabaseConfig(DatabaseConfig databaseConfig).
</td>
</tr>
- <tr>
+ <tr>
<td>2023994</td>
<td><code>Removed setters from org.dbunit.JdbcDatabaseTester and added constructors</code></td>
<td>Just invoke the appropriate constructor of JdbcDatabaseTester</td>
@@ -108,7 +132,7 @@
(or copy-pasted) multiple times before.
</td>
</tr>
-
+
<tr>
<td>1961269</td>
<td><code>org.dbunit.dataset.datatype.IDataTypeFactory.createDataType(int sqlType, String sqlTypeName, String tableName, String columnName)</code></td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2010-01-21 22:31:16
|
Revision: 1137
http://dbunit.svn.sourceforge.net/dbunit/?rev=1137&view=rev
Author: jbhurst
Date: 2010-01-21 22:31:08 +0000 (Thu, 21 Jan 2010)
Log Message:
-----------
[2875235] - Integration tests renamed XxxIT; added failsafe plugin to run them.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/test/org/dbunit/AllTests.java
trunk/dbunit/src/test/org/dbunit/ant/AllTests.java
trunk/dbunit/src/test/org/dbunit/assertion/AllTests.java
trunk/dbunit/src/test/org/dbunit/assertion/DiffCollectingFailureHandlerTest.java
trunk/dbunit/src/test/org/dbunit/database/AllTests.java
trunk/dbunit/src/test/org/dbunit/database/ScrollableResultSetTableTest.java
trunk/dbunit/src/test/org/dbunit/dataset/xml/AllTests.java
trunk/dbunit/src/test/org/dbunit/ext/mssql/AllTests.java
trunk/dbunit/src/test/org/dbunit/ext/postgresql/AllTests.java
trunk/dbunit/src/test/org/dbunit/operation/AllTests.java
Added Paths:
-----------
trunk/dbunit/src/test/org/dbunit/AbstractDatabaseIT.java
trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterIT.java
trunk/dbunit/src/test/org/dbunit/DBTestCaseIT.java
trunk/dbunit/src/test/org/dbunit/DatabaseTestCaseIT.java
trunk/dbunit/src/test/org/dbunit/ant/DbUnitTaskIT.java
trunk/dbunit/src/test/org/dbunit/assertion/DbUnitAssertIT.java
trunk/dbunit/src/test/org/dbunit/database/AbstractDatabaseConnectionIT.java
trunk/dbunit/src/test/org/dbunit/database/AbstractDatabaseTesterConnectionIT.java
trunk/dbunit/src/test/org/dbunit/database/CachedResultSetTableIT.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseConnectionIT.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseDataSetIT.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseTableMetaDataIT.java
trunk/dbunit/src/test/org/dbunit/database/DefaultDatabaseTesterConnectionIT.java
trunk/dbunit/src/test/org/dbunit/database/ForwardOnlyResultSetTableIT.java
trunk/dbunit/src/test/org/dbunit/database/JdbcDatabaseTesterConnectionIT.java
trunk/dbunit/src/test/org/dbunit/database/QueryDataSetIT.java
trunk/dbunit/src/test/org/dbunit/database/ResultSetTableMetaDataIT.java
trunk/dbunit/src/test/org/dbunit/dataset/xml/FlatDtdDataSetIT.java
trunk/dbunit/src/test/org/dbunit/ext/mssql/InsertIdentityOperationIT.java
trunk/dbunit/src/test/org/dbunit/ext/postgresql/SQLHelperDomainPostgreSQLIT.java
trunk/dbunit/src/test/org/dbunit/operation/AbstractBatchOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/CloseConnectionOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/CompositeOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/DeleteAllOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/DeleteOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/InsertOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/RefreshOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/TransactionOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/TruncateTableOperationIT.java
trunk/dbunit/src/test/org/dbunit/operation/UpdateOperationIT.java
Removed Paths:
-------------
trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTest.java
trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterTest.java
trunk/dbunit/src/test/org/dbunit/DBTestCaseTest.java
trunk/dbunit/src/test/org/dbunit/DatabaseTestCaseTest.java
trunk/dbunit/src/test/org/dbunit/ant/DbUnitTaskTest.java
trunk/dbunit/src/test/org/dbunit/assertion/DbUnitAssertTest.java
trunk/dbunit/src/test/org/dbunit/database/AbstractDatabaseConnectionTest.java
trunk/dbunit/src/test/org/dbunit/database/AbstractDatabaseTesterConnectionTest.java
trunk/dbunit/src/test/org/dbunit/database/CachedResultSetTableTest.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseConnectionTest.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseDataSetTest.java
trunk/dbunit/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java
trunk/dbunit/src/test/org/dbunit/database/DefaultDatabaseTesterConnectionTest.java
trunk/dbunit/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java
trunk/dbunit/src/test/org/dbunit/database/JdbcDatabaseTesterConnectionTest.java
trunk/dbunit/src/test/org/dbunit/database/QueryDataSetTest.java
trunk/dbunit/src/test/org/dbunit/database/ResultSetTableMetaDataTest.java
trunk/dbunit/src/test/org/dbunit/dataset/xml/FlatDtdDataSetTest.java
trunk/dbunit/src/test/org/dbunit/ext/mssql/InsertIdentityOperationTest.java
trunk/dbunit/src/test/org/dbunit/ext/postgresql/SQLHelperDomainPostgreSQLTest.java
trunk/dbunit/src/test/org/dbunit/operation/AbstractBatchOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/CloseConnectionOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/CompositeOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/DeleteAllOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/DeleteOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/InsertOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/RefreshOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/TransactionOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/TruncateTableOperationTest.java
trunk/dbunit/src/test/org/dbunit/operation/UpdateOperationTest.java
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-01-07 20:50:16 UTC (rev 1136)
+++ trunk/dbunit/pom.xml 2010-01-21 22:31:08 UTC (rev 1137)
@@ -399,6 +399,52 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>failsafe-maven-plugin</artifactId>
+ <version>2.4.3-alpha-1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <systemProperties>
+ <property>
+ <name>dbunit.profile</name>
+ <value>${dbunit.profile}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.driverClass</name>
+ <value>${dbunit.profile.driverClass}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.url</name>
+ <value>${dbunit.profile.url}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.schema</name>
+ <value>${dbunit.profile.schema}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.user</name>
+ <value>${dbunit.profile.user}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.password</name>
+ <value>${dbunit.profile.password}</value>
+ </property>
+ <property>
+ <name>dbunit.profile.unsupportedFeatures</name>
+ <value>${dbunit.profile.unsupportedFeatures}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Copied: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseIT.java (from rev 1136, trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTest.java)
===================================================================
--- trunk/dbunit/src/test/org/dbunit/AbstractDatabaseIT.java (rev 0)
+++ trunk/dbunit/src/test/org/dbunit/AbstractDatabaseIT.java 2010-01-21 22:31:08 UTC (rev 1137)
@@ -0,0 +1,186 @@
+/*
+ *
+ * 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;
+
+import org.dbunit.database.DatabaseConfig;
+import org.dbunit.database.IDatabaseConnection;
+import org.dbunit.dataset.IDataSet;
+import org.dbunit.dataset.ITable;
+import org.dbunit.dataset.SortedTable;
+import org.dbunit.operation.DatabaseOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Manuel Laflamme
+ * @version $Revision$
+ * @since Feb 18, 2002
+ */
+public abstract class AbstractDatabaseIT extends DatabaseTestCase
+{
+ protected IDatabaseConnection _connection;
+
+ protected final Logger logger = LoggerFactory.getLogger(getClass());
+
+ public AbstractDatabaseIT(String s)
+ {
+ super(s);
+ }
+
+ protected DatabaseEnvironment getEnvironment() throws Exception
+ {
+ return DatabaseEnvironment.getInstance();
+ }
+
+ protected ITable createOrderedTable(String tableName, String orderByColumn)
+ throws Exception
+ {
+ return new SortedTable(_connection.createDataSet().getTable(tableName),
+ new String[]{orderByColumn});
+// String sql = "select * from " + tableName + " order by " + orderByColumn;
+// return _connection.createQueryTable(tableName, sql);
+ }
+
+ /**
+ * Returns the string converted as an identifier according to the metadata rules of the database environment.
+ * Most databases convert all metadata identifiers to uppercase.
+ * PostgreSQL converts identifiers to lowercase.
+ * MySQL preserves case.
+ * @param str The identifier.
+ * @return The identifier converted according to database rules.
+ */
+ protected String convertString(String str) throws Exception
+ {
+ return getEnvironment().convertString(str);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // TestCase class
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ _connection = getDatabaseTester().getConnection();
+ setUpDatabaseConfig(_connection.getConfig());
+ }
+
+ protected IDatabaseTester getDatabaseTester() throws Exception
+ {
+ try{
+ return getEnvironment().getDatabaseTester();
+ }
+ catch( Exception e ){
+ //TODO matthias: this here hides original exceptions from being shown in the JUnit results
+ //(logger is not configured for unit tests). Think about how exceptions can be passed through
+ // So I temporarily added the "e.printStackTrace()"...
+ logger.error("getDatabaseTester()", e );
+ e.printStackTrace();
+ }
+ return super.getDatabaseTester();
+ }
+
+ protected void setUpDatabaseConfig(DatabaseConfig config)
+ {
+ try
+ {
+ getEnvironment().setupDatabaseConfig(config);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex); // JH_TODO: is this the "DbUnit way" to handle exceptions?
+ }
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ DatabaseOperation.DELETE_ALL.execute(_connection, _connection.createDataSet());
+
+ _connection = null;
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DatabaseTestCase class
+
+ protected IDatabaseConnection getConnection() throws Exception
+ {
+ IDatabaseConnection connection = getEnvironment().getConnection();
+ return connection;
+
+// return new DatabaseEnvironment(getEnvironment().getProfile()).getConnection();
+// return new DatabaseConnection(connection.getConnection(), connection.getSchema());
+ }
+
+ protected IDataSet getDataSet() throws Exception
+ {
+ return getEnvironment().getInitDataSet();
+ }
+
+ protected void closeConnection(IDatabaseConnection connection) throws Exception
+ {
+// getEnvironment().closeConnection();
+ }
+//
+// protected DatabaseOperation getTearDownOperation() throws Exception
+// {
+// return DatabaseOperation.DELETE_ALL;
+// }
+
+ /**
+ * This method is used so sub-classes can disable the tests according to
+ * some characteristics of the environment
+ * @param testName name of the test to be checked
+ * @return flag indicating if the test should be executed or not
+ */
+ protected boolean runTest(String testName) {
+ return true;
+ }
+
+ protected void runTest() throws Throwable {
+ if ( runTest(getName()) ) {
+ super.runTest();
+ } else {
+ if ( logger.isDebugEnabled() ) {
+ logger.debug( "Skipping test " + getClass().getName() + "." + getName() );
+ }
+ }
+ }
+
+ public static boolean environmentHasFeature(TestFeature feature) {
+ try {
+ final DatabaseEnvironment environment = DatabaseEnvironment.getInstance();
+ final boolean runIt = environment.support(feature);
+ return runIt;
+ } catch ( Exception e ) {
+ throw new DatabaseUnitRuntimeException(e);
+ }
+ }
+
+}
+
+
+
+
+
+
Property changes on: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTest.java 2010-01-07 20:50:16 UTC (rev 1136)
+++ trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTest.java 2010-01-21 22:31:08 UTC (rev 1137)
@@ -1,186 +0,0 @@
-/*
- *
- * 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;
-
-import org.dbunit.database.DatabaseConfig;
-import org.dbunit.database.IDatabaseConnection;
-import org.dbunit.dataset.IDataSet;
-import org.dbunit.dataset.ITable;
-import org.dbunit.dataset.SortedTable;
-import org.dbunit.operation.DatabaseOperation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Manuel Laflamme
- * @version $Revision$
- * @since Feb 18, 2002
- */
-public abstract class AbstractDatabaseTest extends DatabaseTestCase
-{
- protected IDatabaseConnection _connection;
-
- protected final Logger logger = LoggerFactory.getLogger(getClass());
-
- public AbstractDatabaseTest(String s)
- {
- super(s);
- }
-
- protected DatabaseEnvironment getEnvironment() throws Exception
- {
- return DatabaseEnvironment.getInstance();
- }
-
- protected ITable createOrderedTable(String tableName, String orderByColumn)
- throws Exception
- {
- return new SortedTable(_connection.createDataSet().getTable(tableName),
- new String[]{orderByColumn});
-// String sql = "select * from " + tableName + " order by " + orderByColumn;
-// return _connection.createQueryTable(tableName, sql);
- }
-
- /**
- * Returns the string converted as an identifier according to the metadata rules of the database environment.
- * Most databases convert all metadata identifiers to uppercase.
- * PostgreSQL converts identifiers to lowercase.
- * MySQL preserves case.
- * @param str The identifier.
- * @return The identifier converted according to database rules.
- */
- protected String convertString(String str) throws Exception
- {
- return str;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // TestCase class
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _connection = getDatabaseTester().getConnection();
- setUpDatabaseConfig(_connection.getConfig());
- }
-
- protected IDatabaseTester getDatabaseTester() throws Exception
- {
- try{
- return getEnvironment().getDatabaseTester();
- }
- catch( Exception e ){
- //TODO matthias: this here hides original exceptions from being shown in the JUnit results
- //(logger is not configured for unit tests). Think about how exceptions can be passed through
- // So I temporarily added the "e.printStackTrace()"...
- logger.error("getDatabaseTester()", e );
- e.printStackTrace();
- }
- return super.getDatabaseTester();
- }
-
- protected void setUpDatabaseConfig(DatabaseConfig config)
- {
- try
- {
- getEnvironment().setupDatabaseConfig(config);
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex); // JH_TODO: is this the "DbUnit way" to handle exceptions?
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- DatabaseOperation.DELETE_ALL.execute(_connection, _connection.createDataSet());
-
- _connection = null;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // DatabaseTestCase class
-
- protected IDatabaseConnection getConnection() throws Exception
- {
- IDatabaseConnection connection = getEnvironment().getConnection();
- return connection;
-
-// return new DatabaseEnvironment(getEnvironment().getProfile()).getConnection();
-// return new DatabaseConnection(connection.getConnection(), connection.getSchema());
- }
-
- protected IDataSet getDataSet() throws Exception
- {
- return getEnvironment().getInitDataSet();
- }
-
- protected void closeConnection(IDatabaseConnection connection) throws Exception
- {
-// getEnvironment().closeConnection();
- }
-//
-// protected DatabaseOperation getTearDownOperation() throws Exception
-// {
-// return DatabaseOperation.DELETE_ALL;
-// }
-
- /**
- * This method is used so sub-classes can disable the tests according to
- * some characteristics of the environment
- * @param testName name of the test to be checked
- * @return flag indicating if the test should be executed or not
- */
- protected boolean runTest(String testName) {
- return true;
- }
-
- protected void runTest() throws Throwable {
- if ( runTest(getName()) ) {
- super.runTest();
- } else {
- if ( logger.isDebugEnabled() ) {
- logger.debug( "Skipping test " + getClass().getName() + "." + getName() );
- }
- }
- }
-
- public static boolean environmentHasFeature(TestFeature feature) {
- try {
- final DatabaseEnvironment environment = DatabaseEnvironment.getInstance();
- final boolean runIt = environment.support(feature);
- return runIt;
- } catch ( Exception e ) {
- throw new DatabaseUnitRuntimeException(e);
- }
- }
-
-}
-
-
-
-
-
-
Copied: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterIT.java (from rev 1136, trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterTest.java)
===================================================================
--- trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterIT.java (rev 0)
+++ trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterIT.java 2010-01-21 22:31:08 UTC (rev 1137)
@@ -0,0 +1,144 @@
+/*
+ *
+ * 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;
+
+import junit.framework.TestCase;
+
+import org.dbunit.database.IDatabaseConnection;
+import org.dbunit.dataset.IDataSet;
+import org.dbunit.dataset.ITable;
+import org.dbunit.dataset.SortedTable;
+import org.dbunit.operation.DatabaseOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Andres Almiray (aal...@us...)
+ * @author Last changed by: $Author$
+ * @version $Revision$ $Date$
+ * @since 2.2.0
+ */
+public abstract class AbstractDatabaseTesterIT extends TestCase
+{
+ protected IDatabaseConnection _connection;
+ protected IDatabaseTester _databaseTester;
+
+ protected final Logger logger = LoggerFactory.getLogger(AbstractDatabaseTesterIT.class);
+
+ public AbstractDatabaseTesterIT( String s )
+ {
+ super( s );
+ }
+
+ protected DatabaseEnvironment getEnvironment() throws Exception
+ {
+ return DatabaseEnvironment.getInstance();
+ }
+
+ protected ITable createOrderedTable( String tableName, String orderByColumn ) throws Exception
+ {
+ return new SortedTable( _connection.createDataSet()
+ .getTable( tableName ), new String[] { orderByColumn } );
+ }
+
+ // //////////////////////////////////////////////////////////////////////////
+ // TestCase class
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ assertNotNull( "DatabaseTester is not set", getDatabaseTester() );
+ getDatabaseTester().setSetUpOperation( getSetUpOperation() );
+ getDatabaseTester().setDataSet( getDataSet() );
+ getDatabaseTester().onSetup();
+
+ _connection = getDatabaseTester().getConnection();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ assertNotNull( "DatabaseTester is not set", getDatabaseTester() );
+ getDatabaseTester().setTearDownOperation( getTearDownOperation() );
+ getDatabaseTester().setDataSet( getDataSet() );
+ getDatabaseTester().onTearDown();
+
+ DatabaseOperation.DELETE_ALL.execute( _connection, _connection.createDataSet() );
+
+ _connection = null;
+ }
+
+ // //////////////////////////////////////////////////////////////////////////
+
+ protected IDataSet getDataSet() throws Exception
+ {
+ return getEnvironment().getInitDataSet();
+ }
+
+ protected DatabaseOperation getSetUpOperation()
+ {
+ return DatabaseOperation.CLEAN_INSERT;
+ }
+
+ protected DatabaseOperation getTearDownOperation()
+ {
+ return DatabaseOperation.NONE;
+ }
+
+ protected abstract IDatabaseTester getDatabaseTester() throws Exception;
+
+ /**
+ * This method is used so sub-classes can disable the tests according to some
+ * characteristics of the environment
+ *
+ * @param testName name of the test to be checked
+ * @return flag indicating if the test should be executed or not
+ */
+ protected boolean runTest( String testName )
+ {
+ return true;
+ }
+
+ protected void runTest() throws Throwable
+ {
+ if( runTest( getName() ) ){
+ super.runTest();
+ }else{
+ if( logger.isDebugEnabled() ){
+ logger.debug( "Skipping test " + getClass().getName() + "." + getName() );
+ }
+ }
+ }
+
+ public static boolean environmentHasFeature( TestFeature feature )
+ {
+ try{
+ final DatabaseEnvironment environment = DatabaseEnvironment.getInstance();
+ final boolean runIt = environment.support( feature );
+ return runIt;
+ }
+ catch( Exception e ){
+ throw new DatabaseUnitRuntimeException( e );
+ }
+ }
+}
Property changes on: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterTest.java 2010-01-07 20:50:16 UTC (rev 1136)
+++ trunk/dbunit/src/test/org/dbunit/AbstractDatabaseTesterTest.java 2010-01-21 22:31:08 UTC (rev 1137)
@@ -1,144 +0,0 @@
-/*
- *
- * 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;
-
-import junit.framework.TestCase;
-
-import org.dbunit.database.IDatabaseConnection;
-import org.dbunit.dataset.IDataSet;
-import org.dbunit.dataset.ITable;
-import org.dbunit.dataset.SortedTable;
-import org.dbunit.operation.DatabaseOperation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Andres Almiray (aal...@us...)
- * @author Last changed by: $Author$
- * @version $Revision$ $Date$
- * @since 2.2.0
- */
-public abstract class AbstractDatabaseTesterTest extends TestCase
-{
- protected IDatabaseConnection _connection;
- protected IDatabaseTester _databaseTester;
-
- protected final Logger logger = LoggerFactory.getLogger(AbstractDatabaseTesterTest.class);
-
- public AbstractDatabaseTesterTest( String s )
- {
- super( s );
- }
-
- protected DatabaseEnvironment getEnvironment() throws Exception
- {
- return DatabaseEnvironment.getInstance();
- }
-
- protected ITable createOrderedTable( String tableName, String orderByColumn ) throws Exception
- {
- return new SortedTable( _connection.createDataSet()
- .getTable( tableName ), new String[] { orderByColumn } );
- }
-
- // //////////////////////////////////////////////////////////////////////////
- // TestCase class
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- assertNotNull( "DatabaseTester is not set", getDatabaseTester() );
- getDatabaseTester().setSetUpOperation( getSetUpOperation() );
- getDatabaseTester().setDataSet( getDataSet() );
- getDatabaseTester().onSetup();
-
- _connection = getDatabaseTester().getConnection();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- assertNotNull( "DatabaseTester is not set", getDatabaseTester() );
- getDatabaseTester().setTearDownOperation( getTearDownOperation() );
- getDatabaseTester().setDataSet( getDataSet() );
- getDatabaseTester().onTearDown();
-
- DatabaseOperation.DELETE_ALL.execute( _connection, _connection.createDataSet() );
-
- _connection = null;
- }
-
- // //////////////////////////////////////////////////////////////////////////
-
- protected IDataSet getDataSet() throws Exception
- {
- return getEnvironment().getInitDataSet();
- }
-
- protected DatabaseOperation getSetUpOperation()
- {
- return DatabaseOperation.CLEAN_INSERT;
- }
-
- protected DatabaseOperation getTearDownOperation()
- {
- return DatabaseOperation.NONE;
- }
-
- protected abstract IDatabaseTester getDatabaseTester() throws Exception;
-
- /**
- * This method is used so sub-classes can disable the tests according to some
- * characteristics of the environment
- *
- * @param testName name of the test to be checked
- * @return flag indicating if the test should be executed or not
- */
- protected boolean runTest( String testName )
- {
- return true;
- }
-
- protected void runTest() throws Throwable
- {
- if( runTest( getName() ) ){
- super.runTest();
- }else{
- if( logger.isDebugEnabled() ){
- logger.debug( "Skipping test " + getClass().getName() + "." + getName() );
- }
- }
- }
-
- public static boolean environmentHasFeature( TestFeature feature )
- {
- try{
- final DatabaseEnvironment environment = DatabaseEnvironment.getInstance();
- final boolean runIt = environment....
[truncated message content] |
|
From: <jb...@us...> - 2010-01-22 01:06:26
|
Revision: 1138
http://dbunit.svn.sourceforge.net/dbunit/?rev=1138&view=rev
Author: jbhurst
Date: 2010-01-22 01:06:13 +0000 (Fri, 22 Jan 2010)
Log Message:
-----------
[2875235] - mvn sql plugin to run DDL for integration tests.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/sql/db2xml.sql
trunk/dbunit/src/sql/mssql.sql
trunk/dbunit/src/sql/oracle.sql
trunk/dbunit/src/sql/postgresql.sql
Added Paths:
-----------
trunk/dbunit/src/sql/empty.sql
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-01-21 22:31:08 UTC (rev 1137)
+++ trunk/dbunit/pom.xml 2010-01-22 01:06:13 UTC (rev 1138)
@@ -488,6 +488,32 @@
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <version>1.3</version>
+ <configuration>
+ <driver>${dbunit.profile.driverClass}</driver>
+ <url>${dbunit.profile.url}</url>
+ <username>${dbunit.profile.user}</username>
+ <password>${dbunit.profile.password}</password>
+ </configuration>
+ <executions>
+ <execution>
+ <id>sql-ddl</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <srcFiles>
+ <srcFile>src/sql/${dbunit.profile.ddl}</srcFile>
+ </srcFiles>
+ <onError>continue</onError>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<executions>
<execution>
@@ -682,7 +708,23 @@
<dbunit.profile.user>sa</dbunit.profile.user>
<dbunit.profile.password></dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>empty.sql</dbunit.profile.ddl> <!-- DDL in HypersonicEnvironment -->
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 -->
<profile>
@@ -695,6 +737,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>oracle.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -704,6 +747,22 @@
<optional>true</optional>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.2.0.4.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 11 JDBC driver for Java 6 -->
<profile>
@@ -716,6 +775,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>oracle.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -725,6 +785,22 @@
<optional>true</optional>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.2.0.4.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!-- "newer" Oracle10DataTypeFactory with Oracle 10 JDBC driver for Java 1.4 -->
<profile>
@@ -737,6 +813,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>oracle.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -746,6 +823,22 @@
<optional>true</optional>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.2.0.4.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!-- "newer" Oracle10DataTypeFactory with Oracle 11 JDBC driver for Java 6 -->
<profile>
@@ -758,6 +851,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>oracle.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -767,6 +861,22 @@
<optional>true</optional>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.2.0.4.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>postgresql</id>
@@ -778,6 +888,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,CLOB,BLOB,SCROLLABLE_RESULTSET,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>postgresql.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -786,6 +897,21 @@
<version>8.4-701.jdbc3</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.4-701.jdbc3</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>mysql</id>
@@ -797,6 +923,7 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>mysql.sql</dbunit.profile.ddl>
</properties>
<dependencies>
<dependency>
@@ -805,6 +932,21 @@
<version>5.1.6</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.6</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>mssql</id>
@@ -816,7 +958,18 @@
<dbunit.profile.user>dbunit</dbunit.profile.user>
<dbunit.profile.password>dbunit</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>mssql.sql</dbunit.profile.ddl>
</properties>
+ <!-- JH_TODO: mssql dependencies -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <!-- JH_TODO: mssql dependencies -->
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>db2</id>
@@ -828,7 +981,18 @@
<dbunit.profile.user>TODO</dbunit.profile.user>
<dbunit.profile.password>TODO</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>TODO</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>db2xml.sql</dbunit.profile.ddl>
</properties>
+ <!-- JH_TODO: db2 dependencies -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <!-- JH_TODO: db2 dependencies -->
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>derby</id>
@@ -840,6 +1004,7 @@
<dbunit.profile.user>APP</dbunit.profile.user>
<dbunit.profile.password>APP</dbunit.profile.password>
<dbunit.profile.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>empty.sql</dbunit.profile.ddl> <!-- DDL in DerbyEnvironment -->
</properties>
<dependencies>
<dependency>
@@ -849,6 +1014,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.4.1.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>h2</id>
@@ -860,6 +1041,7 @@
<dbunit.profile.user>sa</dbunit.profile.user>
<dbunit.profile.password />
<dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures>
+ <dbunit.profile.ddl>empty.sql</dbunit.profile.ddl> <!-- DDL in H2Environment -->
</properties>
<dependencies>
<dependency>
@@ -868,6 +1050,21 @@
<version>1.1.118</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sql-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.1.118</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
</profile>
</profiles>
Modified: trunk/dbunit/src/sql/db2xml.sql
===================================================================
--- trunk/dbunit/src/sql/db2xml.sql 2010-01-21 22:31:08 UTC (rev 1137)
+++ trunk/dbunit/src/sql/db2xml.sql 2010-01-22 01:06:13 UTC (rev 1138)
@@ -1,23 +1,15 @@
--- DROP TABLE TEST_TABLE;
--- DROP TABLE SECOND_TABLE;
--- DROP TABLE EMPTY_TABLE;
--- DROP TABLE PK_TABLE;
--- DROP TABLE ONLY_PK_TABLE;
--- DROP TABLE EMPTY_MULTITYPE_TABLE;
--- DROP TABLE IDENTITY_TABLE;
--- DROP TABLE TEST_IDENTITY_NOT_PK;
-- DROP TABLE XMLTYPES;
--- CREATE TABLE XMLTYPES
--- (XMLVARCHAR DB2XML.XMLVARCHAR,
--- XMLCLOB DB2XML.XMLCLOBNOT LOGGED NOT COMPACT,
+-- CREATE TABLE XMLTYPES
+-- (XMLVARCHAR DB2XML.XMLVARCHAR,
+-- XMLCLOB DB2XML.XMLCLOBNOT LOGGED NOT COMPACT,
-- XMLFILE DB2XML.XMLFILE);
-----------------------------------------------------------------------------
-- TEST_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE TEST_TABLE
+DROP TABLE TEST_TABLE;
CREATE TABLE TEST_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -27,7 +19,7 @@
-----------------------------------------------------------------------------
-- SECOND_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE SECOND_TABLE
+DROP TABLE SECOND_TABLE;
CREATE TABLE SECOND_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -37,7 +29,7 @@
-----------------------------------------------------------------------------
-- EMPTY_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE EMPTY_TABLE
+DROP TABLE EMPTY_TABLE;
CREATE TABLE EMPTY_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -47,7 +39,7 @@
-----------------------------------------------------------------------------
-- PK_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE PK_TABLE
+DROP TABLE PK_TABLE;
CREATE TABLE PK_TABLE
(PK0 DECIMAL(31, 0) NOT NULL,
PK1 DECIMAL(31, 0) NOT NULL,
@@ -58,14 +50,14 @@
-----------------------------------------------------------------------------
-- ONLY_PK_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE ONLY_PK_TABLE
+DROP TABLE ONLY_PK_TABLE;
CREATE TABLE ONLY_PK_TABLE
(PK0 NUMERIC(31, 0) NOT NULL PRIMARY KEY);
-----------------------------------------------------------------------------
-- EMPTY_MULTITYPE_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE EMPTY_MULTITYPE_TABLE
+DROP TABLE EMPTY_MULTITYPE_TABLE;
CREATE TABLE EMPTY_MULTITYPE_TABLE
(VARCHAR_COL VARCHAR(32),
NUMERIC_COL DECIMAL(31, 0),
@@ -75,7 +67,7 @@
-----------------------------------------------------------------------------
-- IDENTITY_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE IDENTITY_TABLE
+DROP TABLE IDENTITY_TABLE;
CREATE TABLE IDENTITY_TABLE
(IDENTITY_TABLE_ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +0 , INCREMENT BY +1 , NO CACHE ) NOT NULL,
COLUMN0 VARCHAR(32),
@@ -84,7 +76,7 @@
-----------------------------------------------------------------------------
-- IDENTITY_TABLE
-----------------------------------------------------------------------------
--- DROP TABLE TEST_IDENTITY_NOT_PK
+DROP TABLE TEST_IDENTITY_NOT_PK;
CREATE TABLE TEST_IDENTITY_NOT_PK
(COL01 BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +0 , INCREMENT BY +1 , NO CACHE ) NOT NULL,
COL02 VARCHAR(64));
Added: trunk/dbunit/src/sql/empty.sql
===================================================================
--- trunk/dbunit/src/sql/empty.sql (rev 0)
+++ trunk/dbunit/src/sql/empty.sql 2010-01-22 01:06:13 UTC (rev 1138)
@@ -0,0 +1,4 @@
+-- This is a dummy SQL/DDL file.
+-- It's provided for in-memory database environments such as HSQLDB.
+-- Those databases have their schemas created on connection by their respective Environment classes.
+
Property changes on: trunk/dbunit/src/sql/empty.sql
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: trunk/dbunit/src/sql/mssql.sql
===================================================================
--- trunk/dbunit/src/sql/mssql.sql 2010-01-21 22:31:08 UTC (rev 1137)
+++ trunk/dbunit/src/sql/mssql.sql 2010-01-22 01:06:13 UTC (rev 1138)
@@ -2,6 +2,7 @@
-- TEST_TABLE
-----------------------------------------------------------------------------
+DROP TABLE TEST_TABLE;
CREATE TABLE TEST_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -12,6 +13,7 @@
-- SECOND_TABLE
-----------------------------------------------------------------------------
+DROP TABLE SECOND_TABLE;
CREATE TABLE SECOND_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -22,6 +24,7 @@
-- EMPTY_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_TABLE;
CREATE TABLE EMPTY_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -32,6 +35,7 @@
-- PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE PK_TABLE;
CREATE TABLE PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL,
PK1 NUMERIC(38, 0) NOT NULL,
@@ -43,6 +47,7 @@
-- ONLY_PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE ONLY_PK_TABLE;
CREATE TABLE ONLY_PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL PRIMARY KEY);
@@ -50,6 +55,7 @@
-- EMPTY_MULTITYPE_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_MULTITYPE_TABLE;
CREATE TABLE EMPTY_MULTITYPE_TABLE
(VARCHAR_COL VARCHAR(32),
NUMERIC_COL NUMERIC(38, 0),
@@ -60,6 +66,7 @@
-- IDENTITY_TABLE
-----------------------------------------------------------------------------
+DROP TABLE IDENTITY_TABLE;
CREATE TABLE IDENTITY_TABLE
(IDENTITY_TABLE_ID INT IDENTITY (1, 1) NOT NULL,
COLUMN0 VARCHAR(32),
@@ -69,6 +76,8 @@
-- TEST_IDENTITY_NOT_PK
-----------------------------------------------------------------------------
+DROP TABLE TEST_IDENTITY_NOT_PK;
CREATE TABLE TEST_IDENTITY_NOT_PK
(COL01 INT IDENTITY (1, 1) NOT NULL,
COL02 VARCHAR(64));
+
Modified: trunk/dbunit/src/sql/oracle.sql
===================================================================
--- trunk/dbunit/src/sql/oracle.sql 2010-01-21 22:31:08 UTC (rev 1137)
+++ trunk/dbunit/src/sql/oracle.sql 2010-01-22 01:06:13 UTC (rev 1138)
@@ -2,6 +2,7 @@
-- TEST_TABLE
-----------------------------------------------------------------------------
+DROP TABLE TEST_TABLE;
CREATE TABLE TEST_TABLE
(COLUMN0 VARCHAR2(32),
COLUMN1 VARCHAR2(32),
@@ -12,6 +13,7 @@
-- SECOND_TABLE
-----------------------------------------------------------------------------
+DROP TABLE SECOND_TABLE;
CREATE TABLE SECOND_TABLE
(COLUMN0 VARCHAR2(32),
COLUMN1 VARCHAR2(32),
@@ -22,6 +24,7 @@
-- EMPTY_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_TABLE;
CREATE TABLE EMPTY_TABLE
(COLUMN0 VARCHAR2(32),
COLUMN1 VARCHAR2(32),
@@ -32,6 +35,7 @@
-- PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE PK_TABLE;
CREATE TABLE PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL,
PK1 NUMERIC(38, 0) NOT NULL,
@@ -43,6 +47,7 @@
-- ONLY_PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE ONLY_PK_TABLE;
CREATE TABLE ONLY_PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL PRIMARY KEY);
@@ -50,6 +55,7 @@
-- EMPTY_MULTITYPE_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_MULTITYPE_TABLE;
CREATE TABLE EMPTY_MULTITYPE_TABLE
(VARCHAR_COL VARCHAR2(32),
NUMERIC_COL NUMERIC(38, 0),
@@ -60,6 +66,7 @@
-- CLOB_TABLE
-----------------------------------------------------------------------------
+DROP TABLE CLOB_TABLE;
CREATE TABLE CLOB_TABLE
(PK NUMERIC(38, 0) NOT NULL,
CLOB CLOB, PRIMARY KEY (PK));
@@ -68,6 +75,7 @@
-- BLOB_TABLE
-----------------------------------------------------------------------------
+DROP TABLE BLOB_TABLE;
CREATE TABLE BLOB_TABLE
(PK NUMERIC(38, 0) NOT NULL,
BLOB BLOB, PRIMARY KEY (PK));
@@ -76,6 +84,7 @@
-- SDO_GEOMETRY_TABLE
-----------------------------------------------------------------------------
+DROP TABLE SDO_GEOMETRY_TABLE;
CREATE TABLE SDO_GEOMETRY_TABLE
(PK NUMERIC(38, 0) NOT NULL,
VAL SDO_GEOMETRY,
Modified: trunk/dbunit/src/sql/postgresql.sql
===================================================================
--- trunk/dbunit/src/sql/postgresql.sql 2010-01-21 22:31:08 UTC (rev 1137)
+++ trunk/dbunit/src/sql/postgresql.sql 2010-01-22 01:06:13 UTC (rev 1138)
@@ -2,6 +2,7 @@
-- TEST_TABLE
-----------------------------------------------------------------------------
+DROP TABLE TEST_TABLE;
CREATE TABLE TEST_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -12,6 +13,7 @@
-- SECOND_TABLE
-----------------------------------------------------------------------------
+DROP TABLE SECOND_TABLE;
CREATE TABLE SECOND_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -22,6 +24,7 @@
-- EMPTY_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_TABLE;
CREATE TABLE EMPTY_TABLE
(COLUMN0 VARCHAR(32),
COLUMN1 VARCHAR(32),
@@ -32,6 +35,7 @@
-- PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE PK_TABLE;
CREATE TABLE PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL,
PK1 NUMERIC(38, 0) NOT NULL,
@@ -43,6 +47,7 @@
-- ONLY_PK_TABLE
-----------------------------------------------------------------------------
+DROP TABLE ONLY_PK_TABLE;
CREATE TABLE ONLY_PK_TABLE
(PK0 NUMERIC(38, 0) NOT NULL PRIMARY KEY);
@@ -50,6 +55,7 @@
-- EMPTY_MULTITYPE_TABLE
-----------------------------------------------------------------------------
+DROP TABLE EMPTY_MULTITYPE_TABLE;
CREATE TABLE EMPTY_MULTITYPE_TABLE
(VARCHAR_COL VARCHAR(32),
NUMERIC_COL NUMERIC(38, 0),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2010-01-23 22:17:20
|
Revision: 1148
http://dbunit.svn.sourceforge.net/dbunit/?rev=1148&view=rev
Author: jbhurst
Date: 2010-01-23 22:17:13 +0000 (Sat, 23 Jan 2010)
Log Message:
-----------
[2905970] - Reverted POI-3.5 changes -- incompatible with Java 1.4.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/changes/changes.xml
trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java
trunk/dbunit/src/site/xdoc/components.xml
trunk/dbunit/src/site/xdoc/migration.xml
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-01-23 16:57:03 UTC (rev 1147)
+++ trunk/dbunit/pom.xml 2010-01-23 22:17:13 UTC (rev 1148)
@@ -256,7 +256,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
- <version>3.5-FINAL</version>
+ <version>3.2-FINAL</version>
<optional>true</optional>
</dependency>
Modified: trunk/dbunit/src/changes/changes.xml
===================================================================
--- trunk/dbunit/src/changes/changes.xml 2010-01-23 16:57:03 UTC (rev 1147)
+++ trunk/dbunit/src/changes/changes.xml 2010-01-23 22:17:13 UTC (rev 1148)
@@ -14,7 +14,6 @@
<action dev="gommma" type="fix" issue="2887115" due-to="unwissender2009">SQL: "Create Domain" ... Data Types are not supported.</action>
<action dev="jbhurst" type="add" issue="2875253" due-to="caseylucas">Additional refinements for Oracle SDO_GEOMETRY datatype</action>
<action dev="jbhurst" type="add" issue="2921131" due-to="vlamp">Add timezone support for timestamp data type</action>
- <action dev="jbhurst" type="add" issue="2905970" due-to="pkamm">Upgrade to POI Version 3.5-FINAL</action>
<action dev="jbhurst" type="add" issue="2919427" due-to="dbamberghi (Daniele Bamberghi)">OracleDataTypeFactory recognises "SYS.XMLTYPE"</action>
<action dev="jeffjensen" type="add" issue="2938029" due-to="jeffjensen">Add "file loader" utility for various data file types</action>
</release>
Modified: trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java
===================================================================
--- trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java 2010-01-23 16:57:03 UTC (rev 1147)
+++ trunk/dbunit/src/java/org/dbunit/dataset/excel/XlsTable.java 2010-01-23 22:17:13 UTC (rev 1148)
@@ -30,9 +30,9 @@
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.ss.usermodel.DateUtil;
import org.dbunit.dataset.AbstractTable;
import org.dbunit.dataset.Column;
import org.dbunit.dataset.DataSetException;
@@ -150,7 +150,7 @@
{
case HSSFCell.CELL_TYPE_NUMERIC:
HSSFCellStyle style = cell.getCellStyle();
- if (DateUtil.isCellDateFormatted(cell))
+ if (HSSFDateUtil.isCellDateFormatted(cell))
{
return getDateValue(cell);
}
@@ -203,7 +203,7 @@
logger.debug("getDateValue(cell={}) - start", cell);
double numericValue = cell.getNumericCellValue();
- Date date = DateUtil.getJavaDate(numericValue);
+ Date date = HSSFDateUtil.getJavaDate(numericValue);
// Add the timezone offset again because it was subtracted automatically by Apache-POI (we need UTC)
long tzOffset = TimeZone.getDefault().getOffset(date.getTime());
date = new Date(date.getTime() + tzOffset);
Modified: trunk/dbunit/src/site/xdoc/components.xml
===================================================================
--- trunk/dbunit/src/site/xdoc/components.xml 2010-01-23 16:57:03 UTC (rev 1147)
+++ trunk/dbunit/src/site/xdoc/components.xml 2010-01-23 22:17:13 UTC (rev 1148)
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<document><properties><title>Core Components</title></properties><body><section>
-
+
<h3>Core Components</h3>
- <p>This document attemps to give you an overview of the core classes that make up DbUnit.
+ <p>This document attemps to give you an overview of the core classes that make up DbUnit.
Following are the core interfaces or abstract classes:
-
+
<table border="1">
- <tr>
+ <tr>
<th>Class</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="#databaseconnection">IDatabaseConnection</a></td>
<td>Interface representing a DbUnit connection to a database.</td>
</tr>
- <tr>
+ <tr>
<td><a href="#dataset">IDataSet</a></td>
<td>Interface representing a collection of tables.</td>
</tr>
- <tr>
+ <tr>
<td><a href="#databaseoperation">DatabaseOperation</a></td>
<td>Abstract class representing an operation performed on the database before and after each test.</td>
</tr>
@@ -26,72 +26,72 @@
</p>
<h3><a name="databaseconnection">IDatabaseConnection</a></h3>
- <p>The <a href="apidocs/org/dbunit/database/IDatabaseConnection.html">IDatabaseConnection</a> interface represents
- a DbUnit connection to a database.
-
+ <p>The <a href="apidocs/org/dbunit/database/IDatabaseConnection.html">IDatabaseConnection</a> interface represents
+ a DbUnit connection to a database.
+
<table border="1">
- <tr>
+ <tr>
<th>Class</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/database/DatabaseConnection.html">DatabaseConnection</a></td>
<td>Wraps a JDBC connection.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/database/DatabaseDataSourceConnection.html">DatabaseDataSourceConnection</a></td>
<td>Wraps a JDBC DataSource.</td>
</tr>
</table>
</p>
-
+
<h3><a name="dataset">IDataSet</a></h3>
- <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection
- of tables. This is the primary abstraction used by DbUnit to manipulate tabular data.
+ <p>The <a href="apidocs/org/dbunit/dataset/IDataSet.html">IDataSet</a> interface represents is a collection
+ of tables. This is the primary abstraction used by DbUnit to manipulate tabular data.
</p>
- <p>Most commonly used implemetations:
+ <p>Most commonly used implemetations:
<table border="1">
- <tr>
+ <tr>
<th>Implementation</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a name="flatxmldataset" href="apidocs/org/dbunit/dataset/xml/FlatXmlDataSet.html">FlatXmlDataSet</a></td>
- <td>
- Reads and writes flat XML dataset document. Each XML element corresponds to a table row.
- Each XML element name corresponds to a table name. The XML attributes
+ <td>
+ Reads and writes flat XML dataset document. Each XML element corresponds to a table row.
+ Each XML element name corresponds to a table name. The XML attributes
correspond to table columns.<br/>
Flat XML dataset document sample:
<source><![CDATA[
<!DOCTYPE dataset SYSTEM "my-dataset.dtd">
<dataset>
- <TEST_TABLE COL0="row 0 col 0"
+ <TEST_TABLE COL0="row 0 col 0"
COL1="row 0 col 1"
- COL2="row 0 col 2"/>
+ COL2="row 0 col 2"/>
<TEST_TABLE COL1="row 1 col 1"/>
- <SECOND_TABLE COL0="row 0 col 0"
+ <SECOND_TABLE COL0="row 0 col 0"
COL1="row 0 col 1" />
<EMPTY_TABLE/>
</dataset>]]></source>
<br/>
- To specify null values, omit corresponding attribute.
+ To specify null values, omit corresponding attribute.
In the above example, missing COL0 and COL2 attributes of TEST_TABLE second row represents null values.
<br/>
Table metadata is deduced from the first row of each table by default, whereas it is possible to enable the
<i>column sensing</i> feature as described in <a name="FAQ-differentcolumnnumber" href="faq.html#differentcolumnnumber">differentcolumnnumber</a>
<b>Beware you may get a NoSuchColumnException if the first row of a table has one or more null values.</b>
- Because of that, this is highly recommended to use DTD. DbUnit will use the
- columns declared in the DTD as table metadata. DbUnit only support external system URI.
+ Because of that, this is highly recommended to use DTD. DbUnit will use the
+ columns declared in the DTD as table metadata. DbUnit only support external system URI.
The URI can be absolute or relative.
<br/>
Another way to cope with this problem is to use the <a href= "#replacementdataset">ReplacementDataSet</a>.
-
+
</td>
</tr>
- <tr>
+ <tr>
<td><a name="xmldataset" href="apidocs/org/dbunit/dataset/xml/XmlDataSet.html">XmlDataSet</a></td>
<td>
- Reads and writes original XML dataset document. This format
+ Reads and writes original XML dataset document. This format
is very verbose and must conform to the following DTD:
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
@@ -141,13 +141,13 @@
<br/>
</td>
</tr>
- <tr>
+ <tr>
<td><a name="streamingdataset" href="apidocs/org/dbunit/database/StreamingDataSet.html">StreamingDataSet</a></td>
<td>Consumes a producer and expose its content as a dataset. Provides cursor like forward only access to it and only keeps the active row in memory. Can be used with FlatXmlProducer and XmlProvider.
<br/>
This is a very efficient way to load XML dataset document when working with forward only database operations (UPDATE, INSERT, REFRESH).
<br/>
-Following sample shows how to load a flat XML dataset with the StreamingDataSet:
+Following sample shows how to load a flat XML dataset with the StreamingDataSet:
<source>
IDataSetProducer producer = new FlatXmlProducer(
new InputSource("dataset.xml"));
@@ -155,13 +155,13 @@
</source>
</td>
</tr>
- <tr>
+ <tr>
<td><a name="databasedataset" href="apidocs/org/dbunit/database/DatabaseDataSet.html">DatabaseDataSet</a></td>
- <td>Adapter that provides access
- to a database instance as a dataset. This class is not usually instantiated
+ <td>Adapter that provides access
+ to a database instance as a dataset. This class is not usually instantiated
directly but from the factory method <code>IDatabaseConnection.createDataSet()</code>.</td>
</tr>
- <tr>
+ <tr>
<td><a name="querydataset" href="apidocs/org/dbunit/database/QueryDataSet.html">QueryDataSet</a></td>
<td>Holds collection of tables resulting from database queries.
<br/>
@@ -174,41 +174,41 @@
</td>
</tr>
- <tr>
+ <tr>
<td><a name="defaultdataset" href="apidocs/org/dbunit/dataset/DefaultDataSet.html">DefaultDataSet</a></td>
<td>Uses to create datasets programmatically.</td>
</tr>
- <tr>
+ <tr>
<td><a name="compositedataset" href="apidocs/org/dbunit/dataset/CompositeDataSet.html">CompositeDataSet</a></td>
<td>Combines multiple datasets into a single logical dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="filtereddataset" href="apidocs/org/dbunit/dataset/FilteredDataSet.html">FilteredDataSet</a></td>
<td>Decorator that exposes only some tables from decorated dataset. Can be used with different filtering strategies. Some strategies can include/exclude tables without altering their order while others expose tables with a different order.
<table border="1">
- <tr>
+ <tr>
<th>Strategy</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td>IncludeTableFilter</td>
<td>Exposes only matching tables pattern without modifying the original table order. Support wildcards. </td>
</tr>
- <tr>
+ <tr>
<td>ExcludeTableFilter </td>
<td>Hides matching tables pattern without modifying the original table order. Support wildcards.</td>
</tr>
- <tr>
+ <tr>
<td>SequenceTableFilter </td>
<td>Exposes a configured table sequence and can be used to reorder dataset table. This is the original filtering strategy from DbUnit 1.x. </td>
</tr>
- <tr>
+ <tr>
<td>DatabaseSequenceFilter</td>
- <td> Automatically determine the tables order using foreign/exported keys information.
- This strategy is vendor
- independent and should work with any JDBC driver that implement the
- <code>DatabaseMetaData.getExportedKeys()</code> method.
+ <td> Automatically determine the tables order using foreign/exported keys information.
+ This strategy is vendor
+ independent and should work with any JDBC driver that implement the
+ <code>DatabaseMetaData.getExportedKeys()</code> method.
<br/>
Support simple multi-level dependency like this:
<source>
@@ -224,14 +224,13 @@
</td>
</tr>
- <tr>
+ <tr>
<td><a name="xlsdataset" href="apidocs/org/dbunit/dataset/excel/XlsDataSet.html">XlsDataSet</a></td>
<td>Read and writes MS Excel dataset documents. Each
sheet represents a table. The first row of a sheet defines the columns names
and remaining rows contains the data.</td>
- <td><b>Note:</b> You need to include Apache POI version 3.5-FINAL or later in your classpath to use XmlDataSet.</td>
</tr>
- <tr>
+ <tr>
<td><a name= "replacementdataset" href="apidocs/org/dbunit/dataset/ReplacementDataSet.html">ReplacementDataSet</a></td>
<td>Decorator that replaces placeholder objects from the decorated dataset with replacement objects. Substring substitution is also possible.
<br/>
@@ -240,19 +239,19 @@
<source><![CDATA[
<?xml version="1.0"?>
<dataset>
- <TEST_TABLE COL0="row 0 col 0"
- COL1="[null]"/>
+ <TEST_TABLE COL0="row 0 col 0"
+ COL1="[null]"/>
<TEST_TABLE COL1="row 1 col 0"
- COL2="row 1 col 1"/>
+ COL2="row 1 col 1"/>
</dataset>]]></source>
<br/>
Loading the flat XML dataset:
<source><![CDATA[
ReplacementDataSet dataSet = new ReplacementDataSet(
- new FlatXmlDataSet(\x85));
+ new FlatXmlDataSet(\x85));
dataSet.addReplacementObject("[NULL]", null);]]></source>
<br/>
- You can choose to use a fail-fast replacement to ensure that all placeholders are actually set
+ You can choose to use a fail-fast replacement to ensure that all placeholders are actually set
and no one is missing in the replacement map. If one is missing the replacement will fail immediately throwing an exception.
(Note that the default behaviour is to leave the non-replaced placeholder there and proceeding work silently):
<source>replacementDataSet.setStrictReplacement(true);</source>
@@ -263,80 +262,80 @@
</p>
<h3><a name="databaseoperation">DatabaseOperation</a></h3>
<p><a href="apidocs/org/dbunit/operation/DatabaseOperation.html">DatabaseOperation</a> is an abstract class that represents an operation performed on the database before and after each test. </p>
- <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and
- <a href="#cleanInsert">CLEAN_INSERT</a>. They
- are the ones you will deal usualy with. They represent two
+ <p>The two most usefull operations are <a href="#refresh">REFRESH</a> and
+ <a href="#cleanInsert">CLEAN_INSERT</a>. They
+ are the ones you will deal usualy with. They represent two
testing strategies with different benefits and tradeoffs. </p>
<table border="1">
- <tr>
+ <tr>
<th>Operation</th>
<th>Description</th>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/UpdateOperation.html">DatabaseOperation.UPDATE</a></td>
- <td>This operation updates the database from the dataset contents. This operation
- assumes that table data already exists in the target database and fails
+ <td>This operation updates the database from the dataset contents. This operation
+ assumes that table data already exists in the target database and fails
if this is not the case.</td>
</tr>
- <tr>
+ <tr>
<td><a name="insert" href="apidocs/org/dbunit/operation/InsertOperation.html">DatabaseOperation.INSERT</a></td>
- <td>This operation inserts the dataset contents into the database. This operation
- assumes that table data does not exist in the target database and fails
- if this is not the case. To prevent problems with foreign keys, tables must
+ <td>This operation inserts the dataset contents into the database. This operation
+ assumes that table data does not exist in the target database and fails
+ if this is not the case. To prevent problems with foreign keys, tables must
be sequenced appropriately in the dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="delete" href="apidocs/org/dbunit/operation/DeleteOperation.html">DatabaseOperation.DELETE</a></td>
- <td>This operation deletes only the dataset contents from the database. This
- operation does not delete the entire table contents but only data that are
+ <td>This operation deletes only the dataset contents from the database. This
+ operation does not delete the entire table contents but only data that are
present in the dataset.</td>
</tr>
- <tr>
+ <tr>
<td><a name="deleteall" href="apidocs/org/dbunit/operation/DeleteAllOperation.html">DatabaseOperation.DELETE_ALL</a></td>
<td>Deletes all rows of tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.</td>
</tr>
- <tr>
+ <tr>
<td><a name="truncate" href="apidocs/org/dbunit/operation/TruncateTableOperation.html">DatabaseOperation.TRUNCATE</a></td>
- <td>Truncate tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.
+ <td>Truncate tables present in the specified dataset. If the dataset does not contains a particular table, but that table exists in the database, the database table is not affected. Table are truncated in reverse sequence.
</td>
</tr>
- <tr>
+ <tr>
<td><a name="refresh" href="apidocs/org/dbunit/operation/RefreshOperation.html">DatabaseOperation.REFRESH</a></td>
- <td>This operation literally refreshes dataset contents into the target database.
- This means that data of existing rows are updated and non-existing row get
- inserted. Any rows which exist in the database but not in dataset stay unaffected.
- This approach is more appropriate for tests that assume other data may exist
+ <td>This operation literally refreshes dataset contents into the target database.
+ This means that data of existing rows are updated and non-existing row get
+ inserted. Any rows which exist in the database but not in dataset stay unaffected.
+ This approach is more appropriate for tests that assume other data may exist
in the database.<br/>
- if they are correctly written, tests using this strategy can even be performed
+ if they are correctly written, tests using this strategy can even be performed
on a populated database like a copy of a production database.</td>
</tr>
- <tr>
+ <tr>
<td><a name="cleanInsert">DatabaseOperation.CLEAN_INSERT</a></td>
- <td>This composite operation performs a <a href="#deleteall">DELETE_ALL</a> operation followed by an
- <a href="#insert">INSERT</a> operation. This is the safest approach to ensure that the database
- is in a known state. This is appropriate for tests that require the database
+ <td>This composite operation performs a <a href="#deleteall">DELETE_ALL</a> operation followed by an
+ <a href="#insert">INSERT</a> operation. This is the safest approach to ensure that the database
+ is in a known state. This is appropriate for tests that require the database
to only contain a specific set of data.</td>
</tr>
- <tr>
+ <tr>
<td>DatabaseOperation.NONE</td>
<td>Empty operation that does absolutely nothing.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/CompositeOperation.html">CompositeOperation</a></td>
<td>This operation combines multiple operations into a single one.</td>
</tr>
- <tr>
+ <tr>
<td><a href="apidocs/org/dbunit/operation/TransactionOperation.html">TransactionOperation</a></td>
- <td>This operation decorates an operation and executes it within the context
+ <td>This operation decorates an operation and executes it within the context
of a transaction.</td>
</tr>
- <tr>
+ <tr>
<td><a name="InsertIdentityOperation" href="apidocs/org/dbunit/ext/mssql/InsertIdentityOperation.html">InsertIdentityOperation</a></td>
- <td>This operation decorates an insert operation and disables the MS SQL
- Server automatic identifier generation (IDENTITY) during its execution.
- Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT
+ <td>This operation decorates an insert operation and disables the MS SQL
+ Server automatic identifier generation (IDENTITY) during its execution.
+ Use following constants InsertIdentityOperation.INSERT, InsertIdentityOperation.CLEAN_INSERT
or InsertIdentityOperation.REFRESH instead of those defined in DatabaseOperation.</td>
</tr>
</table>
Modified: trunk/dbunit/src/site/xdoc/migration.xml
===================================================================
--- trunk/dbunit/src/site/xdoc/migration.xml 2010-01-23 16:57:03 UTC (rev 1147)
+++ trunk/dbunit/src/site/xdoc/migration.xml 2010-01-23 22:17:13 UTC (rev 1148)
@@ -6,30 +6,7 @@
<h2>Migration guide</h2>
<p>To migrate from an older DbUnit release to a newer one you can find some useful information here.</p>
-
- <subsection name="2.4.7 to 2.4.8">
- <p>There is a change to dependencies.
- <table border="1">
- <tr>
- <th>Tracker #</th>
- <th>Affects</th>
- <th>Migration</th>
- <th>Background information</th>
- </tr>
-
- <tr>
- <td>2905970</td>
- <td>XlsDataSet</td>
- <td>Upgrade to POI 3.5-FINAL or later.
- <td>POI moved static utility methods from org.apache.poi.hssf.usermodel.HSSFDateUtil to a superclass.
- This required a recompile against the new version, and clients will need to use the new version.
- </td>
- </td>
- </tr>
- </table>
- </p>
- </subsection>
-
+
<subsection name="2.4.3 to 2.4.4">
<p>There has been a very small change to the API.</p>
<table border="1">
@@ -40,42 +17,42 @@
<th>Background information</th>
</tr>
- <tr>
+ <tr>
<td>2567724</td>
<td><code>new method org.dbunit.IDatabaseTester#setOperationListener()</code></td>
<td>If you extend from AbstractDatabaseTester then there is nothing to do. If you implement
the IDatabaseTester interface then you must support the methods of IOperationListener. As
reference implementation you can look at the AbstractDatabaseTester.</td>
- <td>This change was necessary to ensure that the user defined IDatabaseConnection setup provided by
+ <td>This change was necessary to ensure that the user defined IDatabaseConnection setup provided by
<code>DatabaseTestCase#setUpDatabaseConfig(DatabaseConfig databaseConfig)</code> is also used in
the setUp and tearDown operations.
</td>
</tr>
- <tr>
+ <tr>
<td>1956543</td>
<td><code>new method org.dbunit.database.IDatabaseConnection#createTable(String tableName, PreparedStatement preparedStatement)</code></td>
<td>If you extend from AbstractDatabaseConnection then there is nothing to do. If you implement
the IDatabaseConnection interface then you must implement the new method. As
reference implementation you can look into AbstractDatabaseConnection.</td>
- <td>This addition comes from the feature request
+ <td>This addition comes from the feature request
<a href='https://sourceforge.net/tracker/index.php?func=detail&aid=1956543&group_id=47439&atid=449494'>1956543</a>
where you can read details about why this is useful.
</td>
</tr>
- <tr>
+ <tr>
<td>1956543</td>
<td><code>new method org.dbunit.database.IResultSetTableFactory#createTable(String tableName,
PreparedStatement preparedStatement, IDatabaseConnection connection)</code></td>
<td>If you provide a custom IResultSetTableFactory then you have to implement this new method.
As reference implementation you can look into ForwardOnlyResultSetTableFactory.</td>
- <td>This addition comes from the feature request
+ <td>This addition comes from the feature request
<a href='https://sourceforge.net/tracker/index.php?func=detail&aid=1956543&group_id=47439&atid=449494'>1956543</a>
where you can read details about why this is useful.
</td>
</tr>
</table>
</subsection>
-
+
<subsection name="2.4.2 to 2.4.3">
<p>There has been a very small change to the API.</p>
<table border="1">
@@ -86,20 +63,20 @@
<th>Background information</th>
</tr>
- <tr>
+ <tr>
<td>2023994</td>
<td><code>org.dbunit.DBTestCase#getConnection() is final</code></td>
- <td>To control the creation of the IDatabaseConnection, override method DBTestCase#newDatabaseTester() which provides
+ <td>To control the creation of the IDatabaseConnection, override method DBTestCase#newDatabaseTester() which provides
the connection via IDatabaseTester#getConnection()</td>
- <td>The method DBTestCase#getConnection() is now final and the master object for retrieving a
- connection here is the IDatabaseTester. It is created via the DBTestCase#newDatabaseTester()
- method and provides the database connection via IDatabaseTester#getConnection. The reason for
+ <td>The method DBTestCase#getConnection() is now final and the master object for retrieving a
+ connection here is the IDatabaseTester. It is created via the DBTestCase#newDatabaseTester()
+ method and provides the database connection via IDatabaseTester#getConnection. The reason for
this change is firstly to provide a consistent access to the database connection
- and secondly to allow the user to easily configure dbunit properties by overriding the
+ and secondly to allow the user to easily configure dbunit properties by overriding the
method setUpDatabaseConfig(DatabaseConfig databaseConfig).
</td>
</tr>
- <tr>
+ <tr>
<td>2023994</td>
<td><code>Removed setters from org.dbunit.JdbcDatabaseTester and added constructors</code></td>
<td>Just invoke the appropriate constructor of JdbcDatabaseTester</td>
@@ -131,7 +108,7 @@
(or copy-pasted) multiple times before.
</td>
</tr>
-
+
<tr>
<td>1961269</td>
<td><code>org.dbunit.dataset.datatype.IDataTypeFactory.createDataType(int sqlType, String sqlTypeName, String tableName, String columnName)</code></td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jef...@us...> - 2010-02-07 07:26:58
|
Revision: 1154
http://dbunit.svn.sourceforge.net/dbunit/?rev=1154&view=rev
Author: jeffjensen
Date: 2010-02-07 07:26:52 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
Configure Logback for unit tests. Remove the slf4j-nop dep to see the messages. Add log4j and commons-logging excludes to POI dep to prevent transitive dep leakage to users of dbunit.
Modified Paths:
--------------
trunk/dbunit/pom.xml
Added Paths:
-----------
trunk/dbunit/src/testresources/
trunk/dbunit/src/testresources/logback-test.xml
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-02-06 05:55:11 UTC (rev 1153)
+++ trunk/dbunit/pom.xml 2010-02-07 07:26:52 UTC (rev 1154)
@@ -22,6 +22,8 @@
<properties>
<compileSource>1.4</compileSource>
<checkstyle.excludes>org/dbunit/util/concurrent/*.java</checkstyle.excludes>
+ <logbackVersion>0.9.15</logbackVersion>
+ <slf4jVersion>1.5.6</slf4jVersion>
</properties>
<scm>
@@ -226,7 +228,27 @@
<!-- TODO: add exclusion for dependencies that include xerces/xalan -->
+ <!-- LOGGING -->
+ <!-- NOTE: must list slf4j first to override other logger frameworks -->
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logbackVersion}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.1</version>
@@ -238,11 +260,6 @@
<version>3.8.2</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.6</version>
- </dependency>
- <dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
@@ -257,6 +274,16 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.2-FINAL</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
<optional>true</optional>
</dependency>
@@ -311,13 +338,6 @@
<version>1.4</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-nop</artifactId>
- <version>1.5.6</version>
- <scope>runtime</scope>
- <optional>true</optional>
- </dependency>
</dependencies>
<build>
@@ -364,6 +384,9 @@
<testResource>
<directory>${project.basedir}/src/csv</directory>
</testResource>
+ <testResource>
+ <directory>${project.basedir}/src/testresources</directory>
+ </testResource>
</testResources>
<plugins>
Added: trunk/dbunit/src/testresources/logback-test.xml
===================================================================
--- trunk/dbunit/src/testresources/logback-test.xml (rev 0)
+++ trunk/dbunit/src/testresources/logback-test.xml 2010-02-07 07:26:52 UTC (rev 1154)
@@ -0,0 +1,28 @@
+<!-- logback config file for testing-->
+<configuration scan="true">
+ <contextName>dbunit</contextName>
+
+ <logger name="org.dbunit" level="TRACE" />
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <!-- NOTE: user must append slash in property -->
+ <file>${logback.file.path:-target/}dbunit-TEST.log</file>
+ <append>false</append>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <pattern>%date %contextName [%thread] %-5level %-55logger{55} %mdc: %marker: %msg%n</pattern>
+ </layout>
+ </appender>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}: %msg%n</pattern>
+ </layout>
+ </appender>
+
+ <root level="DEBUG">
+ <appender-ref ref="STDOUT" />
+ <appender-ref ref="FILE" />
+ </root>
+
+ <jmxConfigurator contextName="dbunit"/>
+</configuration>
Property changes on: trunk/dbunit/src/testresources/logback-test.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jb...@us...> - 2010-02-12 01:43:00
|
Revision: 1164
http://dbunit.svn.sourceforge.net/dbunit/?rev=1164&view=rev
Author: jbhurst
Date: 2010-02-12 01:42:50 +0000 (Fri, 12 Feb 2010)
Log Message:
-----------
[2875235] - Moved directories to match Maven default structure.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseDiIT.java
trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseExtIT.java
trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseTest.java
trunk/dbunit/src/test/java/org/dbunit/testutil/TestUtils.java
trunk/dbunit/src/test/java/org/dbunit/util/fileloader/CsvDataFileLoaderTest.java
trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FlatXmlDataFileLoaderTest.java
trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FullXmlDataFileLoaderTest.java
trunk/dbunit/src/test/java/org/dbunit/util/fileloader/XlsDataFileLoaderTest.java
trunk/dbunit/src/test/resources/xml/antTestBuildFile.xml
Added Paths:
-----------
trunk/dbunit/src/main/
trunk/dbunit/src/main/java/
trunk/dbunit/src/main/resources/
trunk/dbunit/src/main/resources/org/
trunk/dbunit/src/main/resources/org/dbunit/
trunk/dbunit/src/main/resources/org/dbunit/dataset/
trunk/dbunit/src/main/resources/org/dbunit/dataset/xml/
trunk/dbunit/src/main/resources/org/dbunit/dataset/xml/dataset.dtd
trunk/dbunit/src/test/java/
trunk/dbunit/src/test/java/org/
trunk/dbunit/src/test/resources/
trunk/dbunit/src/test/resources/csv/
trunk/dbunit/src/test/resources/dtd/
trunk/dbunit/src/test/resources/logback-test.xml
trunk/dbunit/src/test/resources/sql/
trunk/dbunit/src/test/resources/sqlloader/
trunk/dbunit/src/test/resources/xml/
Removed Paths:
-------------
trunk/dbunit/src/csv/
trunk/dbunit/src/dtd/
trunk/dbunit/src/java/
trunk/dbunit/src/main/java/org/dbunit/dataset/xml/dataset.dtd
trunk/dbunit/src/sql/
trunk/dbunit/src/sqlloader/
trunk/dbunit/src/test/org/
trunk/dbunit/src/testresources/logback-test.xml
trunk/dbunit/src/xml/
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/pom.xml 2010-02-12 01:42:50 UTC (rev 1164)
@@ -342,53 +342,6 @@
<build>
<defaultGoal>install</defaultGoal>
- <sourceDirectory>src/java</sourceDirectory>
- <testSourceDirectory>src/test</testSourceDirectory>
-
- <!--
- TODO: move to M2's expected path and separate java from test (once
- SCM is migrated to SVN...)
- -->
- <resources>
- <resource>
- <directory>.</directory>
- <includes>
- <include>LICENSE.txt</include>
- </includes>
- </resource>
- <resource>
- <directory>src/java</directory>
- <includes>
- <include>**/dataset.dtd</include>
- </includes>
- </resource>
- <resource>
- <directory>src/csv</directory>
- <includes>
- <include>**/cvs-tests.properties</include>
- </includes>
- </resource>
-
- </resources>
- <!--
- TODO: that are some resources on src that should be on test...
-
- <testResources> <testResource> </testResource> </testResources>
- -->
-
- <!-- not ideal yet, but gets these files on test classpath -->
- <testResources>
- <testResource>
- <directory>${project.basedir}/src/xml</directory>
- </testResource>
- <testResource>
- <directory>${project.basedir}/src/csv</directory>
- </testResource>
- <testResource>
- <directory>${project.basedir}/src/testresources</directory>
- </testResource>
- </testResources>
-
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -571,7 +524,7 @@
</goals>
<configuration>
<srcFiles>
- <srcFile>src/sql/${dbunit.profile.ddl}</srcFile>
+ <srcFile>src/test/resources/sql/${dbunit.profile.ddl}</srcFile>
</srcFiles>
<onError>continue</onError>
</configuration>
Deleted: trunk/dbunit/src/main/java/org/dbunit/dataset/xml/dataset.dtd
===================================================================
--- trunk/dbunit/src/java/org/dbunit/dataset/xml/dataset.dtd 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/main/java/org/dbunit/dataset/xml/dataset.dtd 2010-02-12 01:42:50 UTC (rev 1164)
@@ -1,17 +0,0 @@
-<?xml version='1.0' encoding='UTF-8' ?>
-
-<!ELEMENT dataset (table+)>
-
-<!ELEMENT table (column* , row*)>
-
-<!ATTLIST table name CDATA #REQUIRED >
-<!ELEMENT column (#PCDATA)>
-
-<!ELEMENT row (value | null)*>
-
-<!ELEMENT value (#PCDATA)>
-
-<!ELEMENT null EMPTY>
-
-
-
Copied: trunk/dbunit/src/main/resources/org/dbunit/dataset/xml/dataset.dtd (from rev 1163, trunk/dbunit/src/java/org/dbunit/dataset/xml/dataset.dtd)
===================================================================
--- trunk/dbunit/src/main/resources/org/dbunit/dataset/xml/dataset.dtd (rev 0)
+++ trunk/dbunit/src/main/resources/org/dbunit/dataset/xml/dataset.dtd 2010-02-12 01:42:50 UTC (rev 1164)
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!ELEMENT dataset (table+)>
+
+<!ELEMENT table (column* , row*)>
+
+<!ATTLIST table name CDATA #REQUIRED >
+<!ELEMENT column (#PCDATA)>
+
+<!ELEMENT row (value | null)*>
+
+<!ELEMENT value (#PCDATA)>
+
+<!ELEMENT null EMPTY>
+
+
+
Modified: trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseDiIT.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/DefaultPrepAndExpectedTestCaseDiIT.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseDiIT.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -21,9 +21,8 @@
private final Logger LOG =
LoggerFactory.getLogger(DefaultPrepAndExpectedTestCaseDiIT.class);
- private static final String PREP_DATA_FILE_NAME = "/flatXmlDataSetTest.xml";
- private static final String EXP_DATA_FILE_NAME =
- "/flatXmlDataSetTestChanged.xml";
+ private static final String PREP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
+ private static final String EXP_DATA_FILE_NAME = "/xml/flatXmlDataSetTestChanged.xml";
private static final VerifyTableDefinition TEST_TABLE =
new VerifyTableDefinition("TEST_TABLE", new String[] {});
Modified: trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseExtIT.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/DefaultPrepAndExpectedTestCaseExtIT.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseExtIT.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -18,9 +18,8 @@
*/
public class DefaultPrepAndExpectedTestCaseExtIT extends
DefaultPrepAndExpectedTestCase {
- private static final String PREP_DATA_FILE_NAME = "/flatXmlDataSetTest.xml";
- private static final String EXP_DATA_FILE_NAME =
- "/flatXmlDataSetTestChanged.xml";
+ private static final String PREP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
+ private static final String EXP_DATA_FILE_NAME = "/xml/flatXmlDataSetTestChanged.xml";
private static final VerifyTableDefinition TEST_TABLE =
new VerifyTableDefinition("TEST_TABLE", new String[] {});
Modified: trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/DefaultPrepAndExpectedTestCaseTest.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/DefaultPrepAndExpectedTestCaseTest.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -7,8 +7,8 @@
import org.dbunit.util.fileloader.FlatXmlDataFileLoader;
public class DefaultPrepAndExpectedTestCaseTest extends TestCase {
- private static final String PREP_DATA_FILE_NAME = "/flatXmlDataSetTest.xml";
- private static final String EXP_DATA_FILE_NAME = "/flatXmlDataSetTest.xml";
+ private static final String PREP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
+ private static final String EXP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
private final DataFileLoader dataFileLoader = new FlatXmlDataFileLoader();
// private final IDatabaseTester databaseTester = new
Modified: trunk/dbunit/src/test/java/org/dbunit/testutil/TestUtils.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/testutil/TestUtils.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/testutil/TestUtils.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -42,8 +42,7 @@
public static String getFileName(String fileName)
{
-// return "src/resources/" + fileName;
- return "src/" + fileName;
+ return "src/test/resources/" + fileName;
}
public static File getFile(String fileName)
Modified: trunk/dbunit/src/test/java/org/dbunit/util/fileloader/CsvDataFileLoaderTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/util/fileloader/CsvDataFileLoaderTest.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/util/fileloader/CsvDataFileLoaderTest.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -46,7 +46,7 @@
* Test can load the specified file.
*/
public void testLoad() throws DataSetException {
- String filename = "/orders/orders_row.csv";
+ String filename = "/csv/orders/orders_row.csv";
IDataSet ds = loader.load(filename);
assertTrue("No tables found in dataset.", ds.getTableNames().length > 0);
// DataSet loading tests verify data accuracy
Modified: trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FlatXmlDataFileLoaderTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/util/fileloader/FlatXmlDataFileLoaderTest.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FlatXmlDataFileLoaderTest.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -46,7 +46,7 @@
* Test can load the specified file.
*/
public void testLoad() throws DataSetException {
- String filename = "/flatXmlDataSetTest.xml";
+ String filename = "/xml/flatXmlDataSetTest.xml";
IDataSet ds = loader.load(filename);
assertTrue("No tables found in dataset.", ds.getTableNames().length > 0);
// DataSet loading tests verify data accuracy
Modified: trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FullXmlDataFileLoaderTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/util/fileloader/FullXmlDataFileLoaderTest.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/util/fileloader/FullXmlDataFileLoaderTest.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -46,7 +46,7 @@
* Test can load the specified file.
*/
public void testLoad() throws DataSetException {
- String filename = "/xmlTableTest.xml";
+ String filename = "/xml/xmlTableTest.xml";
IDataSet ds = loader.load(filename);
assertTrue("No tables found in dataset.", ds.getTableNames().length > 0);
// DataSet loading tests verify data accuracy
Modified: trunk/dbunit/src/test/java/org/dbunit/util/fileloader/XlsDataFileLoaderTest.java
===================================================================
--- trunk/dbunit/src/test/org/dbunit/util/fileloader/XlsDataFileLoaderTest.java 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/java/org/dbunit/util/fileloader/XlsDataFileLoaderTest.java 2010-02-12 01:42:50 UTC (rev 1164)
@@ -46,7 +46,7 @@
* Test can load the specified file.
*/
public void testLoad() throws DataSetException {
- String filename = "/dataSetTest.xls";
+ String filename = "/xml/dataSetTest.xls";
IDataSet ds = loader.load(filename);
assertTrue("No tables found in dataset.", ds.getTableNames().length > 0);
// DataSet loading tests verify data accuracy
Copied: trunk/dbunit/src/test/resources/logback-test.xml (from rev 1163, trunk/dbunit/src/testresources/logback-test.xml)
===================================================================
--- trunk/dbunit/src/test/resources/logback-test.xml (rev 0)
+++ trunk/dbunit/src/test/resources/logback-test.xml 2010-02-12 01:42:50 UTC (rev 1164)
@@ -0,0 +1,28 @@
+<!-- logback config file for testing-->
+<configuration scan="true">
+ <contextName>dbunit</contextName>
+
+ <logger name="org.dbunit" level="TRACE" />
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <!-- NOTE: user must append slash in property -->
+ <file>${logback.file.path:-target/}dbunit-TEST.log</file>
+ <append>false</append>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <pattern>%date %contextName [%thread] %-5level %-55logger{55} %mdc: %marker: %msg%n</pattern>
+ </layout>
+ </appender>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}: %msg%n</pattern>
+ </layout>
+ </appender>
+
+ <root level="DEBUG">
+ <appender-ref ref="STDOUT" />
+ <appender-ref ref="FILE" />
+ </root>
+
+ <jmxConfigurator contextName="dbunit"/>
+</configuration>
Modified: trunk/dbunit/src/test/resources/xml/antTestBuildFile.xml
===================================================================
--- trunk/dbunit/src/xml/antTestBuildFile.xml 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/test/resources/xml/antTestBuildFile.xml 2010-02-12 01:42:50 UTC (rev 1164)
@@ -9,11 +9,11 @@
<property name="dbunit.profile.user" value="unknown"/>
<property name="dbunit.profile.password" value="unknown"/>
- <property name="testDataSet" value="src/xml/flatXmlDataSetTest.xml"/>
- <property name="updateDataSet" value="src/xml/antTestDataSet.xml"/>
+ <property name="testDataSet" value="src/test/resources/xml/flatXmlDataSetTest.xml"/>
+ <property name="updateDataSet" value="src/test/resources/xml/antTestDataSet.xml"/>
<property name="exportDataSet" value="target/xml/antExportDataSet.xml"/>
- <property name="exportDtd" value="src/xml/antExport.dtd"/>
- <property name="exportCsv" value="src/xml/antExportCsv"/>
+ <property name="exportDtd" value="src/test/resources/xml/antExport.dtd"/>
+ <property name="exportCsv" value="src/test/resources/xml/antExportCsv"/>
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" loaderref="dbunit"/>
<typedef name="queryset" classname="org.dbunit.ant.QuerySet" loaderref="dbunit"/>
Deleted: trunk/dbunit/src/testresources/logback-test.xml
===================================================================
--- trunk/dbunit/src/testresources/logback-test.xml 2010-02-11 23:50:32 UTC (rev 1163)
+++ trunk/dbunit/src/testresources/logback-test.xml 2010-02-12 01:42:50 UTC (rev 1164)
@@ -1,28 +0,0 @@
-<!-- logback config file for testing-->
-<configuration scan="true">
- <contextName>dbunit</contextName>
-
- <logger name="org.dbunit" level="TRACE" />
-
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <!-- NOTE: user must append slash in property -->
- <file>${logback.file.path:-target/}dbunit-TEST.log</file>
- <append>false</append>
- <layout class="ch.qos.logback.classic.PatternLayout">
- <pattern>%date %contextName [%thread] %-5level %-55logger{55} %mdc: %marker: %msg%n</pattern>
- </layout>
- </appender>
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <layout class="ch.qos.logback.classic.PatternLayout">
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}: %msg%n</pattern>
- </layout>
- </appender>
-
- <root level="DEBUG">
- <appender-ref ref="STDOUT" />
- <appender-ref ref="FILE" />
- </root>
-
- <jmxConfigurator contextName="dbunit"/>
-</configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jef...@us...> - 2010-02-21 06:15:48
|
Revision: 1174
http://dbunit.svn.sourceforge.net/dbunit/?rev=1174&view=rev
Author: jeffjensen
Date: 2010-02-21 06:15:42 +0000 (Sun, 21 Feb 2010)
Log Message:
-----------
Add reflective toString() method to AbstractTable so all subclasses have detailed output in log statements.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/changes/changes.xml
trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-02-20 19:53:04 UTC (rev 1173)
+++ trunk/dbunit/pom.xml 2010-02-21 06:15:42 UTC (rev 1174)
@@ -271,6 +271,11 @@
<version>3.2.1</version>
</dependency>
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.5.4</version>
Modified: trunk/dbunit/src/changes/changes.xml
===================================================================
--- trunk/dbunit/src/changes/changes.xml 2010-02-20 19:53:04 UTC (rev 1173)
+++ trunk/dbunit/src/changes/changes.xml 2010-02-21 06:15:42 UTC (rev 1174)
@@ -17,6 +17,7 @@
<action dev="jbhurst" type="add" issue="2919427" due-to="dbamberghi (Daniele Bamberghi)">OracleDataTypeFactory recognises "SYS.XMLTYPE"</action>
<action dev="jeffjensen" type="add" issue="2938029" due-to="jeffjensen">Add "file loader" utility for various data file types</action>
<action dev="jeffjensen" type="add" due-to="jeffjensen">Add new TestCase that supports prepare and expected datasets: "DefaultPrepAndExpectedTestCase"</action>
+ <action dev="jeffjensen" type="add" due-to="jeffjensen">Add reflective toString() method to AbstractTable so all subclasses have detailed output in log statements.</action>
</release>
<release version="2.4.7" date="Nov 09, 2009" description="Bugfixes and some non breaking refactoring">
<action dev="gommma" type="fix" issue="2685615" due-to="lumpynose">dtd for XmlDataSet</action>
Modified: trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java 2010-02-20 19:53:04 UTC (rev 1173)
+++ trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java 2010-02-21 06:15:42 UTC (rev 1174)
@@ -20,63 +20,70 @@
*/
package org.dbunit.dataset;
+import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
/**
* @author Manuel Laflamme
* @version $Revision$
* @since Feb 17, 2002
*/
-public abstract class AbstractTable implements ITable
-{
+public abstract class AbstractTable implements ITable {
/**
* Logger for this class
*/
- private static final Logger logger = LoggerFactory.getLogger(AbstractTable.class);
+ private static final Logger logger =
+ LoggerFactory.getLogger(AbstractTable.class);
- protected void assertValidRowIndex(int row) throws DataSetException
- {
- if(logger.isDebugEnabled())
- logger.debug("assertValidRowIndex(row={}) - start", Integer.toString(row));
+ protected void assertValidRowIndex(int row) throws DataSetException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("assertValidRowIndex(row={}) - start", Integer
+ .toString(row));
+ }
assertValidRowIndex(row, getRowCount());
}
protected void assertValidRowIndex(int row, int rowCount)
- throws DataSetException
- {
- if(logger.isDebugEnabled())
- logger.debug("assertValidRowIndex(row={}, rowCount={}) - start",
- Integer.toString(row), Integer.toString(rowCount));
+ throws DataSetException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("assertValidRowIndex(row={}, rowCount={}) - start",
+ Integer.toString(row), Integer.toString(rowCount));
+ }
- if (row < 0)
- {
+ if (row < 0) {
throw new RowOutOfBoundsException(row + " < 0");
}
- if (row >= rowCount)
- {
+ if (row >= rowCount) {
throw new RowOutOfBoundsException(row + " >= " + rowCount);
}
}
- protected void assertValidColumn(String columnName) throws DataSetException
- {
- logger.debug("assertValidColumn(columnName={}) - start", columnName);
+ protected void assertValidColumn(String columnName) throws DataSetException {
+ logger.debug("assertValidColumn(columnName={}) - start", columnName);
ITableMetaData metaData = getTableMetaData();
- // Try to find the column in the metadata - if it cannot be found an exception is thrown
- Columns.getColumnValidated(columnName, metaData.getColumns(), metaData.getTableName());
+ // Try to find the column in the metadata - if it cannot be found an
+ // exception is thrown
+ Columns.getColumnValidated(columnName, metaData.getColumns(), metaData
+ .getTableName());
}
- protected int getColumnIndex(String columnName) throws DataSetException
- {
+ protected int getColumnIndex(String columnName) throws DataSetException {
logger.debug("getColumnIndex(columnName={}) - start", columnName);
ITableMetaData metaData = getTableMetaData();
return metaData.getColumnIndex(columnName);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public String toString() {
+ ToStringBuilder.reflectionToString(this);
+ return super.toString();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jef...@us...> - 2010-02-21 18:49:47
|
Revision: 1176
http://dbunit.svn.sourceforge.net/dbunit/?rev=1176&view=rev
Author: jeffjensen
Date: 2010-02-21 18:49:40 +0000 (Sun, 21 Feb 2010)
Log Message:
-----------
Remove use of commons-lang and ToStringBuilder. Add custom toString()s.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java
trunk/dbunit/src/main/java/org/dbunit/dataset/CompositeTable.java
trunk/dbunit/src/main/java/org/dbunit/dataset/SortedTable.java
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2010-02-21 17:36:55 UTC (rev 1175)
+++ trunk/dbunit/pom.xml 2010-02-21 18:49:40 UTC (rev 1176)
@@ -271,11 +271,6 @@
<version>3.2.1</version>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.5.4</version>
Modified: trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java 2010-02-21 17:36:55 UTC (rev 1175)
+++ trunk/dbunit/src/main/java/org/dbunit/dataset/AbstractTable.java 2010-02-21 18:49:40 UTC (rev 1176)
@@ -20,7 +20,6 @@
*/
package org.dbunit.dataset;
-import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -78,11 +77,4 @@
ITableMetaData metaData = getTableMetaData();
return metaData.getColumnIndex(columnName);
}
-
- /**
- * {@inheritDoc}
- */
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
}
Modified: trunk/dbunit/src/main/java/org/dbunit/dataset/CompositeTable.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/dataset/CompositeTable.java 2010-02-21 17:36:55 UTC (rev 1175)
+++ trunk/dbunit/src/main/java/org/dbunit/dataset/CompositeTable.java 2010-02-21 18:49:40 UTC (rev 1176)
@@ -21,6 +21,8 @@
package org.dbunit.dataset;
+import java.util.Arrays;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -29,13 +31,13 @@
* @version $Revision$
* @since Feb 17, 2002
*/
-public class CompositeTable extends AbstractTable
-{
+public class CompositeTable extends AbstractTable {
/**
* Logger for this class
*/
- private static final Logger logger = LoggerFactory.getLogger(CompositeTable.class);
+ private static final Logger logger =
+ LoggerFactory.getLogger(CompositeTable.class);
private final ITableMetaData _metaData;
private final ITable[] _tables;
@@ -44,18 +46,16 @@
* Creates a composite table that combines the specified metadata with the
* specified table.
*/
- public CompositeTable(ITableMetaData metaData, ITable table)
- {
+ public CompositeTable(ITableMetaData metaData, ITable table) {
_metaData = metaData;
- _tables = new ITable[]{table};
+ _tables = new ITable[] {table};
}
/**
* Creates a composite table that combines the specified metadata with the
* specified tables.
*/
- public CompositeTable(ITableMetaData metaData, ITable[] tables)
- {
+ public CompositeTable(ITableMetaData metaData, ITable[] tables) {
_metaData = metaData;
_tables = tables;
}
@@ -64,40 +64,35 @@
* Creates a composite table that combines the specified specified tables.
* The metadata from the first table is used as metadata for the new table.
*/
- public CompositeTable(ITable table1, ITable table2)
- {
+ public CompositeTable(ITable table1, ITable table2) {
_metaData = table1.getTableMetaData();
- _tables = new ITable[]{table1, table2};
+ _tables = new ITable[] {table1, table2};
}
/**
- * Creates a composite dataset that encapsulate the specified table with
- * a new name.
+ * Creates a composite dataset that encapsulate the specified table with a
+ * new name.
*/
- public CompositeTable(String newName, ITable table)
- throws DataSetException
- {
+ public CompositeTable(String newName, ITable table) throws DataSetException {
ITableMetaData metaData = table.getTableMetaData();
- _metaData = new DefaultTableMetaData(newName,
- metaData.getColumns(), metaData.getPrimaryKeys());
- _tables = new ITable[]{table};
+ _metaData =
+ new DefaultTableMetaData(newName, metaData.getColumns(),
+ metaData.getPrimaryKeys());
+ _tables = new ITable[] {table};
}
- ////////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////////
// ITable interface
- public ITableMetaData getTableMetaData()
- {
+ public ITableMetaData getTableMetaData() {
return _metaData;
}
- public int getRowCount()
- {
+ public int getRowCount() {
logger.debug("getRowCount() - start");
int totalCount = 0;
- for (int i = 0; i < _tables.length; i++)
- {
+ for (int i = 0; i < _tables.length; i++) {
ITable table = _tables[i];
totalCount += table.getRowCount();
}
@@ -105,24 +100,22 @@
return totalCount;
}
- public Object getValue(int row, String columnName) throws DataSetException
- {
- if(logger.isDebugEnabled())
- logger.debug("getValue(row={}, columnName={}) - start", Integer.toString(row), columnName);
+ public Object getValue(int row, String columnName) throws DataSetException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("getValue(row={}, columnName={}) - start", Integer
+ .toString(row), columnName);
+ }
- if (row < 0)
- {
+ if (row < 0) {
throw new RowOutOfBoundsException(row + " < 0 ");
}
int totalCount = 0;
- for (int i = 0; i < _tables.length; i++)
- {
+ for (int i = 0; i < _tables.length; i++) {
ITable table = _tables[i];
int count = table.getRowCount();
- if (totalCount + count > row)
- {
+ if (totalCount + count > row) {
return table.getValue(row - totalCount, columnName);
}
totalCount += count;
@@ -130,4 +123,18 @@
throw new RowOutOfBoundsException(row + " > " + totalCount);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public String toString() {
+ StringBuilder sb = new StringBuilder(2000);
+
+ sb.append(getClass().getName()).append("[");
+ sb.append("_metaData=[").append(_metaData).append("], ");
+ sb.append("_tables=[").append(Arrays.toString(_tables)).append("]");
+ sb.append("]");
+
+ return sb.toString();
+ }
}
Modified: trunk/dbunit/src/main/java/org/dbunit/dataset/SortedTable.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/dataset/SortedTable.java 2010-02-21 17:36:55 UTC (rev 1175)
+++ trunk/dbunit/src/main/java/org/dbunit/dataset/SortedTable.java 2010-02-21 18:49:40 UTC (rev 1176)
@@ -32,25 +32,27 @@
/**
* This is a ITable decorator that provide a sorted view of the decorated table.
- * This implementation does not keep a separate copy of the decorated table data.
- *
+ * This implementation does not keep a separate copy of the decorated table
+ * data.
+ *
* @author Manuel Laflamme
* @author Last changed by: $Author$
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2009-05-01 02:56:07 -0500 (Fri, 01 May 2009)
+ * $
* @since Feb 19, 2003
*/
-public class SortedTable extends AbstractTable
-{
+public class SortedTable extends AbstractTable {
/**
* Logger for this class
*/
- private static final Logger logger = LoggerFactory.getLogger(SortedTable.class);
+ private static final Logger logger =
+ LoggerFactory.getLogger(SortedTable.class);
private final ITable _table;
private final Column[] _columns;
private Integer[] _indexes;
-
+
/**
* The row comparator which is used for sorting
*/
@@ -58,348 +60,365 @@
/**
* Sort the decorated table by specified columns order.
- * @param table decorated table
- * @param columns columns to be used for sorting
+ *
+ * @param table
+ * decorated table
+ * @param columns
+ * columns to be used for sorting
* @throws DataSetException
*/
- public SortedTable(ITable table, Column[] columns) throws DataSetException
- {
+ public SortedTable(ITable table, Column[] columns) throws DataSetException {
_table = table;
_columns = validateAndResolveColumns(columns);
initialize();
}
- /**
+ /**
* Sort the decorated table by specified columns order.
- * @param table decorated table
- * @param columnNames names of columns to be used for sorting
+ *
+ * @param table
+ * decorated table
+ * @param columnNames
+ * names of columns to be used for sorting
* @throws DataSetException
*/
- public SortedTable(ITable table, String[] columnNames) throws DataSetException
- {
+ public SortedTable(ITable table, String[] columnNames)
+ throws DataSetException {
_table = table;
_columns = validateAndResolveColumns(columnNames);
initialize();
}
/**
- * Sort the decorated table by specified metadata columns order. All
- * metadata columns will be used.
- * @param table The decorated table
- * @param metaData The metadata used to retrieve all columns which in turn are used
- * for sorting the table
+ * Sort the decorated table by specified metadata columns order. All
+ * metadata columns will be used.
+ *
+ * @param table
+ * The decorated table
+ * @param metaData
+ * The metadata used to retrieve all columns which in turn are
+ * used for sorting the table
* @throws DataSetException
*/
- public SortedTable(ITable table, ITableMetaData metaData) throws DataSetException
- {
+ public SortedTable(ITable table, ITableMetaData metaData)
+ throws DataSetException {
this(table, metaData.getColumns());
}
/**
- * Sort the decorated table by its own columns order which is defined by {@link ITable#getTableMetaData()}.
- * All table columns will be used.
- * @param table The decorated table
+ * Sort the decorated table by its own columns order which is defined by
+ * {@link ITable#getTableMetaData()}. All table columns will be used.
+ *
+ * @param table
+ * The decorated table
* @throws DataSetException
*/
- public SortedTable(ITable table) throws DataSetException
- {
+ public SortedTable(ITable table) throws DataSetException {
this(table, table.getTableMetaData());
}
/**
- * Verifies that all given columns really exist in the
- * current table and returns the physical {@link Column} objects from the table.
+ * Verifies that all given columns really exist in the current table and
+ * returns the physical {@link Column} objects from the table.
+ *
* @param columns
* @return
* @throws DataSetException
*/
- private Column[] validateAndResolveColumns(Column[] columns) throws DataSetException
- {
+ private Column[] validateAndResolveColumns(Column[] columns)
+ throws DataSetException {
ITableMetaData tableMetaData = _table.getTableMetaData();
- Column[] resultColumns = Columns.findColumnsByName(columns, tableMetaData);
+ Column[] resultColumns =
+ Columns.findColumnsByName(columns, tableMetaData);
return resultColumns;
- }
+ }
/**
- * Verifies that all given columns really exist in the
- * current table and returns the physical {@link Column} objects from the table.
+ * Verifies that all given columns really exist in the current table and
+ * returns the physical {@link Column} objects from the table.
+ *
* @param columnNames
* @return
* @throws DataSetException
*/
- private Column[] validateAndResolveColumns(String[] columnNames) throws DataSetException
- {
+ private Column[] validateAndResolveColumns(String[] columnNames)
+ throws DataSetException {
ITableMetaData tableMetaData = _table.getTableMetaData();
- Column[] resultColumns = Columns.findColumnsByName(columnNames, tableMetaData);
+ Column[] resultColumns =
+ Columns.findColumnsByName(columnNames, tableMetaData);
return resultColumns;
}
- private void initialize()
- {
+ private void initialize() {
logger.debug("initialize() - start");
-
- // The default comparator is the one that sorts by string - for backwards compatibility
- this.rowComparator = new RowComparatorByString(this._table, this._columns);
- }
- /**
- * @return The columns that are used for sorting the table
- */
- public Column[] getSortColumns()
- {
- return this._columns;
- }
-
- private int getOriginalRowIndex(int row) throws DataSetException
- {
- if(logger.isDebugEnabled())
- logger.debug("getOriginalRowIndex(row={}) - start", Integer.toString(row));
+ // The default comparator is the one that sorts by string - for
+ // backwards compatibility
+ this.rowComparator =
+ new RowComparatorByString(this._table, this._columns);
+ }
- if (_indexes == null)
- {
+ /**
+ * @return The columns that are used for sorting the table
+ */
+ public Column[] getSortColumns() {
+ return this._columns;
+ }
+
+ private int getOriginalRowIndex(int row) throws DataSetException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("getOriginalRowIndex(row={}) - start", Integer
+ .toString(row));
+ }
+
+ if (_indexes == null) {
Integer[] indexes = new Integer[getRowCount()];
- for (int i = 0; i < indexes.length; i++)
- {
+ for (int i = 0; i < indexes.length; i++) {
indexes[i] = new Integer(i);
}
- try
- {
+ try {
Arrays.sort(indexes, rowComparator);
+ } catch (DatabaseUnitRuntimeException e) {
+ throw (DataSetException) e.getCause();
}
- catch (DatabaseUnitRuntimeException e)
- {
- throw (DataSetException)e.getCause();
- }
_indexes = indexes;
}
return _indexes[row].intValue();
}
-
+
/**
- * Whether or not the comparable interface should be used of the compared columns
- * instead of the plain strings
- * Default value is <code>false</code> for backwards compatibility
- * Set whether or not to use the Comparable implementation of the corresponding column
- * DataType for comparing values or not. Default value is <code>false</code>
- * which means that the old string comparison is used.
- * <br>
+ * Whether or not the comparable interface should be used of the compared
+ * columns instead of the plain strings Default value is <code>false</code>
+ * for backwards compatibility Set whether or not to use the Comparable
+ * implementation of the corresponding column DataType for comparing values
+ * or not. Default value is <code>false</code> which means that the old
+ * string comparison is used. <br>
+ *
* @param useComparable
- * @since 2.3.0
+ * @since 2.3.0
*/
- public void setUseComparable(boolean useComparable)
- {
- if(logger.isDebugEnabled())
- logger.debug("setUseComparable(useComparable={}) - start", Boolean.valueOf(useComparable));
-
- if(useComparable)
- {
- setRowComparator(new RowComparator(this._table, this._columns));
- }
- else
- {
- setRowComparator(new RowComparatorByString(this._table, this._columns));
- }
+ public void setUseComparable(boolean useComparable) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("setUseComparable(useComparable={}) - start", Boolean
+ .valueOf(useComparable));
+ }
+
+ if (useComparable) {
+ setRowComparator(new RowComparator(this._table, this._columns));
+ } else {
+ setRowComparator(new RowComparatorByString(this._table,
+ this._columns));
+ }
}
-
/**
* Sets the comparator to be used for sorting the table rows.
- * @param comparator that sorts the table rows
+ *
+ * @param comparator
+ * that sorts the table rows
* @since 2.4.2
*/
- public void setRowComparator(Comparator comparator)
- {
- if(logger.isDebugEnabled())
+ public void setRowComparator(Comparator comparator) {
+ if (logger.isDebugEnabled()) {
logger.debug("setRowComparator(comparator={}) - start", comparator);
-
- if(_indexes != null)
- {
- // TODO this is an ugly design to avoid increasing the number of constructors from 4 to 8. To be discussed how to implement it the best way.
- throw new IllegalStateException("Do not use this method after the table has been used (i.e. #getValue() has been called). " +
- "Please invoke this method immediately after the intialization of this object.");
}
+ if (_indexes != null) {
+ // TODO this is an ugly design to avoid increasing the number of
+ // constructors from 4 to 8. To be discussed how to implement it the
+ // best way.
+ throw new IllegalStateException(
+ "Do not use this method after the table has been used (i.e. #getValue() has been called). "
+ + "Please invoke this method immediately after the intialization of this object.");
+ }
+
this.rowComparator = comparator;
}
- ////////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////////
// ITable interface
- public ITableMetaData getTableMetaData()
- {
+ public ITableMetaData getTableMetaData() {
logger.debug("getTableMetaData() - start");
return _table.getTableMetaData();
}
- public int getRowCount()
- {
+ public int getRowCount() {
logger.debug("getRowCount() - start");
return _table.getRowCount();
}
- public Object getValue(int row, String columnName) throws DataSetException
- {
- if(logger.isDebugEnabled())
- logger.debug("getValue(row={}, columnName={}) - start", Integer.toString(row), columnName);
+ public Object getValue(int row, String columnName) throws DataSetException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("getValue(row={}, columnName={}) - start", Integer
+ .toString(row), columnName);
+ }
assertValidRowIndex(row);
return _table.getValue(getOriginalRowIndex(row), columnName);
}
- ////////////////////////////////////////////////////////////////////////////
+ // //////////////////////////////////////////////////////////////////////////
// Comparator interface
/**
- * Abstract class for sorting the table rows of a given table in a specific order
+ * Abstract class for sorting the table rows of a given table in a specific
+ * order
*/
- public static abstract class AbstractRowComparator implements Comparator
- {
+ public static abstract class AbstractRowComparator implements Comparator {
/**
* Logger for this class
*/
- private final Logger logger = LoggerFactory.getLogger(AbstractRowComparator.class);
- private ITable _table;
- private Column[] _sortColumns;
+ private final Logger logger =
+ LoggerFactory.getLogger(AbstractRowComparator.class);
+ private final ITable _table;
+ private final Column[] _sortColumns;
- /**
- * @param table The wrapped table to be sorted
- * @param sortColumns The columns to be used for sorting in the given order
- */
- public AbstractRowComparator(ITable table, Column[] sortColumns)
- {
- this._table = table;
- this._sortColumns = sortColumns;
- }
+ /**
+ * @param table
+ * The wrapped table to be sorted
+ * @param sortColumns
+ * The columns to be used for sorting in the given order
+ */
+ public AbstractRowComparator(ITable table, Column[] sortColumns) {
+ this._table = table;
+ this._sortColumns = sortColumns;
+ }
- public int compare(Object o1, Object o2)
- {
+ public int compare(Object o1, Object o2) {
logger.debug("compare(o1={}, o2={}) - start", o1, o2);
- Integer i1 = (Integer)o1;
- Integer i2 = (Integer)o2;
+ Integer i1 = (Integer) o1;
+ Integer i2 = (Integer) o2;
- try
- {
- for (int i = 0; i < _sortColumns.length; i++)
- {
+ try {
+ for (int i = 0; i < _sortColumns.length; i++) {
String columnName = _sortColumns[i].getColumnName();
-
+
Object value1 = _table.getValue(i1.intValue(), columnName);
Object value2 = _table.getValue(i2.intValue(), columnName);
- if (value1 == null && value2 == null)
- {
+ if (value1 == null && value2 == null) {
continue;
}
- if (value1 == null && value2 != null)
- {
+ if (value1 == null && value2 != null) {
return -1;
}
- if (value1 != null && value2 == null)
- {
+ if (value1 != null && value2 == null) {
return 1;
}
// Compare the two values with each other for sorting
int result = compare(_sortColumns[i], value1, value2);
-
- if (result != 0)
- {
+
+ if (result != 0) {
return result;
}
}
- }
- catch (DataSetException e)
- {
+ } catch (DataSetException e) {
throw new DatabaseUnitRuntimeException(e);
}
return 0;
}
- /**
- * @param column The column to be compared
- * @param value1 The first value of the given column
- * @param value2 The second value of the given column
- * @return 0 if both values are considered equal.
- * @throws TypeCastException
- */
- protected abstract int compare(Column column, Object value1, Object value2) throws TypeCastException;
+ /**
+ * @param column
+ * The column to be compared
+ * @param value1
+ * The first value of the given column
+ * @param value2
+ * The second value of the given column
+ * @return 0 if both values are considered equal.
+ * @throws TypeCastException
+ */
+ protected abstract int compare(Column column, Object value1,
+ Object value2) throws TypeCastException;
}
-
-
+
/**
- * Compares the rows with each other in order to sort them in the correct order using the
- * data type and the Comparable implementation the current column has.
+ * Compares the rows with each other in order to sort them in the correct
+ * order using the data type and the Comparable implementation the current
+ * column has.
*/
- protected static class RowComparator extends AbstractRowComparator
- {
+ protected static class RowComparator extends AbstractRowComparator {
/**
* Logger for this class
*/
- private final Logger logger = LoggerFactory.getLogger(RowComparator.class);
+ private final Logger logger =
+ LoggerFactory.getLogger(RowComparator.class);
- public RowComparator(ITable table, Column[] sortColumns)
- {
- super(table, sortColumns);
- }
+ public RowComparator(ITable table, Column[] sortColumns) {
+ super(table, sortColumns);
+ }
- protected int compare(Column column, Object value1, Object value2) throws TypeCastException
- {
- if(logger.isDebugEnabled())
- logger.debug("compare(column={}, value1={}, value2={}) - start",
- new Object[]{column, value1, value2} );
-
- DataType dataType = column.getDataType();
- int result = dataType.compare(value1, value2);
- return result;
- }
-
+ protected int compare(Column column, Object value1, Object value2)
+ throws TypeCastException {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "compare(column={}, value1={}, value2={}) - start",
+ new Object[] {column, value1, value2});
+ }
+
+ DataType dataType = column.getDataType();
+ int result = dataType.compare(value1, value2);
+ return result;
+ }
+
}
-
-
+
/**
- * Compares the rows with each other in order to sort them in the correct order using
- * the string value of both values for the comparison.
+ * Compares the rows with each other in order to sort them in the correct
+ * order using the string value of both values for the comparison.
*/
- protected static class RowComparatorByString extends AbstractRowComparator
- {
+ protected static class RowComparatorByString extends AbstractRowComparator {
/**
* Logger for this class
*/
- private final Logger logger = LoggerFactory.getLogger(RowComparatorByString.class);
+ private final Logger logger =
+ LoggerFactory.getLogger(RowComparatorByString.class);
- public RowComparatorByString(ITable table, Column[] sortColumns)
- {
- super(table, sortColumns);
- }
+ public RowComparatorByString(ITable table, Column[] sortColumns) {
+ super(table, sortColumns);
+ }
- protected int compare(Column column, Object value1, Object value2) throws TypeCastException
- {
- if(logger.isDebugEnabled())
- logger.debug("compare(column={}, value1={}, value2={}) - start",
- new Object[]{column, value1, value2} );
+ protected int compare(Column column, Object value1, Object value2)
+ throws TypeCastException {
+ if (logger.isDebugEnabled()) {
+ logger.debug(
+ "compare(column={}, value1={}, value2={}) - start",
+ new Object[] {column, value1, value2});
+ }
// Default behavior since ever
- String stringValue1 = DataType.asString(value1);
- String stringValue2 = DataType.asString(value2);
- int result = stringValue1.compareTo(stringValue2);
- return result;
- }
+ String stringValue1 = DataType.asString(value1);
+ String stringValue2 = DataType.asString(value2);
+ int result = stringValue1.compareTo(stringValue2);
+ return result;
+ }
}
-
-}
+ /**
+ * {@inheritDoc}
+ */
+ public String toString() {
+ StringBuilder sb = new StringBuilder(2000);
+ sb.append(getClass().getName()).append("[");
+ sb.append("_columns=[").append(Arrays.toString(_columns)).append("], ");
+ sb.append("_indexes=[").append(_indexes).append("], ");
+ sb.append("_table=[").append(_table).append("]");
+ sb.append("]");
-
-
+ return sb.toString();
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jef...@us...> - 2011-04-11 02:29:47
|
Revision: 1217
http://dbunit.svn.sourceforge.net/dbunit/?rev=1217&view=rev
Author: jeffjensen
Date: 2011-04-11 02:29:39 +0000 (Mon, 11 Apr 2011)
Log Message:
-----------
SF Feature Request 3170998. Patch by Darryl Pierce (mcpierceaim): Provides support for the uniqueidentifier column type in SQLServer.
The column type is handled via the UniqueIdentierType provided by the patch. This type marshalls a UUID value into a uniqueidentifier column and back. Modified the MsSqlDataTypeFactory to correctly return this new type when it detects a UUID. Also included are unit tests to verify some of the new code.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/changes/changes.xml
trunk/dbunit/src/main/java/org/dbunit/ext/mssql/MsSqlDataTypeFactory.java
trunk/dbunit/src/test/java/org/dbunit/ext/mssql/AllTests.java
trunk/dbunit/src/test/java/org/dbunit/ext/mssql/MsSqlDataTypeFactoryTest.java
Added Paths:
-----------
trunk/dbunit/src/main/java/org/dbunit/ext/mssql/UniqueIdentifierType.java
trunk/dbunit/src/test/java/org/dbunit/ext/mssql/UniqueIdentifierTypeTest.java
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2011-02-22 03:22:19 UTC (rev 1216)
+++ trunk/dbunit/pom.xml 2011-04-11 02:29:39 UTC (rev 1217)
@@ -213,6 +213,13 @@
<role>IDatabaseTester creator</role>
</roles>
</contributor>
+ <contributor>
+ <name>Darryl Pierce</name>
+ <email>mcp...@us...</email>
+ <roles>
+ <role>SQLServer uniqueidentifier column type</role>
+ </roles>
+ </contributor>
</contributors>
Modified: trunk/dbunit/src/changes/changes.xml
===================================================================
--- trunk/dbunit/src/changes/changes.xml 2011-02-22 03:22:19 UTC (rev 1216)
+++ trunk/dbunit/src/changes/changes.xml 2011-04-11 02:29:39 UTC (rev 1217)
@@ -16,6 +16,7 @@
<action dev="jeffjensen" type="fix" due-to="jeffjensen">Add schema name, if specified, to table name in query in AbstractDatabaseConnection.createTable().</action>
<action dev="rlogiacco" type="fix" issue="3071408" due-to="chrisphe">New Handling of Timestamp in 2.4.8 has error with subseconds</action>
<action dev="jeffjensen" type="fix" issue="3132130" due-to="jeffjensen">AbstractDatabaseConnection createQueryTable throws UOEx.</action>
+ <action dev="jeffjensen" type="add" issue="3170998" due-to="mcpierceaim">Provides support for the uniqueidentifier type in Microsoft SQLServer.</action>
</release>
<release version="2.4.8" date="Sep 2, 2010" description="Bug fixes, timezone support, Oracle support improvements, new DataFileLoader, new PrepAndExpectedTestCase">
<action dev="gommma" type="add" issue="3027485" due-to="Yishai">MSSQL JDBC Driver 3.0 doesn't work well</action>
Modified: trunk/dbunit/src/main/java/org/dbunit/ext/mssql/MsSqlDataTypeFactory.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/ext/mssql/MsSqlDataTypeFactory.java 2011-02-22 03:22:19 UTC (rev 1216)
+++ trunk/dbunit/src/main/java/org/dbunit/ext/mssql/MsSqlDataTypeFactory.java 2011-04-11 02:29:39 UTC (rev 1217)
@@ -20,6 +20,7 @@
*/
package org.dbunit.ext.mssql;
+import java.sql.Types;
import java.util.Arrays;
import java.util.Collection;
@@ -67,6 +68,14 @@
logger.debug("createDataType(sqlType={}, sqlTypeName={}) - start", String.valueOf(sqlType), sqlTypeName);
// TODO : Process MS SQL Server custom datatype here
+ if(sqlType == Types.CHAR)
+ {
+ if (UniqueIdentifierType.UNIQUE_IDENTIFIER_TYPE.equals(sqlTypeName))
+ {
+ return new UniqueIdentifierType();
+ }
+ }
+
switch(sqlType) {
case NCHAR: return DataType.CHAR; // nchar
case NVARCHAR: return DataType.VARCHAR; // nvarchar
Added: trunk/dbunit/src/main/java/org/dbunit/ext/mssql/UniqueIdentifierType.java
===================================================================
--- trunk/dbunit/src/main/java/org/dbunit/ext/mssql/UniqueIdentifierType.java (rev 0)
+++ trunk/dbunit/src/main/java/org/dbunit/ext/mssql/UniqueIdentifierType.java 2011-04-11 02:29:39 UTC (rev 1217)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2011, Red Hat, Inc.
+ * Written by Darryl L. Pierce <dp...@re...>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package org.dbunit.ext.mssql;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.UUID;
+
+import org.dbunit.dataset.datatype.AbstractDataType;
+import org.dbunit.dataset.datatype.TypeCastException;
+
+/**
+ * <code>UniqueIdentifierType</code> provides support for the "uniqueidentifier" column in Microsoft SQLServer
+ * databases. It users the {@link UUID}
+ *
+ * @Author Darryl L. Pierce <dp...@re...>
+ * @Since 02 February 2011
+ * @version $Revision$
+ */
+public class UniqueIdentifierType extends AbstractDataType {
+ static final String UNIQUE_IDENTIFIER_TYPE = "uniqueidentifier";
+
+ public UniqueIdentifierType() {
+ super(UNIQUE_IDENTIFIER_TYPE, Types.CHAR, UUID.class, false);
+ }
+
+ public Object typeCast(Object value) throws TypeCastException {
+ return value.toString();
+ }
+
+ public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException {
+ String value = resultSet.getString(column);
+
+ try {
+ return value != null && !value.isEmpty() ? UUID.fromString(value) : null;
+ } catch (NumberFormatException error) {
+ throw new TypeCastException("Invalid UUID: " + value, error);
+ }
+ }
+
+ public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException,
+ TypeCastException {
+ if (value == null)
+ statement.setObject(column, null);
+ else
+ statement.setObject(column, value.toString());
+ }
+}
Property changes on: trunk/dbunit/src/main/java/org/dbunit/ext/mssql/UniqueIdentifierType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/dbunit/src/test/java/org/dbunit/ext/mssql/AllTests.java
===================================================================
--- trunk/dbunit/src/test/java/org/dbunit/ext/mssql/AllTests.java 2011-02-22 03:22:19 UTC (rev 1216)
+++ trunk/dbunit/src/test/java/org/dbunit/ext/mssql/AllTests.java 2011-04-11 02:29:39 UTC (rev 1217)
@@ -36,6 +36,7 @@
suite.addTest(new TestSuite(InsertIdentityOperationIT.class));
suite.addTest(new TestSuite(MsSqlDataTypeFactoryTest.class));
+ suite.addTest(new TestSuite(UniqueIdentifierTypeTest.class));
return suite;
}
Modified: trunk/dbunit/src/test/java/org/dbunit/ext/mssql/MsSqlDataTypeFactoryTest.java
===================================================================
--- trunk/dbunit/src/test/java/org/dbunit/ext/mssql/MsSqlDataTypeFactoryTest.java 2011-02-22 03:22:19 UTC (rev 1216)
+++ trunk/dbunit/src/test/java/org/dbunit/ext/mssql/MsSqlDataTypeFactoryTest.java 2011-04-11 02:29:39 UTC (rev 1217)
@@ -1,5 +1,7 @@
package org.dbunit.ext.mssql;
+import java.sql.Types;
+
import org.dbunit.dataset.datatype.DataType;
import org.dbunit.dataset.datatype.IDataTypeFactory;
import junit.framework.TestCase;
@@ -62,4 +64,14 @@
DataType expected = DataType.LONGVARCHAR;
DataType actual = createFactory().createDataType(sqlType, sqlTypeName);
assertEquals("type", expected, actual);
- }}
+ }
+
+ public void testCreateUniqueIdentifierType() throws Exception {
+ int sqlType = Types.CHAR;
+ String sqlTypeName = UniqueIdentifierType.UNIQUE_IDENTIFIER_TYPE;
+
+ DataType expected = DataType.CHAR;
+ DataType actual = createFactory().createDataType(sqlType, sqlTypeName);
+ assertTrue(actual instanceof UniqueIdentifierType);
+ }
+}
Added: trunk/dbunit/src/test/java/org/dbunit/ext/mssql/UniqueIdentifierTypeTest.java
===================================================================
--- trunk/dbunit/src/test/java/org/dbunit/ext/mssql/UniqueIdentifierTypeTest.java (rev 0)
+++ trunk/dbunit/src/test/java/org/dbunit/ext/mssql/UniqueIdentifierTypeTest.java 2011-04-11 02:29:39 UTC (rev 1217)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2011, Red Hat, Inc.
+ * Written by Darryl L. Pierce <dp...@re...>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package org.dbunit.ext.mssql;
+
+import java.sql.SQLException;
+import java.util.UUID;
+
+import junit.framework.TestCase;
+
+import org.dbunit.dataset.datatype.TypeCastException;
+
+import com.mockobjects.sql.MockSingleRowResultSet;
+
+/**
+ * <code>UniqueIdentifierTypeTest</code> ensures that the {@link UniqueIdentifierType} works as expected.
+ *
+ * @author Darryl L. Pierce <dp...@re...>
+ *
+ */
+public class UniqueIdentifierTypeTest extends TestCase {
+ private UUID existingUuid;
+ private UniqueIdentifierType uuidType;
+ private MockSingleRowResultSet resultSet;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ uuidType = new UniqueIdentifierType();
+
+ resultSet = new MockSingleRowResultSet();
+ existingUuid = UUID.randomUUID();
+ }
+
+ protected void tearDown() throws Exception {
+ resultSet.verify();
+ }
+
+ /**
+ * Ensures that an exception occurs if the UUID value is invalid.
+ *
+ * @throws SQLException
+ */
+ public void testGetSqlValueWithBadValue() throws SQLException {
+ resultSet.addExpectedIndexedValues(new String[] { existingUuid.toString() + "Z" });
+
+ try {
+ uuidType.getSqlValue(1, resultSet);
+
+ fail("Method should have throw an exception");
+ } catch (TypeCastException e) {
+ assertTrue(true);
+ }
+ }
+
+ /**
+ * Ensures that unmarshalling a UUID value works correctly.
+ *
+ * @throws SQLException
+ * @throws TypeCastException
+ */
+ public void testGetValue() throws TypeCastException, SQLException {
+ resultSet.addExpectedIndexedValues(new String[] { existingUuid.toString() });
+
+ UUID result = (UUID) uuidType.getSqlValue(1, resultSet);
+
+ assertEquals(existingUuid, result);
+
+ resultSet.verify();
+ }
+}
Property changes on: trunk/dbunit/src/test/java/org/dbunit/ext/mssql/UniqueIdentifierTypeTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jef...@us...> - 2012-09-29 17:55:49
|
Revision: 1229
http://dbunit.svn.sourceforge.net/dbunit/?rev=1229&view=rev
Author: jeffjensen
Date: 2012-09-29 17:55:43 +0000 (Sat, 29 Sep 2012)
Log Message:
-----------
[3573007] Remove POM setting and note related to using JDK 1.4.
Modified Paths:
--------------
trunk/dbunit/pom.xml
trunk/dbunit/src/changes/changes.xml
Modified: trunk/dbunit/pom.xml
===================================================================
--- trunk/dbunit/pom.xml 2012-09-29 17:54:06 UTC (rev 1228)
+++ trunk/dbunit/pom.xml 2012-09-29 17:55:43 UTC (rev 1229)
@@ -451,11 +451,6 @@
<source>${compileSource}</source>
<target>${compileSource}</target>
<compilerVersion>${compileSource}</compilerVersion>
- <!--
- TODO somehow we must ensure that the used rt.jar is really a
- 1.4 and not higher, also for continuous integration
- -->
- <!--<executable>${JAVA_1_4_HOME}/bin/javac</executable>-->
<debug>true</debug>
<fork>true</fork>
</configuration>
@@ -741,7 +736,6 @@
<source>${compileSource}</source>
<target>${compileSource}</target>
<compilerVersion>${compileSource}</compilerVersion>
- <executable>${JAVA_1_4_HOME}/bin/javac</executable>
<debug>true</debug>
<fork>true</fork>
</configuration>
Modified: trunk/dbunit/src/changes/changes.xml
===================================================================
--- trunk/dbunit/src/changes/changes.xml 2012-09-29 17:54:06 UTC (rev 1228)
+++ trunk/dbunit/src/changes/changes.xml 2012-09-29 17:55:43 UTC (rev 1229)
@@ -10,7 +10,8 @@
</properties>
<body>
- <release version="2.4.9" date="Sep 29, 2012" description="Additional toString()s, schema name usage, logging, timestamp, unique ID, table name in Operation exceptions.">
+ <release version="2.4.9" date="Sep 29, 2012" description="Additional toString()s, schema name usage, logging, timestamp, unique ID, table name in Operation exceptions, build with JDK 6.">
+ <action dev="jeffjensen" type="add" issue="3573007" due-to="jeffjensen">Change build to use current compiler on path vs 1.4. This is first dbUnit release done with JDK 6. If you encounter problems, please open a bug tracker item.</action>
<action dev="jeffjensen" type="add" due-to="jeffjensen">Add toString() methods to AbstractResultSetTable, ForwardOnlyResultSetTable, ScrollableResultSetTable, ColumnFilterTable.</action>
<action dev="jeffjensen" type="update" due-to="jeffjensen">For DefaultPrepAndExpectedTestCase, catch, log, and rethrow all log messages to help with troubleshooting. Tweak log messages. Improve doc example.</action>
<action dev="jeffjensen" type="fix" due-to="jeffjensen">Add schema name, if specified, to table name in query in AbstractDatabaseConnection.createTable().</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|