You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(7) |
Aug
(37) |
Sep
|
Oct
|
Nov
(1) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(8) |
Feb
(68) |
Mar
(72) |
Apr
(149) |
May
(32) |
Jun
(46) |
Jul
(26) |
Aug
(59) |
Sep
(25) |
Oct
(18) |
Nov
(4) |
Dec
(3) |
2004 |
Jan
(90) |
Feb
(19) |
Mar
(38) |
Apr
(41) |
May
(44) |
Jun
(2) |
Jul
(10) |
Aug
|
Sep
(14) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(15) |
Jun
(1) |
Jul
|
Aug
(9) |
Sep
|
Oct
(17) |
Nov
|
Dec
|
2006 |
Jan
(1) |
Feb
(16) |
Mar
|
Apr
(1) |
May
(48) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(29) |
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(23) |
Mar
(31) |
Apr
|
May
(26) |
Jun
(6) |
Jul
(1) |
Aug
|
Sep
(7) |
Oct
(1) |
Nov
(8) |
Dec
(8) |
2009 |
Jan
(5) |
Feb
(9) |
Mar
(1) |
Apr
|
May
(23) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(9) |
Oct
(28) |
Nov
(18) |
Dec
(8) |
2010 |
Jan
(19) |
Feb
(24) |
Mar
(3) |
Apr
|
May
(5) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(11) |
Oct
|
Nov
(2) |
Dec
(1) |
2011 |
Jan
|
Feb
(7) |
Mar
|
Apr
(6) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(32) |
Oct
(6) |
Nov
|
Dec
|
From: <rlo...@us...> - 2009-10-29 04:09:22
|
Revision: 1085 http://dbunit.svn.sourceforge.net/dbunit/?rev=1085&view=rev Author: rlogiacco Date: 2009-10-29 04:09:15 +0000 (Thu, 29 Oct 2009) Log Message: ----------- added faq regarding the DataTypeFactory property Modified Paths: -------------- trunk/src/site/fml/faq.fml Modified: trunk/src/site/fml/faq.fml =================================================================== --- trunk/src/site/fml/faq.fml 2009-10-25 10:35:42 UTC (rev 1084) +++ trunk/src/site/fml/faq.fml 2009-10-29 04:09:15 UTC (rev 1085) @@ -723,16 +723,25 @@ </p> </answer> </faq> - - + <faq id="DefaultDataTypeFactory"> + <question> + Why am I getting an "The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database ..."? + </question> + <answer> + <p>This warning occurs when no data type factory has been configured and DbUnit defaults to its <code>org.dbunit.dataset.datatype.DefaultDataTypeFactory</code> which supports a limited set of RDBMS.</p> + <p>You can solve this problem in two different ways: + <ol> + <li>set the appropriate data type factory for your RDBMS through the <a href="properties.html#typefactory">data type factory</a> feature; this is the preferred solution if you RDBMS is among the ones already having an IDataTypeFactory implementation</li> + <li>disable the warning notification through the <a href="properties.html#typewarning">data type warning</a> property, but only if a data type factory is not available for your RDBMS and your tests doesn't use features specific of your RDBMS!</li> + </ol> + If you are not in any of the above cases please help us to write down an IDataTypeFactory implementation for your RDBMS. + </p> + </answer> + </faq> </part> - - - - - <part id="use"> + <part id="errors"> <title>Errors</title> <faq id="AmbiguousTableNameException"> @@ -809,7 +818,6 @@ </answer> </faq> - <h5>SLF4J Errors</h5> <faq id="slf4jdependency"> <question> Why am I getting the following error: "java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-23 05:40:08
|
Revision: 1083 http://dbunit.svn.sourceforge.net/dbunit/?rev=1083&view=rev Author: jbhurst Date: 2009-10-23 05:40:00 +0000 (Fri, 23 Oct 2009) Log Message: ----------- Typo. Modified Paths: -------------- trunk/src/site/apt/integrationtests.apt Modified: trunk/src/site/apt/integrationtests.apt =================================================================== --- trunk/src/site/apt/integrationtests.apt 2009-10-23 05:36:53 UTC (rev 1082) +++ trunk/src/site/apt/integrationtests.apt 2009-10-23 05:40:00 UTC (rev 1083) @@ -70,7 +70,7 @@ </settings> --- -Riunning HSQLDB Integration Tests +Running HSQLDB Integration Tests Nothing special is required. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-23 05:37:04
|
Revision: 1082 http://dbunit.svn.sourceforge.net/dbunit/?rev=1082&view=rev Author: jbhurst Date: 2009-10-23 05:36:53 +0000 (Fri, 23 Oct 2009) Log Message: ----------- [2875235] - Integration tests working with postgresql profile. Modified Paths: -------------- trunk/pom.xml trunk/src/site/apt/integrationtests.apt trunk/src/test/org/dbunit/AbstractDatabaseTest.java trunk/src/test/org/dbunit/DatabaseEnvironment.java trunk/src/test/org/dbunit/database/AbstractDatabaseConnectionTest.java trunk/src/test/org/dbunit/database/CachedResultSetTableTest.java trunk/src/test/org/dbunit/database/DatabaseConnectionTest.java trunk/src/test/org/dbunit/database/DatabaseDataSetTest.java trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java trunk/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java trunk/src/test/org/dbunit/dataset/AbstractTableTest.java trunk/src/test/org/dbunit/dataset/AbstractTest.java trunk/src/test/org/dbunit/dataset/xml/FlatDtdDataSetTest.java Added Paths: ----------- trunk/src/dtd/flatDtdDataSetTest-postgresql.dtd trunk/src/sql/postgresql.sql trunk/src/test/org/dbunit/PostgresqlEnvironment.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/pom.xml 2009-10-23 05:36:53 UTC (rev 1082) @@ -304,8 +304,13 @@ <version>2.0.1</version> <scope>test</scope> </dependency> - <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-nop</artifactId> <version>1.5.6</version> Added: trunk/src/dtd/flatDtdDataSetTest-postgresql.dtd =================================================================== --- trunk/src/dtd/flatDtdDataSetTest-postgresql.dtd (rev 0) +++ trunk/src/dtd/flatDtdDataSetTest-postgresql.dtd 2009-10-23 05:36:53 UTC (rev 1082) @@ -0,0 +1,54 @@ +<!ELEMENT dataset ( + test_table*, + second_table*, + empty_table*, + pk_table*, + only_pk_table*, + empty_multitype_table*)> + +<!ELEMENT test_table EMPTY> +<!ATTLIST test_table + column0 CDATA #IMPLIED + column1 CDATA #IMPLIED + column2 CDATA #IMPLIED + column3 CDATA #IMPLIED +> + +<!ELEMENT second_table EMPTY> +<!ATTLIST second_table + column0 CDATA #IMPLIED + column1 CDATA #IMPLIED + column2 CDATA #IMPLIED + column3 CDATA #IMPLIED +> + +<!ELEMENT empty_table EMPTY> +<!ATTLIST empty_table + column0 CDATA #IMPLIED + column1 CDATA #IMPLIED + column2 CDATA #IMPLIED + column3 CDATA #IMPLIED +> + +<!ELEMENT pk_table EMPTY> +<!ATTLIST pk_table + pk0 CDATA #REQUIRED + pk1 CDATA #REQUIRED + pk2 CDATA #REQUIRED + normal0 CDATA #IMPLIED + normal1 CDATA #IMPLIED +> + +<!ELEMENT only_pk_table EMPTY> +<!ATTLIST only_pk_table + pk0 CDATA #REQUIRED +> + +<!ELEMENT empty_multitype_table EMPTY> +<!ATTLIST empty_multitype_table + varchar_col CDATA #IMPLIED + numeric_col CDATA #IMPLIED + timestamp_col CDATA #IMPLIED + varbinary_col CDATA #IMPLIED +> + Property changes on: trunk/src/dtd/flatDtdDataSetTest-postgresql.dtd ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/src/site/apt/integrationtests.apt =================================================================== --- trunk/src/site/apt/integrationtests.apt 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/site/apt/integrationtests.apt 2009-10-23 05:36:53 UTC (rev 1082) @@ -70,9 +70,9 @@ </settings> --- -Setting up for HSQLDB Integration Tests +Riunning HSQLDB Integration Tests - Nothing is required. + Nothing special is required. Run the full test suite, including integration tests, with this command: @@ -80,14 +80,14 @@ mvn clean test --- -Setting up for Oracle Integration Tests +Running Oracle Integration Tests [[1]] Install Oracle database. This can be on your local machine, or you can use any Oracle database you have access to. [[2]] Create a "dbunit" user with password "dbunit". - These are the defaults configured in the project. - If you use different values, you will need to override the properties in your settings.xml. + These values are the defaults configured in the project. + If you use different values, you will need to override the properties in your Maven settings.xml. [[3]] Log in to your dbunit schema and run src/sql/oracle.sql. @@ -105,5 +105,38 @@ mvn clean test -Poracle10-ojdbc6 --- +Running PostgreSQL Integration Tests + + [[1]] Install PostgreSQL database. This can be on your local machine, or you can use any PostgreSQL database you have access to. + + [[2]] Create a "dbunit" user and database, for example with these commands: + +--- +sudo -u postgres psql <<EOF +CREATE USER dbunit WITH PASSWORD 'dbunit'; +CREATE DATABASE dbunit OWNER dbunit; + +\q +EOF +--- + + These values are the defaults configured in the project. + If you use different values, you will need to override the properties in your Maven settings.xml. + + [[3]] Log in to your dbunit user and run src/sql/postgresql.sql. + + [] + + This should create the DbUnit test schema in your PostgreSQL database. + You are now ready to run tests. + + Run the full test suite, including integration tests, with this command: + +--- +mvn clean test -Poracle-default,postgresql +--- + + <<Note:>> currently the oracle-default profile is required, along with the postgresql profile, to ensure all JARs required on the compile-time classpath in Maven. + TODO: Other databases. Added: trunk/src/sql/postgresql.sql =================================================================== --- trunk/src/sql/postgresql.sql (rev 0) +++ trunk/src/sql/postgresql.sql 2009-10-23 05:36:53 UTC (rev 1082) @@ -0,0 +1,78 @@ +----------------------------------------------------------------------------- +-- TEST_TABLE +----------------------------------------------------------------------------- + +CREATE TABLE TEST_TABLE + (COLUMN0 VARCHAR(32), + COLUMN1 VARCHAR(32), + COLUMN2 VARCHAR(32), + COLUMN3 VARCHAR(32)); + +----------------------------------------------------------------------------- +-- SECOND_TABLE +----------------------------------------------------------------------------- + +CREATE TABLE SECOND_TABLE + (COLUMN0 VARCHAR(32), + COLUMN1 VARCHAR(32), + COLUMN2 VARCHAR(32), + COLUMN3 VARCHAR(32)); + +----------------------------------------------------------------------------- +-- EMPTY_TABLE +----------------------------------------------------------------------------- + +CREATE TABLE EMPTY_TABLE + (COLUMN0 VARCHAR(32), + COLUMN1 VARCHAR(32), + COLUMN2 VARCHAR(32), + COLUMN3 VARCHAR(32)); + +----------------------------------------------------------------------------- +-- 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 +----------------------------------------------------------------------------- + +CREATE TABLE ONLY_PK_TABLE + (PK0 NUMERIC(38, 0) NOT NULL PRIMARY KEY); + +----------------------------------------------------------------------------- +-- EMPTY_MULTITYPE_TABLE +----------------------------------------------------------------------------- + +CREATE TABLE EMPTY_MULTITYPE_TABLE + (VARCHAR_COL VARCHAR(32), + NUMERIC_COL NUMERIC(38, 0), + TIMESTAMP_COL DATE, + VARBINARY_COL TEXT); +-- TODO: VARBINARY_COL is supposed to be RAW or VARBINARY? + + +----------------------------------------------------------------------------- +-- CLOB_TABLE +----------------------------------------------------------------------------- + +-- TODO +--CREATE TABLE CLOB_TABLE +-- (PK NUMERIC(38, 0) NOT NULL, +-- CLOB CLOB, PRIMARY KEY (PK)); + +----------------------------------------------------------------------------- +-- BLOB_TABLE +----------------------------------------------------------------------------- + +-- TODO +--CREATE TABLE BLOB_TABLE +-- (PK NUMERIC(38, 0) NOT NULL, +-- BLOB BLOB, PRIMARY KEY (PK)); + Property changes on: trunk/src/sql/postgresql.sql ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: trunk/src/test/org/dbunit/AbstractDatabaseTest.java =================================================================== --- trunk/src/test/org/dbunit/AbstractDatabaseTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/AbstractDatabaseTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -60,6 +60,19 @@ // 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 Modified: trunk/src/test/org/dbunit/DatabaseEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -26,6 +26,7 @@ import java.sql.Connection; import java.sql.DriverManager; +import org.apache.commons.io.FilenameUtils; import org.dbunit.database.DatabaseConfig; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; @@ -65,6 +66,10 @@ { INSTANCE = new Oracle10Environment(profile); } + else if (profileName.equals("postgresql")) + { + INSTANCE = new PostgresqlEnvironment(profile); + } else if (profileName.equals("derby")) { INSTANCE = new DerbyEnvironment(profile); @@ -152,6 +157,35 @@ return true; } + + public File getFile(String fileName) + { + String fullPath = FilenameUtils.getFullPath(fileName); + String baseName = FilenameUtils.getBaseName(fileName); + String extension = FilenameUtils.getExtension(fileName); + File profileFile = new File(fullPath + baseName + "-" + _profile.getActiveProfile() + "." + extension); + if (profileFile.exists()) + { + return profileFile; + } + else + { + return new File(fileName); + } + } + + /** + * 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. + */ + public String convertString(String str) + { + return str == null ? null : str.toUpperCase(); + } public String toString() { Added: trunk/src/test/org/dbunit/PostgresqlEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/PostgresqlEnvironment.java (rev 0) +++ trunk/src/test/org/dbunit/PostgresqlEnvironment.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -0,0 +1,49 @@ +/* + * + * 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; + +import org.dbunit.database.DatabaseConfig; +import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; + +/** + * @author John Hurst (adpated from Manuel Laflamme: OracleEnvironment) + * @version $Revision$ + * @since DbUnit 2.4.7 + */ +public class PostgresqlEnvironment extends DatabaseEnvironment +{ + public PostgresqlEnvironment(DatabaseProfile profile) throws Exception + { + super(profile); + } + + protected void setupDatabaseConfig(DatabaseConfig config) + { + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory()); + } + + public String convertString(String str) + { + return str == null ? null : str.toLowerCase(); + } +} + Property changes on: trunk/src/test/org/dbunit/PostgresqlEnvironment.java ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: trunk/src/test/org/dbunit/database/AbstractDatabaseConnectionTest.java =================================================================== --- trunk/src/test/org/dbunit/database/AbstractDatabaseConnectionTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/AbstractDatabaseConnectionTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -73,7 +73,7 @@ try { IDatabaseConnection dbConnection = dbTester.getConnection(); - assertEquals(nonexistingSchema, dbConnection.getSchema()); + assertEquals(convertString(nonexistingSchema), dbConnection.getSchema()); try { dbConnection.getRowCount("test_table"); fail("Should not be able to retrieve row count for non-existing schema " + nonexistingSchema); Modified: trunk/src/test/org/dbunit/database/CachedResultSetTableTest.java =================================================================== --- trunk/src/test/org/dbunit/database/CachedResultSetTableTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/CachedResultSetTableTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -49,6 +49,11 @@ new ForwardOnlyResultSetTable("TEST_TABLE", selectStatement, connection)); } + protected String convertString(String str) throws Exception + { + return DatabaseEnvironment.getInstance().convertString(str); + } + public void testGetMissingValue() throws Exception { // Do not test this! Modified: trunk/src/test/org/dbunit/database/DatabaseConnectionTest.java =================================================================== --- trunk/src/test/org/dbunit/database/DatabaseConnectionTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/DatabaseConnectionTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -27,6 +27,7 @@ import java.sql.PreparedStatement; import java.util.Locale; +import org.dbunit.DatabaseEnvironment; import org.dbunit.DatabaseUnitException; import org.dbunit.dataset.ITable; @@ -43,6 +44,12 @@ super(s); } + protected String convertString(String str) throws Exception + { + return getEnvironment().convertString(str); + } + + public void testCreateNullConnection() throws Exception { try @@ -58,8 +65,9 @@ public void testCreateConnectionWithNonExistingSchemaAndStrictValidation() throws Exception { + DatabaseEnvironment environment = getEnvironment(); + String schema = environment.convertString("XYZ_INVALID_SCHEMA_1642344539"); IDatabaseConnection validConnection = super.getConnection(); - String schema = "XYZ_INVALID_SCHEMA_1642344539"; // Try to create a database connection with an invalid schema try { @@ -69,15 +77,16 @@ } catch(DatabaseUnitException expected) { - String expectedMsg = "The given schema 'XYZ_INVALID_SCHEMA_1642344539' does not exist."; + String expectedMsg = "The given schema '" + convertString(schema) + "' does not exist."; assertEquals(expectedMsg, expected.getMessage()); } } public void testCreateConnectionWithNonExistingSchemaAndLenientValidation() throws Exception { + DatabaseEnvironment environment = getEnvironment(); + String schema = environment.convertString("XYZ_INVALID_SCHEMA_1642344539"); IDatabaseConnection validConnection = super.getConnection(); - String schema = "XYZ_INVALID_SCHEMA_1642344539"; // Try to create a database connection with an invalid schema boolean validate = false; DatabaseConnection dbConnection = new DatabaseConnection(validConnection.getConnection(), schema, validate); Modified: trunk/src/test/org/dbunit/database/DatabaseDataSetTest.java =================================================================== --- trunk/src/test/org/dbunit/database/DatabaseDataSetTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/DatabaseDataSetTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -69,6 +69,12 @@ //////////////////////////////////////////////////////////////////////////// // AbstractDataSetTest class + + protected String convertString(String str) throws Exception + { + return DatabaseEnvironment.getInstance().convertString(str); + } + protected IDataSet createDataSet() throws Exception { return _connection.createDataSet(); @@ -197,7 +203,7 @@ assertEquals("column count", expected.length, columns.length); for (int i = 0; i < columns.length; i++) { - assertEquals("column name", expected[i], columns[i].getColumnName()); + assertEquals("column name", convertString(expected[i]), columns[i].getColumnName()); } } @@ -218,7 +224,7 @@ assertEquals("column count", expected.length, columns.length); for (int i = 0; i < columns.length; i++) { - assertEquals("column name", expected[i], columns[i].getColumnName()); + assertEquals("column name", convertString(expected[i]), columns[i].getColumnName()); } } @@ -249,7 +255,7 @@ assertEquals("column count", expected.length, columns.length); for (int i = 0; i < columns.length; i++) { - assertEquals("column name", expected[i], columns[i].getColumnName()); + assertEquals("column name", convertString(expected[i]), columns[i].getColumnName()); } } @@ -271,7 +277,7 @@ public void testGetTableThatIsFiltered() throws Exception { - final String existingTableToFilter = "TEST_TABLE"; + final String existingTableToFilter = convertString("TEST_TABLE"); ITableFilterSimple tableFilter = new ITableFilterSimple(){ public boolean accept(String tableName) throws DataSetException { if(tableName.equals(existingTableToFilter)) Modified: trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java =================================================================== --- trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -63,6 +63,11 @@ return _connection.createDataSet(); } + protected String convertString(String str) throws Exception + { + return DatabaseEnvironment.getInstance().convertString(str); + } + public void testGetPrimaryKeys() throws Exception { String tableName = "PK_TABLE"; @@ -76,7 +81,7 @@ for (int i = 0; i < columns.length; i++) { Column column = columns[i]; - assertEquals("name", expected[i], column.getColumnName()); + assertEquals("name", convertString(expected[i]), column.getColumnName()); } } @@ -105,7 +110,7 @@ } catch (NoSuchTableException expected) { - String msg = "Did not find table 'UNKNOWN_TABLE' in schema '" + schema + "'"; + String msg = "Did not find table '" + convertString("UNKNOWN_TABLE") + "' in schema '" + schema + "'"; assertEquals(msg, expected.getMessage()); } } @@ -199,15 +204,27 @@ for (int i = 0; i < expectedNames.size(); i++) { Column column = columns[i]; - assertEquals("name", (String)expectedNames.get(i), column.getColumnName()); + assertEquals("name", convertString((String)expectedNames.get(i)), column.getColumnName()); if (expectedTypes.get(i).equals(DataType.NUMERIC)) { - // 2009-10-10 John Hurst: hack for Oracle, returns java.sql.Types.DECIMAL for this column + // 2009-10-10 TODO John Hurst: hack for Oracle, returns java.sql.Types.DECIMAL for this column assertTrue("Expected numeric datatype, got [" + column.getDataType() + "]", column.getDataType().equals(DataType.NUMERIC) || column.getDataType().equals(DataType.DECIMAL) ); } + else if (expectedTypes.get(i).equals(DataType.TIMESTAMP) && column.getDataType().equals(DataType.DATE)) + { + // 2009-10-22 TODO John Hurst: hack for Postgresql, returns DATE for TIMESTAMP. + // Need to move DataType comparison to DatabaseEnvironment. + assertTrue(true); + } + else if (expectedTypes.get(i).equals(DataType.VARBINARY) && column.getDataType().equals(DataType.VARCHAR)) + { + // 2009-10-22 TODO John Hurst: hack for Postgresql, returns VARCHAR for VARBINARY. + // Need to move DataType comparison to DatabaseEnvironment. + assertTrue(true); + } else { assertEquals("datatype", (DataType)expectedTypes.get(i), column.getDataType()); @@ -331,7 +348,7 @@ // Connection jdbcConn = _connection.getConnection(); // String schema = SQLHelper.getSchema(jdbcConn); DatabaseTableMetaData metaData = new DatabaseTableMetaData(schema + "." + TEST_TABLE, _connection); - assertEquals(schema + "." + TEST_TABLE, metaData.getTableName()); + assertEquals(schema + "." + convertString(TEST_TABLE), metaData.getTableName()); } public void testDbStoresUpperCaseTableNames() throws Exception Modified: trunk/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java =================================================================== --- trunk/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/database/ForwardOnlyResultSetTableTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -51,6 +51,11 @@ return new ForwardOnlyResultSetTable("TEST_TABLE", selectStatement, connection); } + protected String convertString(String str) throws Exception + { + return DatabaseEnvironment.getInstance().convertString(str); + } + public void testGetMissingValue() throws Exception { // Do not test this! Modified: trunk/src/test/org/dbunit/dataset/AbstractTableTest.java =================================================================== --- trunk/src/test/org/dbunit/dataset/AbstractTableTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/dataset/AbstractTableTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -23,6 +23,7 @@ import junit.framework.TestCase; +import org.dbunit.DatabaseEnvironment; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,6 +51,19 @@ */ protected abstract ITable createTable() throws Exception; + /** + * 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; + } + //////////////////////////////////////////////////////////////////////////// // Test methods @@ -64,7 +78,7 @@ assertEquals("column count", COLUMN_COUNT, columns.length); for (int i = 0; i < columns.length; i++) { - String expected = "COLUMN" + i; + String expected = convertString("COLUMN" + i); String actual = columns[i].getColumnName(); assertEquals("column name", expected, actual); } Modified: trunk/src/test/org/dbunit/dataset/AbstractTest.java =================================================================== --- trunk/src/test/org/dbunit/dataset/AbstractTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/dataset/AbstractTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -52,6 +52,19 @@ super(s); } + /** + * 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; + } + protected String[] getExpectedNames() throws Exception { return (String[])AbstractTest.TABLE_NAMES.clone(); Modified: trunk/src/test/org/dbunit/dataset/xml/FlatDtdDataSetTest.java =================================================================== --- trunk/src/test/org/dbunit/dataset/xml/FlatDtdDataSetTest.java 2009-10-23 04:43:02 UTC (rev 1081) +++ trunk/src/test/org/dbunit/dataset/xml/FlatDtdDataSetTest.java 2009-10-23 05:36:53 UTC (rev 1082) @@ -40,12 +40,12 @@ */ public class FlatDtdDataSetTest extends AbstractDataSetTest { - private static final File DTD_FILE = - new File("src/dtd/flatDtdDataSetTest.dtd"); - private static final File DUPLICATE_FILE = - new File("src/dtd/flatDtdDataSetDuplicateTest.dtd"); - private static final File DUPLICATE_MULTIPLE_CASE_FILE = - new File("src/dtd/flatDtdDataSetDuplicateMultipleCaseTest.dtd"); + private static final String DTD_FILE = + "src/dtd/flatDtdDataSetTest.dtd"; + private static final String DUPLICATE_FILE = + "src/dtd/flatDtdDataSetDuplicateTest.dtd"; + private static final String DUPLICATE_MULTIPLE_CASE_FILE = + "src/dtd/flatDtdDataSetDuplicateMultipleCaseTest.dtd"; public FlatDtdDataSetTest(String s) { @@ -55,6 +55,11 @@ //////////////////////////////////////////////////////////////////////////// // AbstractDataSetTest class + private File getFile(String fileName) throws Exception + { + return DatabaseEnvironment.getInstance().getFile(fileName); + } + protected IDataSet createDataSet() throws Exception { return new FlatDtdDataSet(new FileReader(DTD_FILE)); @@ -134,7 +139,7 @@ } FileAsserts.assertEquals( - new BufferedReader(new FileReader(DTD_FILE)), + new BufferedReader(new FileReader(getFile(DTD_FILE))), new BufferedReader(new FileReader(tempFile))); } finally This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-23 04:43:13
|
Revision: 1081 http://dbunit.svn.sourceforge.net/dbunit/?rev=1081&view=rev Author: jbhurst Date: 2009-10-23 04:43:02 +0000 (Fri, 23 Oct 2009) Log Message: ----------- [2875235] - Changed evil tabs to spaces. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-19 00:13:43 UTC (rev 1080) +++ trunk/pom.xml 2009-10-23 04:43:02 UTC (rev 1081) @@ -291,14 +291,14 @@ <version>1.8.0.1</version> <scope>test</scope> </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <version>1.1.113</version> - <!-- Note that the 1.1.113 version is the last one officially built with JDK 1.4 --> - <scope>test</scope> - </dependency> <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>1.1.113</version> + <!-- Note that the 1.1.113 version is the last one officially built with JDK 1.4 --> + <scope>test</scope> + </dependency> + <dependency> <groupId>gsbase</groupId> <artifactId>gsbase</artifactId> <version>2.0.1</version> @@ -717,6 +717,25 @@ </dependencies> </profile> <profile> + <id>postgresql</id> + <properties> + <dbunit.profile>postgresql</dbunit.profile> + <dbunit.profile.driverClass>org.postgresql.Driver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:postgresql://host/database</dbunit.profile.url> + <dbunit.profile.schema>public</dbunit.profile.schema> + <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> + </properties> + <dependencies> + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>8.4-701.jdbc3</version> + </dependency> + </dependencies> + </profile> + <profile> <id>mysql</id> <properties> <dbunit.profile>mysql</dbunit.profile> @@ -773,18 +792,6 @@ </dependencies> </profile> <profile> - <id>postgresql</id> - <properties> - <dbunit.profile>postgresql</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> - </properties> - </profile> - <profile> <id>h2</id> <properties> <dbunit.profile>h2</dbunit.profile> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rlo...@us...> - 2009-10-19 00:50:21
|
Revision: 1080 http://dbunit.svn.sourceforge.net/dbunit/?rev=1080&view=rev Author: rlogiacco Date: 2009-10-19 00:13:43 +0000 (Mon, 19 Oct 2009) Log Message: ----------- updated features notes: escape pattern and qualified tables can be mixed since 2.2.1 Modified Paths: -------------- trunk/src/site/xdoc/properties.xml Modified: trunk/src/site/xdoc/properties.xml =================================================================== --- trunk/src/site/xdoc/properties.xml 2009-10-17 11:11:13 UTC (rev 1079) +++ trunk/src/site/xdoc/properties.xml 2009-10-19 00:13:43 UTC (rev 1080) @@ -79,7 +79,7 @@ </tr> <tr> <td>Note</td> - <td>This feature is not compatible with the <a href="#escapepattern">escape pattern</a> property.</td> + <td>This feature was not compatible with the <a href="#escapepattern">escape pattern</a> property until the 2.2.1 release. Since then the two properties can be mixed without problem: each element will be properly escaped.</td> </tr> </table> @@ -148,8 +148,8 @@ </tr> <tr> <td>Note</td> - <td>This property is not compatible with the <a href="#qualifiedtablenames">qualified - table names</a> feature. + <td>This property was not compatible with the <a href="#qualifiedtablenames">qualified + table names</a> feature until 2.2.1. Since then the two properties can be mixed resulting in each element properly escaped. </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rlo...@us...> - 2009-10-17 11:11:20
|
Revision: 1079 http://dbunit.svn.sourceforge.net/dbunit/?rev=1079&view=rev Author: rlogiacco Date: 2009-10-17 11:11:13 +0000 (Sat, 17 Oct 2009) Log Message: ----------- added jeffjensen among project developers Modified Paths: -------------- trunk/pom.xml trunk/src/site/xdoc/index.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-17 09:32:56 UTC (rev 1078) +++ trunk/pom.xml 2009-10-17 11:11:13 UTC (rev 1079) @@ -86,6 +86,22 @@ </roles> </developer> <developer> + <name>John Hurst</name> + <id>jbhurst</id> + <email>jb...@us...</email> + <roles> + <role>Java Developer (very active)</role> + </roles> + </developer> + <developer> + <name>Jeff Jensen</name> + <id>jeffjensen</id> + <email>jef...@us...</email> + <roles> + <role>Java Developer (active)</role> + </roles> + </developer> + <developer> <name>Roberto Lo Giacco</name> <id>rlogiacco</id> <email>rlo...@us...</email> Modified: trunk/src/site/xdoc/index.xml =================================================================== --- trunk/src/site/xdoc/index.xml 2009-10-17 09:32:56 UTC (rev 1078) +++ trunk/src/site/xdoc/index.xml 2009-10-17 11:11:13 UTC (rev 1079) @@ -26,6 +26,10 @@ <section name="News"> <table border="1"> <tr> + <td>2009-10-09</td> + <td>We wish to welcome Jeff Jensen as a DbUnit developer, the project team is growing!</td> + </tr> + <tr> <td>2009-09-24</td> <td>Another member joined the DbUnit project developers group: welcome John Hurst!</td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-16 01:03:44
|
Revision: 1077 http://dbunit.svn.sourceforge.net/dbunit/?rev=1077&view=rev Author: jbhurst Date: 2009-10-16 01:03:36 +0000 (Fri, 16 Oct 2009) Log Message: ----------- [2875253] - Add support for Oracle SDO_GEOMETRY datatype. Thanks Lucas Casey. Modified Paths: -------------- trunk/pom.xml trunk/src/changes/changes.xml trunk/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java trunk/src/sql/oracle.sql trunk/src/test/org/dbunit/Oracle10Environment.java trunk/src/test/org/dbunit/OracleEnvironment.java trunk/src/test/org/dbunit/TestFeature.java trunk/src/test/org/dbunit/dataset/AbstractDataSetTest.java trunk/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java trunk/src/test/org/dbunit/operation/InsertOperationTest.java trunk/src/test/org/dbunit/operation/UpdateOperationTest.java Added Paths: ----------- trunk/src/java/org/dbunit/ext/oracle/OracleSdoGeometryDataType.java trunk/src/xml/sdoGeometryInsertTest.xml trunk/src/xml/sdoGeometryUpdateTest.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/pom.xml 2009-10-16 01:03:36 UTC (rev 1077) @@ -606,7 +606,7 @@ <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</dbunit.profile.unsupportedFeatures> + <dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures> </properties> </profile> <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 --> @@ -702,7 +702,7 @@ <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> <dbunit.profile.user>dbunit</dbunit.profile.user> <dbunit.profile.password>dbunit</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</dbunit.profile.unsupportedFeatures> + <dbunit.profile.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> @@ -714,7 +714,7 @@ <dbunit.profile.schema>dbo</dbunit.profile.schema> <dbunit.profile.user>dbunit</dbunit.profile.user> <dbunit.profile.password>dbunit</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> + <dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> @@ -738,7 +738,7 @@ <dbunit.profile.schema>APP</dbunit.profile.schema> <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</dbunit.profile.unsupportedFeatures> + <dbunit.profile.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE,SDO_GEOMETRY</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> Modified: trunk/src/changes/changes.xml =================================================================== --- trunk/src/changes/changes.xml 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/changes/changes.xml 2009-10-16 01:03:36 UTC (rev 1077) @@ -16,9 +16,10 @@ <action dev="gommma" type="fix" issue="2741077" due-to="dnap">DatabaseSequenceFilter fails on case sensitive tables</action> <action dev="gommma" type="fix" issue="2838922" due-to="matthieus, simon_wu">DB2 problem with schema names</action> <action dev="gommma" type="fix" issue="2875262" due-to="caseylucas">Handle non-typical characters in xml encoding</action> - <action dev="jbhurst" type="fix" issue="2875235" due-to="jbhurst">Fix integration tests.</action> + <action dev="jbhurst" type="fix" issue="2875235" due-to="jbhurst">Fix integration tests</action> <action dev="gommma" type="fix" issue="2880113" due-to="jherico">FK table sorting does not work with cross-schema FKs</action> - <action dev="jbhurst" type="update" issue="2876909" due-to="jbhurst">Replaced reflection-based Oracle data types with static calls.</action> + <action dev="jbhurst" type="update" issue="2876909" due-to="jbhurst">Replaced reflection-based Oracle data types with static calls</action> + <action dev="jbhurst" type="add" issue="2875253" due-to="caseylucas">Add support for Oracle SDO_GEOMETRY datatype</action> </release> <release version="2.4.6" date="Sep 20, 2009" description="Bugfixes and some database specific additions"> <action dev="rlogiacco" type="add" issue="284432" due-to="JamesR">Add support for interval type on postgres</action> Modified: trunk/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/java/org/dbunit/ext/oracle/OracleDataTypeFactory.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -54,6 +54,7 @@ public static final DataType ORACLE_CLOB = new OracleClobDataType(); public static final DataType ORACLE_NCLOB = new OracleNClobDataType(); public static final DataType ORACLE_XMLTYPE = new OracleXMLTypeDataType(); + public static final DataType ORACLE_SDO_GEOMETRY_TYPE = new OracleSdoGeometryDataType(); public static final DataType LONG_RAW = new BinaryStreamDataType( "LONG RAW", Types.LONGVARBINARY); @@ -152,6 +153,12 @@ return ROWID_TYPE; } + // SDO_GEOMETRY + if ("SDO_GEOMETRY".equals(sqlTypeName) || "MDSYS.SDO_GEOMETRY".equals(sqlTypeName)) + { + return ORACLE_SDO_GEOMETRY_TYPE; + } + return super.createDataType(sqlType, sqlTypeName); } } Added: trunk/src/java/org/dbunit/ext/oracle/OracleSdoGeometryDataType.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleSdoGeometryDataType.java (rev 0) +++ trunk/src/java/org/dbunit/ext/oracle/OracleSdoGeometryDataType.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -0,0 +1,475 @@ +/* + * + * The DbUnit Database Testing Framework + * Copyright (C)2002-2008, DbUnit.org + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package org.dbunit.ext.oracle; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.text.ParseException; + +import oracle.sql.STRUCT; +import oracle.sql.StructDescriptor; + +import org.dbunit.dataset.datatype.AbstractDataType; +import org.dbunit.dataset.datatype.TypeCastException; +import org.dbunit.dataset.ITable; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * This class implements DataType for Oracle SDO_GEOMETRY type used in Oracle Spatial. + * See the Oracle Spatial Developer's Guide for details on SDO_GEOMETRY. This class + * handles values similar to: + * <ul> + * <li>SDO_GEOMETRY(NULL, NULL, NULL, NULL, NULL)</li> + * <li>NULL</li> + * <li>SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(71.2988, 42.8052, NULL), NULL, NULL)</li> + * <li>SDO_GEOMETRY(3302, NULL, SDO_POINT_TYPE(96.8233, 32.5261, NULL), SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(2, 2, 0, 2, 4, 2, 8, 4, 8, 12, 4, 12, 12, 10, NULL, 8, 10, 22, 5, 14, 27))</li> + * </ul> + * + * <p> + * For more information on oracle spatial support go to http://tahiti.oracle.com + * and search for "spatial". The developers guide is available at + * http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/toc.htm + * </p> + * + * <p> + * example table: + * <code> + * CREATE TABLE cola_markets ( + * mkt_id NUMBER PRIMARY KEY, + * name VARCHAR2(32), + * shape SDO_GEOMETRY); + * </code> + * </p> + * + * <p> + * example insert: + * <code> + * INSERT INTO cola_markets VALUES( + * 2, + * 'cola_b', + * SDO_GEOMETRY( + * 2003, -- two-dimensional polygon + * NULL, + * NULL, + * SDO_ELEM_INFO_ARRAY(1,1003,1), -- one polygon (exterior polygon ring) + * SDO_ORDINATE_ARRAY(5,1, 8,1, 8,6, 5,7, 5,1) + * ) + * ); + * </code> + * </p> + * + * @author cl...@e-... + * @author Last changed by: $Author$ + * @version $Revision$ $Date$ + * @since <dbunit-version> + */ +public class OracleSdoGeometryDataType extends AbstractDataType +{ + /** + * Logger for this class + */ + private static final Logger logger = LoggerFactory.getLogger(OracleSdoGeometryDataType.class); + + private static final String NULL = "NULL"; + private static final String SDO_GEOMETRY = "SDO_GEOMETRY"; + private static final String SDO_POINT_TYPE = "SDO_POINT_TYPE"; + private static final String SDO_ELEM_INFO_ARRAY = "SDO_ELEM_INFO_ARRAY"; + private static final String SDO_ORDINATE_ARRAY = "SDO_ORDINATE_ARRAY"; + + OracleSdoGeometryDataType () + { + super(SDO_GEOMETRY, Types.STRUCT, java.sql.Struct.class, false); + } + + public Object typeCast(Object value) throws TypeCastException + { + return typeCast(value, null); + } + + /** + * This method parses out a list of numbers similar to: + * <ul> + * <li> + * SDO_ORDINATE_ARRAY(2, 2, 0, 2, 4, 2, 8, 4, 8, 12, 4, 12, 12, 10, NULL, 8) + * </li> + * <li> + * SDO_POINT_TYPE(96.8233, 32.5261, NULL) + * </li> + * </ul> + * + * @param input input string to parse (may be null) + * @param name name of array (ex: SDO_ORDINATE_ARRAY) + * @return array of parsed numbers some of which may be null + */ + private BigDecimal [] parseNumbers(String input, String name) throws ParseException + { + logger.debug("parseNumbers(input={}, name={}) - start", input, name); + if (input == null) + { + return null; + } + + int workIndex = 0; + if (name != null) + { + if (! input.startsWith(name)) + { + throw new ParseException("missing " + name, workIndex); + } + workIndex += name.length(); + } + + if (workIndex+1 >= input.length() || input.charAt(workIndex) != '(') + { + throw new ParseException("missing (", workIndex); + } + if (input.charAt(input.length() - 1) != ')') + { + throw new ParseException("missing )", input.length() - 1); + } + String [] numberStrings = input.substring(workIndex + 1, input.length() - 1).split(","); + if (numberStrings == null) + { + return null; + } + BigDecimal returnVal [] = new BigDecimal[numberStrings.length]; + for (int index=0; index<numberStrings.length; index++) + { + String valToParse = numberStrings[index].trim(); + logger.debug("parsing {} as BigDecimal", valToParse); + if (NULL.equals(valToParse)) + { + returnVal[index] = null; + } + else + { + returnVal[index] = new BigDecimal(valToParse); + } + } + + return returnVal; + } + + /** + * This method performs a typeCast using a jdbc connection. The connection is required + * for working with oracle STRUCTs. + * + */ + public Object typeCast(Object value, Connection connection) throws TypeCastException + { + logger.debug("typeCast(value={}) - start", value); + + if (value == null || value == ITable.NO_VALUE) + { + return null; + } + + if (value instanceof java.sql.Struct) + { + return value; + } + + if (value instanceof String) + { + // attempt to parse the SDO_GEOMETRY + if (connection == null) + { + throw new TypeCastException(value, this); + } + + try + { + String upperVal = ((String) value).toUpperCase(); + if (NULL.equals(upperVal)) + { + return null; + } + + if (! (upperVal.startsWith(SDO_GEOMETRY + "(") && upperVal.endsWith(")"))) + { + throw new TypeCastException(value, this); + } + + String workingVal = upperVal.substring( + (SDO_GEOMETRY + "(").length(), upperVal.length() - 1); + int workingIndex = 0; + + // parse out SDO_GTYPE + int commaIndex = workingVal.indexOf(",", workingIndex); + if (commaIndex == -1 || commaIndex == workingIndex || + commaIndex+1 == workingVal.length()) + { + throw new TypeCastException(value, this); + } + String gtypeString = workingVal.substring(workingIndex, commaIndex).trim(); + Integer gtype = NULL.equals(gtypeString) ? null : new Integer(gtypeString); + workingIndex = commaIndex + 1; + + // parse out SDO_SRID + commaIndex = workingVal.indexOf(",", workingIndex); + if (commaIndex == -1 || commaIndex == workingIndex || + commaIndex+1 == workingVal.length()) + { + throw new TypeCastException(value, this); + } + String sridString = workingVal.substring(workingIndex, commaIndex).trim(); + Integer srid = NULL.equals(sridString) ? null : new Integer(sridString); + workingIndex = commaIndex + 1; + + // parse out SDO_POINT + workingVal = workingVal.substring(workingIndex).trim(); + workingIndex = 0; + + BigDecimal pointValues []; + if (workingVal.startsWith(NULL)) + { + pointValues = null; + } + else + { + int closingParenIndex = workingVal.indexOf(")", workingIndex); + if (closingParenIndex == -1) + { + throw new TypeCastException(value, this); + } + pointValues = parseNumbers(workingVal.substring( + workingIndex, closingParenIndex + 1), SDO_POINT_TYPE); + workingIndex = closingParenIndex + 1; + } + + + // eat the comma + commaIndex = workingVal.indexOf(",", workingIndex); + if (commaIndex == -1 || commaIndex+1 == workingVal.length()) + { + throw new TypeCastException(value, this); + } + workingVal = workingVal.substring(commaIndex + 1).trim(); + workingIndex = 0; + + + BigDecimal elemInfos []; + if (workingVal.startsWith(NULL)) + { + elemInfos = null; + } + else + { + int closingParenIndex = workingVal.indexOf(")", workingIndex); + if (closingParenIndex == -1) + { + throw new TypeCastException(value, this); + } + elemInfos = parseNumbers(workingVal.substring( + workingIndex, closingParenIndex + 1), SDO_ELEM_INFO_ARRAY); + workingIndex = closingParenIndex + 1; + } + + // eat the comma + commaIndex = workingVal.indexOf(",", workingIndex); + if (commaIndex == -1 || commaIndex+1 == workingVal.length()) + { + throw new TypeCastException(value, this); + } + workingVal = workingVal.substring(commaIndex + 1).trim(); + workingIndex = 0; + + BigDecimal ordinates []; + if (workingVal.startsWith(NULL)) + { + ordinates = null; + } + else + { + int closingParenIndex = workingVal.indexOf(")", workingIndex); + if (closingParenIndex == -1) + { + throw new TypeCastException(value, this); + } + ordinates = parseNumbers(workingVal.substring( + workingIndex, closingParenIndex + 1), SDO_ORDINATE_ARRAY); + workingIndex = closingParenIndex + 1; + } + + + // Now package it all up in an oracle STRUCT object + + // SDO_POINT_TYPE + STRUCT pointStruct; + if (pointValues == null) + { + pointStruct = null; + } + else + { + // SDO_POINT_TYPE has x,y,z coordinates + if (pointValues.length != 3) + { + throw new TypeCastException(value, this); + } + StructDescriptor pointDescriptor = StructDescriptor.createDescriptor(SDO_POINT_TYPE, connection); + Object [] pointAttributes = new Object [] + { pointValues[0], pointValues[1], pointValues[2] }; + pointStruct = new STRUCT(pointDescriptor, connection, pointAttributes); + } + + // SDO_GEOMETRY + StructDescriptor geometryDescriptor = StructDescriptor.createDescriptor(SDO_GEOMETRY, connection); + Object [] geometryAttributes = new Object [] + { gtype, srid, pointStruct, elemInfos, ordinates }; + STRUCT geometryStruct = new STRUCT(geometryDescriptor, connection, geometryAttributes); + + return geometryStruct; + } + catch (ParseException e) + { + throw new TypeCastException(value, this, e); + } + catch (SQLException e) + { + throw new TypeCastException(value, this, e); + } + } + + throw new TypeCastException(value, this); + } + + + protected void appendNamedArray(StringBuffer buf, String name, + java.sql.Array array) throws SQLException + { + if (array == null) + { + buf.append(NULL); + } + else + { + buf.append(name); + buf.append("("); + Object elements [] = (Object[]) array.getArray(); + for (int index=0; index<elements.length; index++) + { + buf.append(elements[index] == null ? NULL : elements[index]); + if (index+1 != elements.length) + { + buf.append(", "); + } + } + buf.append(")"); + } + } + + public Object getSqlValue(int column, ResultSet resultSet) + throws SQLException, TypeCastException + { + if(logger.isDebugEnabled()) + logger.debug("getSqlValue(column={}, resultSet={}) - start", + new Integer(column), resultSet); + + Object data = null; + try + { + data = resultSet.getObject(column); + + if (data != null) + { + if (! (data instanceof STRUCT)) + { + throw new TypeCastException(data, this); + } + + Object attributes [] = ((STRUCT) data).getAttributes(); + + // build out a string representing the SDO_GEOMETRY + StringBuffer buf = new StringBuffer(); + + Object attribute; + buf.append(SDO_GEOMETRY); + buf.append("("); + attribute = attributes[0]; + buf.append(attribute == null ? NULL : attribute); + buf.append(", "); + attribute = attributes[1]; + buf.append(attribute == null ? NULL : attribute); + buf.append(", "); + attribute = attributes[2]; + if (attribute == null) + { + buf.append(NULL); + } + else + { + buf.append(SDO_POINT_TYPE); + buf.append("("); + Object [] pointAttributes = ((STRUCT) attribute).getAttributes(); + buf.append(pointAttributes[0] == null ? NULL : pointAttributes[0]); + buf.append(", "); + buf.append(pointAttributes[1] == null ? NULL : pointAttributes[1]); + buf.append(", "); + buf.append(pointAttributes[2] == null ? NULL : pointAttributes[2]); + buf.append(")"); + } + buf.append(", "); + + appendNamedArray(buf, SDO_ELEM_INFO_ARRAY, (java.sql.Array) attributes[3]); + buf.append(", "); + appendNamedArray(buf, SDO_ORDINATE_ARRAY, (java.sql.Array) attributes[4]); + + buf.append(")"); + + return buf.toString(); + } + else + { + // return a string instead of null so that it can be interpreted + // in typeCast. DBUnit does not handle PreparedStatement.setNull + // for user defined types. + return NULL; + } + + } + catch (SQLException e) + { + throw new TypeCastException(data, this, e); + } + } + + public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException + { + Object castValue = typeCast(value, statement.getConnection()); + if (castValue == null) + { + statement.setNull(column, Types.STRUCT, SDO_GEOMETRY); + } + else + { + statement.setObject(column, castValue, Types.STRUCT); + } + } +} Property changes on: trunk/src/java/org/dbunit/ext/oracle/OracleSdoGeometryDataType.java ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/src/sql/oracle.sql =================================================================== --- trunk/src/sql/oracle.sql 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/sql/oracle.sql 2009-10-16 01:03:36 UTC (rev 1077) @@ -56,7 +56,6 @@ TIMESTAMP_COL DATE, VARBINARY_COL RAW(255)); - ----------------------------------------------------------------------------- -- CLOB_TABLE ----------------------------------------------------------------------------- @@ -73,3 +72,13 @@ (PK NUMERIC(38, 0) NOT NULL, BLOB BLOB, PRIMARY KEY (PK)); +----------------------------------------------------------------------------- +-- SDO_GEOMETRY_TABLE +----------------------------------------------------------------------------- + +CREATE TABLE SDO_GEOMETRY_TABLE + (PK NUMERIC(38, 0) NOT NULL, + VAL SDO_GEOMETRY, + PRIMARY KEY(PK)); + + Modified: trunk/src/test/org/dbunit/Oracle10Environment.java =================================================================== --- trunk/src/test/org/dbunit/Oracle10Environment.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/Oracle10Environment.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -22,11 +22,6 @@ package org.dbunit; import org.dbunit.database.DatabaseConfig; -import org.dbunit.dataset.CompositeDataSet; -import org.dbunit.dataset.DefaultDataSet; -import org.dbunit.dataset.DefaultTable; -import org.dbunit.dataset.IDataSet; -import org.dbunit.dataset.ITable; import org.dbunit.ext.oracle.Oracle10DataTypeFactory; /** @@ -34,7 +29,7 @@ * @version $Revision$ * @since DbUnit 2.4.7 */ -public class Oracle10Environment extends DatabaseEnvironment +public class Oracle10Environment extends OracleEnvironment { public Oracle10Environment(DatabaseProfile profile) throws Exception { @@ -46,15 +41,5 @@ config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory()); } - public IDataSet getInitDataSet() throws Exception - { - ITable[] extraTables = { - new DefaultTable("CLOB_TABLE"), - new DefaultTable("BLOB_TABLE"), - }; - - return new CompositeDataSet(super.getInitDataSet(), - new DefaultDataSet(extraTables)); - } } Modified: trunk/src/test/org/dbunit/OracleEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/OracleEnvironment.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/OracleEnvironment.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -51,6 +51,7 @@ ITable[] extraTables = { new DefaultTable("CLOB_TABLE"), new DefaultTable("BLOB_TABLE"), + new DefaultTable("SDO_GEOMETRY_TABLE") }; return new CompositeDataSet(super.getInitDataSet(), Modified: trunk/src/test/org/dbunit/TestFeature.java =================================================================== --- trunk/src/test/org/dbunit/TestFeature.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/TestFeature.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -33,7 +33,8 @@ public static final TestFeature TRANSACTION = new TestFeature("TRANSACTION"); public static final TestFeature SCROLLABLE_RESULTSET = new TestFeature("SCROLLABLE_RESULTSET"); public static final TestFeature INSERT_IDENTITY = new TestFeature("INSERT_IDENTITY"); - public static final TestFeature TRUNCATE_TABLE = new TestFeature("TRUNCATE_TABLE");; + public static final TestFeature TRUNCATE_TABLE = new TestFeature("TRUNCATE_TABLE"); + public static final TestFeature SDO_GEOMETRY = new TestFeature("SDO_GEOMETRY"); private final String _name; Modified: trunk/src/test/org/dbunit/dataset/AbstractDataSetTest.java =================================================================== --- trunk/src/test/org/dbunit/dataset/AbstractDataSetTest.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/dataset/AbstractDataSetTest.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -59,8 +59,10 @@ List nameList = new ArrayList(Arrays.asList(names)); nameList.remove("BLOB_TABLE"); nameList.remove("CLOB_TABLE"); + nameList.remove("SDO_GEOMETRY_TABLE"); nameList.remove("DBUNIT.BLOB_TABLE"); nameList.remove("DBUNIT.CLOB_TABLE"); + nameList.remove("DBUNIT.SDO_GEOMETRY"); /* this table shows up on MSSQLServer. It is a user table for storing diagram information that really should be considered a system table. Modified: trunk/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java =================================================================== --- trunk/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/ext/oracle/OracleDataTypeFactoryTest.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -153,4 +153,14 @@ assertSame("type", expected, actual); } + public void testCreateSdoGeometryDataType() throws Exception + { + int sqlType = Types.STRUCT; + String sqlTypeName = "SDO_GEOMETRY"; + + DataType expected = OracleDataTypeFactory.ORACLE_SDO_GEOMETRY_TYPE; + DataType actual = createFactory().createDataType(sqlType, sqlTypeName); + assertSame("type", expected, actual); + } + } Modified: trunk/src/test/org/dbunit/operation/InsertOperationTest.java =================================================================== --- trunk/src/test/org/dbunit/operation/InsertOperationTest.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/operation/InsertOperationTest.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -45,6 +45,7 @@ import org.dbunit.dataset.NoSuchColumnException; import org.dbunit.dataset.SortedTable; import org.dbunit.dataset.datatype.DataType; +import org.dbunit.dataset.xml.FlatDtdDataSet; import org.dbunit.dataset.xml.FlatXmlDataSetBuilder; import org.dbunit.dataset.xml.XmlDataSet; @@ -373,6 +374,27 @@ } } + public void testInsertSdoGeometry() throws Exception + { + // execute this test only if the target database supports SDO_GEOMETRY + DatabaseEnvironment environment = DatabaseEnvironment.getInstance(); + if (environment.support(TestFeature.SDO_GEOMETRY)) + { + String tableName = "SDO_GEOMETRY_TABLE"; + + Reader in = new FileReader(new File("src/xml/sdoGeometryInsertTest.xml")); + IDataSet xmlDataSet = new FlatXmlDataSetBuilder().build(in); + + assertEquals("count before", 0, _connection.getRowCount(tableName)); + + DatabaseOperation.INSERT.execute(_connection, xmlDataSet); + + ITable tableAfter = _connection.createDataSet().getTable(tableName); + assertEquals("count after", 1, tableAfter.getRowCount()); + Assertion.assertEquals(xmlDataSet.getTable(tableName), tableAfter); + } + } + public void testMissingColumns() throws Exception { Reader in = new FileReader("src/xml/missingColumnTest.xml"); Modified: trunk/src/test/org/dbunit/operation/UpdateOperationTest.java =================================================================== --- trunk/src/test/org/dbunit/operation/UpdateOperationTest.java 2009-10-15 22:45:39 UTC (rev 1076) +++ trunk/src/test/org/dbunit/operation/UpdateOperationTest.java 2009-10-16 01:03:36 UTC (rev 1077) @@ -81,6 +81,14 @@ dataSet); } + if (environment.support(TestFeature.SDO_GEOMETRY)) + { + dataSet = new CompositeDataSet( + new FlatXmlDataSetBuilder().build(new File("src/xml/sdoGeometryInsertTest.xml")), + dataSet + ); + } + return dataSet; } @@ -270,6 +278,35 @@ } } + public void testUpdateSdoGeometry() throws Exception + { + // execute this test only if the target database supports SDO_GEOMETRY + DatabaseEnvironment environment = DatabaseEnvironment.getInstance(); + if (environment.support(TestFeature.SDO_GEOMETRY)) + { + String tableName = "SDO_GEOMETRY_TABLE"; + + { + IDataSet beforeDataSet = new FlatXmlDataSetBuilder().build( + new File("src/xml/sdoGeometryInsertTest.xml")); + + ITable tableBefore = _connection.createDataSet().getTable(tableName); + assertEquals("count before", 1, _connection.getRowCount(tableName)); + Assertion.assertEquals(beforeDataSet.getTable(tableName), tableBefore); + } + + IDataSet afterDataSet = new FlatXmlDataSetBuilder().build( + new File("src/xml/sdoGeometryUpdateTest.xml")); + DatabaseOperation.REFRESH.execute(_connection, afterDataSet); + + { + ITable tableAfter = _connection.createDataSet().getTable(tableName); + assertEquals("count after", 2, tableAfter.getRowCount()); + Assertion.assertEquals(afterDataSet.getTable(tableName), tableAfter); + } + } + } + public void testExecute() throws Exception { Reader in = new FileReader( Added: trunk/src/xml/sdoGeometryInsertTest.xml =================================================================== --- trunk/src/xml/sdoGeometryInsertTest.xml (rev 0) +++ trunk/src/xml/sdoGeometryInsertTest.xml 2009-10-16 01:03:36 UTC (rev 1077) @@ -0,0 +1,3 @@ +<dataset> + <SDO_GEOMETRY_TABLE PK="0" VAL="SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(71.2988, 42.8052, NULL), NULL, NULL)"/> +</dataset> \ No newline at end of file Property changes on: trunk/src/xml/sdoGeometryInsertTest.xml ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/src/xml/sdoGeometryUpdateTest.xml =================================================================== --- trunk/src/xml/sdoGeometryUpdateTest.xml (rev 0) +++ trunk/src/xml/sdoGeometryUpdateTest.xml 2009-10-16 01:03:36 UTC (rev 1077) @@ -0,0 +1,4 @@ +<dataset> + <SDO_GEOMETRY_TABLE PK="0" VAL="SDO_GEOMETRY(3302, NULL, SDO_POINT_TYPE(96.8233, 32.5261, NULL), SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(2, 2, 0, 2, 4, 2, 8, 4, 8, 12, 4, 12, 12, 10, NULL, 8, 10, 22, 5, 14, 27))"/> + <SDO_GEOMETRY_TABLE PK="1" VAL="SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(71.2988, 42.8052, NULL), NULL, NULL)"/> +</dataset> \ No newline at end of file Property changes on: trunk/src/xml/sdoGeometryUpdateTest.xml ___________________________________________________________________ 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-10-15 22:45:48
|
Revision: 1076 http://dbunit.svn.sourceforge.net/dbunit/?rev=1076&view=rev Author: jbhurst Date: 2009-10-15 22:45:39 +0000 (Thu, 15 Oct 2009) Log Message: ----------- [2876909] - Added info to change log. Modified Paths: -------------- trunk/src/changes/changes.xml Modified: trunk/src/changes/changes.xml =================================================================== --- trunk/src/changes/changes.xml 2009-10-15 21:58:24 UTC (rev 1075) +++ trunk/src/changes/changes.xml 2009-10-15 22:45:39 UTC (rev 1076) @@ -18,6 +18,7 @@ <action dev="gommma" type="fix" issue="2875262" due-to="caseylucas">Handle non-typical characters in xml encoding</action> <action dev="jbhurst" type="fix" issue="2875235" due-to="jbhurst">Fix integration tests.</action> <action dev="gommma" type="fix" issue="2880113" due-to="jherico">FK table sorting does not work with cross-schema FKs</action> + <action dev="jbhurst" type="update" issue="2876909" due-to="jbhurst">Replaced reflection-based Oracle data types with static calls.</action> </release> <release version="2.4.6" date="Sep 20, 2009" description="Bugfixes and some database specific additions"> <action dev="rlogiacco" type="add" issue="284432" due-to="JamesR">Add support for interval type on postgres</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-15 21:43:17
|
Revision: 1074 http://dbunit.svn.sourceforge.net/dbunit/?rev=1074&view=rev Author: jbhurst Date: 2009-10-15 21:43:05 +0000 (Thu, 15 Oct 2009) Log Message: ----------- [2875235] - Added some documentation about integration tests. Modified Paths: -------------- trunk/src/site/site.xml Added Paths: ----------- trunk/src/site/apt/integrationtests.apt Added: trunk/src/site/apt/integrationtests.apt =================================================================== --- trunk/src/site/apt/integrationtests.apt (rev 0) +++ trunk/src/site/apt/integrationtests.apt 2009-10-15 21:43:05 UTC (rev 1074) @@ -0,0 +1,109 @@ + --- +Running DbUnit Integration Tests + --- +John Hurst + --- +13 October 2009 + +Overview + + DbUnit includes a comprehensive test suite. + Most of the tests are <<unit tests>>, and do not rely on any particular database environment. + Some of the tests are <<integration tests>>, and can test DbUnit functionality against a particular database. + + Maven profiles control which database environment is in use for a particular test run. + + The default profile runs the tests using an HSQLDB in-memory database, which does not require a database server. + + Other profiles run against server-based database products. + + For example, to run the tests using the DbUnit Oracle10DataTypeFactory and the Oracle 10 JDBC driver for JDK 1.4, + use this command: + +--- +mvn clean test -Poracle10-ojdbc14 +--- + + List all profiles using this command: + +--- +mvn help:all-profiles +--- + +Database Properties + + Each database is configured by properties and dependencies. + The properties relate to standard JDBC connection parameters, + and the dependencies cover the database-specific JDBC driver. + + The properties include: + + * dbunit.profile - the name of the database environment + + * dbunit.profile.driverClass - JDBC driver class + + * dbunit.profile.url - JDBC connection URL + + * dbunit.profile.schema - database schema (may be case-sensitive) + + * dbunit.profile.user - database connection user name + + * dbunit.profile.password - database connection password + + * dbunit.profile.unsupportedFeatures - comma-separated list of features not to test + + [] + + These properties are all configured with defaults per test profile. + You can override these defaults in ~/.m2/settings.xml: + +--- +<settings> + <profiles> + <profile> + <id>oracle-ojdbc14</id> + <properties> + <dbunit.profile.url>jdbc:oracle:thin:@myhost:1521:mysid</dbunit.profile.url> + </properties> + </profile> + </profiles> +</settings> +--- + +Setting up for HSQLDB Integration Tests + + Nothing is required. + + Run the full test suite, including integration tests, with this command: + +--- +mvn clean test +--- + +Setting up for Oracle Integration Tests + + [[1]] Install Oracle database. This can be on your local machine, or you can use any Oracle database you have access to. + + [[2]] Create a "dbunit" user with password "dbunit". + + These are the defaults configured in the project. + If you use different values, you will need to override the properties in your settings.xml. + + [[3]] Log in to your dbunit schema and run src/sql/oracle.sql. + + [] + + This should create the DbUnit test schema in your Oracle database. + You are now ready to run tests. + + Run the full test suite, including integration tests, with one of these commands: + +--- +mvn clean test -Poracle-ojdbc14 +mvn clean test -Poracle-ojdbc6 +mvn clean test -Poracle10-ojdbc14 +mvn clean test -Poracle10-ojdbc6 +--- + +TODO: Other databases. + Modified: trunk/src/site/site.xml =================================================================== --- trunk/src/site/site.xml 2009-10-15 21:37:07 UTC (rev 1073) +++ trunk/src/site/site.xml 2009-10-15 21:43:05 UTC (rev 1074) @@ -20,7 +20,7 @@ <skin> <groupId>org.apache.maven.skins</groupId> - <!-- + <!-- The choices are maven-application-skin maven-classic-skin @@ -49,32 +49,33 @@ </links> <menu name="Quick Links"> - <item name="Maven 1.x Plugin" href="http://maven-plugins.sourceforge.net/maven-dbunit-plugin/index.html"/> - <item name="Maven 2 Plugin" href="http://mojo.codehaus.org/dbunit-maven-plugin/"/> - <item name="Download" href="http://sourceforge.net/project/showfiles.php?group_id=47439"/> - <item name="Changes" href="/changes-report.html"/> - <item name="FAQ" href="/faq.html"/> - <item name="Wiki" href="http://dbunit.wikidot.com/"/> - <item name="Get Support" href="http://sourceforge.net/support/getsupport.php?group_id=47439"/> - <item name="Get source" href="/source-repository.html"/> - <item name="Browse source" href="/xref/index.html"/> - <item name="JavaDocs" href="/apidocs/index.html"/> - <item name="DBUnit AT ohloh" href="http://www.ohloh.net/p/dbunit"/> + <item name="Maven 1.x Plugin" href="http://maven-plugins.sourceforge.net/maven-dbunit-plugin/index.html"/> + <item name="Maven 2 Plugin" href="http://mojo.codehaus.org/dbunit-maven-plugin/"/> + <item name="Download" href="http://sourceforge.net/project/showfiles.php?group_id=47439"/> + <item name="Changes" href="/changes-report.html"/> + <item name="FAQ" href="/faq.html"/> + <item name="Wiki" href="http://dbunit.wikidot.com/"/> + <item name="Get Support" href="http://sourceforge.net/support/getsupport.php?group_id=47439"/> + <item name="Get source" href="/source-repository.html"/> + <item name="Browse source" href="/xref/index.html"/> + <item name="JavaDocs" href="/apidocs/index.html"/> + <item name="DBUnit AT ohloh" href="http://www.ohloh.net/p/dbunit"/> </menu> <menu name="Overview"> - <item name="About DbUnit" href="/index.html"/> - <item name="Database Testing" href="/intro.html"/> - <item name="Getting Started" href="/howto.html"/> - <item name="Best Practices" href="/bestpractices.html"/> - <item name="Core Components" href="/components.html"/> - <item name="Properties" href="/properties.html"/> - <item name="Ant Task" href="/anttask.html"/> - <item name="Migration Guide" href="/migration.html"/> - <item name="Building DbUnit" href="/building.html"/> - <item name="Developers Guide" href="/devguide.html"/> - <item name="Resources" href="/resources.html"/> - <item name="Credits" href="/credits.html"/> + <item name="About DbUnit" href="/index.html"/> + <item name="Database Testing" href="/intro.html"/> + <item name="Getting Started" href="/howto.html"/> + <item name="Best Practices" href="/bestpractices.html"/> + <item name="Core Components" href="/components.html"/> + <item name="Properties" href="/properties.html"/> + <item name="Ant Task" href="/anttask.html"/> + <item name="Migration Guide" href="/migration.html"/> + <item name="Building DbUnit" href="/building.html"/> + <item name="Developers Guide" href="/devguide.html"/> + <item name="Integration Tests" href="/integrationtests.html"/> + <item name="Resources" href="/resources.html"/> + <item name="Credits" href="/credits.html"/> </menu> <menu ref="parent"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-15 21:37:28
|
Revision: 1073 http://dbunit.svn.sourceforge.net/dbunit/?rev=1073&view=rev Author: jbhurst Date: 2009-10-15 21:37:07 +0000 (Thu, 15 Oct 2009) Log Message: ----------- [2875235] - Simplified pom/properties for integration tests. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-12 17:46:45 UTC (rev 1072) +++ trunk/pom.xml 2009-10-15 21:37:07 UTC (rev 1073) @@ -21,66 +21,6 @@ <properties> <compileSource>1.4</compileSource> <checkstyle.excludes>org/dbunit/util/concurrent/*.java</checkstyle.excludes> - - <dbunit.profile>hsqldb</dbunit.profile> - - <dbunit.profile.hsqldb.driverClass>org.hsqldb.jdbcDriver</dbunit.profile.hsqldb.driverClass> - <dbunit.profile.hsqldb.url>jdbc:hsqldb:mem:.</dbunit.profile.hsqldb.url> - <dbunit.profile.hsqldb.schema>PUBLIC</dbunit.profile.hsqldb.schema> - <dbunit.profile.hsqldb.user>sa</dbunit.profile.hsqldb.user> - <dbunit.profile.hsqldb.password></dbunit.profile.hsqldb.password> - <dbunit.profile.hsqldb.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</dbunit.profile.hsqldb.unsupportedFeatures> - - <dbunit.profile.oracle.driverClass>oracle.jdbc.driver.OracleDriver</dbunit.profile.oracle.driverClass> - <dbunit.profile.oracle.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.oracle.url> - <dbunit.profile.oracle.schema>DBUNIT</dbunit.profile.oracle.schema> - <dbunit.profile.oracle.user>dbunit</dbunit.profile.oracle.user> - <dbunit.profile.oracle.password>dbunit</dbunit.profile.oracle.password> - <dbunit.profile.oracle.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.oracle.unsupportedFeatures> - - <dbunit.profile.oracle10.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.oracle10.driverClass> - - <dbunit.profile.postgresql.driverClass>TODO</dbunit.profile.postgresql.driverClass> - <dbunit.profile.postgresql.url>TODO</dbunit.profile.postgresql.url> - <dbunit.profile.postgresql.schema>TODO</dbunit.profile.postgresql.schema> - <dbunit.profile.postgresql.user>TODO</dbunit.profile.postgresql.user> - <dbunit.profile.postgresql.password>TODO</dbunit.profile.postgresql.password> - <dbunit.profile.postgresql.unsupportedFeatures>TODO</dbunit.profile.postgresql.unsupportedFeatures> - - <dbunit.profile.mysql.driverClass>com.mysql.jdbc.Driver</dbunit.profile.mysql.driverClass> - <dbunit.profile.mysql.url>jdbc:mysql://localhost:3306/dbunit</dbunit.profile.mysql.url> - <dbunit.profile.mysql.schema>DBUNIT</dbunit.profile.mysql.schema> - <dbunit.profile.mysql.user>dbunit</dbunit.profile.mysql.user> - <dbunit.profile.mysql.password>dbunit</dbunit.profile.mysql.password> - <dbunit.profile.mysql.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</dbunit.profile.mysql.unsupportedFeatures> - - <dbunit.profile.mssql.driverClass>com.microsoft.jdbc.sqlserver.SQLServerDriver</dbunit.profile.mssql.driverClass> - <dbunit.profile.mssql.url>jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor</dbunit.profile.mssql.url> - <dbunit.profile.mssql.schema>dbo</dbunit.profile.mssql.schema> - <dbunit.profile.mssql.user>dbunit</dbunit.profile.mssql.user> - <dbunit.profile.mssql.password>dbunit</dbunit.profile.mssql.password> - <dbunit.profile.mssql.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</dbunit.profile.mssql.unsupportedFeatures> - - <dbunit.profile.db2.driverClass>TODO</dbunit.profile.db2.driverClass> - <dbunit.profile.db2.url>TODO</dbunit.profile.db2.url> - <dbunit.profile.db2.schema>TODO</dbunit.profile.db2.schema> - <dbunit.profile.db2.user>TODO</dbunit.profile.db2.user> - <dbunit.profile.db2.password>TODO</dbunit.profile.db2.password> - <dbunit.profile.db2.unsupportedFeatures>TODO</dbunit.profile.db2.unsupportedFeatures> - - <dbunit.profile.derby.driverClass>org.apache.derby.jdbc.EmbeddedDriver</dbunit.profile.derby.driverClass> - <dbunit.profile.derby.url>jdbc\:derby\:target\/derby_db;create\=true</dbunit.profile.derby.url> - <dbunit.profile.derby.schema>APP</dbunit.profile.derby.schema> - <dbunit.profile.derby.user>APP</dbunit.profile.derby.user> - <dbunit.profile.derby.password>APP</dbunit.profile.derby.password> - <dbunit.profile.derby.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</dbunit.profile.derby.unsupportedFeatures> - - <dbunit.profile.h2.driverClass>TODO</dbunit.profile.h2.driverClass> - <dbunit.profile.h2.url>TODO</dbunit.profile.h2.url> - <dbunit.profile.h2.schema>TODO</dbunit.profile.h2.schema> - <dbunit.profile.h2.user>TODO</dbunit.profile.h2.user> - <dbunit.profile.h2.password>TODO</dbunit.profile.h2.password> - <dbunit.profile.h2.unsupportedFeatures>TODO</dbunit.profile.h2.unsupportedFeatures> </properties> <scm> @@ -661,48 +601,25 @@ </activation> <properties> <dbunit.profile>hsqldb</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.hsqldb.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.hsqldb.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.hsqldb.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.hsqldb.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.hsqldb.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.hsqldb.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>org.hsqldb.jdbcDriver</dbunit.profile.driverClass> + <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.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</dbunit.profile.unsupportedFeatures> </properties> </profile> - <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 8 JDBC driver for Java 1.2 --> - <!-- Doesn't work. - <profile> - <id>oracle-classes12</id> - <properties> - <dbunit.profile>oracle</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> - </properties> - <dependencies> - <dependency> - <groupId>com.oracle</groupId> - <artifactId>classes12</artifactId> - <version>8.1.7.1</version> - <optional>true</optional> - </dependency> - </dependencies> - </profile> - --> <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 --> <profile> <id>oracle-ojdbc14</id> <properties> <dbunit.profile>oracle</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.url> + <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -718,12 +635,12 @@ <id>oracle-ojdbc6</id> <properties> <dbunit.profile>oracle</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.url> + <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -739,12 +656,12 @@ <id>oracle10-ojdbc14</id> <properties> <dbunit.profile>oracle10</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.oracle10.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.url> + <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -760,12 +677,12 @@ <id>oracle10-ojdbc6</id> <properties> <dbunit.profile>oracle10</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.oracle10.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.url> + <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -780,48 +697,48 @@ <id>mysql</id> <properties> <dbunit.profile>mysql</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.mysql.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.mysql.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.mysql.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.mysql.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.mysql.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.mysql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>com.mysql.jdbc.Driver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:mysql://localhost:3306/dbunit</dbunit.profile.url> + <dbunit.profile.schema>DBUNIT</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>mssql</id> <properties> <dbunit.profile>mssql</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.mssql.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.mssql.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.mssql.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.mssql.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.mssql.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.mssql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <dbunit.profile.driverClass>com.microsoft.jdbc.sqlserver.SQLServerDriver</dbunit.profile.driverClass> + <dbunit.profile.url>jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor</dbunit.profile.url> + <dbunit.profile.schema>dbo</dbunit.profile.schema> + <dbunit.profile.user>dbunit</dbunit.profile.user> + <dbunit.profile.password>dbunit</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>db2</id> <properties> <dbunit.profile>db2</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.db2.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.db2.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.db2.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.db2.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.db2.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.db2.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <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> </properties> </profile> <profile> <id>derby</id> <properties> <dbunit.profile>derby</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.derby.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.derby.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.derby.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.derby.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.derby.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.derby.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <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.schema>APP</dbunit.profile.schema> + <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</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -836,24 +753,24 @@ <id>postgresql</id> <properties> <dbunit.profile>postgresql</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.postgresql.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.postgresql.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.postgresql.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.postgresql.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.postgresql.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.postgresql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <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> </properties> </profile> <profile> <id>h2</id> <properties> <dbunit.profile>h2</dbunit.profile> - <dbunit.profile.driverClass>${dbunit.profile.h2.driverClass}</dbunit.profile.driverClass> - <dbunit.profile.url>${dbunit.profile.h2.url}</dbunit.profile.url> - <dbunit.profile.schema>${dbunit.profile.h2.schema}</dbunit.profile.schema> - <dbunit.profile.user>${dbunit.profile.h2.user}</dbunit.profile.user> - <dbunit.profile.password>${dbunit.profile.h2.password}</dbunit.profile.password> - <dbunit.profile.unsupportedFeatures>${dbunit.profile.h2.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + <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> </properties> </profile> </profiles> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-12 17:47:21
|
Revision: 1072 http://dbunit.svn.sourceforge.net/dbunit/?rev=1072&view=rev Author: jbhurst Date: 2009-10-12 17:46:45 +0000 (Mon, 12 Oct 2009) Log Message: ----------- [2876909] - Replaced reflection-based Oracle data types with static calls. Modified Paths: -------------- trunk/pom.xml trunk/src/java/org/dbunit/ext/oracle/OracleBlobDataType.java trunk/src/java/org/dbunit/ext/oracle/OracleClobDataType.java trunk/src/java/org/dbunit/ext/oracle/OracleNClobDataType.java trunk/src/java/org/dbunit/ext/oracle/OracleXMLTypeDataType.java trunk/src/site/apt/building.apt Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/pom.xml 2009-10-12 17:46:45 UTC (rev 1072) @@ -336,12 +336,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>com.oracle</groupId> - <artifactId>ojdbc14</artifactId> - <version>10.2.0.4.0</version> - <optional>true</optional> - </dependency> - <dependency> <groupId>gsbase</groupId> <artifactId>gsbase</artifactId> <version>2.0.1</version> @@ -647,6 +641,20 @@ </reporting> </profile> <profile> + <id>oracle-default</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <dependencies> + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc14</artifactId> + <version>10.2.0.4.0</version> + <optional>true</optional> + </dependency> + </dependencies> + </profile> + <profile> <id>hsqldb</id> <activation> <activeByDefault>true</activeByDefault> @@ -662,6 +670,7 @@ </properties> </profile> <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 8 JDBC driver for Java 1.2 --> + <!-- Doesn't work. <profile> <id>oracle-classes12</id> <properties> @@ -678,10 +687,11 @@ <groupId>com.oracle</groupId> <artifactId>classes12</artifactId> <version>8.1.7.1</version> - <scope>test</scope> + <optional>true</optional> </dependency> </dependencies> </profile> + --> <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 --> <profile> <id>oracle-ojdbc14</id> @@ -699,7 +709,7 @@ <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> - <scope>test</scope> + <optional>true</optional> </dependency> </dependencies> </profile> @@ -720,7 +730,7 @@ <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.7.0</version> - <scope>test</scope> + <optional>true</optional> </dependency> </dependencies> </profile> @@ -741,7 +751,7 @@ <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> - <scope>test</scope> + <optional>true</optional> </dependency> </dependencies> </profile> @@ -762,7 +772,7 @@ <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.7.0</version> - <scope>test</scope> + <optional>true</optional> </dependency> </dependencies> </profile> Modified: trunk/src/java/org/dbunit/ext/oracle/OracleBlobDataType.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleBlobDataType.java 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/src/java/org/dbunit/ext/oracle/OracleBlobDataType.java 2009-10-12 17:46:45 UTC (rev 1072) @@ -20,6 +20,8 @@ */ package org.dbunit.ext.oracle; +import oracle.sql.BLOB; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,8 +30,6 @@ import java.io.IOException; import java.io.OutputStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -49,13 +49,7 @@ */ private static final Logger logger = LoggerFactory.getLogger(OracleBlobDataType.class); - private static final Integer DURATION_SESSION = new Integer(1); -// private static final Integer DURATION_CALL = new Integer(2); -// private static final Integer MODE_READONLY = new Integer(0); - private static final Integer MODE_READWRITE = new Integer(1); - - public Object getSqlValue(int column, ResultSet resultSet) - throws SQLException, TypeCastException + public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { if(logger.isDebugEnabled()) logger.debug("getSqlValue(column={}, resultSet={}) - start", new Integer(column), resultSet); @@ -73,32 +67,17 @@ statement.setObject(column, getBlob(value, statement.getConnection())); } - private Object getBlob(Object value, Connection connection) - throws TypeCastException + private Object getBlob(Object value, Connection connection) throws TypeCastException { logger.debug("getBlob(value={}, connection={}) - start", value, connection); - Object tempBlob = null; + oracle.sql.BLOB tempBlob = null; try { - Class aBlobClass = super.loadClass("oracle.sql.BLOB", connection); + tempBlob = oracle.sql.BLOB.createTemporary(connection, true, oracle.sql.BLOB.DURATION_SESSION); + tempBlob.open(oracle.sql.BLOB.MODE_READWRITE); + OutputStream tempBlobOutputStream = tempBlob.getBinaryOutputStream(); - // Create new temporary Blob - Method createTemporaryMethod = aBlobClass.getMethod("createTemporary", - new Class[]{Connection.class, Boolean.TYPE, Integer.TYPE}); - tempBlob = createTemporaryMethod.invoke(null, - new Object[]{connection, Boolean.TRUE, DURATION_SESSION}); - - // Open the temporary Blob in readwrite mode to enable writing - Method openMethod = aBlobClass.getMethod("open", new Class[]{Integer.TYPE}); - openMethod.invoke(tempBlob, new Object[]{MODE_READWRITE}); - - // Get the output stream to write - Method getOutputStreamMethod = tempBlob.getClass().getMethod( - "getBinaryOutputStream", new Class[0]); - OutputStream tempBlobOutputStream = (OutputStream)getOutputStreamMethod.invoke( - tempBlob, new Object[0]); - // Write the data into the temporary BLOB tempBlobOutputStream.write((byte[])typeCast(value)); @@ -107,41 +86,26 @@ tempBlobOutputStream.close(); // Close the temporary Blob - Method closeMethod = tempBlob.getClass().getMethod( - "close", new Class[0]); - closeMethod.invoke(tempBlob, new Object[0]); + tempBlob.close(); } - catch (IllegalAccessException e) + catch (SQLException e) { + // JH_TODO: shouldn't freeTemporary be called in finally {} ? + // It wasn't done like that in the original reflection-styled DbUnit code. freeTemporaryBlob(tempBlob); throw new TypeCastException(value, this, e); } - catch (NoSuchMethodException e) - { - freeTemporaryBlob(tempBlob); - throw new TypeCastException(value, this, e); - } catch (IOException e) { freeTemporaryBlob(tempBlob); throw new TypeCastException(value, this, e); } - catch (InvocationTargetException e) - { - freeTemporaryBlob(tempBlob); - throw new TypeCastException(value, this, e.getTargetException()); - } - catch (ClassNotFoundException e) - { - freeTemporaryBlob(tempBlob); - throw new TypeCastException(value, this, e); - } return tempBlob; } - private void freeTemporaryBlob(Object tempBlob) throws TypeCastException + private void freeTemporaryBlob(oracle.sql.BLOB tempBlob) throws TypeCastException { logger.debug("freeTemporaryBlob(tempBlob={}) - start", tempBlob); @@ -152,21 +116,12 @@ try { - Method freeTemporaryMethod = tempBlob.getClass().getMethod("freeTemporary", new Class[0]); - freeTemporaryMethod.invoke(tempBlob, new Object[0]); + tempBlob.freeTemporary(); } - catch (NoSuchMethodException e) + catch (SQLException e) { throw new TypeCastException("Error freeing Oracle BLOB", e); } - catch (IllegalAccessException e) - { - throw new TypeCastException("Error freeing Oracle BLOB", e); - } - catch (InvocationTargetException e) - { - throw new TypeCastException("Error freeing Oracle BLOB", e.getTargetException()); - } } } Modified: trunk/src/java/org/dbunit/ext/oracle/OracleClobDataType.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleClobDataType.java 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/src/java/org/dbunit/ext/oracle/OracleClobDataType.java 2009-10-12 17:46:45 UTC (rev 1072) @@ -28,8 +28,6 @@ import java.io.IOException; import java.io.Writer; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -49,11 +47,6 @@ */ private static final Logger logger = LoggerFactory.getLogger(OracleClobDataType.class); - private static final Integer DURATION_SESSION = new Integer(1); -// private static final Integer DURATION_CALL = new Integer(2); -// private static final Integer MODE_READONLY = new Integer(0); - private static final Integer MODE_READWRITE = new Integer(1); - public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { @@ -73,32 +66,17 @@ statement.setObject(column, getClob(value, statement.getConnection())); } - protected Object getClob(Object value, Connection connection) - throws TypeCastException + protected Object getClob(Object value, Connection connection) throws TypeCastException { logger.debug("getClob(value={}, connection={}) - start", value, connection); - Object tempClob = null; + oracle.sql.CLOB tempClob = null; try { - Class aClobClass = super.loadClass("oracle.sql.CLOB", connection); - - // Create new temporary CLOB - Method createTemporaryMethod = aClobClass.getMethod("createTemporary", - new Class[]{Connection.class, Boolean.TYPE, Integer.TYPE}); - tempClob = createTemporaryMethod.invoke(null, - new Object[]{connection, Boolean.TRUE, DURATION_SESSION}); + tempClob = oracle.sql.CLOB.createTemporary(connection, true, oracle.sql.CLOB.DURATION_SESSION); + tempClob.open(oracle.sql.CLOB.MODE_READWRITE); + Writer tempClobWriter = tempClob.getCharacterOutputStream(); - // Open the temporary CLOB in readwrite mode to enable writing - Method openMethod = aClobClass.getMethod("open", new Class[]{Integer.TYPE}); - openMethod.invoke(tempClob, new Object[]{MODE_READWRITE}); - - // Get the output stream to write - Method getCharacterOutputStreamMethod = tempClob.getClass().getMethod( - "getCharacterOutputStream", new Class[0]); - Writer tempClobWriter = (Writer)getCharacterOutputStreamMethod.invoke( - tempClob, new Object[0]); - // Write the data into the temporary CLOB tempClobWriter.write((String)typeCast(value)); @@ -107,33 +85,18 @@ tempClobWriter.close(); // Close the temporary CLOB - Method closeMethod = tempClob.getClass().getMethod( - "close", new Class[0]); - closeMethod.invoke(tempClob, new Object[0]); + tempClob.close(); } - catch (IllegalAccessException e) - { - freeTemporaryClob(tempClob); - throw new TypeCastException(value, this, e); - } - catch (NoSuchMethodException e) - { - freeTemporaryClob(tempClob); - throw new TypeCastException(value, this, e); - } catch (IOException e) { + // JH_TODO: shouldn't freeTemporary be called in finally {} ? + // It wasn't done like that in the original reflection-styled DbUnit code. freeTemporaryClob(tempClob); throw new TypeCastException(value, this, e); } - catch (InvocationTargetException e) + catch (SQLException e) { freeTemporaryClob(tempClob); - throw new TypeCastException(value, this, e.getTargetException()); - } - catch (ClassNotFoundException e) - { - freeTemporaryClob(tempClob); throw new TypeCastException(value, this, e); } @@ -141,7 +104,7 @@ } - protected void freeTemporaryClob(Object tempClob) throws TypeCastException + protected void freeTemporaryClob(oracle.sql.CLOB tempClob) throws TypeCastException { logger.debug("freeTemporaryClob(tempClob={}) - start", tempClob); @@ -152,21 +115,12 @@ try { - Method freeTemporaryMethod = tempClob.getClass().getMethod("freeTemporary", new Class[0]); - freeTemporaryMethod.invoke(tempClob, new Object[0]); + tempClob.freeTemporary(); } - catch (NoSuchMethodException e) + catch (SQLException e) { - throw new TypeCastException("Error freeing Oracle CLOB", e); + throw new TypeCastException("error freeing Oracle CLOB", e); } - catch (IllegalAccessException e) - { - throw new TypeCastException("Error freeing Oracle CLOB", e); - } - catch (InvocationTargetException e) - { - throw new TypeCastException("Error freeing Oracle CLOB", e.getTargetException()); - } } } Modified: trunk/src/java/org/dbunit/ext/oracle/OracleNClobDataType.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleNClobDataType.java 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/src/java/org/dbunit/ext/oracle/OracleNClobDataType.java 2009-10-12 17:46:45 UTC (rev 1072) @@ -20,11 +20,11 @@ */ package org.dbunit.ext.oracle; +import oracle.jdbc.OraclePreparedStatement; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -44,8 +44,6 @@ */ private static final Logger logger = LoggerFactory.getLogger(OracleNClobDataType.class); - protected static final Short FORM_NCHAR = new Short((short)2); - public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { @@ -53,29 +51,8 @@ logger.debug("setSqlValue(value={}, column={}, statement={}) - start", new Object[]{value, new Integer(column), statement} ); - try - { - Class statementClass = super.loadClass("oracle.jdbc.OraclePreparedStatement", statement.getConnection()); - Method formOfUse = statementClass.getMethod("setFormOfUse", new Class[] { Integer.TYPE, Short.TYPE }); - formOfUse.invoke(statement, new Object[] { new Integer(column), FORM_NCHAR }); - } - catch (IllegalAccessException e) - { - throw new TypeCastException(value, this, e); - } - catch (NoSuchMethodException e) - { - throw new TypeCastException(value, this, e); - } - catch (InvocationTargetException e) - { - throw new TypeCastException(value, this, e.getTargetException()); - } - catch (ClassNotFoundException e) - { - throw new TypeCastException(value, this, e); - } - + OraclePreparedStatement oraclePreparedStatement = (OraclePreparedStatement) statement; + oraclePreparedStatement.setFormOfUse(column, OraclePreparedStatement.FORM_NCHAR); statement.setObject(column, getClob(value, statement.getConnection())); } Modified: trunk/src/java/org/dbunit/ext/oracle/OracleXMLTypeDataType.java =================================================================== --- trunk/src/java/org/dbunit/ext/oracle/OracleXMLTypeDataType.java 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/src/java/org/dbunit/ext/oracle/OracleXMLTypeDataType.java 2009-10-12 17:46:45 UTC (rev 1072) @@ -20,14 +20,15 @@ */ package org.dbunit.ext.oracle; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import oracle.jdbc.OraclePreparedStatement; +import oracle.jdbc.OracleResultSet; +import oracle.sql.OPAQUE; +import oracle.sql.OpaqueDescriptor; + import org.dbunit.dataset.datatype.BlobDataType; import org.dbunit.dataset.datatype.TypeCastException; @@ -44,119 +45,23 @@ public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException { - Object data = new byte[0]; - try + byte[] data = new byte[0]; + OracleResultSet oracleResultSet = (OracleResultSet) resultSet; + OPAQUE opaque = oracleResultSet.getOPAQUE(column); + if (opaque != null) { - ClassLoader classLoader = resultSet.getClass().getClassLoader(); - // Classes - Class cOracleResultSet = super.loadClass("oracle.jdbc.OracleResultSet", classLoader); - Class cOPAQUE = super.loadClass("oracle.sql.OPAQUE", classLoader); - - // Methods - Method mGetOPAQUE = cOracleResultSet.getMethod("getOPAQUE", new Class[]{ Integer.TYPE }); - Method mGetBytes = cOPAQUE.getMethod("getBytes", null); - - // cast resultSet to an OracleResultSet -// Object ors = cOracleResultSet.cast(resultSet); // TODO activate this with java 1.5 - Object ors = resultSet; - - // call ors.getOPAQUE(column) - Object opaque = mGetOPAQUE.invoke(ors, new Object[]{ new Integer(column) }); - - // if there is any data for this column call opaque.getBytes() to get it. - if (opaque != null) - { - data = mGetBytes.invoke(opaque, null); - } + data = opaque.getBytes(); } - catch (SecurityException e) - { - throw new TypeCastException(data, this, e); - } - catch (IllegalArgumentException e) - { - throw new TypeCastException(data, this, e); - } - catch (ClassNotFoundException e) - { - throw new TypeCastException(data, this, e); - } - catch (NoSuchMethodException e) - { - throw new TypeCastException(data, this, e); - } - catch (IllegalAccessException e) - { - throw new TypeCastException(data, this, e); - } - catch (InvocationTargetException e) - { - throw new TypeCastException(data, this, e); - } // return the byte data (using typeCast to cast it to Base64 notation) - return typeCast((byte[]) data); + return typeCast(data); } public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException { - try - { - ClassLoader classLoader = statement.getClass().getClassLoader(); - // Classes - Class cOraclePreparedStatement = super.loadClass("oracle.jdbc.OraclePreparedStatement", classLoader); - Class cOpaqueDescriptor = super.loadClass("oracle.sql.OpaqueDescriptor", classLoader); - Class cOPAQUE = super.loadClass("oracle.sql.OPAQUE", classLoader); - - // Methods (inc. the constructor for the class OPAQUE) - Constructor mOPAQUEConstructor = cOPAQUE.getConstructor(new Class[]{ cOpaqueDescriptor, new byte[0].getClass(), Connection.class }); - Method mCreateDescriptor = cOpaqueDescriptor.getMethod("createDescriptor", new Class[]{ String.class, Connection.class }); - Method mSetOPAQUE = cOraclePreparedStatement.getMethod("setOPAQUE", new Class[]{ Integer.TYPE, cOPAQUE }); - - // Cast statement to OraclePreparedStatement -// Object oraclePreparedStatement = cOraclePreparedStatement.cast(statement); // TODO activate this with java 1.5 - Object oraclePreparedStatement = statement; - - // Create the OpaqueDescriptor for type SYS.XMLTYPE - Object opaqueDescriptor = mCreateDescriptor.invoke(null, new Object[]{ "SYS.XMLTYPE", statement.getConnection() }); - - // Create the OPAQUE object - Object opaque = mOPAQUEConstructor.newInstance(new Object[]{ opaqueDescriptor, typeCast(value), statement.getConnection() }); - - // call oraclePreparedStatement.setOPAQUE(column, opaque) - mSetOPAQUE.invoke(oraclePreparedStatement, new Object[]{ new Integer(column), opaque }); - } - catch (TypeCastException e) - { - throw new TypeCastException(value, this, e); - } - catch (SecurityException e) - { - throw new TypeCastException(value, this, e); - } - catch (IllegalArgumentException e) - { - throw new TypeCastException(value, this, e); - } - catch (ClassNotFoundException e) - { - throw new TypeCastException(value, this, e); - } - catch (NoSuchMethodException e) - { - throw new TypeCastException(value, this, e); - } - catch (IllegalAccessException e) - { - throw new TypeCastException(value, this, e); - } - catch (InvocationTargetException e) - { - throw new TypeCastException(value, this, e); - } - catch (InstantiationException e) - { - throw new TypeCastException(value, this, e); - } + OraclePreparedStatement oraclePreparedStatement = (OraclePreparedStatement) statement; + OpaqueDescriptor opaqueDescriptor = OpaqueDescriptor.createDescriptor("SYS.XMLTYPE", statement.getConnection()); + OPAQUE opaque = new OPAQUE(opaqueDescriptor, (byte[]) typeCast(value), statement.getConnection()); + oraclePreparedStatement.setOPAQUE(column, opaque); } } Modified: trunk/src/site/apt/building.apt =================================================================== --- trunk/src/site/apt/building.apt 2009-10-10 23:53:58 UTC (rev 1071) +++ trunk/src/site/apt/building.apt 2009-10-12 17:46:45 UTC (rev 1072) @@ -7,23 +7,61 @@ Overview - Building DbUnit is quite simple; all you need is JDK 1.4+, Subversion and Maven 2. Once you have them all, you can build DbUnit by just typing <<mvn>>! Anyway, the items below describe every step. + Building DbUnit is quite simple. You need the following software installed: + * {{{http://java.sun.com/javase}Java SE SDK 1.4+}} (Java 1.4 is required by Maven 2 as well as DbUnit) + + * {{{http://maven.apache.org}Maven 2}} + + * Oracle ojdbc14.jar (see below) + + [] + + Once you have them all, you can build DbUnit by just typing <<mvn>>! Anyway, the items below describe every step. + + If you wish to work on the latest DbUnit source code, you also may want to install a {{{http://subversion.tigris.org} Subversion}} client. + + +Installing the Oracle JDBC driver + + DbUnit includes a dependency on the Oracle JDBC driver, which is not available in a public Maven repository. + You must download the JAR manually and install it into your local Maven repository. + + <<Note:>> This dependency is required to compile DbUnit. + It is not required to run DbUnit, unless you're actually using Oracle. + + [[1]] Point your web browser to {{{http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html} http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html}}. (Or Google "Oracle JDBC download" if this link breaks.) + + [[2]] Download the Oracle Database 10g Release 2 (10.2.0.4) JDBC Driver for JDK 1.4 and 1.5 (ojdbc14.jar). + + [[3]] Install it into your Maven repository with: + +--- +mvn install:install-file \ +-Dfile=ojdbc14.jar \ +-DgroupId=com.oracle \ +-DartifactId=ojdbc14 \ +-Dversion=10.2.0.4.0 \ +-Dpackaging=jar \ +-DgeneratePom=true +--- + + (If you're using Windows, you need to put the whole command on one line, without the backslashes.) + Generating the JAR - [[1]] Install {{{http://java.sun.com/javase/}Java SE SDK}} version 1.4 or newer (Java 1.4 is required by Maven 2 as well as DbUnit) + [[1]] Install Java SE SDK 1.4+, Maven 2 and the Oracle JDBC Driver. - [[2]] Install {{{http://maven.apache.org}Maven 2}} + [[2]] Download DbUnit code, either current or released source (see <<Quick Links>> on left menu) - [[3]] Download DbUnit code, either current or released source (see <<Quick Links>> on left menu) + [[3]] On the root directory, simply type <<<mvn>>> in the command line. (If you need to clean up the binaries, run <<<mvn clean install>>> instead.) The jar file will be generated in the target directory. - [[4]] On the root directory, simply type <<<mvn>>> in the command line. (If you need to clean up the binaries, run <<<mvn clean install>>> instead.) The jar file will be generated in the target directory. - Creating the site - Run <<<mvn site:site>>> in the command line; the site will be available on <<<target/site/index.html>>>. Note that you might get an <OutOfMemoryExceptionError>; if that happens, you must increase the heap size through the <MAVEN_OPTS> variable (for instance, on Unix systems, you could run <<<MAVEN_OPTS=-mx512M mvn site:site>>>). + Run <<<mvn site:site>>> in the command line; the site will be available on <<<target/site/index.html>>>. Note that you might get an <OutOfMemoryExceptionError>; if that happens, you must increase the heap size through the <MAVEN_OPTS> variable (for instance, on Unix systems, you could run <<<MAVEN_OPTS=-mx512M mvn site:site>>>). + Using an IDE As DbUnit uses Maven, it is not necessary to store IDE-specific information in the source repository. Instead, these meta-data can be dynamically generate by Maven. @@ -50,14 +88,20 @@ Maintenance tasks - The tasks below describe how to maintain DbUnit. Some of these tasks will use <ssh> to upload files to SourceForge, so it is necessary to setup your environment to allow it (typically using <ssh-agent> - see more details on {{{http://sourceforge.net/docman/display_doc.php?docid=761&group_id=1} SourceForge}}). Also notice that in 2008 SourceForge changed the way it provides shell access, so you need to create a temporary shell for your user before using ssh (see instructions {{{http://people.apache.org/~baerrach/maven-site-plugin-2.0-beta-8-SNAPSHOT/examples/site-deploy-to-sourceforge.net.html} here}}. + The tasks below describe how to maintain DbUnit. + Some of these tasks will use <ssh> to upload files to SourceForge, + so it is necessary to setup your environment to allow it (typically using <ssh-agent> - + see more details on {{{http://sourceforge.net/docman/display_doc.php?docid=761&group_id=1} SourceForge}}). + Also notice that in 2008 SourceForge changed the way it provides shell access, + so you need to create a temporary shell for your user before using ssh + (see instructions {{{http://people.apache.org/~baerrach/maven-site-plugin-2.0-beta-8-SNAPSHOT/examples/site-deploy-to-sourceforge.net.html} here}}. 2009-09-28 TODO: The two links above are dead. This section needs to be revised. Updating the repository and site - Once new code is incorporated in the SVN code, it is necessary to update the Maven 2 repository with new snapshots, and also update the site. These 2 tasks can be done with a simple command: + Once new code is incorporated in the SVN code, it is necessary to update the Maven 2 repository with new snapshots, and also update the site. These 2 tasks can be done with a simple command: --- mvn -Pofficial clean source:jar javadoc:jar deploy site:site site:deploy @@ -73,32 +117,32 @@ mvn -Pofficial release:prepare --- - and then: + and then: --- mvn -Pofficial release:perform --- - That last command has created all necessary files for the fourth and fifth steps in the <<<target/checkout/target>>> directory. So, for the fourth step, log in to SourceForge and upload the following files: + That last command has created all necessary files for the fourth and fifth steps in the <<<target/checkout/target>>> directory. So, for the fourth step, log in to SourceForge and upload the following files: - * <dbunit-RELEASE.jar> + * <dbunit-RELEASE.jar> - * <dbunit-RELEASE-sources.jar> + * <dbunit-RELEASE-sources.jar> - * <dbunit-RELEASE-javadoc.jar> + * <dbunit-RELEASE-javadoc.jar> - [] + [] - And for the fifth step, create a {{{http://jira.codehaus.org/secure/CreateIssue.jspa?pid=10367&issuetype=3}Jira request}} and upload the <<<XXX/target/dbunit-RELEASE-bundle.jar>>>) file (see {{{http://maven.apache.org/guides/mini/guide-ibiblio-upload.html}Guide to uploading artifacts to The Central Repository}} for detailed instructions). NOTE: it is also necessary to create dbunit-RELEASE.tar.gz and dbunit-RELEASE.zip - I think Maven does that, but could not test by the time of the 2.2 release. + And for the fifth step, create a {{{http://jira.codehaus.org/secure/CreateIssue.jspa?pid=10367&issuetype=3}Jira request}} and upload the <<<XXX/target/dbunit-RELEASE-bundle.jar>>>) file (see {{{http://maven.apache.org/guides/mini/guide-ibiblio-upload.html}Guide to uploading artifacts to The Central Repository}} for detailed instructions). NOTE: it is also necessary to create dbunit-RELEASE.tar.gz and dbunit-RELEASE.zip - I think Maven does that, but could not test by the time of the 2.2 release. - The final step can also be done by Maven, using the {{{http://maven.apache.org/plugins/maven-changes-plugin/}Maven Changes Plugin}}: + The final step can also be done by Maven, using the {{{http://maven.apache.org/plugins/maven-changes-plugin/}Maven Changes Plugin}}: --- mvn changes:announcement-mail --- - Note that it is nice to change the release's introduction message first - look for the plugin's <<<introduction>>> parameter in the <<<pom.xml>>>; please change such an element before tagging the release. + Note that it is nice to change the release's introduction message first - look for the plugin's <<<introduction>>> parameter in the <<<pom.xml>>>; please change such an element before tagging the release. Fixing a bug/request - Everytime a bug is fixed (or request is implemented), it is necessary to update the <<<src/changes/changes.xml>>> file. + Every time a bug is fixed (or request is implemented), it is necessary to update the <<<src/changes/changes.xml>>> file. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 23:54:06
|
Revision: 1071 http://dbunit.svn.sourceforge.net/dbunit/?rev=1071&view=rev Author: jbhurst Date: 2009-10-10 23:53:58 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added profiles for running integration tests with Oracle10DataTypeFactory. Modified Paths: -------------- trunk/pom.xml trunk/src/test/org/dbunit/DatabaseEnvironment.java Added Paths: ----------- trunk/src/test/org/dbunit/Oracle10Environment.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 23:04:42 UTC (rev 1070) +++ trunk/pom.xml 2009-10-10 23:53:58 UTC (rev 1071) @@ -38,6 +38,8 @@ <dbunit.profile.oracle.password>dbunit</dbunit.profile.oracle.password> <dbunit.profile.oracle.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.oracle.unsupportedFeatures> + <dbunit.profile.oracle10.driverClass>oracle.jdbc.OracleDriver</dbunit.profile.oracle10.driverClass> + <dbunit.profile.postgresql.driverClass>TODO</dbunit.profile.postgresql.driverClass> <dbunit.profile.postgresql.url>TODO</dbunit.profile.postgresql.url> <dbunit.profile.postgresql.schema>TODO</dbunit.profile.postgresql.schema> @@ -722,7 +724,49 @@ </dependency> </dependencies> </profile> + <!-- "newer" Oracle10DataTypeFactory with Oracle 10 JDBC driver for Java 1.4 --> <profile> + <id>oracle10-ojdbc14</id> + <properties> + <dbunit.profile>oracle10</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.oracle10.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + </properties> + <dependencies> + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc14</artifactId> + <version>10.2.0.4.0</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + <!-- "newer" Oracle10DataTypeFactory with Oracle 11 JDBC driver for Java 6 --> + <profile> + <id>oracle10-ojdbc6</id> + <properties> + <dbunit.profile>oracle10</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.oracle10.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + </properties> + <dependencies> + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc6</artifactId> + <version>11.1.0.7.0</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + <profile> <id>mysql</id> <properties> <dbunit.profile>mysql</dbunit.profile> Modified: trunk/src/test/org/dbunit/DatabaseEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 23:04:42 UTC (rev 1070) +++ trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 23:53:58 UTC (rev 1071) @@ -61,6 +61,10 @@ { INSTANCE = new OracleEnvironment(profile); } + else if (profileName.equals("oracle10")) + { + INSTANCE = new Oracle10Environment(profile); + } else if (profileName.equals("derby")) { INSTANCE = new DerbyEnvironment(profile); Added: trunk/src/test/org/dbunit/Oracle10Environment.java =================================================================== --- trunk/src/test/org/dbunit/Oracle10Environment.java (rev 0) +++ trunk/src/test/org/dbunit/Oracle10Environment.java 2009-10-10 23:53:58 UTC (rev 1071) @@ -0,0 +1,60 @@ +/* + * + * 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.dataset.CompositeDataSet; +import org.dbunit.dataset.DefaultDataSet; +import org.dbunit.dataset.DefaultTable; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.ITable; +import org.dbunit.ext.oracle.Oracle10DataTypeFactory; + +/** + * @author John Hurst (adpated from Manuel Laflamme: OracleEnvironment) + * @version $Revision$ + * @since DbUnit 2.4.7 + */ +public class Oracle10Environment extends DatabaseEnvironment +{ + public Oracle10Environment(DatabaseProfile profile) throws Exception + { + super(profile); + } + + protected void setupDatabaseConfig(DatabaseConfig config) + { + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory()); + } + + public IDataSet getInitDataSet() throws Exception + { + ITable[] extraTables = { + new DefaultTable("CLOB_TABLE"), + new DefaultTable("BLOB_TABLE"), + }; + + return new CompositeDataSet(super.getInitDataSet(), + new DefaultDataSet(extraTables)); + } +} + Property changes on: trunk/src/test/org/dbunit/Oracle10Environment.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-10-10 23:04:50
|
Revision: 1070 http://dbunit.svn.sourceforge.net/dbunit/?rev=1070&view=rev Author: jbhurst Date: 2009-10-10 23:04:42 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added different profiles for running integration tests with different Oracle JDBC drivers: classes12.jar, ojdbc14.jar, ojdbc6.jar. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 22:25:50 UTC (rev 1069) +++ trunk/pom.xml 2009-10-10 23:04:42 UTC (rev 1070) @@ -659,8 +659,9 @@ <dbunit.profile.unsupportedFeatures>${dbunit.profile.hsqldb.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> + <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 8 JDBC driver for Java 1.2 --> <profile> - <id>oracle</id> + <id>oracle-classes12</id> <properties> <dbunit.profile>oracle</dbunit.profile> <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> @@ -672,27 +673,53 @@ </properties> <dependencies> <dependency> - <!-- - <dependency> - <groupId>com.oracle</groupId> - <artifactId>classes12</artifactId> - <version>8.1.7.1</version> - <scope>test</scope> - </dependency> - --> <groupId>com.oracle</groupId> + <artifactId>classes12</artifactId> + <version>8.1.7.1</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 10 JDBC driver for Java 1.4 --> + <profile> + <id>oracle-ojdbc14</id> + <properties> + <dbunit.profile>oracle</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + </properties> + <dependencies> + <dependency> + <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> <scope>test</scope> </dependency> - <!-- + </dependencies> + </profile> + <!-- "original" OracleDataTypeFactory (NOT 10g) with Oracle 11 JDBC driver for Java 6 --> + <profile> + <id>oracle-ojdbc6</id> + <properties> + <dbunit.profile>oracle</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> + </properties> + <dependencies> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.7.0</version> <scope>test</scope> </dependency> - --> </dependencies> </profile> <profile> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 22:25:56
|
Revision: 1069 http://dbunit.svn.sourceforge.net/dbunit/?rev=1069&view=rev Author: jbhurst Date: 2009-10-10 22:25:50 +0000 (Sat, 10 Oct 2009) Log Message: ----------- Added SlickEdit project files (.vpj, .vpw*, .vtg) to svn:ignore patterns. Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - *.log .classpath target *.ser junit*.properties .project spy.* tmp idea .settings release.properties tempdb.lck bin full.xml *.ipr *.iml *.iws + *.log .classpath target *.ser junit*.properties .project spy.* tmp idea .settings release.properties tempdb.lck bin full.xml *.ipr *.iml *.iws *.vpj *.vpw* *.vtg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 22:16:09
|
Revision: 1068 http://dbunit.svn.sourceforge.net/dbunit/?rev=1068&view=rev Author: jbhurst Date: 2009-10-10 22:16:00 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Renamed profile properties back to dbunit.profile.*, better for settings.xml etc. Modified Paths: -------------- trunk/pom.xml trunk/src/test/org/dbunit/DatabaseProfile.java trunk/src/xml/antTestBuildFile.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 21:20:11 UTC (rev 1067) +++ trunk/pom.xml 2009-10-10 22:16:00 UTC (rev 1068) @@ -22,63 +22,63 @@ <compileSource>1.4</compileSource> <checkstyle.excludes>org/dbunit/util/concurrent/*.java</checkstyle.excludes> - <database.profile>hsqldb</database.profile> + <dbunit.profile>hsqldb</dbunit.profile> - <database.hsqldb.driverClass>org.hsqldb.jdbcDriver</database.hsqldb.driverClass> - <database.hsqldb.url>jdbc:hsqldb:mem:.</database.hsqldb.url> - <database.hsqldb.schema>PUBLIC</database.hsqldb.schema> - <database.hsqldb.user>sa</database.hsqldb.user> - <database.hsqldb.password></database.hsqldb.password> - <database.hsqldb.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</database.hsqldb.unsupportedFeatures> + <dbunit.profile.hsqldb.driverClass>org.hsqldb.jdbcDriver</dbunit.profile.hsqldb.driverClass> + <dbunit.profile.hsqldb.url>jdbc:hsqldb:mem:.</dbunit.profile.hsqldb.url> + <dbunit.profile.hsqldb.schema>PUBLIC</dbunit.profile.hsqldb.schema> + <dbunit.profile.hsqldb.user>sa</dbunit.profile.hsqldb.user> + <dbunit.profile.hsqldb.password></dbunit.profile.hsqldb.password> + <dbunit.profile.hsqldb.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</dbunit.profile.hsqldb.unsupportedFeatures> - <database.oracle.driverClass>oracle.jdbc.driver.OracleDriver</database.oracle.driverClass> - <database.oracle.url>jdbc:oracle:thin:@demowin:1521:demowin</database.oracle.url> - <database.oracle.schema>DBUNIT</database.oracle.schema> - <database.oracle.user>dbunit</database.oracle.user> - <database.oracle.password>dbunit</database.oracle.password> - <database.oracle.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</database.oracle.unsupportedFeatures> + <dbunit.profile.oracle.driverClass>oracle.jdbc.driver.OracleDriver</dbunit.profile.oracle.driverClass> + <dbunit.profile.oracle.url>jdbc:oracle:thin:@demowin:1521:demowin</dbunit.profile.oracle.url> + <dbunit.profile.oracle.schema>DBUNIT</dbunit.profile.oracle.schema> + <dbunit.profile.oracle.user>dbunit</dbunit.profile.oracle.user> + <dbunit.profile.oracle.password>dbunit</dbunit.profile.oracle.password> + <dbunit.profile.oracle.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</dbunit.profile.oracle.unsupportedFeatures> - <database.postgresql.driverClass>TODO</database.postgresql.driverClass> - <database.postgresql.url>TODO</database.postgresql.url> - <database.postgresql.schema>TODO</database.postgresql.schema> - <database.postgresql.user>TODO</database.postgresql.user> - <database.postgresql.password>TODO</database.postgresql.password> - <database.postgresql.unsupportedFeatures>TODO</database.postgresql.unsupportedFeatures> + <dbunit.profile.postgresql.driverClass>TODO</dbunit.profile.postgresql.driverClass> + <dbunit.profile.postgresql.url>TODO</dbunit.profile.postgresql.url> + <dbunit.profile.postgresql.schema>TODO</dbunit.profile.postgresql.schema> + <dbunit.profile.postgresql.user>TODO</dbunit.profile.postgresql.user> + <dbunit.profile.postgresql.password>TODO</dbunit.profile.postgresql.password> + <dbunit.profile.postgresql.unsupportedFeatures>TODO</dbunit.profile.postgresql.unsupportedFeatures> - <database.mysql.driverClass>com.mysql.jdbc.Driver</database.mysql.driverClass> - <database.mysql.url>jdbc:mysql://localhost:3306/dbunit</database.mysql.url> - <database.mysql.schema>DBUNIT</database.mysql.schema> - <database.mysql.user>dbunit</database.mysql.user> - <database.mysql.password>dbunit</database.mysql.password> - <database.mysql.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</database.mysql.unsupportedFeatures> + <dbunit.profile.mysql.driverClass>com.mysql.jdbc.Driver</dbunit.profile.mysql.driverClass> + <dbunit.profile.mysql.url>jdbc:mysql://localhost:3306/dbunit</dbunit.profile.mysql.url> + <dbunit.profile.mysql.schema>DBUNIT</dbunit.profile.mysql.schema> + <dbunit.profile.mysql.user>dbunit</dbunit.profile.mysql.user> + <dbunit.profile.mysql.password>dbunit</dbunit.profile.mysql.password> + <dbunit.profile.mysql.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</dbunit.profile.mysql.unsupportedFeatures> - <database.mssql.driverClass>com.microsoft.jdbc.sqlserver.SQLServerDriver</database.mssql.driverClass> - <database.mssql.url>jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor</database.mssql.url> - <database.mssql.schema>dbo</database.mssql.schema> - <database.mssql.user>dbunit</database.mssql.user> - <database.mssql.password>dbunit</database.mssql.password> - <database.mssql.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</database.mssql.unsupportedFeatures> + <dbunit.profile.mssql.driverClass>com.microsoft.jdbc.sqlserver.SQLServerDriver</dbunit.profile.mssql.driverClass> + <dbunit.profile.mssql.url>jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor</dbunit.profile.mssql.url> + <dbunit.profile.mssql.schema>dbo</dbunit.profile.mssql.schema> + <dbunit.profile.mssql.user>dbunit</dbunit.profile.mssql.user> + <dbunit.profile.mssql.password>dbunit</dbunit.profile.mssql.password> + <dbunit.profile.mssql.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</dbunit.profile.mssql.unsupportedFeatures> - <database.db2.driverClass>TODO</database.db2.driverClass> - <database.db2.url>TODO</database.db2.url> - <database.db2.schema>TODO</database.db2.schema> - <database.db2.user>TODO</database.db2.user> - <database.db2.password>TODO</database.db2.password> - <database.db2.unsupportedFeatures>TODO</database.db2.unsupportedFeatures> + <dbunit.profile.db2.driverClass>TODO</dbunit.profile.db2.driverClass> + <dbunit.profile.db2.url>TODO</dbunit.profile.db2.url> + <dbunit.profile.db2.schema>TODO</dbunit.profile.db2.schema> + <dbunit.profile.db2.user>TODO</dbunit.profile.db2.user> + <dbunit.profile.db2.password>TODO</dbunit.profile.db2.password> + <dbunit.profile.db2.unsupportedFeatures>TODO</dbunit.profile.db2.unsupportedFeatures> - <database.derby.driverClass>org.apache.derby.jdbc.EmbeddedDriver</database.derby.driverClass> - <database.derby.url>jdbc\:derby\:target\/derby_db;create\=true</database.derby.url> - <database.derby.schema>APP</database.derby.schema> - <database.derby.user>APP</database.derby.user> - <database.derby.password>APP</database.derby.password> - <database.derby.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</database.derby.unsupportedFeatures> + <dbunit.profile.derby.driverClass>org.apache.derby.jdbc.EmbeddedDriver</dbunit.profile.derby.driverClass> + <dbunit.profile.derby.url>jdbc\:derby\:target\/derby_db;create\=true</dbunit.profile.derby.url> + <dbunit.profile.derby.schema>APP</dbunit.profile.derby.schema> + <dbunit.profile.derby.user>APP</dbunit.profile.derby.user> + <dbunit.profile.derby.password>APP</dbunit.profile.derby.password> + <dbunit.profile.derby.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</dbunit.profile.derby.unsupportedFeatures> - <database.h2.driverClass>TODO</database.h2.driverClass> - <database.h2.url>TODO</database.h2.url> - <database.h2.schema>TODO</database.h2.schema> - <database.h2.user>TODO</database.h2.user> - <database.h2.password>TODO</database.h2.password> - <database.h2.unsupportedFeatures>TODO</database.h2.unsupportedFeatures> + <dbunit.profile.h2.driverClass>TODO</dbunit.profile.h2.driverClass> + <dbunit.profile.h2.url>TODO</dbunit.profile.h2.url> + <dbunit.profile.h2.schema>TODO</dbunit.profile.h2.schema> + <dbunit.profile.h2.user>TODO</dbunit.profile.h2.user> + <dbunit.profile.h2.password>TODO</dbunit.profile.h2.password> + <dbunit.profile.h2.unsupportedFeatures>TODO</dbunit.profile.h2.unsupportedFeatures> </properties> <scm> @@ -403,32 +403,32 @@ </includes> <systemProperties> <property> - <name>database.profile</name> - <value>${database.profile}</value> + <name>dbunit.profile</name> + <value>${dbunit.profile}</value> </property> <property> - <name>database.driverClass</name> - <value>${database.driverClass}</value> + <name>dbunit.profile.driverClass</name> + <value>${dbunit.profile.driverClass}</value> </property> <property> - <name>database.url</name> - <value>${database.url}</value> + <name>dbunit.profile.url</name> + <value>${dbunit.profile.url}</value> </property> <property> - <name>database.schema</name> - <value>${database.schema}</value> + <name>dbunit.profile.schema</name> + <value>${dbunit.profile.schema}</value> </property> <property> - <name>database.user</name> - <value>${database.user}</value> + <name>dbunit.profile.user</name> + <value>${dbunit.profile.user}</value> </property> <property> - <name>database.password</name> - <value>${database.password}</value> + <name>dbunit.profile.password</name> + <value>${dbunit.profile.password}</value> </property> <property> - <name>database.unsupportedFeatures</name> - <value>${database.unsupportedFeatures}</value> + <name>dbunit.profile.unsupportedFeatures</name> + <value>${dbunit.profile.unsupportedFeatures}</value> </property> </systemProperties> </configuration> @@ -650,25 +650,25 @@ <activeByDefault>true</activeByDefault> </activation> <properties> - <database.profile>hsqldb</database.profile> - <database.driverClass>${database.hsqldb.driverClass}</database.driverClass> - <database.url>${database.hsqldb.url}</database.url> - <database.schema>${database.hsqldb.schema}</database.schema> - <database.user>${database.hsqldb.user}</database.user> - <database.password>${database.hsqldb.password}</database.password> - <database.unsupportedFeatures>${database.hsqldb.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>hsqldb</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.hsqldb.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.hsqldb.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.hsqldb.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.hsqldb.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.hsqldb.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.hsqldb.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>oracle</id> <properties> - <database.profile>oracle</database.profile> - <database.driverClass>${database.oracle.driverClass}</database.driverClass> - <database.url>${database.oracle.url}</database.url> - <database.schema>${database.oracle.schema}</database.schema> - <database.user>${database.oracle.user}</database.user> - <database.password>${database.oracle.password}</database.password> - <database.unsupportedFeatures>${database.oracle.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>oracle</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.oracle.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.oracle.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.oracle.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.oracle.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.oracle.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.oracle.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -698,49 +698,49 @@ <profile> <id>mysql</id> <properties> - <database.profile>mysql</database.profile> - <database.driverClass>${database.mysql.driverClass}</database.driverClass> - <database.url>${database.mysql.url}</database.url> - <database.schema>${database.mysql.schema}</database.schema> - <database.user>${database.mysql.user}</database.user> - <database.password>${database.mysql.password}</database.password> - <database.unsupportedFeatures>${database.mysql.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>mysql</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.mysql.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.mysql.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.mysql.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.mysql.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.mysql.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.mysql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>mssql</id> <properties> - <database.profile>mssql</database.profile> - <database.driverClass>${database.mssql.driverClass}</database.driverClass> - <database.url>${database.mssql.url}</database.url> - <database.schema>${database.mssql.schema}</database.schema> - <database.user>${database.mssql.user}</database.user> - <database.password>${database.mssql.password}</database.password> - <database.unsupportedFeatures>${database.mssql.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>mssql</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.mssql.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.mssql.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.mssql.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.mssql.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.mssql.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.mssql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>db2</id> <properties> - <database.profile>db2</database.profile> - <database.driverClass>${database.db2.driverClass}</database.driverClass> - <database.url>${database.db2.url}</database.url> - <database.schema>${database.db2.schema}</database.schema> - <database.user>${database.db2.user}</database.user> - <database.password>${database.db2.password}</database.password> - <database.unsupportedFeatures>${database.db2.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>db2</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.db2.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.db2.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.db2.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.db2.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.db2.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.db2.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>derby</id> <properties> - <database.profile>derby</database.profile> - <database.driverClass>${database.derby.driverClass}</database.driverClass> - <database.url>${database.derby.url}</database.url> - <database.schema>${database.derby.schema}</database.schema> - <database.user>${database.derby.user}</database.user> - <database.password>${database.derby.password}</database.password> - <database.unsupportedFeatures>${database.derby.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>derby</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.derby.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.derby.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.derby.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.derby.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.derby.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.derby.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> <dependencies> <dependency> @@ -754,25 +754,25 @@ <profile> <id>postgresql</id> <properties> - <database.profile>postgresql</database.profile> - <database.driverClass>${database.postgresql.driverClass}</database.driverClass> - <database.url>${database.postgresql.url}</database.url> - <database.schema>${database.postgresql.schema}</database.schema> - <database.user>${database.postgresql.user}</database.user> - <database.password>${database.postgresql.password}</database.password> - <database.unsupportedFeatures>${database.postgresql.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>postgresql</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.postgresql.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.postgresql.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.postgresql.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.postgresql.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.postgresql.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.postgresql.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> <profile> <id>h2</id> <properties> - <database.profile>h2</database.profile> - <database.driverClass>${database.h2.driverClass}</database.driverClass> - <database.url>${database.h2.url}</database.url> - <database.schema>${database.h2.schema}</database.schema> - <database.user>${database.h2.user}</database.user> - <database.password>${database.h2.password}</database.password> - <database.unsupportedFeatures>${database.h2.unsupportedFeatures}</database.unsupportedFeatures> + <dbunit.profile>h2</dbunit.profile> + <dbunit.profile.driverClass>${dbunit.profile.h2.driverClass}</dbunit.profile.driverClass> + <dbunit.profile.url>${dbunit.profile.h2.url}</dbunit.profile.url> + <dbunit.profile.schema>${dbunit.profile.h2.schema}</dbunit.profile.schema> + <dbunit.profile.user>${dbunit.profile.h2.user}</dbunit.profile.user> + <dbunit.profile.password>${dbunit.profile.h2.password}</dbunit.profile.password> + <dbunit.profile.unsupportedFeatures>${dbunit.profile.h2.unsupportedFeatures}</dbunit.profile.unsupportedFeatures> </properties> </profile> </profiles> Modified: trunk/src/test/org/dbunit/DatabaseProfile.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseProfile.java 2009-10-10 21:20:11 UTC (rev 1067) +++ trunk/src/test/org/dbunit/DatabaseProfile.java 2009-10-10 22:16:00 UTC (rev 1068) @@ -32,13 +32,13 @@ { private static final String[] EMPTY_ARRAY = new String[0]; - private static final String DATABASE_PROFILE = "database.profile"; - private static final String DATABASE_DRIVER_CLASS = "database.driverClass"; - private static final String DATABASE_URL = "database.url"; - private static final String DATABASE_SCHEMA = "database.schema"; - private static final String DATABASE_USER = "database.user"; - private static final String DATABASE_PASSWORD = "database.password"; - private static final String DATABASE_UNSUPPORTED_FEATURES = "database.unsupportedFeatures"; + private static final String DATABASE_PROFILE = "dbunit.profile"; + private static final String PROFILE_DRIVER_CLASS = "dbunit.profile.driverClass"; + private static final String PROFILE_URL = "dbunit.profile.url"; + private static final String PROFILE_SCHEMA = "dbunit.profile.schema"; + private static final String PROFILE_USER = "dbunit.profile.user"; + private static final String PROFILE_PASSWORD = "dbunit.profile.password"; + private static final String PROFILE_UNSUPPORTED_FEATURES = "dbunit.profile.unsupportedFeatures"; private final Properties _properties; @@ -59,32 +59,32 @@ public String getDriverClass() { - return _properties.getProperty(DATABASE_DRIVER_CLASS); + return _properties.getProperty(PROFILE_DRIVER_CLASS); } public String getConnectionUrl() { - return _properties.getProperty(DATABASE_URL); + return _properties.getProperty(PROFILE_URL); } public String getSchema() { - return _properties.getProperty(DATABASE_SCHEMA, null); + return _properties.getProperty(PROFILE_SCHEMA, null); } public String getUser() { - return _properties.getProperty(DATABASE_USER); + return _properties.getProperty(PROFILE_USER); } public String getPassword() { - return _properties.getProperty(DATABASE_PASSWORD); + return _properties.getProperty(PROFILE_PASSWORD); } public String[] getUnsupportedFeatures() { - String property = _properties.getProperty(DATABASE_UNSUPPORTED_FEATURES); + String property = _properties.getProperty(PROFILE_UNSUPPORTED_FEATURES); // If property is not set return an empty array if(property == null){ Modified: trunk/src/xml/antTestBuildFile.xml =================================================================== --- trunk/src/xml/antTestBuildFile.xml 2009-10-10 21:20:11 UTC (rev 1067) +++ trunk/src/xml/antTestBuildFile.xml 2009-10-10 22:16:00 UTC (rev 1068) @@ -2,12 +2,12 @@ <project name="ant-test" basedir="../../" default="all"> - <property name="database.profile" value="unknown"/> - <property name="database.driverClass" value="unknown"/> - <property name="database.url" value="unknown"/> - <property name="database.schema" value="unknown"/> - <property name="database.user" value="unknown"/> - <property name="database.password" value="unknown"/> + <property name="dbunit.profile" value="unknown"/> + <property name="dbunit.profile.driverClass" value="unknown"/> + <property name="dbunit.profile.url" value="unknown"/> + <property name="dbunit.profile.schema" value="unknown"/> + <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"/> @@ -21,151 +21,151 @@ <target name="all" depends="no-driver, no-db-url, no-userid, no-password"/> <target name="no-driver"> - <dbunit url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-db-url"> - <dbunit driver="${database.driverClass}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-userid"> - <dbunit driver="${database.driverClass}" - url="${database.url}" + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" - password="${database.password}"> + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-password"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="invalid-db-info"> - <dbunit driver="${database.driverClass}" + <dbunit driver="${dbunit.profile.driverClass}" url="jdbc:foobar://localhost/dbunittest" - userid="${database.user}" - password="${database.password}"> + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="set-format-xml"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="INSERT" src="${testDataSet}" format="xml"/> </dbunit> </target> <target name="test-type-none"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="NONE" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-update"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="UPDATE" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-refresh"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="REFRESH" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-delete"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="DELETE" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-delete-all"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="DELETE_ALL" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-mssql-insert" depends="test-type-delete-all"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="MSSQL_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-mssql-refresh"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="MSSQL_REFRESH" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-mssql-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="MSSQL_CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="invalid-type"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> <operation type="DELETE" src="${updateDataSet}"/> <operation type="RIDICULOUS" src="${testDataSet}"/> @@ -174,22 +174,22 @@ <!-- JH_TODO: I added the schema attribute, seems to be required for Oracle. Do we need to test other DBs without it? --> <target name="test-export-full" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-partial" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}"> <table name="TEST_TABLE"/> <table name="PK_TABLE"/> @@ -200,11 +200,11 @@ </target> <target name="test-export-format-flat" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat"/> <compare src="${exportDataSet}" format="flat"/> </dbunit> @@ -212,33 +212,33 @@ </target> <target name="test-export-format-flat-with-doctype" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat" doctype="dataset.dtd"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-format-flat-with-encoding" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat" encoding="ISO-8859-1"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-format-xml" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="xml"/> <compare src="${exportDataSet}" format="xml"/> </dbunit> @@ -246,11 +246,11 @@ </target> <target name="test-export-format-xml-ordered" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="xml" ordered="true" /> <compare src="${exportDataSet}" format="xml"/> </dbunit> @@ -258,22 +258,22 @@ </target> <target name="test-export-format-dtd"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDtd}" format="dtd"/> </dbunit> <delete file="${exportDtd}"/> </target> <target name="test-export-format-csv" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - schema="${database.schema}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + schema="${dbunit.profile.schema}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportCsv}" format="csv"/> <compare src="${exportCsv}" format="csv"/> </dbunit> @@ -282,10 +282,10 @@ <target name="test-export-with-queryset" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportCsv}" format="csv"> <query name="SECOND_TABLE" sql="SELECT * FROM SECOND_TABLE"/> @@ -305,10 +305,10 @@ </target> <target name="invalid-queryset"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exporDataSet}" format="flat"> <queryset id="someid" refid="someid"/> </export> @@ -325,10 +325,10 @@ sql="SELECT B.* FROM TEST_TABLE A, SECOND_TABLE B WHERE A.COLUMN0 = '@colValue@' AND B.COLUMN0 = A.COLUMN0"/> </queryset> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat"> <queryset refid="queryset-id"> <filterset> @@ -342,19 +342,19 @@ <target name="invalid-export-format"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDtd}" format="invalid"/> </dbunit> </target> <target name="test-export-query" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}"> <query name="TEST_TABLE" sql="SELECT * FROM test_table ORDER BY column0 DESC"/> <query name="PK_TABLE" sql="SELECT * FROM pk_table"/> @@ -365,10 +365,10 @@ </target> <target name="test-export-query-mixed" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}"> <table name="TEST_TABLE" /> <query name="PK_TABLE" sql="SELECT * FROM pk_table WHERE normal1='0 wor'"/> @@ -382,10 +382,10 @@ </target> <target name="test-export-and-compare-format-mismatch" depends="test-type-clean-insert"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <export dest="${exportDataSet}" format="flat"> <table name="TEST_TABLE" /> @@ -398,7 +398,7 @@ </target> <target name="test-classpath"> - <dbunit driver="${database.driverClass}" + <dbunit driver="${dbunit.profile.driverClass}" url="jdbc:mysql://localhost:3306/dbunit" userid="root" password=""> @@ -422,30 +422,30 @@ </target> <target name="test-datatypefactory"> - <dbunit driver="${database.driverClass}" + <dbunit driver="${dbunit.profile.driverClass}" datatypeFactory="org.dbunit.ext.oracle.OracleDataTypeFactory" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="NONE"/> </dbunit> </target> <target name="test-escapepattern"> - <dbunit driver="${database.driverClass}" + <dbunit driver="${dbunit.profile.driverClass}" escapePattern="[?]" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <operation type="NONE" src="${testDataSet}"/> </dbunit> </target> <target name="test-datatypefactory-via-generic-config"> - <dbunit driver="${database.driverClass}" - url="${database.url}" - userid="${database.user}" - password="${database.password}"> + <dbunit driver="${dbunit.profile.driverClass}" + url="${dbunit.profile.url}" + userid="${dbunit.profile.user}" + password="${dbunit.profile.password}"> <dbconfig> <property name="datatypeFactory" value="org.dbunit.ext.oracle.OracleDataTypeFactory" /> <property name="tableType" value="TABLE,SYNONYM" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 21:20:18
|
Revision: 1067 http://dbunit.svn.sourceforge.net/dbunit/?rev=1067&view=rev Author: jbhurst Date: 2009-10-10 21:20:11 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Moved integration test dependencies into appropriate integration test profiles. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 03:03:59 UTC (rev 1066) +++ trunk/pom.xml 2009-10-10 21:20:11 UTC (rev 1067) @@ -333,39 +333,13 @@ <version>1.8.0.1</version> <scope>test</scope> </dependency> - <!-- <dependency> <groupId>com.oracle</groupId> - <artifactId>classes12</artifactId> - <version>8.1.7.1</version> - <scope>test</scope> - </dependency> - --> - <dependency> - <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> - <scope>test</scope> + <optional>true</optional> </dependency> - <!-- <dependency> - <groupId>com.oracle</groupId> - <artifactId>ojdbc6</artifactId> - <version>11.1.0.7.0</version> - <scope>test</scope> - </dependency> - --> - <dependency> - <!-- - Only needed when "profile.properties" is set to "derby" - environment - --> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.4.1.3</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>gsbase</groupId> <artifactId>gsbase</artifactId> <version>2.0.1</version> @@ -696,6 +670,30 @@ <database.password>${database.oracle.password}</database.password> <database.unsupportedFeatures>${database.oracle.unsupportedFeatures}</database.unsupportedFeatures> </properties> + <dependencies> + <dependency> + <!-- + <dependency> + <groupId>com.oracle</groupId> + <artifactId>classes12</artifactId> + <version>8.1.7.1</version> + <scope>test</scope> + </dependency> + --> + <groupId>com.oracle</groupId> + <artifactId>ojdbc14</artifactId> + <version>10.2.0.4.0</version> + <scope>test</scope> + </dependency> + <!-- + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc6</artifactId> + <version>11.1.0.7.0</version> + <scope>test</scope> + </dependency> + --> + </dependencies> </profile> <profile> <id>mysql</id> @@ -744,6 +742,14 @@ <database.password>${database.derby.password}</database.password> <database.unsupportedFeatures>${database.derby.unsupportedFeatures}</database.unsupportedFeatures> </properties> + <dependencies> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.4.1.3</version> + <scope>test</scope> + </dependency> + </dependencies> </profile> <profile> <id>postgresql</id> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 03:04:05
|
Revision: 1066 http://dbunit.svn.sourceforge.net/dbunit/?rev=1066&view=rev Author: jbhurst Date: 2009-10-10 03:03:59 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added schema attribute to ant export tests so that they work with Oracle. They also work with HSQLDB whether or not the schema is included. Should there be test variants with and without the schema attribute? Modified Paths: -------------- trunk/src/xml/antTestBuildFile.xml Modified: trunk/src/xml/antTestBuildFile.xml =================================================================== --- trunk/src/xml/antTestBuildFile.xml 2009-10-10 02:24:14 UTC (rev 1065) +++ trunk/src/xml/antTestBuildFile.xml 2009-10-10 03:03:59 UTC (rev 1066) @@ -172,10 +172,12 @@ </dbunit> </target> + <!-- JH_TODO: I added the schema attribute, seems to be required for Oracle. Do we need to test other DBs without it? --> <target name="test-export-full" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}"/> </dbunit> @@ -185,13 +187,14 @@ <target name="test-export-partial" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}"> <table name="TEST_TABLE"/> <table name="PK_TABLE"/> </export> - <compare src="${exportDataSet}" format="flat"/> + <compare src="${exportDataSet}" format="flat" sort="true"/> </dbunit> <delete file="${exportDataSet}"/> </target> @@ -199,7 +202,8 @@ <target name="test-export-format-flat" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}" format="flat"/> <compare src="${exportDataSet}" format="flat"/> @@ -210,7 +214,8 @@ <target name="test-export-format-flat-with-doctype" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}" format="flat" doctype="dataset.dtd"/> </dbunit> @@ -220,6 +225,7 @@ <target name="test-export-format-flat-with-encoding" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" + schema="${database.schema}" userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}" format="flat" encoding="ISO-8859-1"/> @@ -230,7 +236,8 @@ <target name="test-export-format-xml" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}" format="xml"/> <compare src="${exportDataSet}" format="xml"/> @@ -241,7 +248,8 @@ <target name="test-export-format-xml-ordered" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDataSet}" format="xml" ordered="true" /> <compare src="${exportDataSet}" format="xml"/> @@ -252,7 +260,8 @@ <target name="test-export-format-dtd"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + schema="${database.schema}" + userid="${database.user}" password="${database.password}"> <export dest="${exportDtd}" format="dtd"/> </dbunit> @@ -262,6 +271,7 @@ <target name="test-export-format-csv" depends="test-type-clean-insert"> <dbunit driver="${database.driverClass}" url="${database.url}" + schema="${database.schema}" userid="${database.user}" password="${database.password}"> <export dest="${exportCsv}" format="csv"/> @@ -274,7 +284,7 @@ <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + userid="${database.user}" password="${database.password}"> <export dest="${exportCsv}" format="csv"> @@ -297,7 +307,7 @@ <target name="invalid-queryset"> <dbunit driver="${database.driverClass}" url="${database.url}" - userid="${database.user}" + userid="${database.user}" password="${database.password}"> <export dest="${exporDataSet}" format="flat"> <queryset id="someid" refid="someid"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 02:24:20
|
Revision: 1065 http://dbunit.svn.sourceforge.net/dbunit/?rev=1065&view=rev Author: jbhurst Date: 2009-10-10 02:24:14 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added hack for Oracle NUMERIC/DECIMAL column data type test. Modified Paths: -------------- trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java Modified: trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java =================================================================== --- trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java 2009-10-10 01:49:38 UTC (rev 1064) +++ trunk/src/test/org/dbunit/database/DatabaseTableMetaDataTest.java 2009-10-10 02:24:14 UTC (rev 1065) @@ -200,7 +200,18 @@ { Column column = columns[i]; assertEquals("name", (String)expectedNames.get(i), column.getColumnName()); - assertEquals("datatype", (DataType)expectedTypes.get(i), column.getDataType()); + if (expectedTypes.get(i).equals(DataType.NUMERIC)) + { + // 2009-10-10 John Hurst: hack for Oracle, returns java.sql.Types.DECIMAL for this column + assertTrue("Expected numeric datatype, got [" + column.getDataType() + "]", + column.getDataType().equals(DataType.NUMERIC) || + column.getDataType().equals(DataType.DECIMAL) + ); + } + else + { + assertEquals("datatype", (DataType)expectedTypes.get(i), column.getDataType()); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 01:50:12
|
Revision: 1064 http://dbunit.svn.sourceforge.net/dbunit/?rev=1064&view=rev Author: jbhurst Date: 2009-10-10 01:49:38 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added ORDER BY to a couple of tests to get them working with Oracle. Modified Paths: -------------- trunk/src/test/org/dbunit/assertion/DbUnitAssertTest.java Modified: trunk/src/test/org/dbunit/assertion/DbUnitAssertTest.java =================================================================== --- trunk/src/test/org/dbunit/assertion/DbUnitAssertTest.java 2009-10-10 01:47:49 UTC (rev 1063) +++ trunk/src/test/org/dbunit/assertion/DbUnitAssertTest.java 2009-10-10 01:49:38 UTC (rev 1064) @@ -300,7 +300,7 @@ // Ignore COLUMN2 which has been modified by the "ModifyingTable" above and hence does not match. // When we ignore this column, the assertion should work without failure String[] ignoreCols = new String[] {"COLUMN2"}; - assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE", ignoreCols); + assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE order by 1", ignoreCols); } public void testAssertTablesByQueryWithColFilterAndValuesNotEqualNotExcluded() throws Exception @@ -319,7 +319,7 @@ // not match and is not ignored. So the assertion should fail. String[] ignoreCols = new String[] {"COLUMN1"}; try { - assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE", ignoreCols); + assertion.assertEqualsByQuery(expectedTable, connection, "TEST_TABLE", "select * from TEST_TABLE order by 1", ignoreCols); fail("The assertion should not work"); } catch (ComparisonFailure expected) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 01:48:02
|
Revision: 1063 http://dbunit.svn.sourceforge.net/dbunit/?rev=1063&view=rev Author: jbhurst Date: 2009-10-10 01:47:49 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Disabled SCROLLABLE_RESULTSET from Oracle tests. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 01:06:28 UTC (rev 1062) +++ trunk/pom.xml 2009-10-10 01:47:49 UTC (rev 1063) @@ -36,7 +36,7 @@ <database.oracle.schema>DBUNIT</database.oracle.schema> <database.oracle.user>dbunit</database.oracle.user> <database.oracle.password>dbunit</database.oracle.password> - <database.oracle.unsupportedFeatures>INSERT_IDENTITY</database.oracle.unsupportedFeatures> + <database.oracle.unsupportedFeatures>INSERT_IDENTITY,SCROLLABLE_RESULTSET</database.oracle.unsupportedFeatures> <database.postgresql.driverClass>TODO</database.postgresql.driverClass> <database.postgresql.url>TODO</database.postgresql.url> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 01:06:34
|
Revision: 1062 http://dbunit.svn.sourceforge.net/dbunit/?rev=1062&view=rev Author: jbhurst Date: 2009-10-10 01:06:28 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Updated change log. Modified Paths: -------------- trunk/src/changes/changes.xml Modified: trunk/src/changes/changes.xml =================================================================== --- trunk/src/changes/changes.xml 2009-10-10 00:59:38 UTC (rev 1061) +++ trunk/src/changes/changes.xml 2009-10-10 01:06:28 UTC (rev 1062) @@ -2,7 +2,7 @@ <document> <properties> <title>Changes</title> - <!-- Commented out as recent versions of maven-changes-plugin generate + <!-- Commented out as recent versions of maven-changes-plugin generate errors parsing multiple author tags <author email="ep...@up...">Eric Pugh</author> <author email="mla...@us...">Manuel Laflamme</author> @@ -16,6 +16,7 @@ <action dev="gommma" type="fix" issue="2741077" due-to="dnap">DatabaseSequenceFilter fails on case sensitive tables</action> <action dev="gommma" type="fix" issue="2838922" due-to="matthieus, simon_wu">DB2 problem with schema names</action> <action dev="gommma" type="fix" issue="2875262" due-to="caseylucas">Handle non-typical characters in xml encoding</action> + <action dev="jbhurst" type="fix" issue="2875235" due-to="jbhurst">Fix integration tests.</action> </release> <release version="2.4.6" date="Sep 20, 2009" description="Bugfixes and some database specific additions"> <action dev="rlogiacco" type="add" issue="284432" due-to="JamesR">Add support for interval type on postgres</action> @@ -34,7 +35,7 @@ <action dev="gommma" type="fix" issue="2854788" due-to="olibye">Sybace - SQLHelper.getDatabaseInfo exception getDatabaseMajorVersion()</action> <action dev="gommma" type="add" issue="2828869" due-to="amit3011">DBUnit support for Netezza database</action> </release> - + <release version="2.4.5" date="May 22, 2009" description="Bugfixes and some few additions"> <action dev="gommma" type="add" issue="2633859" due-to="tjstavenger">Add Excel support to Export</action> <action dev="gommma" type="fix" issue="2658082" due-to="Bernard Schubach">MySQL - NoSuchTableException</action> @@ -280,12 +281,12 @@ <release version="1.5.1" date="April 4, 2003"> <action dev="" type="fix">Fixed DELETE operation that was not deleting tables in reverse order as expected.</action> <action dev="" type="fix">712329 - setObject fails on BEA JDriver for MS-SQL.</action> - + <action dev="" type="update">DbUnitTask DTD export optimization. </action> <action dev="" type="update">REFRESH operation optimization.</action> </release> <release version="1.5" date="March 1, 2003"> - <action dev="" type="fix">Multiple bugfixes.</action> + <action dev="" type="fix">Multiple bugfixes.</action> <action dev="" type="add">533321 - DbUnit is now case insensitive.</action> <action dev="" type="add">555455- Supports table names escaping (see escapePattern property).</action> <action dev="" type="add">551925 - Allows duplicate table names in datasets. A new method, getTables(), have been added in the IDataSet interface.</action> @@ -294,8 +295,8 @@ <action dev="" type="add">645691 - Added the <classpath> nested element in DbUnitTask ant task; used to load the JDBC classes.</action> <action dev="" type="add">Added <query> nested element in DbUnitTask <export>. Allows exporting the result of a SELECT as a table of a dataset. See ant task documentation.</action> <action dev="" type="add">New Canoo Webtest integration guide.</action> - - </release> + + </release> <release version="1.4" date="July 17, 2002"> <action dev="" type="add">DbUnitTask for Ant contributed by Timothy Ruppert and Ben Cox.</action> <action dev="" type="update">Moved the Base64 class to the org.dbunit.util package because Visual Age for Java is not able to handle classes located in the default package.</action> @@ -304,7 +305,7 @@ <action dev="" type="add">542462 - Added a system property to disable usage of batch statement even if the target database support it..</action> <action dev="" type="update">545238 - Sort tables prior to comparing them. DbUnit now generates an ORDER BY clause in the select statement used by DatabaseDataSet.getTable(). Rows are sorted by primary keys.</action> <action dev="" type="update">554249 - None column values.</action> - <action dev="" type="add">Added support for BLOB and CLOB data types.</action> + <action dev="" type="add">Added support for BLOB and CLOB data types.</action> </release> <release version="1.3" date="April 4, 2002"> @@ -336,7 +337,7 @@ </release> <release version="1.0" date="Febuary 27, 2002" description="Initial public release."> - </release> + </release> </body> </document> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 00:59:49
|
Revision: 1061 http://dbunit.svn.sourceforge.net/dbunit/?rev=1061&view=rev Author: jbhurst Date: 2009-10-10 00:59:38 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added some missing integration test properties. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 00:58:04 UTC (rev 1060) +++ trunk/pom.xml 2009-10-10 00:59:38 UTC (rev 1061) @@ -38,6 +38,13 @@ <database.oracle.password>dbunit</database.oracle.password> <database.oracle.unsupportedFeatures>INSERT_IDENTITY</database.oracle.unsupportedFeatures> + <database.postgresql.driverClass>TODO</database.postgresql.driverClass> + <database.postgresql.url>TODO</database.postgresql.url> + <database.postgresql.schema>TODO</database.postgresql.schema> + <database.postgresql.user>TODO</database.postgresql.user> + <database.postgresql.password>TODO</database.postgresql.password> + <database.postgresql.unsupportedFeatures>TODO</database.postgresql.unsupportedFeatures> + <database.mysql.driverClass>com.mysql.jdbc.Driver</database.mysql.driverClass> <database.mysql.url>jdbc:mysql://localhost:3306/dbunit</database.mysql.url> <database.mysql.schema>DBUNIT</database.mysql.schema> @@ -52,12 +59,12 @@ <database.mssql.password>dbunit</database.mssql.password> <database.mssql.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</database.mssql.unsupportedFeatures> - <database.db2.driverClass></database.db2.driverClass> - <database.db2.url></database.db2.url> - <database.db2.schema></database.db2.schema> - <database.db2.user></database.db2.user> - <database.db2.password></database.db2.password> - <database.db2.unsupportedFeatures></database.db2.unsupportedFeatures> + <database.db2.driverClass>TODO</database.db2.driverClass> + <database.db2.url>TODO</database.db2.url> + <database.db2.schema>TODO</database.db2.schema> + <database.db2.user>TODO</database.db2.user> + <database.db2.password>TODO</database.db2.password> + <database.db2.unsupportedFeatures>TODO</database.db2.unsupportedFeatures> <database.derby.driverClass>org.apache.derby.jdbc.EmbeddedDriver</database.derby.driverClass> <database.derby.url>jdbc\:derby\:target\/derby_db;create\=true</database.derby.url> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 00:58:12
|
Revision: 1060 http://dbunit.svn.sourceforge.net/dbunit/?rev=1060&view=rev Author: jbhurst Date: 2009-10-10 00:58:04 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Added Oracle dependency to POM, for running Oracle integration tests. Modified Paths: -------------- trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 00:56:36 UTC (rev 1059) +++ trunk/pom.xml 2009-10-10 00:58:04 UTC (rev 1060) @@ -326,7 +326,29 @@ <version>1.8.0.1</version> <scope>test</scope> </dependency> + <!-- <dependency> + <groupId>com.oracle</groupId> + <artifactId>classes12</artifactId> + <version>8.1.7.1</version> + <scope>test</scope> + </dependency> + --> + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc14</artifactId> + <version>10.2.0.4.0</version> + <scope>test</scope> + </dependency> + <!-- + <dependency> + <groupId>com.oracle</groupId> + <artifactId>ojdbc6</artifactId> + <version>11.1.0.7.0</version> + <scope>test</scope> + </dependency> + --> + <dependency> <!-- Only needed when "profile.properties" is set to "derby" environment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 00:56:49
|
Revision: 1059 http://dbunit.svn.sourceforge.net/dbunit/?rev=1059&view=rev Author: jbhurst Date: 2009-10-10 00:56:36 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Fixed UpdateOperationTest for Oracle. (By using correct DataTypeFactory in test.) Modified Paths: -------------- trunk/src/test/org/dbunit/AbstractDatabaseTest.java trunk/src/test/org/dbunit/DatabaseEnvironment.java trunk/src/test/org/dbunit/OracleEnvironment.java Modified: trunk/src/test/org/dbunit/AbstractDatabaseTest.java =================================================================== --- trunk/src/test/org/dbunit/AbstractDatabaseTest.java 2009-10-10 00:54:04 UTC (rev 1058) +++ trunk/src/test/org/dbunit/AbstractDatabaseTest.java 2009-10-10 00:56:36 UTC (rev 1059) @@ -21,6 +21,7 @@ package org.dbunit; +import org.dbunit.database.DatabaseConfig; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.ITable; @@ -67,6 +68,7 @@ super.setUp(); _connection = getDatabaseTester().getConnection(); + setUpDatabaseConfig(_connection.getConfig()); } protected IDatabaseTester getDatabaseTester() throws Exception @@ -84,6 +86,18 @@ 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(); Modified: trunk/src/test/org/dbunit/DatabaseEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 00:54:04 UTC (rev 1058) +++ trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 00:56:36 UTC (rev 1059) @@ -26,6 +26,7 @@ import java.sql.Connection; import java.sql.DriverManager; +import org.dbunit.database.DatabaseConfig; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.IDataSet; @@ -103,6 +104,11 @@ } return _connection; } + + protected void setupDatabaseConfig(DatabaseConfig config) + { +// override in subclasses as necessary + } public IDatabaseTester getDatabaseTester() { Modified: trunk/src/test/org/dbunit/OracleEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/OracleEnvironment.java 2009-10-10 00:54:04 UTC (rev 1058) +++ trunk/src/test/org/dbunit/OracleEnvironment.java 2009-10-10 00:56:36 UTC (rev 1059) @@ -21,7 +21,13 @@ package org.dbunit; -import org.dbunit.dataset.*; +import org.dbunit.database.DatabaseConfig; +import org.dbunit.dataset.CompositeDataSet; +import org.dbunit.dataset.DefaultDataSet; +import org.dbunit.dataset.DefaultTable; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.ITable; +import org.dbunit.ext.oracle.OracleDataTypeFactory; /** * @author Manuel Laflamme @@ -35,6 +41,11 @@ super(profile); } + protected void setupDatabaseConfig(DatabaseConfig config) + { + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new OracleDataTypeFactory()); + } + public IDataSet getInitDataSet() throws Exception { ITable[] extraTables = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jb...@us...> - 2009-10-10 00:54:16
|
Revision: 1058 http://dbunit.svn.sourceforge.net/dbunit/?rev=1058&view=rev Author: jbhurst Date: 2009-10-10 00:54:04 +0000 (Sat, 10 Oct 2009) Log Message: ----------- [2875235] - Replaced profile.properties with Maven profiles and settings.xml properties. (Needs doc.) Modified Paths: -------------- trunk/assembly.xml trunk/pom.xml trunk/src/test/org/dbunit/DatabaseEnvironment.java trunk/src/test/org/dbunit/DatabaseProfile.java trunk/src/xml/antTestBuildFile.xml Removed Paths: ------------- trunk/profile.properties Modified: trunk/assembly.xml =================================================================== --- trunk/assembly.xml 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/assembly.xml 2009-10-10 00:54:04 UTC (rev 1058) @@ -12,7 +12,6 @@ <include>LICENSE*</include> <include>NOTICE*</include> <include>pom.xml</include> - <include>profile.properties</include> </includes> </fileSet> <fileSet> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/pom.xml 2009-10-10 00:54:04 UTC (rev 1058) @@ -21,7 +21,59 @@ <properties> <compileSource>1.4</compileSource> <checkstyle.excludes>org/dbunit/util/concurrent/*.java</checkstyle.excludes> + + <database.profile>hsqldb</database.profile> + + <database.hsqldb.driverClass>org.hsqldb.jdbcDriver</database.hsqldb.driverClass> + <database.hsqldb.url>jdbc:hsqldb:mem:.</database.hsqldb.url> + <database.hsqldb.schema>PUBLIC</database.hsqldb.schema> + <database.hsqldb.user>sa</database.hsqldb.user> + <database.hsqldb.password></database.hsqldb.password> + <database.hsqldb.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</database.hsqldb.unsupportedFeatures> + + <database.oracle.driverClass>oracle.jdbc.driver.OracleDriver</database.oracle.driverClass> + <database.oracle.url>jdbc:oracle:thin:@demowin:1521:demowin</database.oracle.url> + <database.oracle.schema>DBUNIT</database.oracle.schema> + <database.oracle.user>dbunit</database.oracle.user> + <database.oracle.password>dbunit</database.oracle.password> + <database.oracle.unsupportedFeatures>INSERT_IDENTITY</database.oracle.unsupportedFeatures> + + <database.mysql.driverClass>com.mysql.jdbc.Driver</database.mysql.driverClass> + <database.mysql.url>jdbc:mysql://localhost:3306/dbunit</database.mysql.url> + <database.mysql.schema>DBUNIT</database.mysql.schema> + <database.mysql.user>dbunit</database.mysql.user> + <database.mysql.password>dbunit</database.mysql.password> + <database.mysql.unsupportedFeatures>BLOB,CLOB,TRANSACTION,INSERT_IDENTITY</database.mysql.unsupportedFeatures> + + <database.mssql.driverClass>com.microsoft.jdbc.sqlserver.SQLServerDriver</database.mssql.driverClass> + <database.mssql.url>jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor</database.mssql.url> + <database.mssql.schema>dbo</database.mssql.schema> + <database.mssql.user>dbunit</database.mssql.user> + <database.mssql.password>dbunit</database.mssql.password> + <database.mssql.unsupportedFeatures>BLOB,CLOB,SCROLLABLE_RESULTSET</database.mssql.unsupportedFeatures> + + <database.db2.driverClass></database.db2.driverClass> + <database.db2.url></database.db2.url> + <database.db2.schema></database.db2.schema> + <database.db2.user></database.db2.user> + <database.db2.password></database.db2.password> + <database.db2.unsupportedFeatures></database.db2.unsupportedFeatures> + + <database.derby.driverClass>org.apache.derby.jdbc.EmbeddedDriver</database.derby.driverClass> + <database.derby.url>jdbc\:derby\:target\/derby_db;create\=true</database.derby.url> + <database.derby.schema>APP</database.derby.schema> + <database.derby.user>APP</database.derby.user> + <database.derby.password>APP</database.derby.password> + <database.derby.unsupportedFeatures>VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE</database.derby.unsupportedFeatures> + + <database.h2.driverClass>TODO</database.h2.driverClass> + <database.h2.url>TODO</database.h2.url> + <database.h2.schema>TODO</database.h2.schema> + <database.h2.user>TODO</database.h2.user> + <database.h2.password>TODO</database.h2.password> + <database.h2.unsupportedFeatures>TODO</database.h2.unsupportedFeatures> </properties> + <scm> <connection>scm:svn:https://dbunit.svn.sourceforge.net/svnroot/dbunit/trunk</connection> <developerConnection>scm:svn:https://dbunit.svn.sourceforge.net/svnroot/dbunit/trunk</developerConnection> @@ -69,8 +121,8 @@ </mailingList> </mailingLists> - <!-- - - Who are the developers for the project, in order of recent activity. + <!-- + - Who are the developers for the project, in order of recent activity. --> <developers> <!-- @@ -346,6 +398,36 @@ <includes> <include>**/*Test.java</include> </includes> + <systemProperties> + <property> + <name>database.profile</name> + <value>${database.profile}</value> + </property> + <property> + <name>database.driverClass</name> + <value>${database.driverClass}</value> + </property> + <property> + <name>database.url</name> + <value>${database.url}</value> + </property> + <property> + <name>database.schema</name> + <value>${database.schema}</value> + </property> + <property> + <name>database.user</name> + <value>${database.user}</value> + </property> + <property> + <name>database.password</name> + <value>${database.password}</value> + </property> + <property> + <name>database.unsupportedFeatures</name> + <value>${database.unsupportedFeatures}</value> + </property> + </systemProperties> </configuration> </plugin> <plugin> @@ -559,6 +641,105 @@ </plugins> </reporting> </profile> + <profile> + <id>hsqldb</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <database.profile>hsqldb</database.profile> + <database.driverClass>${database.hsqldb.driverClass}</database.driverClass> + <database.url>${database.hsqldb.url}</database.url> + <database.schema>${database.hsqldb.schema}</database.schema> + <database.user>${database.hsqldb.user}</database.user> + <database.password>${database.hsqldb.password}</database.password> + <database.unsupportedFeatures>${database.hsqldb.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>oracle</id> + <properties> + <database.profile>oracle</database.profile> + <database.driverClass>${database.oracle.driverClass}</database.driverClass> + <database.url>${database.oracle.url}</database.url> + <database.schema>${database.oracle.schema}</database.schema> + <database.user>${database.oracle.user}</database.user> + <database.password>${database.oracle.password}</database.password> + <database.unsupportedFeatures>${database.oracle.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>mysql</id> + <properties> + <database.profile>mysql</database.profile> + <database.driverClass>${database.mysql.driverClass}</database.driverClass> + <database.url>${database.mysql.url}</database.url> + <database.schema>${database.mysql.schema}</database.schema> + <database.user>${database.mysql.user}</database.user> + <database.password>${database.mysql.password}</database.password> + <database.unsupportedFeatures>${database.mysql.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>mssql</id> + <properties> + <database.profile>mssql</database.profile> + <database.driverClass>${database.mssql.driverClass}</database.driverClass> + <database.url>${database.mssql.url}</database.url> + <database.schema>${database.mssql.schema}</database.schema> + <database.user>${database.mssql.user}</database.user> + <database.password>${database.mssql.password}</database.password> + <database.unsupportedFeatures>${database.mssql.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>db2</id> + <properties> + <database.profile>db2</database.profile> + <database.driverClass>${database.db2.driverClass}</database.driverClass> + <database.url>${database.db2.url}</database.url> + <database.schema>${database.db2.schema}</database.schema> + <database.user>${database.db2.user}</database.user> + <database.password>${database.db2.password}</database.password> + <database.unsupportedFeatures>${database.db2.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>derby</id> + <properties> + <database.profile>derby</database.profile> + <database.driverClass>${database.derby.driverClass}</database.driverClass> + <database.url>${database.derby.url}</database.url> + <database.schema>${database.derby.schema}</database.schema> + <database.user>${database.derby.user}</database.user> + <database.password>${database.derby.password}</database.password> + <database.unsupportedFeatures>${database.derby.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>postgresql</id> + <properties> + <database.profile>postgresql</database.profile> + <database.driverClass>${database.postgresql.driverClass}</database.driverClass> + <database.url>${database.postgresql.url}</database.url> + <database.schema>${database.postgresql.schema}</database.schema> + <database.user>${database.postgresql.user}</database.user> + <database.password>${database.postgresql.password}</database.password> + <database.unsupportedFeatures>${database.postgresql.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> + <profile> + <id>h2</id> + <properties> + <database.profile>h2</database.profile> + <database.driverClass>${database.h2.driverClass}</database.driverClass> + <database.url>${database.h2.url}</database.url> + <database.schema>${database.h2.schema}</database.schema> + <database.user>${database.h2.user}</database.user> + <database.password>${database.h2.password}</database.password> + <database.unsupportedFeatures>${database.h2.unsupportedFeatures}</database.unsupportedFeatures> + </properties> + </profile> </profiles> </project> Deleted: trunk/profile.properties =================================================================== --- trunk/profile.properties 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/profile.properties 2009-10-10 00:54:04 UTC (rev 1058) @@ -1,93 +0,0 @@ -## -## -## - -dbunit.profile = hypersonic -#dbunit.profile = oracle -#dbunit.profile = mysql -#dbunit.profile = mssql -#dbunit.profile = db2 -#dbunit.profile = derbyembedded - -# dbunit.profile.{profileName}.driverClass = com.acme.driver -# dbunit.profile.{profileName}.connectionUrl = jdbc:acme:database -# dbunit.profile.{profileName}.schema = -# dbunit.profile.{profileName}.user = -# dbunit.profile.{profileName}.password = -# dbunit.profile.{profileName}.unsupportedFeatures = BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_INDENTITY,TRUNCATE_TABLE - -dbunit.profile.hypersonic.driverClass = org.hsqldb.jdbcDriver -dbunit.profile.hypersonic.connectionUrl = jdbc:hsqldb:mem:. -dbunit.profile.hypersonic.schema = PUBLIC -dbunit.profile.hypersonic.user = sa -dbunit.profile.hypersonic.password = -dbunit.profile.hypersonic.unsupportedFeatures = BLOB,CLOB,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE - -dbunit.profile.oracle.driverClass = oracle.jdbc.driver.OracleDriver -dbunit.profile.oracle.connectionUrl = jdbc:oracle:thin:@demowin:1521:demowin -dbunit.profile.oracle.schema = DBUNIT -dbunit.profile.oracle.user = dbunit -dbunit.profile.oracle.password = dbunit -dbunit.profile.oracle.unsupportedFeatures = INSERT_IDENTITY - -dbunit.profile.mysql.driverClass = com.mysql.jdbc.Driver -dbunit.profile.mysql.connectionUrl = jdbc:mysql://localhost:3306/dbunit -#dbunit.profile.mysql.schema = DBUNIT -dbunit.profile.mysql.user = dbunit -dbunit.profile.mysql.password = dbunit -dbunit.profile.mysql.unsupportedFeatures = BLOB,CLOB,TRANSACTION,INSERT_IDENTITY - -dbunit.profile.mssql.driverClass = com.microsoft.jdbc.sqlserver.SQLServerDriver -#dbunit.profile.mssql.connectionUrl = jdbc:microsoft:sqlserver://trujillo:1433;DatabaseName=dbunit;SelectMethod=cursor -dbunit.profile.mssql.connectionUrl = jdbc:microsoft:sqlserver://localhost\\dbunit:1433;DatabaseName=dbunit;SelectMethod=cursor -dbunit.profile.mssql.schema = dbo -dbunit.profile.mssql.user = dbunit -dbunit.profile.mssql.password = dbunit -dbunit.profile.mssql.unsupportedFeatures = BLOB,CLOB,SCROLLABLE_RESULTSET - -dbunit.profile.db2.driverClass = -dbunit.profile.db2.connectionUrl = -dbunit.profile.db2.schema = -dbunit.profile.db2.user = -dbunit.profile.db2.password = -dbunit.profile.db2.unsupportedFeatures = - -dbunit.profile.derbyembedded.driverClass = org.apache.derby.jdbc.EmbeddedDriver -#dbunit.profile.derbyembedded.connectionUrl = jdbc\:derby\:D\:\\TMP\\derby\\derby_db;create\=true -dbunit.profile.derbyembedded.connectionUrl = jdbc\:derby\:target\/derby_db;create\=true -dbunit.profile.derbyembedded.schema = APP -dbunit.profile.derbyembedded.user = APP -dbunit.profile.derbyembedded.password = APP -dbunit.profile.derbyembedded.unsupportedFeatures = VARBINARY,BLOB,CLOB,TRANSACTION,SCROLLABLE_RESULTSET,INSERT_IDENTITY,TRUNCATE_TABLE - - -## Needed for ant testing until profile.properties is merged -dbunit.profile.driverClass = ${dbunit.profile.hypersonic.driverClass} -dbunit.profile.connectionUrl = ${dbunit.profile.hypersonic.connectionUrl} -#dbunit.profile.schema = ${dbunit.profile.hypersonic.schema} -dbunit.profile.user = ${dbunit.profile.hypersonic.user} -dbunit.profile.password = ${dbunit.profile.hypersonic.password} - -#dbunit.profile.driverClass = ${dbunit.profile.oracle.driverClass} -#dbunit.profile.connectionUrl = ${dbunit.profile.oracle.connectionUrl} -#dbunit.profile.schema = ${dbunit.profile.oracle.schema} -#dbunit.profile.user = ${dbunit.profile.oracle.user} -#dbunit.profile.password = ${dbunit.profile.oracle.password} - -#dbunit.profile.driverClass = ${dbunit.profile.mysql.driverClass} -#dbunit.profile.connectionUrl = ${dbunit.profile.mysql.connectionUrl} -##dbunit.profile.schema = ${dbunit.profile.mysql.schema} -#dbunit.profile.user = ${dbunit.profile.mysql.user} -#dbunit.profile.password = ${dbunit.profile.mysql.password} - -#dbunit.profile.driverClass = ${dbunit.profile.mssql.driverClass} -#dbunit.profile.connectionUrl = ${dbunit.profile.mssql.connectionUrl} -#dbunit.profile.schema = ${dbunit.profile.mssql.schema} -#dbunit.profile.user = ${dbunit.profile.mssql.user} -#dbunit.profile.password = ${dbunit.profile.mssql.password} - -#dbunit.profile.driverClass = ${dbunit.profile.db2.driverClass} -#dbunit.profile.connectionUrl = ${dbunit.profile.db2.connectionUrl} -#dbunit.profile.schema = ${dbunit.profile.db2.schema} -#dbunit.profile.user = ${dbunit.profile.db2.user} -#dbunit.profile.password = ${dbunit.profile.db2.password} Modified: trunk/src/test/org/dbunit/DatabaseEnvironment.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/src/test/org/dbunit/DatabaseEnvironment.java 2009-10-10 00:54:04 UTC (rev 1058) @@ -22,11 +22,9 @@ package org.dbunit; import java.io.File; -import java.io.FileInputStream; import java.io.FileReader; import java.sql.Connection; import java.sql.DriverManager; -import java.util.Properties; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; @@ -51,12 +49,10 @@ { if (INSTANCE == null) { - Properties properties = new Properties(); - properties.load(new FileInputStream(new File("profile.properties"))); - DatabaseProfile profile = new DatabaseProfile(properties); + DatabaseProfile profile = new DatabaseProfile(System.getProperties()); String profileName = profile.getActiveProfile(); - if (profileName == null || profileName.equals("hypersonic")) + if (profileName == null || profileName.equals("hsqldb")) { INSTANCE = new HypersonicEnvironment(profile); } @@ -64,7 +60,7 @@ { INSTANCE = new OracleEnvironment(profile); } - else if (profileName.equals("derbyembedded")) + else if (profileName.equals("derby")) { INSTANCE = new DerbyEnvironment(profile); } Modified: trunk/src/test/org/dbunit/DatabaseProfile.java =================================================================== --- trunk/src/test/org/dbunit/DatabaseProfile.java 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/src/test/org/dbunit/DatabaseProfile.java 2009-10-10 00:54:04 UTC (rev 1058) @@ -21,10 +21,7 @@ package org.dbunit; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import java.util.StringTokenizer; +import java.util.*; /** * @author Manuel Laflamme @@ -35,61 +32,59 @@ { private static final String[] EMPTY_ARRAY = new String[0]; - private static final String PROFILE_PREFIX = "dbunit.profile"; + private static final String DATABASE_PROFILE = "database.profile"; + private static final String DATABASE_DRIVER_CLASS = "database.driverClass"; + private static final String DATABASE_URL = "database.url"; + private static final String DATABASE_SCHEMA = "database.schema"; + private static final String DATABASE_USER = "database.user"; + private static final String DATABASE_PASSWORD = "database.password"; + private static final String DATABASE_UNSUPPORTED_FEATURES = "database.unsupportedFeatures"; - private static final String DRIVER_CLASS = "driverClass"; - private static final String CONNECTION_URL = "connectionUrl"; - private static final String SCHEMA = "schema"; - private static final String USER = "user"; - private static final String PASSWORD = "password"; - private static final String UNSUPPORTED_FEATURES = "unsupportedFeatures"; - private final Properties _properties; public DatabaseProfile(Properties properties) { _properties = properties; - } +// ArrayList keys = new ArrayList(properties.keySet()); +// for (int i = 0; i < keys.size(); i++) { +// System.out.println("key = " + keys.get(i) + ", value = " + properties.get(keys.get(i))); +// } - private String getPropertyKey(String name) - { - return PROFILE_PREFIX + "." + getActiveProfile() + "." + name; } public String getActiveProfile() { - return _properties.getProperty(PROFILE_PREFIX); + return _properties.getProperty(DATABASE_PROFILE); } public String getDriverClass() { - return _properties.getProperty(getPropertyKey(DRIVER_CLASS)); + return _properties.getProperty(DATABASE_DRIVER_CLASS); } public String getConnectionUrl() { - return _properties.getProperty(getPropertyKey(CONNECTION_URL)); + return _properties.getProperty(DATABASE_URL); } public String getSchema() { - return _properties.getProperty(getPropertyKey(SCHEMA), null); + return _properties.getProperty(DATABASE_SCHEMA, null); } public String getUser() { - return _properties.getProperty(getPropertyKey(USER)); + return _properties.getProperty(DATABASE_USER); } public String getPassword() { - return _properties.getProperty(getPropertyKey(PASSWORD)); + return _properties.getProperty(DATABASE_PASSWORD); } public String[] getUnsupportedFeatures() { - String property = _properties.getProperty( - getPropertyKey(UNSUPPORTED_FEATURES)); + String property = _properties.getProperty(DATABASE_UNSUPPORTED_FEATURES); // If property is not set return an empty array if(property == null){ @@ -102,7 +97,7 @@ { stringList.add(tokenizer.nextToken().trim()); } - return (String[])stringList.toArray(new String[0]); + return (String[])stringList.toArray(new String[stringList.size()]); } } Modified: trunk/src/xml/antTestBuildFile.xml =================================================================== --- trunk/src/xml/antTestBuildFile.xml 2009-10-10 00:51:27 UTC (rev 1057) +++ trunk/src/xml/antTestBuildFile.xml 2009-10-10 00:54:04 UTC (rev 1058) @@ -2,7 +2,12 @@ <project name="ant-test" basedir="../../" default="all"> - <property file="profile.properties"/> + <property name="database.profile" value="unknown"/> + <property name="database.driverClass" value="unknown"/> + <property name="database.url" value="unknown"/> + <property name="database.schema" value="unknown"/> + <property name="database.user" value="unknown"/> + <property name="database.password" value="unknown"/> <property name="testDataSet" value="src/xml/flatXmlDataSetTest.xml"/> <property name="updateDataSet" value="src/xml/antTestDataSet.xml"/> @@ -12,155 +17,155 @@ <taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" loaderref="dbunit"/> <typedef name="queryset" classname="org.dbunit.ant.QuerySet" loaderref="dbunit"/> - + <target name="all" depends="no-driver, no-db-url, no-userid, no-password"/> <target name="no-driver"> - <dbunit url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-db-url"> - <dbunit driver="${dbunit.profile.driverClass}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + userid="${database.user}" + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-userid"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" + <dbunit driver="${database.driverClass}" + url="${database.url}" - password="${dbunit.profile.password}"> + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="no-password"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="invalid-db-info"> - <dbunit driver="${dbunit.profile.driverClass}" + <dbunit driver="${database.driverClass}" url="jdbc:foobar://localhost/dbunittest" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + userid="${database.user}" + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="set-format-xml"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="INSERT" src="${testDataSet}" format="xml"/> </dbunit> </target> <target name="test-type-none"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="NONE" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-update"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="UPDATE" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-refresh"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="REFRESH" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-delete"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="DELETE" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-delete-all"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="DELETE_ALL" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-mssql-insert" depends="test-type-delete-all"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="MSSQL_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="test-type-mssql-refresh"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="MSSQL_REFRESH" src="${updateDataSet}"/> </dbunit> </target> <target name="test-type-mssql-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="MSSQL_CLEAN_INSERT" src="${testDataSet}"/> </dbunit> </target> <target name="invalid-type"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="CLEAN_INSERT" src="${testDataSet}"/> <operation type="DELETE" src="${updateDataSet}"/> <operation type="RIDICULOUS" src="${testDataSet}"/> @@ -168,20 +173,20 @@ </target> <target name="test-export-full" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-partial" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}"> <table name="TEST_TABLE"/> <table name="PK_TABLE"/> @@ -192,10 +197,10 @@ </target> <target name="test-export-format-flat" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="flat"/> <compare src="${exportDataSet}" format="flat"/> </dbunit> @@ -203,30 +208,30 @@ </target> <target name="test-export-format-flat-with-doctype" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="flat" doctype="dataset.dtd"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-format-flat-with-encoding" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="flat" encoding="ISO-8859-1"/> </dbunit> <delete file="${exportDataSet}"/> </target> <target name="test-export-format-xml" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="xml"/> <compare src="${exportDataSet}" format="xml"/> </dbunit> @@ -234,10 +239,10 @@ </target> <target name="test-export-format-xml-ordered" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="xml" ordered="true" /> <compare src="${exportDataSet}" format="xml"/> </dbunit> @@ -245,42 +250,42 @@ </target> <target name="test-export-format-dtd"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDtd}" format="dtd"/> </dbunit> <delete file="${exportDtd}"/> </target> <target name="test-export-format-csv" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportCsv}" format="csv"/> <compare src="${exportCsv}" format="csv"/> </dbunit> <delete dir="${exportCsv}" failonerror="false" /> </target> - + <target name="test-export-with-queryset" depends="test-type-clean-insert"> - - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> - + + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> + <export dest="${exportCsv}" format="csv"> <query name="SECOND_TABLE" sql="SELECT * FROM SECOND_TABLE"/> <queryset> - <query name="TEST_TABLE" + <query name="TEST_TABLE" sql="SELECT * FROM TEST_TABLE WHERE COLUMN0 = 'row 0 col 0'"/> </queryset> <queryset> <query name="PK_TABLE" sql="SELECT * FROM PK_TABLE"/> - <query name="TEST_TABLE" + <query name="TEST_TABLE" sql="SELECT * FROM TEST_TABLE WHERE COLUMN0 = 'row 1 col 0'"/> </queryset> <table name="EMPTY_TABLE"/> @@ -290,30 +295,30 @@ </target> <target name="invalid-queryset"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exporDataSet}" format="flat"> <queryset id="someid" refid="someid"/> </export> </dbunit> <delete file="${exportDataSet}"/> </target> - + <target name="test-queryset-reference"> - + <queryset id="queryset-id"> - <query name="TEST_TABLE" + <query name="TEST_TABLE" sql="SELECT * FROM TEST_TABLE WHERE COLUMN0 = '@colValue@'"/> - <query name="SECOND_TABLE" + <query name="SECOND_TABLE" sql="SELECT B.* FROM TEST_TABLE A, SECOND_TABLE B WHERE A.COLUMN0 = '@colValue@' AND B.COLUMN0 = A.COLUMN0"/> </queryset> - - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}" format="flat"> <queryset refid="queryset-id"> <filterset> @@ -325,21 +330,21 @@ <delete file="${exportDataSet}"/> </target> - + <target name="invalid-export-format"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDtd}" format="invalid"/> </dbunit> </target> <target name="test-export-query" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}"> <query name="TEST_TABLE" sql="SELECT * FROM test_table ORDER BY column0 DESC"/> <query name="PK_TABLE" sql="SELECT * FROM pk_table"/> @@ -350,10 +355,10 @@ </target> <target name="test-export-query-mixed" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <export dest="${exportDataSet}"> <table name="TEST_TABLE" /> <query name="PK_TABLE" sql="SELECT * FROM pk_table WHERE normal1='0 wor'"/> @@ -367,14 +372,14 @@ </target> <target name="test-export-and-compare-format-mismatch" depends="test-type-clean-insert"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> - + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> + <export dest="${exportDataSet}" format="flat"> <table name="TEST_TABLE" /> - </export> + </export> <compare src="${exportDataSet}" format="xml"> <table name="TEST_TABLE" /> </compare> @@ -383,7 +388,7 @@ </target> <target name="test-classpath"> - <dbunit driver="${dbunit.profile.driverClass}" + <dbunit driver="${database.driverClass}" url="jdbc:mysql://localhost:3306/dbunit" userid="root" password=""> @@ -407,30 +412,30 @@ </target> <target name="test-datatypefactory"> - <dbunit driver="${dbunit.profile.driverClass}" + <dbunit driver="${database.driverClass}" datatypeFactory="org.dbunit.ext.oracle.OracleDataTypeFactory" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="NONE"/> </dbunit> </target> <target name="test-escapepattern"> - <dbunit driver="${dbunit.profile.driverClass}" + <dbunit driver="${database.driverClass}" escapePattern="[?]" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <operation type="NONE" src="${testDataSet}"/> </dbunit> </target> <target name="test-datatypefactory-via-generic-config"> - <dbunit driver="${dbunit.profile.driverClass}" - url="${dbunit.profile.connectionUrl}" - userid="${dbunit.profile.user}" - password="${dbunit.profile.password}"> + <dbunit driver="${database.driverClass}" + url="${database.url}" + userid="${database.user}" + password="${database.password}"> <dbconfig> <property name="datatypeFactory" value="org.dbunit.ext.oracle.OracleDataTypeFactory" /> <property name="tableType" value="TABLE,SYNONYM" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |