Search in sources :

Example 1 with FeatureStoreSpringJdbc

use of org.ff4j.springjdbc.store.FeatureStoreSpringJdbc in project ff4j by ff4j.

the class TestSpringJdbcErrors method testErrorOnDataSource.

@Test(expected = IllegalStateException.class)
public void testErrorOnDataSource() {
    FeatureStoreSpringJdbc s = new FeatureStoreSpringJdbc();
    s.getJdbcTemplate();
}
Also used : FeatureStoreSpringJdbc(org.ff4j.springjdbc.store.FeatureStoreSpringJdbc) Test(org.junit.Test)

Example 2 with FeatureStoreSpringJdbc

use of org.ff4j.springjdbc.store.FeatureStoreSpringJdbc in project ff4j by ff4j.

the class SpringJdbcEmbedDataSourceStoreTest 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;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) FeatureStoreSpringJdbc(org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)

Example 3 with FeatureStoreSpringJdbc

use of org.ff4j.springjdbc.store.FeatureStoreSpringJdbc in project ff4j by ff4j.

the class SpringJdbcFeatureStorePrefixTest method initStore.

/**
 * {@inheritDoc}
 */
@Override
protected FeatureStore initStore() {
    builder = new EmbeddedDatabaseBuilder();
    db = builder.setType(// 
    EmbeddedDatabaseType.HSQL).addScript(// 
    "classpath:ddl-prefix-schema.sql").addScript("classpath:ddl-prefix-data.sql").build();
    FeatureStoreSpringJdbc jdbcStore = new FeatureStoreSpringJdbc();
    jdbcStore.setQueryBuilder(new JdbcQueryBuilder("T_FF4J_", "_01"));
    jdbcStore.setDataSource(db);
    return jdbcStore;
}
Also used : JdbcQueryBuilder(org.ff4j.store.JdbcQueryBuilder) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) FeatureStoreSpringJdbc(org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)

Example 4 with FeatureStoreSpringJdbc

use of org.ff4j.springjdbc.store.FeatureStoreSpringJdbc in project ff4j by ff4j.

the class SpringJdbcFeatureStoreTestInitXml 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;
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) FeatureStoreSpringJdbc(org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)

Example 5 with FeatureStoreSpringJdbc

use of org.ff4j.springjdbc.store.FeatureStoreSpringJdbc 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();
}
Also used : PropertyStoreSpringJdbc(org.ff4j.springjdbc.store.PropertyStoreSpringJdbc) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) PreparedStatement(java.sql.PreparedStatement) FeatureStoreSpringJdbc(org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)

Aggregations

FeatureStoreSpringJdbc (org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)6 EmbeddedDatabaseBuilder (org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)5 PreparedStatement (java.sql.PreparedStatement)1 PropertyStoreSpringJdbc (org.ff4j.springjdbc.store.PropertyStoreSpringJdbc)1 JdbcQueryBuilder (org.ff4j.store.JdbcQueryBuilder)1 Test (org.junit.Test)1