use of java.beans.IntrospectionException in project j2objc by google.
the class PropertyDescriptorTest method testPropertyDescriptorStringMethodMethod_ReadMethodInvalid.
public void testPropertyDescriptorStringMethodMethod_ReadMethodInvalid() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyOne";
Class<MockJavaBean> beanClass = MockJavaBean.class;
String anotherProp = "PropertyTwo";
Method readMethod = beanClass.getMethod("get" + anotherProp, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + propertyName, new Class[] { String.class });
try {
new PropertyDescriptor(propertyName, readMethod, writeMethod);
fail("Should throw IntrospectionException.");
} catch (IntrospectionException e) {
}
}
use of java.beans.IntrospectionException in project j2objc by google.
the class PropertyDescriptorTest method testPropertyDescriptorStringMethodMethod_PropertyNameNull.
public void testPropertyDescriptorStringMethodMethod_PropertyNameNull() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyOne";
Class<MockJavaBean> beanClass = MockJavaBean.class;
Method readMethod = beanClass.getMethod("get" + propertyName, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + propertyName, new Class[] { String.class });
try {
new PropertyDescriptor(null, readMethod, writeMethod);
fail("Should throw IntrospectionException.");
} catch (IntrospectionException e) {
}
}
use of java.beans.IntrospectionException in project j2objc by google.
the class PropertyDescriptorTest method testPropertyDescriptorStringMethodMethod_WriteMethodInvalid.
public void testPropertyDescriptorStringMethodMethod_WriteMethodInvalid() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyOne";
Class<MockJavaBean> beanClass = MockJavaBean.class;
String anotherProp = "PropertyTwo";
Method readMethod = beanClass.getMethod("get" + propertyName, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + anotherProp, new Class[] { Integer.class });
try {
new PropertyDescriptor(propertyName, readMethod, writeMethod);
fail("Should throw IntrospectionException.");
} catch (IntrospectionException e) {
}
}
use of java.beans.IntrospectionException in project j2objc by google.
the class FakeFox02BeanInfo method getPropertyDescriptors.
@Override
public PropertyDescriptor[] getPropertyDescriptors() {
PropertyDescriptor pd = null;
try {
pd = new PropertyDescriptor("fox02", FakeFox02.class);
pd.setDisplayName("fox02.beaninfo");
} catch (IntrospectionException e) {
}
return new PropertyDescriptor[] { pd };
}
use of java.beans.IntrospectionException in project j2objc by google.
the class PropertyDescriptorTest method testSetReadMethod_ReadWriteIncompatible.
/**
* Read method is incompatible with write method getPropertyOn vs.
* setPropertyTow
*/
public void testSetReadMethod_ReadWriteIncompatible() throws SecurityException, NoSuchMethodException, IntrospectionException {
Class<MockJavaBean> beanClass = MockJavaBean.class;
String propertyName = "PropertyOne";
Method readMethod = beanClass.getMethod("get" + "PropertyOne", (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + "PropertyTwo", new Class[] { Integer.class });
PropertyDescriptor pd = new PropertyDescriptor(propertyName, null, writeMethod);
assertNull(pd.getReadMethod());
try {
pd.setReadMethod(readMethod);
fail("Should throw IntrospectionException.");
} catch (IntrospectionException e) {
}
}
Aggregations