use of com.enonic.xp.data.Value in project xp by enonic.
the class DateTimeTypeTest method testRelativeDefaultValue_only_relative_date_exists.
@Test
public void testRelativeDefaultValue_only_relative_date_exists() {
final Input input = getDefaultInputBuilder(InputTypeName.DATE_TIME, "+1year -5months -36d").build();
final Value value = this.type.createDefaultValue(input);
assertNotNull(value);
assertSame(ValueTypes.LOCAL_DATE_TIME, value.getType());
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class DateTimeTypeTest method testCreateDefaultValue.
@Test
public void testCreateDefaultValue() {
final Input input = getDefaultInputBuilder(InputTypeName.DATE_TIME, "2014-08-16T05:03:45").inputTypeConfig(InputTypeConfig.create().property(InputTypeProperty.create("timezone", "false").build()).build()).build();
final Value value = this.type.createDefaultValue(input);
assertNotNull(value);
assertSame(ValueTypes.LOCAL_DATE_TIME, value.getType());
assertEquals(value.toString(), "2014-08-16T05:03:45");
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class DateTypeTest method testCreateDefaultValue.
@Test
public void testCreateDefaultValue() {
final Input input = getDefaultInputBuilder(InputTypeName.DATE, "2014-08-16").build();
final Value value = this.type.createDefaultValue(input);
assertNotNull(value);
assertSame(ValueTypes.LOCAL_DATE, value.getType());
assertEquals(value.toString(), "2014-08-16");
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class DateTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = newEmptyConfig();
final Value value = this.type.createValue(ValueFactory.newString("2015-01-02"), config);
assertNotNull(value);
assertSame(ValueTypes.LOCAL_DATE, value.getType());
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class RadioButtonTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final Value value = this.type.createValue(ValueFactory.newString("one"), config);
assertNotNull(value);
assertSame(ValueTypes.STRING, value.getType());
}
Aggregations