aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java')
-rw-r--r--server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java b/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java
new file mode 100644
index 0000000000..40e8f05e1e
--- /dev/null
+++ b/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java
@@ -0,0 +1,26 @@
+package com.vaadin.util;
+
+import static org.junit.Assert.assertFalse;
+
+import org.junit.Test;
+
+public class ReflectToolsGetPrimitiveFieldValueTest {
+ @Test
+ public void getFieldValueViaGetter() {
+ class MyClass {
+ public int field = 1;
+ }
+
+ MyClass myInstance = new MyClass();
+
+ java.lang.reflect.Field memberField;
+ Object fieldValue = new Boolean(false);
+ try {
+ memberField = myInstance.getClass().getField("field");
+ fieldValue = ReflectTools
+ .getJavaFieldValue(myInstance, memberField);
+ } catch (Exception e) {
+ }
+ assertFalse(fieldValue instanceof Boolean);
+ }
+}