From 7413385a7cc0e87ec8d35574963113d3c58af5ec Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 15 Jan 2013 09:59:04 +0200 Subject: Fix validator test (#10713) Change-Id: I4eaec551836bd40c522463b1a884c57522d445de --- .../textfield/TextFieldWithConverterAndValidator.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'server/tests') 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); } -- cgit v1.2.3