From 18da456c1b398515456ed2224278b95b45538c22 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 17 Dec 2012 19:31:46 +0000 Subject: Revert "Case-insensitive FieldGroup binding #10426" This reverts commit fffd25fc57c862afdac2f4cfc36695c0bd35ec96 Breaks binding using BeanFieldGroup before an item data source has been set. Change-Id: Id05372eef2078efea9e92a69a1af942511ff32a9 --- .../fieldgroup/CaseInsensitiveBinding.java | 84 ---------------------- 1 file changed, 84 deletions(-) delete mode 100644 server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java (limited to 'server/tests') diff --git a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java deleted file mode 100644 index 9b768ef77f..0000000000 --- a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.vaadin.tests.server.component.fieldgroup; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import com.vaadin.data.fieldgroup.FieldGroup; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.data.util.PropertysetItem; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.TextField; - -public class CaseInsensitiveBinding { - - @Test - public void caseInsensitivityAndUnderscoreRemoval() { - PropertysetItem item = new PropertysetItem(); - item.addItemProperty("LastName", new ObjectProperty("Sparrow")); - - class MyForm extends FormLayout { - TextField lastName = new TextField("Last name"); - - public MyForm() { - - // Should bind to the LastName property - addComponent(lastName); - } - } - - MyForm form = new MyForm(); - - FieldGroup binder = new FieldGroup(item); - binder.bindMemberFields(form); - - assertTrue("Sparrow".equals(form.lastName.getValue())); - } - - @Test - public void UnderscoreRemoval() { - PropertysetItem item = new PropertysetItem(); - item.addItemProperty("first_name", new ObjectProperty("Jack")); - - class MyForm extends FormLayout { - TextField firstName = new TextField("First name"); - - public MyForm() { - // Should bind to the first_name property - addComponent(firstName); - } - } - - MyForm form = new MyForm(); - - FieldGroup binder = new FieldGroup(item); - binder.bindMemberFields(form); - - assertTrue("Jack".equals(form.firstName.getValue())); - } - - @Test - public void perfectMatchPriority() { - PropertysetItem item = new PropertysetItem(); - item.addItemProperty("first_name", new ObjectProperty( - "Not this")); - item.addItemProperty("firstName", new ObjectProperty("This")); - - class MyForm extends FormLayout { - TextField firstName = new TextField("First name"); - - public MyForm() { - // should bind to the firstName property, not first_name property - addComponent(firstName); - } - } - - MyForm form = new MyForm(); - - FieldGroup binder = new FieldGroup(item); - binder.bindMemberFields(form); - - assertTrue("This".equals(form.firstName.getValue())); - } - -} -- cgit v1.2.3