use of org.hsqldb.jdbc.pool.JDBCXADataSource in project spring-boot by spring-projects.
the class XADataSourceAutoConfigurationTests method createFromUrl.
@Test
public void createFromUrl() throws Exception {
ApplicationContext context = createContext(FromProperties.class, "spring.datasource.url:jdbc:hsqldb:mem:test", "spring.datasource.username:un");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertThat(dataSource).isNotNull();
assertThat(dataSource.getUrl()).isEqualTo("jdbc:hsqldb:mem:test");
assertThat(dataSource.getUser()).isEqualTo("un");
}
use of org.hsqldb.jdbc.pool.JDBCXADataSource in project spring-boot by spring-projects.
the class XADataSourceAutoConfigurationTests method createFromClass.
@Test
public void createFromClass() throws Exception {
ApplicationContext context = createContext(FromProperties.class, "spring.datasource.xa.data-source-class-name:org.hsqldb.jdbc.pool.JDBCXADataSource", "spring.datasource.xa.properties.database-name:test");
context.getBean(DataSource.class);
MockXADataSourceWrapper wrapper = context.getBean(MockXADataSourceWrapper.class);
JDBCXADataSource dataSource = (JDBCXADataSource) wrapper.getXaDataSource();
assertThat(dataSource).isNotNull();
assertThat(dataSource.getDatabaseName()).isEqualTo("test");
}
Aggregations