use of com.enonic.xp.data.Value in project xp by enonic.
the class SiteConfiguratorTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final PropertySet siteConfig = new PropertySet();
siteConfig.setString("applicationKey", "com.enonic.app.myapp");
final PropertySet appConfig = new PropertySet();
appConfig.setString("param", "value");
siteConfig.setSet("config", appConfig);
final Value value = this.type.createValue(ValueFactory.newPropertySet(siteConfig), config);
assertNotNull(value);
assertSame(ValueTypes.PROPERTY_SET, value.getType());
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class TextAreaTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final Value value = this.type.createValue(ValueFactory.newString("test"), config);
assertNotNull(value);
assertSame(ValueTypes.STRING, value.getType());
}
use of com.enonic.xp.data.Value in project xp by enonic.
the class LongTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final Value value = this.type.createValue(ValueFactory.newDouble(13.0), config);
assertNotNull(value);
assertSame(ValueTypes.LONG, value.getType());
final Value value2 = this.type.createValue("13.0", config);
assertNotNull(value2);
assertSame(ValueTypes.LONG, value2.getType());
}
use of com.enonic.xp.data.Value 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.data.Value in project xp by enonic.
the class MediaSelectorTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final Value value = this.type.createValue(ValueFactory.newString("name"), config);
assertNotNull(value);
assertSame(ValueTypes.REFERENCE, value.getType());
}
Aggregations