aboutsummaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2013-01-15 09:59:04 +0200
committerHenri Sara <hesara@vaadin.com>2013-01-15 09:59:04 +0200
commit7413385a7cc0e87ec8d35574963113d3c58af5ec (patch)
treeb115dd535087d421d0cc498dea9b50646cc9d894 /server/tests
parentf5f8ee2494cc6614420391adb9f1cb730fd795d9 (diff)
downloadvaadin-framework-7413385a7cc0e87ec8d35574963113d3c58af5ec.tar.gz
vaadin-framework-7413385a7cc0e87ec8d35574963113d3c58af5ec.zip
Fix validator test (#10713)
Change-Id: I4eaec551836bd40c522463b1a884c57522d445de
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/textfield/TextFieldWithConverterAndValidator.java12
1 files changed, 4 insertions, 8 deletions
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);
}