use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class SpringJdbcPropertyStorePrefixTest 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();
PropertyStoreSpringJdbc jdbcStore = new PropertyStoreSpringJdbc();
jdbcStore.setQueryBuilder(new JdbcQueryBuilder("T_FF4J_", "_01"));
jdbcStore.setDataSource(db);
return jdbcStore;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class SpringJdbcPropertyStoreTest method initPropertyStore.
/**
* {@inheritDoc}
*/
@Override
protected PropertyStore initPropertyStore() {
builder = new EmbeddedDatabaseBuilder();
db = //
builder.setType(EmbeddedDatabaseType.HSQL).addScript(//
"classpath:schema-ddl.sql").addScript(//
"classpath:ff-store.sql").build();
PropertyStoreSpringJdbc jdbcStore = new PropertyStoreSpringJdbc();
jdbcStore.setDataSource(db);
jdbcStore.getJdbcTemplate();
return jdbcStore;
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class SpringJdbcStoresCreateSchema method initStore.
/**
* {@inheritDoc}
* @throws SQLException
*/
public void initStore() throws SQLException {
builder = new EmbeddedDatabaseBuilder();
db = builder.setType(EmbeddedDatabaseType.HSQL).build();
PreparedStatement prepareStatement = db.getConnection().prepareStatement("CREATE SCHEMA FF4J");
prepareStatement.executeUpdate();
prepareStatement = db.getConnection().prepareStatement("CREATE SCHEMA FF4J_2");
prepareStatement.executeUpdate();
testedStore = new FeatureStoreSpringJdbc();
testedStore.setDataSource(db);
testedStore.getJdbcTemplate();
propertyStore = new PropertyStoreSpringJdbc();
propertyStore.setDataSource(db);
propertyStore.getJdbcTemplate();
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class SpringJdbcEventRepositoryTest method initRepository.
/**
* {@inheritDoc}
*/
@Override
protected EventRepository initRepository() {
builder = new EmbeddedDatabaseBuilder();
db = //
builder.setType(EmbeddedDatabaseType.HSQL).addScript(//
"classpath:schema-ddl.sql").addScript(//
"classpath:ff-store.sql").build();
return new EventRepositorySpringJdbc(db);
}
use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.
the class SpringJdbcFeatureStoreTest method initStore.
/**
* {@inheritDoc}
*/
@Override
protected FeatureStore initStore() {
builder = new EmbeddedDatabaseBuilder();
db = //
builder.setType(EmbeddedDatabaseType.HSQL).addScript(//
"classpath:schema-ddl.sql").addScript(//
"classpath:ff-store.sql").build();
FeatureStoreSpringJdbc jdbcStore = new FeatureStoreSpringJdbc();
jdbcStore.setDataSource(db);
jdbcStore.getJdbcTemplate();
return jdbcStore;
}
Aggregations