use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class InMemoryPropertyStoreTest method testEmpty3.
@Test
public void testEmpty3() {
// Given
InMemoryPropertyStore ips = new InMemoryPropertyStore();
ips.createProperty(new PropertyString("P1", "v1"));
Assert.assertFalse(ips.isEmpty());
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class PropertyStoreCommonsConfig method readProperty.
/**
* {@inheritDoc}
*/
@Override
public Property<?> readProperty(String name) {
Util.assertHasLength(name);
String value = conf().getString(name);
if (value == null) {
throw new PropertyNotFoundException(name);
}
return new PropertyString(name, value);
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class FeatureCacheProviderJCacheRITest method testCacheManagerProperties.
@Test
public void testCacheManagerProperties() {
// Given
FF4jJCacheManager fcm = new FF4jJCacheManager(RICachingProvider.class.getName());
Assert.assertNotNull(fcm.getCacheProviderName());
Assert.assertNotNull(fcm.getNativeCache());
Assert.assertNotNull(fcm.getPropertyNativeCache());
// When
fcm.putProperty(new PropertyString("p1", "v1"));
// Then
Assert.assertNotNull(fcm.getProperty("p1"));
Assert.assertTrue(fcm.listCachedPropertyNames().contains("p1"));
// When
fcm.evictProperty("p1");
fcm.evictProperty("p2");
// Then
Assert.assertNull(fcm.getProperty("p1"));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class PropertyStoreJCacheTest method deleteOK.
/**
* TDD.
*/
@Test
public void deleteOK() {
// Given
testedStore.createProperty(new PropertyString("deleteOK", "ff4j"));
Assert.assertTrue(testedStore.existProperty("deleteOK"));
// When
testedStore.deleteProperty("deleteOK");
// Then
Assert.assertFalse(testedStore.existProperty("deleteOK"));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class PropertyStoreJCacheTest method addPropertyOKsimple.
// --------------- create -----------
/**
* TDD.
*/
@Test
public void addPropertyOKsimple() {
// Given
Assert.assertFalse(testedStore.existProperty("addPropertyOKsimple"));
// When
testedStore.createProperty(new PropertyString("addPropertyOKsimple", "ff4j"));
// Then
Assert.assertTrue(testedStore.existProperty("addPropertyOKsimple"));
}
Aggregations