Package org.ff4j.cache

Examples of org.ff4j.cache.InMemoryCacheManager


public class InMemoryCacheTest extends AbstractStoreTest {

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


        return new FeatureStoreCacheProxy(new InMemoryFeatureStore("ff4j.xml"), new InMemoryCacheManager());
    }

    @Test
    public void testInitializations() {
        InMemoryCacheManager fcm = new InMemoryCacheManager();
        fcm.setTtl(10);
        Assert.assertEquals(10, fcm.getTtl());
        Assert.assertNotNull(fcm.getNativeCache());
    }
View Full Code Here

        Assert.assertNotNull(fcm.getNativeCache());
    }

    @Test(expected = IllegalArgumentException.class)
    public void testPutNullisIlegal() {
        new InMemoryCacheManager().put(null);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testPutNullFeatureId() {
        Feature f = new Feature("a");
        f.setUid(null);
        new InMemoryCacheManager().put(f);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testPutEmptyFeatureId() {
        Feature f = new Feature("a");
        f.setUid("");
        new InMemoryCacheManager().put(f);
    }
View Full Code Here

    }

    @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

TOP

Related Classes of org.ff4j.cache.InMemoryCacheManager

Copyright © 2018 www.massapicom. 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.