Change-Id: I4eaec551836bd40c522463b1a884c57522d445de
import junit.framework.TestCase;
-import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.validator.RangeValidator;
import com.vaadin.tests.data.converter.ConverterFactory.ConvertTo42;
// nulls
- // fails
- try {
- property.setValue(null);
- fail();
- } catch (InvalidValueException e) {
- // should fail
- }
+ // succeeds - validate() converts field value back to property type
+ // before validation
+ property.setValue(null);
+ field.validate();
// succeeds
field.setValue(null);
}