aboutsummaryrefslogtreecommitdiffstats
path: root/server/tests/src
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-11-05 19:37:31 +0200
committerVaadin Code Review <review@vaadin.com>2014-12-01 20:37:24 +0000
commit58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01 (patch)
treefbb6c6a7c8d4cff96d5f81dc0ff70e91bbbed8c4 /server/tests/src
parentf301dd8d759c5006cb411df0e424a876e04b84fb (diff)
downloadvaadin-framework-58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01.tar.gz
vaadin-framework-58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01.zip
Prevent NPE in AbstractBeanContainer.getType() method (#15173).
Change-Id: Ieaed329ed85c68d0da8bd169b4cc5c5886dde212
Diffstat (limited to 'server/tests/src')
-rw-r--r--server/tests/src/com/vaadin/data/util/BeanContainerTest.java13
-rw-r--r--server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java13
2 files changed, 26 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java
index 4e0e98ec43..f22ab8478e 100644
--- a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java
+++ b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java
@@ -68,6 +68,19 @@ public class BeanContainerTest extends AbstractBeanContainerTest {
return false;
}
+ public void testGetType_existingProperty_typeReturned() {
+ BeanContainer<String, ClassName> container = getContainer();
+ Assert.assertEquals(
+ "Unexpected type is returned for property 'simpleName'",
+ String.class, container.getType("simpleName"));
+ }
+
+ public void testGetType_notExistingProperty_nullReturned() {
+ BeanContainer<String, ClassName> container = getContainer();
+ Assert.assertNull("Not null type is returned for property ''",
+ container.getType(""));
+ }
+
public void testBasicOperations() {
testBasicContainerOperations(getContainer());
}
diff --git a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java
index b58d962d96..01c282e294 100644
--- a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java
+++ b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java
@@ -71,6 +71,19 @@ public class BeanItemContainerTest extends AbstractBeanContainerTest {
return false;
}
+ public void testGetType_existingProperty_typeReturned() {
+ BeanItemContainer<ClassName> container = getContainer();
+ Assert.assertEquals(
+ "Unexpected type is returned for property 'simpleName'",
+ String.class, container.getType("simpleName"));
+ }
+
+ public void testGetType_notExistingProperty_nullReturned() {
+ BeanItemContainer<ClassName> container = getContainer();
+ Assert.assertNull("Not null type is returned for property ''",
+ container.getType(""));
+ }
+
public void testBasicOperations() {
testBasicContainerOperations(getContainer());
}