1234567891011121314151617181920212223242526272829303132333435 |
- package com.vaadin.data.util;
-
- import static org.junit.Assert.assertTrue;
-
- import org.junit.Test;
-
- import com.vaadin.data.fieldgroup.FieldGroup;
- import com.vaadin.data.fieldgroup.PropertyId;
- import com.vaadin.v7.ui.LegacyTextField;
-
- public class ReflectToolsGetSuperFieldTest {
-
- @Test
- public void getFieldFromSuperClass() {
- class MyClass {
- @PropertyId("testProperty")
- LegacyTextField test = new LegacyTextField("This is a test");
- }
- class MySubClass extends MyClass {
- // no fields here
- }
-
- PropertysetItem item = new PropertysetItem();
- item.addItemProperty("testProperty",
- new ObjectProperty<String>("Value of testProperty"));
-
- MySubClass form = new MySubClass();
-
- FieldGroup binder = new FieldGroup(item);
- binder.bindMemberFields(form);
-
- assertTrue("Value of testProperty".equals(form.test.getValue()));
- }
-
- }
|