use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testGetFeatureTimeout.
@Test
public void testGetFeatureTimeout() throws InterruptedException {
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putFeature(new Feature("f2"), 1);
Thread.sleep(1100);
Assert.assertNull(imcm.getFeature("f2"));
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testClear.
@Test
public void testClear() {
// Given
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putProperty(new PropertyString("p1"));
Assert.assertFalse(imcm.listCachedPropertyNames().isEmpty());
// When
imcm.clearProperties();
// Then
Assert.assertTrue(imcm.listCachedPropertyNames().isEmpty());
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testPutNullFeatureId1.
@Test(expected = IllegalArgumentException.class)
public void testPutNullFeatureId1() {
Feature f = new Feature("a");
f.setUid(null);
new InMemoryCacheManager().putFeature(f, 1);
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class FF4jTest method testInitCache.
@Test
public void testInitCache() {
FF4j ff4j = new FF4j();
ff4j.cache(new InMemoryCacheManager());
}
Aggregations