Search in sources :

Example 1 with TextType

use of com.qcadoo.model.internal.types.TextType in project qcadoo by qcadoo.

the class FieldTypeFactoryTest method shouldReturnTextType.

@Test
public void shouldReturnTextType() throws Exception {
    // when
    FieldType fieldType = new TextType();
    // then
    assertEquals(String.class, fieldType.getType());
    assertTrue(fieldType.toObject(fieldDefinition, "test").isValid());
    assertTrue(fieldType.toObject(fieldDefinition, StringUtils.repeat("a", 2048)).isValid());
    assertTrue(fieldType.toObject(fieldDefinition, StringUtils.repeat("a", 2049)).isValid());
}
Also used : FieldType(com.qcadoo.model.api.types.FieldType) TextType(com.qcadoo.model.internal.types.TextType) DataAccessTest(com.qcadoo.model.internal.DataAccessTest) Test(org.junit.Test)

Aggregations

FieldType (com.qcadoo.model.api.types.FieldType)1 DataAccessTest (com.qcadoo.model.internal.DataAccessTest)1 TextType (com.qcadoo.model.internal.types.TextType)1 Test (org.junit.Test)1