use of org.apache.harmony.beans.tests.support.mock.MockJavaBean in project j2objc by google.
the class IndexedPropertyDescriptorTest method testEquals_IndexWNull.
/*
* Indexed write method null.
*/
public void testEquals_IndexWNull() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyFour";
Class<MockJavaBean> beanClass = MockJavaBean.class;
Method readMethod = beanClass.getMethod("get" + propertyName, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + propertyName, new Class[] { String[].class });
Method indexedReadMethod = beanClass.getMethod("get" + propertyName, new Class[] { Integer.TYPE });
Method indexedWriteMethod = null;
IndexedPropertyDescriptor ipd = new IndexedPropertyDescriptor(propertyName, readMethod, writeMethod, indexedReadMethod, indexedWriteMethod);
IndexedPropertyDescriptor ipd2 = new IndexedPropertyDescriptor(propertyName, beanClass);
assertFalse(ipd.equals(ipd2));
}
use of org.apache.harmony.beans.tests.support.mock.MockJavaBean in project j2objc by google.
the class IndexedPropertyDescriptorTest method testEquals_IndexedW.
/*
* indexed write method.
*/
public void testEquals_IndexedW() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyFour";
Class<MockJavaBean> beanClass = MockJavaBean.class;
Method readMethod = beanClass.getMethod("get" + propertyName, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + propertyName, new Class[] { String[].class });
Method indexedReadMethod = beanClass.getMethod("get" + propertyName, new Class[] { Integer.TYPE });
Method indexedWriteMethod = beanClass.getMethod("setPropertyFive", new Class[] { Integer.TYPE, String.class });
IndexedPropertyDescriptor ipd = new IndexedPropertyDescriptor(propertyName, readMethod, writeMethod, indexedReadMethod, indexedWriteMethod);
IndexedPropertyDescriptor ipd2 = new IndexedPropertyDescriptor(propertyName, beanClass);
assertFalse(ipd.equals(ipd2));
}
use of org.apache.harmony.beans.tests.support.mock.MockJavaBean in project j2objc by google.
the class IndexedPropertyDescriptorTest method testIndexedPropertyDescriptorStringMethodMethodMethodMethod_IndexedReadMethodNull.
public void testIndexedPropertyDescriptorStringMethodMethodMethodMethod_IndexedReadMethodNull() throws SecurityException, NoSuchMethodException, IntrospectionException {
String propertyName = "PropertyFour";
Class<MockJavaBean> beanClass = MockJavaBean.class;
Method readMethod = beanClass.getMethod("get" + propertyName, (Class[]) null);
Method writeMethod = beanClass.getMethod("set" + propertyName, new Class[] { String[].class });
Method indexedWriteMethod = beanClass.getMethod("set" + propertyName, new Class[] { Integer.TYPE, String.class });
IndexedPropertyDescriptor ipd = new IndexedPropertyDescriptor(propertyName, readMethod, writeMethod, null, indexedWriteMethod);
assertNull(ipd.getIndexedReadMethod());
assertEquals(String[].class, ipd.getPropertyType());
assertEquals(String.class, ipd.getIndexedPropertyType());
}
use of org.apache.harmony.beans.tests.support.mock.MockJavaBean in project j2objc by google.
the class PropertyDescriptorTest method testEquals_PropertyType.
public void testEquals_PropertyType() throws IntrospectionException {
String propertyName = "PropertyOne";
Class<MockJavaBean> beanClass = MockJavaBean.class;
PropertyDescriptor pd = new PropertyDescriptor(propertyName, beanClass);
Class<MockBeanPropertyDesc> beanClass2 = PropertyDescriptorTest.MockBeanPropertyDesc.class;
PropertyDescriptor pd2 = new PropertyDescriptor(propertyName, beanClass2);
assertFalse(pd.equals(pd2));
}
use of org.apache.harmony.beans.tests.support.mock.MockJavaBean in project j2objc by google.
the class PropertyDescriptorTest method testPropertyDescriptorStringClassStringString_ReadMethodNull.
public void testPropertyDescriptorStringClassStringString_ReadMethodNull() throws IntrospectionException {
String propertyName = "PropertyTwo";
Class<MockJavaBean> beanClass = MockJavaBean.class;
PropertyDescriptor pd = new PropertyDescriptor(propertyName, beanClass, null, "set" + propertyName);
assertEquals(Integer.class, pd.getPropertyType());
assertNull(pd.getReadMethod());
assertEquals("set" + propertyName, pd.getWriteMethod().getName());
assertFalse(pd.isBound());
assertFalse(pd.isConstrained());
assertEquals(propertyName, pd.getDisplayName());
assertEquals(propertyName, pd.getName());
assertEquals(propertyName, pd.getShortDescription());
assertNotNull(pd.attributeNames());
assertFalse(pd.isExpert());
assertFalse(pd.isHidden());
assertFalse(pd.isPreferred());
try {
pd = new PropertyDescriptor(propertyName, beanClass, "", "set" + propertyName);
fail("should throw exception");
} catch (IntrospectionException e) {
}
}
Aggregations