Search in sources :

Example 1 with FakeFox011

use of org.apache.harmony.beans.tests.support.mock.FakeFox011 in project j2objc by google.

the class IntrospectorTest method testBeanInfo_1.

/*
     * Test Introspection with BeanInfo No immediate BeanInfo Have super
     * BeanInfo
     */
public void testBeanInfo_1() throws IntrospectionException {
    Class<FakeFox011> beanClass = FakeFox011.class;
    BeanInfo info = Introspector.getBeanInfo(beanClass);
    assertNull(info.getAdditionalBeanInfo());
    BeanDescriptor beanDesc = info.getBeanDescriptor();
    assertEquals("FakeFox011", beanDesc.getName());
    assertEquals(0, info.getEventSetDescriptors().length);
    assertEquals(-1, info.getDefaultEventIndex());
    assertEquals(0, info.getDefaultPropertyIndex());
    MethodDescriptor[] methodDesc = info.getMethodDescriptors();
    assertEquals(4, methodDesc.length);
    PropertyDescriptor[] propertyDesc = info.getPropertyDescriptors();
    assertEquals(2, propertyDesc.length);
    for (PropertyDescriptor element : propertyDesc) {
        if (element.getName().equals("class")) {
            assertNull(element.getWriteMethod());
            assertNotNull(element.getReadMethod());
        }
    }
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanDescriptor(java.beans.BeanDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) FakeFox011(org.apache.harmony.beans.tests.support.mock.FakeFox011) MethodDescriptor(java.beans.MethodDescriptor)

Aggregations

BeanDescriptor (java.beans.BeanDescriptor)1 BeanInfo (java.beans.BeanInfo)1 IndexedPropertyDescriptor (java.beans.IndexedPropertyDescriptor)1 MethodDescriptor (java.beans.MethodDescriptor)1 PropertyDescriptor (java.beans.PropertyDescriptor)1 SimpleBeanInfo (java.beans.SimpleBeanInfo)1 FakeFox011 (org.apache.harmony.beans.tests.support.mock.FakeFox011)1 FakeFox01BeanInfo (org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo)1