]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix validator test (#10713) 45/645/1
authorHenri Sara <hesara@vaadin.com>
Tue, 15 Jan 2013 07:59:04 +0000 (09:59 +0200)
committerHenri Sara <hesara@vaadin.com>
Tue, 15 Jan 2013 07:59:04 +0000 (09:59 +0200)
Change-Id: I4eaec551836bd40c522463b1a884c57522d445de

server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java

index 89d21728e4c8ef88bbef48c87ba8dbf5e435b413..cdb001e266fbf6c75c8d9317c957bcb918ce06c2 100644 (file)
@@ -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);
     }