use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testInitializations.
@Test
public void testInitializations() {
InMemoryCacheManager fcm = new InMemoryCacheManager();
Assert.assertNotNull(fcm.getFeatureNativeCache());
Assert.assertNotNull(fcm.getPropertyNativeCache());
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testPutNullPropertyName.
@Test(expected = IllegalArgumentException.class)
public void testPutNullPropertyName() {
PropertyString p = new PropertyString();
p.setName(null);
new InMemoryCacheManager().putProperty(p);
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testPutEmptyFeatureId.
@Test(expected = IllegalArgumentException.class)
public void testPutEmptyFeatureId() {
Feature f = new Feature("a");
f.setUid("");
new InMemoryCacheManager().putFeature(f);
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testReadFeature.
@Test
public void testReadFeature() {
// Given
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putFeature(new Feature("f1"), 100);
// When
Feature f = imcm.getFeature("f1");
// Then
Assert.assertNotNull(f);
// When
imcm.putFeature(new Feature("f1"), 1);
}
use of org.ff4j.cache.InMemoryCacheManager in project ff4j by ff4j.
the class InMemoryCacheTest method testPutNullFeatureId.
@Test(expected = IllegalArgumentException.class)
public void testPutNullFeatureId() {
Feature f = new Feature("a");
f.setUid(null);
new InMemoryCacheManager().putFeature(f);
}
Aggregations