use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testAccessors.
@Test
public void testAccessors() {
InMemoryCacheManager imcm = new InMemoryCacheManager();
Assert.assertNotNull(imcm.getCacheProviderName());
Assert.assertTrue(imcm.listCachedFeatureNames().isEmpty());
Assert.assertTrue(imcm.listCachedPropertyNames().isEmpty());
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testExistBis.
@Test
public void testExistBis() {
FF4jCacheProxy fscp = new FF4jCacheProxy(new InMemoryFeatureStore("ff4j.xml"), null, new InMemoryCacheManager());
Assert.assertFalse(fscp.exist("toto"));
Assert.assertFalse(fscp.exist("toto"));
Assert.assertTrue(fscp.exist("first"));
Assert.assertTrue(fscp.exist("first"));
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testGetPropertyTimeout.
@Test
public void testGetPropertyTimeout() throws InterruptedException {
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putProperty(new PropertyString("p1"), 1);
imcm.putProperty(new PropertyString("p2"), 10);
Thread.sleep(1100);
Assert.assertNull(imcm.getProperty("p1"));
Assert.assertNotNull(imcm.getProperty("p2"));
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testGetProperty2.
@Test(expected = IllegalArgumentException.class)
public void testGetProperty2() {
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putProperty(null, 1);
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testGetProperty3.
@Test(expected = IllegalArgumentException.class)
public void testGetProperty3() {
InMemoryCacheManager imcm = new InMemoryCacheManager();
PropertyString p1 = new PropertyString("p1");
p1.setName(null);
imcm.putProperty(p1, 1);
}
Aggregations