Search in sources :

Example 1 with DatabaseConfigBean

use of com.github.springtestdbunit.bean.DatabaseConfigBean in project thingsboard by thingsboard.

the class JpaDbunitTestConfig method dbUnitDatabaseConnection.

@Bean(name = "dbUnitDatabaseConnection")
public DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection() throws SQLException, DatabaseUnitException, IOException {
    DatabaseDataSourceConnectionFactoryBean databaseDataSourceConnectionFactoryBean = new DatabaseDataSourceConnectionFactoryBean();
    databaseDataSourceConnectionFactoryBean.setDatabaseConfig(databaseConfigBean());
    databaseDataSourceConnectionFactoryBean.setDataSource(dataSource);
    return databaseDataSourceConnectionFactoryBean;
}
Also used : DatabaseDataSourceConnectionFactoryBean(com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean) DatabaseConfigBean(com.github.springtestdbunit.bean.DatabaseConfigBean) Bean(org.springframework.context.annotation.Bean) DatabaseDataSourceConnectionFactoryBean(com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean)

Example 2 with DatabaseConfigBean

use of com.github.springtestdbunit.bean.DatabaseConfigBean in project thingsboard by thingsboard.

the class JpaDbunitTestConfig method databaseConfigBean.

@Bean
public DatabaseConfigBean databaseConfigBean() {
    DatabaseConfigBean databaseConfigBean = new DatabaseConfigBean();
    databaseConfigBean.setDatatypeFactory(new HsqldbDataTypeFactory());
    return databaseConfigBean;
}
Also used : HsqldbDataTypeFactory(org.dbunit.ext.hsqldb.HsqldbDataTypeFactory) DatabaseConfigBean(com.github.springtestdbunit.bean.DatabaseConfigBean) DatabaseConfigBean(com.github.springtestdbunit.bean.DatabaseConfigBean) Bean(org.springframework.context.annotation.Bean) DatabaseDataSourceConnectionFactoryBean(com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean)

Aggregations

DatabaseConfigBean (com.github.springtestdbunit.bean.DatabaseConfigBean)2 DatabaseDataSourceConnectionFactoryBean (com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean)2 Bean (org.springframework.context.annotation.Bean)2 HsqldbDataTypeFactory (org.dbunit.ext.hsqldb.HsqldbDataTypeFactory)1