use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedBooleanSimpleClass24.
public void test_MixedBooleanSimpleClass24() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedBooleanSimpleClass24.class);
Method setter = MixedBooleanSimpleClass24.class.getDeclaredMethod("setList", int.class, boolean.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertTrue(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertNull(pd.getWriteMethod());
assertNull(((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedBooleanExtendClass7.
public void test_MixedBooleanExtendClass7() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedBooleanExtendClass7.class);
Method setter = MixedBooleanSimpleClass25.class.getDeclaredMethod("setList", int.class, boolean.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertTrue(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertNull(pd.getWriteMethod());
assertNull(((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
break;
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedSimpleClass30.
public void test_MixedSimpleClass30() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass30.class);
Method indexedGetter = MixedSimpleClass30.class.getDeclaredMethod("getList", int.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertTrue(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertNull(pd.getWriteMethod());
assertEquals(indexedGetter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertNull(((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method testMockIncompatibleAllSetterAndGetterBean.
public void testMockIncompatibleAllSetterAndGetterBean() throws Exception {
Class<?> beanClass = MockIncompatibleAllSetterAndGetterBean.class;
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
PropertyDescriptor pd = null;
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
for (int i = 0; i < pds.length; i++) {
pd = pds[i];
if (pd.getName().equals("data")) {
break;
}
}
assertNotNull(pd);
assertTrue(pd instanceof IndexedPropertyDescriptor);
IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
assertNull(ipd.getReadMethod());
assertNull(ipd.getWriteMethod());
Method indexedReadMethod = beanClass.getMethod("getData", new Class[] { int.class });
Method indexedWriteMethod = beanClass.getMethod("setData", new Class[] { int.class, int.class });
assertEquals(indexedReadMethod, ipd.getIndexedReadMethod());
assertEquals(indexedWriteMethod, ipd.getIndexedWriteMethod());
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedSimpleClass27.
public void test_MixedSimpleClass27() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass27.class);
Method indexedGetter = MixedSimpleClass27.class.getDeclaredMethod("getList", int.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertTrue(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertNull(pd.getWriteMethod());
assertEquals(indexedGetter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertNull(((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
}
}
}
Aggregations