use of org.ff4j.store.JdbcQueryBuilder in project ff4j by ff4j.
the class JdbcEventRepositorySchemaTest method testCreateSchema.
@Test
public void testCreateSchema() {
DataSource ds = testedStore.getDataSource();
JdbcQueryBuilder qb = testedStore.getQueryBuilder();
// Given
Assert.assertFalse(isTableExist(ds, qb.getTableNameAudit()));
// When
testedStore.createSchema();
// then
Assert.assertTrue(isTableExist(ds, qb.getTableNameAudit()));
// When (no error)
testedStore.createSchema();
}
use of org.ff4j.store.JdbcQueryBuilder in project ff4j by ff4j.
the class JdbcPropertyStoreSchemaTest method testCreateSchema.
@Test
public void testCreateSchema() {
DataSource ds = testedStore.getDataSource();
JdbcQueryBuilder qb = testedStore.getQueryBuilder();
// Given
Assert.assertFalse(isTableExist(ds, qb.getTableNameProperties()));
// When
testedStore.createSchema();
// then
Assert.assertTrue(isTableExist(ds, qb.getTableNameProperties()));
// When (no error)
testedStore.createSchema();
}
use of org.ff4j.store.JdbcQueryBuilder 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.ff4j.store.JdbcQueryBuilder in project ff4j by ff4j.
the class SpringJdbcStoresCreateSchema method testCreateTablesWithDataBaseSchema.
@Test
public void testCreateTablesWithDataBaseSchema() {
JdbcQueryBuilder queryBuilder = testedStore.getQueryBuilder();
queryBuilder.setDbSchema("FF4J");
testedStore.createSchema();
DataSource dataSource = testedStore.getJdbcTemplate().getDataSource();
Assert.assertTrue(JdbcUtils.isTableExist(dataSource, queryBuilder.getTableNameFeatures(), "FF4J"));
Assert.assertFalse(JdbcUtils.isTableExist(dataSource, queryBuilder.getTableNameFeatures(), "FF4J_2"));
}
Aggregations