takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

Warning AbstractTableMetaData #23

Closed regis-leray closed 10 years ago

regis-leray commented 11 years ago

Im getting this weird message

11:23:08.725 [main] WARN org.dbunit.dataset.AbstractTableMetaData - Potential problem found: The configured data type factory 'class org.dbunit.ext.hsqldb.HsqldbDataTypeFactory' might cause problems with the current database 'PostgreSQL' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[hsql]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.

This how i declare my unit test

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/applicationContext-int.xml")
@DataSet( dbType = DBType.POSTGRESQL, columnSensing = true)
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class, DataSetTestExecutionListener.class })
public class ITResultAssignationPonderateRepositoryTest {

    @Test
    @DataSet(locations = {"dataset_resultassignation_BennyCo.xml"}, columnSensing = true)
    public void shouldHaveSectionStatsByPeriodAndLocationForBennyCo(){
...
    }

}

Im using dbunit 2.4.9 and spring-dbunit 1.1.12 with spring 3.2

slandelle commented 11 years ago

In the current version, when declared at method level, DataSet completely overrides the one declared at type level. You have a perfect point here, and I'll fix this, but probably not before 2 weeks.

Until then, if you want to use per method specific configuration, you have to enforce all the properties you want.

regis-leray commented 11 years ago

Oki. I need to specify for each method

@DataSet(locations = {"dataset_resultassignation_BennyCo.xml"}, columnSensing = true, dbType = DBType.POSTGRESQL)

Thanks

PS: no more errors :)

slandelle commented 11 years ago

yep, until I fix configuration resolution so that it works the way you expected.

regis-leray commented 11 years ago

By the way do an horizontal fix not only for this property, but for all of them :p columnSensing, dbType, dataSourceSpringName columnSensing dtdLocation dtdMetadata caseSensitiveTableNames escapePattern batchSize fetchSize qualifiedTableNames batchedStatements skipOracleRecycleBinTables tableType schema.....

regis1512 commented 10 years ago

Hi, I start to work on this issue.