use of org.ff4j.store.JdbcFeatureStore in project ff4j by ff4j.
the class JdbcFeatureStoreErrorTest method testUpdateKO.
@Test(expected = FeatureAccessException.class)
public void testUpdateKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcFeatureStore jrepo = new JdbcFeatureStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.update(new Feature("f1", true));
}
use of org.ff4j.store.JdbcFeatureStore in project ff4j by ff4j.
the class JdbcFeatureStoreErrorTest method testexistGroupKO.
@Test(expected = FeatureAccessException.class)
public void testexistGroupKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcFeatureStore jrepo = new JdbcFeatureStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.existGroup("invalid");
}
use of org.ff4j.store.JdbcFeatureStore in project ff4j by ff4j.
the class JdbcFeatureStoreErrorTest method testcreateCustomKO.
@Test(expected = FeatureAccessException.class)
public void testcreateCustomKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcFeatureStore jrepo = new JdbcFeatureStore(mockDS);
jrepo.setDataSource(mockDS);
List<Property<?>> lp = new ArrayList<Property<?>>();
lp.add(new PropertyString("p1", "v1"));
lp.add(new PropertyString("p2", "v2"));
jrepo.createCustomProperties("F1", lp);
}
use of org.ff4j.store.JdbcFeatureStore in project ff4j by ff4j.
the class JdbcFeatureStoreErrorTest method testJetDataSourceKO.
@Test(expected = IllegalStateException.class)
public void testJetDataSourceKO() throws SQLException {
JdbcFeatureStore jrepo = new JdbcFeatureStore(null);
jrepo.getDataSource();
}
use of org.ff4j.store.JdbcFeatureStore in project ff4j by ff4j.
the class JdbcFeatureStoreErrorTest method testgetExistKO.
@Test(expected = FeatureAccessException.class)
public void testgetExistKO() throws SQLException {
DataSource mockDS = Mockito.mock(DataSource.class);
doThrow(new SQLException()).when(mockDS).getConnection();
JdbcFeatureStore jrepo = new JdbcFeatureStore(mockDS);
jrepo.setDataSource(mockDS);
jrepo.exist("xx");
}
Aggregations