diff options
author | Artur Signell <artur@vaadin.com> | 2013-03-04 20:06:00 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-03-05 11:05:29 +0000 |
commit | 48b5c927b9e4e614e7cc334fb9c8b0bed42d28c8 (patch) | |
tree | 179360b92bce0877d6a9494a96bce4725d2d254e /server/tests | |
parent | d4143dd71b314a83a8f610f6b5c9d06435180dbd (diff) | |
download | vaadin-framework-48b5c927b9e4e614e7cc334fb9c8b0bed42d28c8.tar.gz vaadin-framework-48b5c927b9e4e614e7cc334fb9c8b0bed42d28c8.zip |
Catch NoSuchFieldException instead of NoSuchFieldError (#10944)
Change-Id: I0ece22fc53388a7c9eb268c00ae46c589859a1f1
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java new file mode 100644 index 0000000000..a01c2dea8f --- /dev/null +++ b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2012 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.data.fieldgroup; + +import junit.framework.Assert; + +import org.junit.Test; + +public class BeanFieldGroupTest { + + class Main { + private String mainField; + + public String getMainField() { + return mainField; + } + + public void setMainField(String mainField) { + this.mainField = mainField; + } + + } + + class Sub1 extends Main { + private Integer sub1Field; + + public Integer getSub1Field() { + return sub1Field; + } + + public void setSub1Field(Integer sub1Field) { + this.sub1Field = sub1Field; + } + + } + + class Sub2 extends Sub1 { + private boolean sub2field; + + public boolean isSub2field() { + return sub2field; + } + + public void setSub2field(boolean sub2field) { + this.sub2field = sub2field; + } + + } + + @Test + public void propertyTypeWithoutItem() { + BeanFieldGroup<Sub2> s = new BeanFieldGroup<BeanFieldGroupTest.Sub2>( + Sub2.class); + Assert.assertEquals(boolean.class, s.getPropertyType("sub2field")); + Assert.assertEquals(Integer.class, s.getPropertyType("sub1Field")); + Assert.assertEquals(String.class, s.getPropertyType("mainField")); + } +} |