Search in sources :

Example 16 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jTest method testCreateSchema.

@Test
public void testCreateSchema() {
    FF4j ff4j = new FF4j();
    ff4j.createSchema();
    ff4j.setFeatureStore(null);
    ff4j.setPropertiesStore(null);
    ff4j.setEventRepository(null);
    // No error event with null elements
    ff4j.createSchema();
    Assert.assertNotNull(ff4j);
}
Also used : FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Example 17 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FeatureStoreAuditProxyTest method initStore.

/**
 * {@inheritDoc}
 */
@Override
public FeatureStore initStore() {
    FF4j ff4j = new FF4j();
    InMemoryFeatureStore imfs = new InMemoryFeatureStore();
    imfs.setLocation("ff4j.xml");
    ff4j.setFeatureStore(imfs);
    return new FeatureStoreAuditProxy(ff4j, imfs);
}
Also used : FF4j(org.ff4j.FF4j) InMemoryFeatureStore(org.ff4j.store.InMemoryFeatureStore) FeatureStoreAuditProxy(org.ff4j.audit.proxy.FeatureStoreAuditProxy)

Example 18 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class CoreFeatureStoreTestSupport method setUp.

/**
 * {@inheritDoc}
 */
@Before
public void setUp() throws Exception {
    ff4j = new FF4j();
    FeatureStore fs = initStore();
    ff4j.setFeatureStore(fs);
    testedStore = fs;
    assertFf4j = new AssertFf4j(ff4j);
}
Also used : AssertFf4j(org.ff4j.test.AssertFf4j) FF4j(org.ff4j.FF4j) TestConstantsFF4j(org.ff4j.test.TestConstantsFF4j) FeatureStore(org.ff4j.core.FeatureStore) Before(org.junit.Before)

Example 19 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class PropertyStoreAuditProxyTest method initPropertyStore.

/**
 * {@inheritDoc}
 */
@Override
protected PropertyStore initPropertyStore() {
    FF4j ff4j = new FF4j();
    PropertyStore ps = new InMemoryPropertyStore("ff4j.xml");
    ff4j.setPropertiesStore(ps);
    return new PropertyStoreAuditProxy(ff4j, ps);
}
Also used : PropertyStoreAuditProxy(org.ff4j.audit.proxy.PropertyStoreAuditProxy) InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) FF4j(org.ff4j.FF4j) InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) PropertyStore(org.ff4j.property.store.PropertyStore)

Example 20 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class CacheProxyTest method testCacheProxy.

@Test
public void testCacheProxy() {
    FF4j myFF4J = new FF4j();
    Assert.assertNull(myFF4J.getCacheProxy());
    myFF4J.setEnableAudit(true);
    Assert.assertNull(myFF4J.getCacheProxy());
    Assert.assertNotNull(myFF4J.getConcreteFeatureStore());
}
Also used : FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Aggregations

FF4j (org.ff4j.FF4j)60 Test (org.junit.Test)41 Before (org.junit.Before)9 Feature (org.ff4j.core.Feature)8 ArrayList (java.util.ArrayList)4 PropertyString (org.ff4j.property.PropertyString)4 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)4 AssertFf4j (org.ff4j.test.AssertFf4j)4 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)3 Date (java.util.Date)2 HashSet (java.util.HashSet)2 PropertyStoreAuditProxy (org.ff4j.audit.proxy.PropertyStoreAuditProxy)2 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)2 FeatureStore (org.ff4j.core.FeatureStore)2 PropertyDate (org.ff4j.property.PropertyDate)2 PropertyStore (org.ff4j.property.store.PropertyStore)2 SpringSecurityAuthorisationManager (org.ff4j.security.SpringSecurityAuthorisationManager)2 TestConstantsFF4j (org.ff4j.test.TestConstantsFF4j)2 ApiConfig (org.ff4j.web.ApiConfig)2 ApiConfigBuilder (org.ff4j.web.ApiConfigBuilder)2