use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class SqlEndpointLikeTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// 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();
jndi.bind("jdbc/myDataSource", db);
return jndi;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class ElSqlComponentTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// 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();
jndi.bind("dataSource", db);
return jndi;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project camel by apache.
the class ElSqlConsumerTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// 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();
jndi.bind("dataSource", db);
return jndi;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project components by Talend.
the class JdbcComponentTestIT method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().generateUniqueName(true).setType(EmbeddedDatabaseType.DERBY).setName("testdb").setScriptEncoding("UTF-8").addScript("/org/talend/components/service/rest/schema.sql").addScript("/org/talend/components/service/rest/data_users.sql").build();
// username='sa'
try (Connection connection = db.getConnection()) {
dbUrl = connection.getMetaData().getURL();
}
RestAssured.port = localServerPort;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class JdbcPropertyStorePrefixTest method initPropertyStore.
/**
* {@inheritDoc}
*/
@Override
protected PropertyStore initPropertyStore() {
builder = new EmbeddedDatabaseBuilder();
db = builder.setType(//
EmbeddedDatabaseType.HSQL).addScript(//
"classpath:ddl-prefix-schema.sql").addScript("classpath:ddl-prefix-data.sql").build();
JdbcPropertyStore jdbcStore = new JdbcPropertyStore();
jdbcStore.setQueryBuilder(new JdbcQueryBuilder("T_FF4J_", "_01"));
jdbcStore.setDataSource(db);
return jdbcStore;
}
Aggregations