From: Henri Sara Date: Tue, 15 Jan 2013 07:59:04 +0000 (+0200) Subject: Fix validator test (#10713) X-Git-Tag: 7.0.0.rc1~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7413385a7cc0e87ec8d35574963113d3c58af5ec;p=vaadin-framework.git Fix validator test (#10713) Change-Id: I4eaec551836bd40c522463b1a884c57522d445de --- diff --git a/server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java b/server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java index 89d21728e4..cdb001e266 100644 --- a/server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java +++ b/server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java @@ -2,7 +2,6 @@ package com.vaadin.tests.server.component.textfield; 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; @@ -38,13 +37,10 @@ public class TextFieldWithConverterAndValidator extends TestCase { // 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); }