Examples of InMemoryFeatureStore


Examples of org.ff4j.store.InMemoryFeatureStore

    private final FeatureCacheManager cache = new FeatureCacheProviderEhCache();

    /** {@inheritDoc} */
    @Override
    public FeatureStore initStore() {
        FeatureStore store = new InMemoryFeatureStore("test-ehcacheProvider.xml");
        return new FeatureStoreCacheProxy(store, cache);
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

     */
    @Test(expected = IllegalArgumentException.class)
    public void testUnitFeatureInitialization3() {
        // Given
        // 'invalid.xml' file does not exist.
        new InMemoryFeatureStore("invalid.xml");
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

public class InMemoryCacheTest extends AbstractStoreTest {

    /** {@inheritDoc} */
    @Override
    public FeatureStore initStore() {
        return new FeatureStoreCacheProxy(new InMemoryFeatureStore("ff4j.xml"), new InMemoryCacheManager());
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

    @Test
    public void testExistBis() {
        FeatureStoreCacheProxy fscp = new FeatureStoreCacheProxy();
        fscp.setCacheManager(new InMemoryCacheManager());
        fscp.setTarget(new InMemoryFeatureStore("ff4j.xml"));
        Assert.assertFalse(fscp.exist("toto"));
        Assert.assertFalse(fscp.exist("toto"));
        Assert.assertTrue(fscp.exist("first"));
        Assert.assertTrue(fscp.exist("first"));
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

public class InMemoryStoreTest extends AbstractStoreTest {

    /** {@inheritDoc} */
    @Override
    public FeatureStore initStore() {
        InMemoryFeatureStore imfs = new InMemoryFeatureStore();
        imfs.setLocation("ff4j.xml");
        return imfs;
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

        return imfs;
    }

    @Test
    public void testUnitFeatureInitialization() {
        InMemoryFeatureStore imfs = new InMemoryFeatureStore();
        imfs.create(new Feature("default", true, "grp1", "desc", null, new PonderationStrategy()));
        Assert.assertEquals(1, imfs.readAll().size());
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

    @Test
    public void testUnitFeatureInitialization2() {
        LinkedHashMap<String, Feature> map1 = new LinkedHashMap<String, Feature>();
        map1.put("new", new Feature("new", true, "description"));
        map1.put("old", new Feature("old", true, "description"));
        InMemoryFeatureStore imfs = new InMemoryFeatureStore(map1);
        Assert.assertEquals(2, imfs.readAll().size());
        Assert.assertNotNull(imfs.read("old"));
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

        Assert.assertNotNull(imfs.read("old"));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testUnitFeatureInitialization3() {
        new InMemoryFeatureStore("invalid.xml");
    }
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

      
        // Initializing cache manager
        FeatureCacheManager cache = new FeatureCacheProviderRedis();

        // Initializing Features for test
        FeatureStore store = new InMemoryFeatureStore(TEST_FEATURES_FILE);
        Feature fold = store.read(F4);
       
        // Put in Cache
        cache.put(fold);
       
        // Retrieve object
View Full Code Here

Examples of org.ff4j.store.InMemoryFeatureStore

    /**
     * Constructor initializing ff4j with an InMemoryStore
     */
    public FF4j(String xmlFile) {
        this.store = new InMemoryFeatureStore(xmlFile);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.