Search in sources :

Example 21 with InMemoryPropertyStore

use of org.ff4j.property.store.InMemoryPropertyStore in project ff4j by ff4j.

the class InMemoryPropertiesStoreTest method testEmpty2.

@Test
public void testEmpty2() {
    // Given
    InMemoryPropertyStore ips = new InMemoryPropertyStore();
    ips.setProperties(null);
    Assert.assertTrue(ips.isEmpty());
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) Test(org.junit.Test)

Example 22 with InMemoryPropertyStore

use of org.ff4j.property.store.InMemoryPropertyStore in project ff4j by ff4j.

the class InMemoryPropertiesStoreTest method testDonotImportInvalid.

@Test(expected = IllegalArgumentException.class)
public void testDonotImportInvalid() {
    InMemoryPropertyStore f = new InMemoryPropertyStore();
    f.importPropertiesFromXmlFile("invalid.xml");
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) Test(org.junit.Test)

Example 23 with InMemoryPropertyStore

use of org.ff4j.property.store.InMemoryPropertyStore in project ff4j by ff4j.

the class InMemoryPropertiesStoreTest method testImportTwice.

@Test
public void testImportTwice() {
    InMemoryPropertyStore f = new InMemoryPropertyStore();
    f.importPropertiesFromXmlFile("ff4j.xml");
    f.importPropertiesFromXmlFile("ff4j.xml");
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) Test(org.junit.Test)

Example 24 with InMemoryPropertyStore

use of org.ff4j.property.store.InMemoryPropertyStore in project ff4j by ff4j.

the class InMemoryPropertiesStoreTest method testDonotImportNull.

@Test(expected = IllegalArgumentException.class)
public void testDonotImportNull() {
    InMemoryPropertyStore f = new InMemoryPropertyStore();
    f.importPropertiesFromXmlFile(null);
}
Also used : InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) Test(org.junit.Test)

Example 25 with InMemoryPropertyStore

use of org.ff4j.property.store.InMemoryPropertyStore in project ff4j by ff4j.

the class AssertTest method initFF4J.

@Before
public void initFF4J() {
    if (assertFF4j == null) {
        ff4j = new FF4j();
        ff4j.setFeatureStore(new InMemoryFeatureStore("test-ff4j-features.xml"));
        ff4j.setPropertiesStore(new InMemoryPropertyStore("test-ff4j-features.xml"));
        ff4j.setAuthorizationsManager(new DefaultAuthorisationManager(Util.set("PERM1", "PERM2"), Util.set("PERM1", "PERM2", "PERM3")));
        assertFF4j = new AssertFf4j(ff4j);
    }
}
Also used : AssertFf4j(org.ff4j.test.AssertFf4j) InMemoryPropertyStore(org.ff4j.property.store.InMemoryPropertyStore) FF4j(org.ff4j.FF4j) InMemoryFeatureStore(org.ff4j.store.InMemoryFeatureStore) Before(org.junit.Before)

Aggregations

InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)41 Test (org.junit.Test)28 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)10 PropertyString (org.ff4j.property.PropertyString)8 Property (org.ff4j.property.Property)6 PropertyStore (org.ff4j.property.store.PropertyStore)6 InputStream (java.io.InputStream)4 Before (org.junit.Before)4 FF4j (org.ff4j.FF4j)3 FF4jCacheProxy (org.ff4j.cache.FF4jCacheProxy)3 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)3 AbstractPollingScheduler (com.netflix.config.AbstractPollingScheduler)2 DynamicConfiguration (com.netflix.config.DynamicConfiguration)2 FixedDelayPollingScheduler (com.netflix.config.FixedDelayPollingScheduler)2 PolledConfigurationSource (com.netflix.config.PolledConfigurationSource)2 HashSet (java.util.HashSet)2 FF4JCacheManager (org.ff4j.cache.FF4JCacheManager)2 Feature (org.ff4j.core.Feature)2 BeforeClass (org.junit.BeforeClass)2 ClientResponse (com.sun.jersey.api.client.ClientResponse)1