Search in sources :

Example 31 with PropertyLogLevel

use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.

the class AbstractPropertyStoreJunitTest method addPropertyOKLogLevel.

/**
 * TDD.
 */
@Test
public void addPropertyOKLogLevel() {
    // Given
    // Assert.assertFalse(testedStore.exist("log"));
    // When
    testedStore.createProperty(new PropertyLogLevel("log", LogLevel.DEBUG));
    // Then
    Assert.assertTrue(testedStore.existProperty("log"));
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 32 with PropertyLogLevel

use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.

the class AbstractPropertyStoreJunitTest method updateKOInvalidValue.

/**
 * TDD.
 */
@Test(expected = IllegalArgumentException.class)
public void updateKOInvalidValue() {
    // Given
    testedStore.createProperty(new PropertyLogLevel("log", LogLevel.ERROR));
    // When
    testedStore.updateProperty("log", "KO");
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 33 with PropertyLogLevel

use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.

the class AbstractPropertyStoreJunitTest method importPropertiesOK.

/**
 * TDD.
 */
@Test
public void importPropertiesOK() {
    // Given
    Assert.assertNotNull(testedStore);
    Assert.assertFalse(testedStore.existProperty("titi1"));
    Assert.assertFalse(testedStore.existProperty("titi2"));
    Assert.assertTrue(testedStore.existProperty("a"));
    // When
    Set<Property<?>> setOfProperty = new HashSet<Property<?>>();
    setOfProperty.add(new PropertyLogLevel("a", LogLevel.INFO));
    setOfProperty.add(new PropertyLogLevel("titi1", LogLevel.INFO));
    setOfProperty.add(new PropertyLogLevel("titi2", LogLevel.INFO));
    testedStore.importProperties(setOfProperty);
    // Then
    Assert.assertTrue(testedStore.existProperty("titi1"));
    Assert.assertTrue(testedStore.existProperty("titi2"));
    Assert.assertTrue(testedStore.existProperty("a"));
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Property(org.ff4j.property.Property) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

PropertyLogLevel (org.ff4j.property.PropertyLogLevel)33 Test (org.junit.Test)33 Property (org.ff4j.property.Property)3 HashSet (java.util.HashSet)2 Feature (org.ff4j.core.Feature)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 FF4jCacheProxy (org.ff4j.cache.FF4jCacheProxy)1 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)1 XmlConfig (org.ff4j.conf.XmlConfig)1 XmlParser (org.ff4j.conf.XmlParser)1 PropertyString (org.ff4j.property.PropertyString)1 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)1 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)1