Search in sources :

Example 6 with PropertyDate

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

the class InMemoryPropertyStoreTest method testProperty.

public void testProperty() {
    FF4j ff4j = new FF4j("ff4j.xml");
    ff4j.getPropertiesStore().createProperty(new PropertyDate("property_3", new Date()));
    Property<?> ap = ff4j.getPropertiesStore().readProperty("property_3");
    PropertyDate pDate = (PropertyDate) ap;
    pDate.setValue(new Date());
    ff4j.getPropertiesStore().updateProperty(pDate);
    ff4j.getPropertiesStore().deleteProperty("property_3");
    Assert.assertFalse(testedStore.existProperty("property_3"));
}
Also used : FF4j(org.ff4j.FF4j) Date(java.util.Date) PropertyDate(org.ff4j.property.PropertyDate) PropertyDate(org.ff4j.property.PropertyDate)

Example 7 with PropertyDate

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

the class PropertyTest method tesInitPropertyDate.

@Test
public void tesInitPropertyDate() {
    PropertyDate d0 = new PropertyDate();
    d0.fromString("2015-01-02 13:00:00");
    PropertyDate d1 = new PropertyDate("d1");
    Assert.assertNotNull(d1.getName());
    PropertyDate d2 = new PropertyDate("d2", "2015-01-02 13:00:00");
    Assert.assertNotNull(d2.getName());
    Date dd = null;
    PropertyDate d3 = new PropertyDate("d3", dd);
    Assert.assertNull(d3.asString());
}
Also used : Date(java.util.Date) PropertyDate(org.ff4j.property.PropertyDate) PropertyDate(org.ff4j.property.PropertyDate) Test(org.junit.Test)

Example 8 with PropertyDate

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

the class PropertyStoreJCacheTest method addPropertyOKDate.

/**
 * TDD.
 */
@Test
public void addPropertyOKDate() {
    // Given
    // Assert.assertFalse(testedStore.exist("log"));
    // When
    testedStore.createProperty(new PropertyDate("ddate", new Date()));
    // Then
    Assert.assertTrue(testedStore.existProperty("ddate"));
}
Also used : Date(java.util.Date) PropertyDate(org.ff4j.property.PropertyDate) PropertyDate(org.ff4j.property.PropertyDate) Test(org.junit.Test)

Aggregations

PropertyDate (org.ff4j.property.PropertyDate)8 Date (java.util.Date)7 Test (org.junit.Test)6 FF4j (org.ff4j.FF4j)2