本文整理匯總了Java中org.apache.harmony.beans.tests.support.mock.MockJavaBean.getClass方法的典型用法代碼示例。如果您正苦於以下問題:Java MockJavaBean.getClass方法的具體用法?Java MockJavaBean.getClass怎麽用?Java MockJavaBean.getClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.harmony.beans.tests.support.mock.MockJavaBean
的用法示例。
在下文中一共展示了MockJavaBean.getClass方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testBeanDescriptorClass
import org.apache.harmony.beans.tests.support.mock.MockJavaBean; //導入方法依賴的package包/類
public void testBeanDescriptorClass() {
String beanName = "BeanDescriptorTest.bean";
MockJavaBean bean = new MockJavaBean(beanName);
Class<? extends MockJavaBean> beanClass = bean.getClass();
BeanDescriptor bd = new BeanDescriptor(beanClass);
assertSame(beanClass, bd.getBeanClass());
String displayName = beanClass.getName().substring(
beanClass.getName().lastIndexOf('.') + 1);
assertEquals(displayName, bd.getDisplayName());
assertEquals(displayName, bd.getName());
assertEquals(displayName, bd.getShortDescription());
assertNotNull(bd.attributeNames());
assertFalse(bd.isExpert());
assertFalse(bd.isHidden());
assertFalse(bd.isPreferred());
}
示例2: testBeanDescriptorClassClass_CustomizerClassNull
import org.apache.harmony.beans.tests.support.mock.MockJavaBean; //導入方法依賴的package包/類
public void testBeanDescriptorClassClass_CustomizerClassNull() {
String beanName = "BeanDescriptorTest.bean";
MockJavaBean bean = new MockJavaBean(beanName);
Class<? extends MockJavaBean> beanClass = bean.getClass();
Class<?> cusClass = null;
BeanDescriptor bd = new BeanDescriptor(beanClass, cusClass);
assertSame(beanClass, bd.getBeanClass());
assertNull(bd.getCustomizerClass());
String displayName = beanClass.getName().substring(
beanClass.getName().lastIndexOf('.') + 1);
assertEquals(displayName, bd.getDisplayName());
assertEquals(displayName, bd.getName());
assertEquals(displayName, bd.getShortDescription());
assertNotNull(bd.attributeNames());
assertFalse(bd.isExpert());
assertFalse(bd.isHidden());
assertFalse(bd.isPreferred());
}