summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-10-11 17:41:48 +0300
committerDenis Anisimov <denis@vaadin.com>2014-10-13 09:24:57 +0000
commita420906d61b0fd54ede8906fb494b5378c4bac5f (patch)
treec7cd867e526cceba865b8624ff6bba959c907296 /server/tests
parent086228f26e933802f252401a99ac29e0a63e0819 (diff)
downloadvaadin-framework-a420906d61b0fd54ede8906fb494b5378c4bac5f.tar.gz
vaadin-framework-a420906d61b0fd54ede8906fb494b5378c4bac5f.zip
Use workaround for JDK6 Introspection bug JDK-6788525 (#14839).
Change-Id: Ib7ef769b7537675c681ac1fab24a425d19a267e7
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/data/util/BeanItemTest.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/data/util/BeanItemTest.java b/server/tests/src/com/vaadin/data/util/BeanItemTest.java
index b458856826..89c56b1779 100644
--- a/server/tests/src/com/vaadin/data/util/BeanItemTest.java
+++ b/server/tests/src/com/vaadin/data/util/BeanItemTest.java
@@ -13,6 +13,8 @@ import junit.framework.TestCase;
import org.junit.Assert;
+import com.vaadin.data.Property;
+
/**
* Test BeanItem specific features.
*
@@ -122,6 +124,31 @@ public class BeanItemTest extends TestCase {
public int getSuper2();
}
+ protected static class Generic<T> {
+
+ public T getProperty() {
+ return null;
+ }
+
+ public void setProperty(T t) {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ protected static class SubClass extends Generic<String> {
+
+ @Override
+ // Has a bridged method
+ public String getProperty() {
+ return "";
+ }
+
+ @Override
+ // Has a bridged method
+ public void setProperty(String t) {
+ }
+ }
+
protected static interface MySubInterface extends MySuperInterface,
MySuperInterface2 {
public int getSub();
@@ -331,4 +358,18 @@ public class BeanItemTest extends TestCase {
Assert.assertEquals(6, item.getItemPropertyIds().size());
Assert.assertEquals(null, item.getItemProperty("myname"));
}
+
+ public void testOverridenGenericMethods() {
+ BeanItem<SubClass> item = new BeanItem<SubClass>(new SubClass());
+
+ Property<?> property = item.getItemProperty("property");
+ Assert.assertEquals("Unexpected class for property type", String.class,
+ property.getType());
+
+ Assert.assertEquals("Unexpected property value", "",
+ property.getValue());
+
+ // Should not be exception
+ property.setValue(null);
+ }
}