Search in sources :

Example 11 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.

the class JdbcPropertyStoreTest method initJdbcPropertyStore.

@Test
public void initJdbcPropertyStore() {
    EmbeddedDatabaseBuilder b2 = new EmbeddedDatabaseBuilder();
    EmbeddedDatabase db2 = // 
    b2.setType(EmbeddedDatabaseType.HSQL).build();
    JdbcPropertyStore jdbcStore2 = new JdbcPropertyStore(db2, "ff4j.xml");
    Assert.assertNotNull(jdbcStore2);
}
Also used : EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) EmbeddedDatabase(org.springframework.jdbc.datasource.embedded.EmbeddedDatabase) JdbcPropertyStore(org.ff4j.property.store.JdbcPropertyStore) Test(org.junit.Test)

Example 12 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.

the class JdbcFeatureStoreCoreTest 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();
    JdbcFeatureStore jdbcStore = new JdbcFeatureStore();
    jdbcStore.setDataSource(db);
    return jdbcStore;
}
Also used : JdbcFeatureStore(org.ff4j.store.JdbcFeatureStore) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)

Example 13 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.

the class JdbcFeatureStorePrefixTest 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();
    JdbcFeatureStore jdbcStore = new JdbcFeatureStore();
    jdbcStore.setQueryBuilder(new JdbcQueryBuilder("T_FF4J_", "_01"));
    jdbcStore.setDataSource(db);
    return jdbcStore;
}
Also used : JdbcFeatureStore(org.ff4j.store.JdbcFeatureStore) JdbcQueryBuilder(org.ff4j.store.JdbcQueryBuilder) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)

Example 14 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder in project ff4j by ff4j.

the class JdbcFeatureStoreTestInvalidData method setUp.

/**
 * {@inheritDoc}
 */
@Before
public void setUp() throws Exception {
    EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    db = builder.setType(// 
    EmbeddedDatabaseType.HSQL).addScript(// 
    "classpath:schema-ddl.sql").addScript("classpath:ff-invalidstore.sql").build();
    jdbcStore = new JdbcFeatureStore();
    jdbcStore.setDataSource(db);
}
Also used : JdbcFeatureStore(org.ff4j.store.JdbcFeatureStore) EmbeddedDatabaseBuilder(org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder) Before(org.junit.Before)

Example 15 with EmbeddedDatabaseBuilder

use of org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder 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)

Aggregations

EmbeddedDatabaseBuilder (org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder)67 Before (org.junit.Before)17 JdbcTemplate (org.springframework.jdbc.core.JdbcTemplate)15 EmbeddedDatabase (org.springframework.jdbc.datasource.embedded.EmbeddedDatabase)15 JndiRegistry (org.apache.camel.impl.JndiRegistry)11 Bean (org.springframework.context.annotation.Bean)9 JdbcPropertyStore (org.ff4j.property.store.JdbcPropertyStore)5 FeatureStoreSpringJdbc (org.ff4j.springjdbc.store.FeatureStoreSpringJdbc)5 JdbcFeatureStore (org.ff4j.store.JdbcFeatureStore)5 JdbcQueryBuilder (org.ff4j.store.JdbcQueryBuilder)4 Test (org.junit.Test)4 PropertyStoreSpringJdbc (org.ff4j.springjdbc.store.PropertyStoreSpringJdbc)3 BeforeClass (org.junit.BeforeClass)3 Test (org.junit.jupiter.api.Test)3 PreparedStatement (java.sql.PreparedStatement)2 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)2 JdbcEventRepository (org.ff4j.audit.repository.JdbcEventRepository)2 Connection (java.sql.Connection)1 Map (java.util.Map)1 Properties (java.util.Properties)1