Search in sources :

Example 1 with PropertyLogLevel

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

the class PropertyStoreArchaiusPolledSourceTest method readOKFixed.

/**
 * TDD.
 */
@Override
@Test
public void readOKFixed() {
    // Given
    testedStore.createProperty(new PropertyLogLevel(READ_OK_FIXED, LogLevel.ERROR));
    // When
    Property<?> log = testedStore.readProperty(READ_OK_FIXED);
    // Then
    Assert.assertNotNull(log);
    Assert.assertNotNull(log.getName());
    Assert.assertEquals(READ_OK_FIXED, log.getName());
    Assert.assertEquals(LogLevel.ERROR.name(), log.getValue());
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 2 with PropertyLogLevel

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

the class PropertyStoreArchaiusPolledSourceTest method updateOK.

/**
 * TDD.
 */
@Override
@Test
public void updateOK() {
    // Given
    testedStore.createProperty(new PropertyLogLevel(UPDATE_OK, LogLevel.ERROR));
    // When
    testedStore.updateProperty(UPDATE_OK, "INFO");
    // Then
    Assert.assertEquals("INFO", testedStore.readProperty(UPDATE_OK).getValue());
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 3 with PropertyLogLevel

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

the class PropertyStoreCommonsConfigTest method updateOK.

/**
 * TDD.
 */
@Override
@Test
public void updateOK() {
    // Given
    testedStore.createProperty(new PropertyLogLevel(UPDATE_OK, LogLevel.ERROR));
    // When
    testedStore.updateProperty(UPDATE_OK, "INFO");
    // Then
    Assert.assertEquals("INFO", testedStore.readProperty(UPDATE_OK).getValue());
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 4 with PropertyLogLevel

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

the class PropertyStoreJCacheTest method addPropertyKOAlreadyExist.

/**
 * TDD.
 */
@Test(expected = PropertyAlreadyExistException.class)
public void addPropertyKOAlreadyExist() {
    // Given
    testedStore.createProperty(new PropertyLogLevel("log", LogLevel.DEBUG));
    Assert.assertTrue(testedStore.existProperty("log"));
    // When
    testedStore.createProperty(new PropertyLogLevel("log", LogLevel.DEBUG));
// Then expect to fail
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Example 5 with PropertyLogLevel

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

the class PropertyStoreJCacheTest method updateOKProperties.

/**
 * TDD.
 */
@Test
public void updateOKProperties() {
    // Given
    testedStore.createProperty(new PropertyLogLevel("logX", LogLevel.ERROR));
    // When
    PropertyLogLevel pll = new PropertyLogLevel("logX", LogLevel.INFO);
    testedStore.updateProperty(pll);
    // Then
    Assert.assertEquals(LogLevel.INFO, testedStore.readProperty("logX").getValue());
}
Also used : PropertyLogLevel(org.ff4j.property.PropertyLogLevel) Test(org.junit.Test)

Aggregations

PropertyLogLevel (org.ff4j.property.PropertyLogLevel)29 Test (org.junit.Test)29 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