use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class InMemoryCacheTest method testEvictProperty1.
@Test
public void testEvictProperty1() {
// Given
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putProperty(new PropertyString("p1"));
Assert.assertFalse(imcm.listCachedPropertyNames().isEmpty());
// When
imcm.evictProperty("p1");
// Then
Assert.assertTrue(imcm.listCachedPropertyNames().isEmpty());
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class InMemoryCacheTest method testPutEmptyPropertyName.
@Test(expected = IllegalArgumentException.class)
public void testPutEmptyPropertyName() {
PropertyString p = new PropertyString();
p.setName("");
new InMemoryCacheManager().putProperty(p);
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class InMemoryCacheTest method testEvictProperty2.
@Test
public void testEvictProperty2() {
// Given
InMemoryCacheManager imcm = new InMemoryCacheManager();
imcm.putProperty(new PropertyString("p2"));
Assert.assertFalse(imcm.listCachedPropertyNames().isEmpty());
// When
imcm.evictProperty("p1");
// Then
Assert.assertFalse(imcm.listCachedPropertyNames().isEmpty());
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class AbstractPropertyStoreJunitTest method readOK.
// ------------------ read --------------------
@Test
public void readOK() {
// Given
testedStore.createProperty(new PropertyString("toto", "ff4j"));
// When
Property<?> ap = testedStore.readProperty("toto");
// Then
Assert.assertNotNull(ap);
Assert.assertNotNull(ap.getName());
Assert.assertEquals("toto", ap.getName());
Assert.assertEquals("ff4j", ap.getValue());
Assert.assertEquals("ff4j", ap.asString());
Assert.assertNull(ap.getFixedValues());
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class AbstractPropertyStoreJunitTest method deleteOK.
/**
* TDD.
*/
@Test
public void deleteOK() {
// Given
testedStore.createProperty(new PropertyString("toto", "ff4j"));
Assert.assertTrue(testedStore.existProperty("toto"));
// When
testedStore.deleteProperty("toto");
// Then
Assert.assertFalse(testedStore.existProperty("toto"));
}
Aggregations