use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlRouteTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlTransactedRouteTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry reg = super.createRegistry();
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).build();
reg.bind("testdb", db);
DataSourceTransactionManager txMgr = new DataSourceTransactionManager();
txMgr.setDataSource(db);
reg.bind("txManager", txMgr);
SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
txPolicy.setTransactionManager(txMgr);
txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
reg.bind("required", txPolicy);
return reg;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlConsumerDeleteBatchCompleteTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlConsumerOutputTypeSelectOneTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
camel1 = new DefaultCamelContext();
camel1.setName("camel-1");
camel1.getComponent("sql", SqlComponent.class).setDataSource(db);
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlDataSourceRefTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// START SNIPPET: e2
// this is the database we create with some initial data for our unit test
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
// END SNIPPET: e2
jndi.bind("jdbc/myDataSource", db);
return jndi;
}
Aggregations