Search in sources :

Example 1 with NumericProperty

use of org.apache.cayenne.exp.property.NumericProperty in project cayenne by apache.

the class PropertyUtilsTest method simpleNumericDefinition.

@Test
public void simpleNumericDefinition() throws Exception {
    importUtils.addType(NumericProperty.class.getName());
    ObjEntity entity = new ObjEntity("test");
    ObjAttribute attribute = new ObjAttribute();
    attribute.setName("test");
    attribute.setType("int");
    entity.addAttribute(attribute);
    String definition = propertyUtils.propertyDefinition(attribute);
    assertEquals("public static final NumericProperty<Integer> TEST = PropertyFactory.createNumeric(\"test\", Integer.class);", definition);
}
Also used : ObjEntity(org.apache.cayenne.map.ObjEntity) ObjAttribute(org.apache.cayenne.map.ObjAttribute) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) NumericProperty(org.apache.cayenne.exp.property.NumericProperty) Test(org.junit.Test)

Aggregations

NumericProperty (org.apache.cayenne.exp.property.NumericProperty)1 ObjAttribute (org.apache.cayenne.map.ObjAttribute)1 ObjEntity (org.apache.cayenne.map.ObjEntity)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1