use of com.enonic.xp.form.Input 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.form.Input 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.form.Input in project xp by enonic.
the class LongTypeTest method testCreateDefaultValue.
@Test
public void testCreateDefaultValue() {
final Input input = getDefaultInputBuilder(InputTypeName.LONG, "2").build();
final Value value = this.type.createDefaultValue(input);
assertNotNull(value);
assertEquals(2L, value.asLong().longValue());
}
use of com.enonic.xp.form.Input in project xp by enonic.
the class DoubleTypeTest method testCreateDefaultValue.
@Test
public void testCreateDefaultValue() {
final Input input = getDefaultInputBuilder(InputTypeName.DOUBLE, "1.3").build();
final Value value = this.type.createDefaultValue(input);
assertNotNull(value);
assertEquals(1.3D, value.asDouble(), Double.MIN_NORMAL);
}
use of com.enonic.xp.form.Input in project xp by enonic.
the class XmlContentTypeParserTest method testI18n_formInput.
@Test
public void testI18n_formInput() throws Exception {
parse(this.parser, "-i18n.xml");
final ContentType result = this.builder.build();
final Input input = (Input) result.getForm().getFormItem("textLine");
assertEquals("translated.label", input.getLabelI18nKey());
assertEquals("translated.help-text", input.getHelpTextI18nKey());
}
Aggregations