use of com.xpn.xwiki.objects.LongProperty in project xwiki-platform by xwiki.
the class NumberClass method newProperty.
@Override
public BaseProperty newProperty() {
String ntype = getNumberType();
BaseProperty property;
if (ntype.equals("integer")) {
property = new IntegerProperty();
} else if (ntype.equals("float")) {
property = new FloatProperty();
} else if (ntype.equals("double")) {
property = new DoubleProperty();
} else {
property = new LongProperty();
}
property.setName(getName());
return property;
}
use of com.xpn.xwiki.objects.LongProperty in project xwiki-platform by xwiki.
the class PropertyConverterTest method longToString.
@Test
public void longToString() throws Exception {
LongProperty longProperty = new LongProperty();
longProperty.setValue(Long.MAX_VALUE);
StringClass stringClass = mock(StringClass.class);
when(stringClass.newProperty()).thenReturn(new StringProperty());
StringProperty stringProperty = new StringProperty();
when(stringClass.fromString(longProperty.toText())).thenReturn(stringProperty);
assertEquals(stringProperty, this.mocker.getComponentUnderTest().convertProperty(longProperty, stringClass));
}
Aggregations