Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
28 lines (23 sloc) 1.3 KB
package com.hp.autonomy.frontend.find.core.savedsearches;
import com.github.springtestdbunit.bean.DatabaseConfigBean;
import com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean;
import org.dbunit.database.DatabaseDataSourceConnection;
import org.dbunit.ext.h2.H2DataTypeFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
@Configuration
public class SavedSearchTestConfiguration {
@SuppressWarnings("ProhibitedExceptionDeclared")
@Bean
public DatabaseDataSourceConnection testConnection(final DataSource dataSource) throws Exception {
final DatabaseConfigBean databaseConfigBean = new DatabaseConfigBean();
databaseConfigBean.setDatatypeFactory(new H2DataTypeFactory());
databaseConfigBean.setCaseSensitiveTableNames(false);
final DatabaseDataSourceConnectionFactoryBean databaseDataSourceConnectionFactoryBean = new DatabaseDataSourceConnectionFactoryBean();
databaseDataSourceConnectionFactoryBean.setDataSource(dataSource);
databaseDataSourceConnectionFactoryBean.setDatabaseConfig(databaseConfigBean);
databaseDataSourceConnectionFactoryBean.setSchema("FIND");
return databaseDataSourceConnectionFactoryBean.getObject();
}
}
You can’t perform that action at this time.