Search in sources :

Example 1 with PropertyFactory

use of org.ff4j.property.util.PropertyFactory in project ff4j by ff4j.

the class PropertyFactoryTest method testPropertyFactory.

@Test
public void testPropertyFactory() {
    new PropertyFactory();
    PropertyFactory.createProperty("p1", (int) 1);
    PropertyFactory.createProperty("p1", (long) 1);
    PropertyFactory.createProperty("p1", (double) 1);
    PropertyFactory.createProperty("p1", (float) 1);
    PropertyFactory.createProperty("p1", (short) 1);
    PropertyFactory.createProperty("p1", (boolean) true);
    PropertyFactory.createProperty("p1", new BigDecimal(1.1d));
    PropertyFactory.createProperty("p1", new BigInteger("1"));
    PropertyFactory.createProperty("p1", new Byte("2"));
    PropertyFactory.createProperty("p1", PropertyLogLevel.LogLevel.DEBUG);
    PropertyFactory.createProperty("p1", new PropertyString("tata"));
    PropertyFactory.createProperty("p1", new Date());
    PropertyFactory.createProperty("p1", "sample");
    PropertyFactory.createProperty("p1", Calendar.getInstance());
    Property<?> pList = PropertyFactory.createProperty("p1", Util.list("a", "b", "c"));
    Assert.assertTrue(pList.getClass().equals(PropertyString.class));
}
Also used : PropertyString(org.ff4j.property.PropertyString) PropertyFactory(org.ff4j.property.util.PropertyFactory) BigInteger(java.math.BigInteger) BigDecimal(java.math.BigDecimal) Date(java.util.Date) Test(org.junit.Test)

Aggregations

BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 Date (java.util.Date)1 PropertyString (org.ff4j.property.PropertyString)1 PropertyFactory (org.ff4j.property.util.PropertyFactory)1 Test (org.junit.Test)1