Browse Source

added further generic property resolution test

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@853 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
985e2b0068
  1. 29
      org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java

29
org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java

@ -471,6 +471,14 @@ public final class BeanWrapperGenericsTests { @@ -471,6 +471,14 @@ public final class BeanWrapperGenericsTests {
Assert.assertEquals(new Integer(30), gb.getGenericListProperty().get(1).iterator().next());
}
@Test
public void testSettingGenericPropertyWithReadOnlyInterface() {
Bar bar = new Bar();
BeanWrapper bw = new BeanWrapperImpl(bar);
bw.setPropertyValue("version", "10");
Assert.assertEquals(10.0, bar.getVersion());
}
private static abstract class BaseGenericCollectionBean {
@ -565,4 +573,25 @@ public final class BeanWrapperGenericsTests { @@ -565,4 +573,25 @@ public final class BeanWrapperGenericsTests {
}
public interface Foo {
Number getVersion();
}
public class Bar implements Foo {
private double version;
public Double getVersion() {
return this.version;
}
public void setVersion(Double theDouble) {
this.version = theDouble;
}
}
}

Loading…
Cancel
Save