ExtendedBeanInfo ignores invalid bean properties (analogous to the JavaBeans Introspector)

Issue: SPR-12434
(cherry picked from commit b45f1aa)
This commit is contained in:
Juergen Hoeller
2014-11-27 01:48:33 +01:00
parent 98cbae7fdc
commit 0e3b26da27
2 changed files with 39 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -917,6 +917,15 @@ public class ExtendedBeanInfoTests {
}
}
@Test // SPR-12434
public void shouldDetectValidPropertiesAndIgnoreInvalidProperties() throws IntrospectionException {
BeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(java.awt.Window.class));
assertThat(hasReadMethodForProperty(bi, "locationByPlatform"), is(true));
assertThat(hasWriteMethodForProperty(bi, "locationByPlatform"), is(true));
assertThat(hasIndexedReadMethodForProperty(bi, "locationByPlatform"), is(false));
assertThat(hasIndexedWriteMethodForProperty(bi, "locationByPlatform"), is(false));
}
interface Spr9453<T> {