Browse Source

Revised ExtendedBeanInfo test for SPR-8937 (for JDK 8u40 compatibility)

Issue: SPR-12582
pull/717/head
Juergen Hoeller 10 years ago
parent
commit
7492129236
  1. 23
      spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java

23
spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java

@ -841,19 +841,24 @@ public class ExtendedBeanInfoTests { @@ -841,19 +841,24 @@ public class ExtendedBeanInfoTests {
public String getAddress(int index){ return null; }
}
{ // baseline. ExtendedBeanInfo needs to behave exactly like the following
// Baseline: ExtendedBeanInfo needs to behave exactly like the following...
boolean hasReadMethod;
boolean hasWriteMethod;
boolean hasIndexedReadMethod;
boolean hasIndexedWriteMethod;
{
BeanInfo bi = Introspector.getBeanInfo(A.class);
assertThat(hasReadMethodForProperty(bi, "address"), is(false));
assertThat(hasWriteMethodForProperty(bi, "address"), is(false));
assertThat(hasIndexedReadMethodForProperty(bi, "address"), is(true));
assertThat(hasIndexedWriteMethodForProperty(bi, "address"), is(true));
hasReadMethod = hasReadMethodForProperty(bi, "address");
hasWriteMethod = hasWriteMethodForProperty(bi, "address");
hasIndexedReadMethod = hasIndexedReadMethodForProperty(bi, "address");
hasIndexedWriteMethod = hasIndexedWriteMethodForProperty(bi, "address");
}
{
BeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(A.class));
assertThat(hasReadMethodForProperty(bi, "address"), is(false));
assertThat(hasWriteMethodForProperty(bi, "address"), is(false));
assertThat(hasIndexedReadMethodForProperty(bi, "address"), is(true));
assertThat(hasIndexedWriteMethodForProperty(bi, "address"), is(true));
assertEquals(hasReadMethodForProperty(bi, "address"), hasReadMethod);
assertEquals(hasWriteMethodForProperty(bi, "address"), hasWriteMethod);
assertEquals(hasIndexedReadMethodForProperty(bi, "address"), hasIndexedReadMethod);
assertEquals(hasIndexedWriteMethodForProperty(bi, "address"), hasIndexedWriteMethod);
}
}

Loading…
Cancel
Save