diff options
Diffstat (limited to 'server/src/test')
-rw-r--r-- | server/src/test/java/com/vaadin/data/ValueContextTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/server/src/test/java/com/vaadin/data/ValueContextTest.java b/server/src/test/java/com/vaadin/data/ValueContextTest.java index 2f13a71dbb..b96f7463cb 100644 --- a/server/src/test/java/com/vaadin/data/ValueContextTest.java +++ b/server/src/test/java/com/vaadin/data/ValueContextTest.java @@ -3,6 +3,7 @@ package com.vaadin.data; import java.util.Locale; import java.util.Objects; +import com.vaadin.ui.CheckBox; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -46,6 +47,28 @@ public class ValueContextTest extends UI { Locale.getDefault(), locale); } + @Test + public void testHasValue1() { + setLocale(null); + ValueContext fromComponent = new ValueContext(textField); + Assert.assertEquals(textField, fromComponent.getHasValue().get()); + } + + @Test + public void testHasValue2() { + setLocale(null); + ValueContext fromComponent = new ValueContext(new CheckBox(), textField); + Assert.assertEquals(textField, fromComponent.getHasValue().get()); + } + + @Test + public void testHasValue3() { + setLocale(null); + ValueContext fromComponent = new ValueContext(new CheckBox(), textField, Locale.CANADA); + Assert.assertEquals(textField, fromComponent.getHasValue().get()); + Assert.assertEquals(Locale.CANADA, fromComponent.getLocale().get()); + } + @Before public void setUp() { setLocale(UI_LOCALE); |