use of cn.taketoday.jdbc.core.JdbcTemplate in project today-infrastructure by TAKETODAY.
the class AbstractDatabaseInitializationTests method setUp.
@BeforeEach
void setUp() {
db = new EmbeddedDatabaseBuilder().setType(getEmbeddedDatabaseType()).build();
jdbcTemplate = new JdbcTemplate(db);
}
use of cn.taketoday.jdbc.core.JdbcTemplate in project today-infrastructure by TAKETODAY.
the class InferredDataSourceSqlScriptsTests method database1.
@Test
@Sql(scripts = "data-add-dogbert.sql", config = @SqlConfig(transactionManager = "txMgr1"))
void database1() {
TransactionAssert.assertThatTransaction().isNotActive();
assertUsers(new JdbcTemplate(dataSource1), "Dilbert", "Dogbert");
}
use of cn.taketoday.jdbc.core.JdbcTemplate in project today-infrastructure by TAKETODAY.
the class InferredDataSourceTransactionalSqlScriptsTests method database2.
@Test
@Transactional("txMgr2")
@Sql(scripts = "data-add-catbert.sql", config = @SqlConfig(transactionManager = "txMgr2"))
void database2() {
assertThatTransaction().isActive();
assertUsers(new JdbcTemplate(dataSource2), "Dilbert", "Catbert");
}
use of cn.taketoday.jdbc.core.JdbcTemplate in project today-infrastructure by TAKETODAY.
the class InferredDataSourceTransactionalSqlScriptsTests method database1.
@Test
@Transactional("txMgr1")
@Sql(scripts = "data-add-dogbert.sql", config = @SqlConfig(transactionManager = "txMgr1"))
void database1() {
assertThatTransaction().isActive();
assertUsers(new JdbcTemplate(dataSource1), "Dilbert", "Dogbert");
}
use of cn.taketoday.jdbc.core.JdbcTemplate in project today-infrastructure by TAKETODAY.
the class AbstractTransactionalAnnotatedConfigClassTests method setDataSource.
@Autowired
public void setDataSource(DataSource dataSource) {
this.dataSourceViaInjection = dataSource;
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
Aggregations