本文整理汇总了Java中com.alibaba.dubbo.common.model.person.BigPerson类的典型用法代码示例。如果您正苦于以下问题:Java BigPerson类的具体用法?Java BigPerson怎么用?Java BigPerson使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BigPerson类属于com.alibaba.dubbo.common.model.person包,在下文中一共展示了BigPerson类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_MultiObject_WithType
import com.alibaba.dubbo.common.model.person.BigPerson; //导入依赖的package包/类
@Test
public void test_MultiObject_WithType() throws Exception {
ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
objectOutput.writeBool(false);
objectOutput.writeObject(bigPerson);
objectOutput.writeByte((byte) 23);
objectOutput.writeObject(mediaContent);
objectOutput.writeInt(-23);
objectOutput.flushBuffer();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
byteArrayOutputStream.toByteArray());
ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
assertEquals(false, deserialize.readBool());
assertEquals(bigPerson, deserialize.readObject(BigPerson.class));
assertEquals((byte) 23, deserialize.readByte());
assertEquals(mediaContent, deserialize.readObject(MediaContent.class));
assertEquals(-23, deserialize.readInt());
try {
deserialize.readObject();
fail();
} catch (IOException expected) {
}
}
示例2: assertEqualsBigPerson
import com.alibaba.dubbo.common.model.person.BigPerson; //导入依赖的package包/类
static void assertEqualsBigPerson(BigPerson person, Object obj) {
JavaBeanDescriptor descriptor = (JavaBeanDescriptor)obj;
Assert.assertTrue(descriptor.isBeanType());
assertEqualsPrimitive(person.getPersonId(), descriptor.getProperty("personId"));
assertEqualsPrimitive(person.getLoginName(), descriptor.getProperty("loginName"));
assertEqualsEnum(person.getStatus(), descriptor.getProperty("status"));
assertEqualsPrimitive(person.getEmail(), descriptor.getProperty("email"));
assertEqualsPrimitive(person.getPenName(), descriptor.getProperty("penName"));
JavaBeanDescriptor infoProfile = (JavaBeanDescriptor)descriptor.getProperty("infoProfile");
Assert.assertTrue(infoProfile.isBeanType());
JavaBeanDescriptor phones = (JavaBeanDescriptor) infoProfile.getProperty("phones");
Assert.assertTrue(phones.isCollectionType());
assertEqualsPhone(person.getInfoProfile().getPhones().get(0), phones.getProperty(0));
assertEqualsPhone(person.getInfoProfile().getPhones().get(1), phones.getProperty(1));
assertEqualsPhone(person.getInfoProfile().getFax(), infoProfile.getProperty("fax"));
assertEqualsFullAddress(person.getInfoProfile().getFullAddress(), infoProfile.getProperty("fullAddress"));
assertEqualsPrimitive(person.getInfoProfile().getMobileNo(), infoProfile.getProperty("mobileNo"));
assertEqualsPrimitive(person.getInfoProfile().getName(), infoProfile.getProperty("name"));
assertEqualsPrimitive(person.getInfoProfile().getDepartment(), infoProfile.getProperty("department"));
assertEqualsPrimitive(person.getInfoProfile().getJobTitle(), infoProfile.getProperty("jobTitle"));
assertEqualsPrimitive(person.getInfoProfile().getHomepageUrl(), infoProfile.getProperty("homepageUrl"));
assertEqualsPrimitive(person.getInfoProfile().isFemale(), infoProfile.getProperty("female"));
assertEqualsPrimitive(person.getInfoProfile().isMale(), infoProfile.getProperty("male"));
}
示例3: assertEqualsBigPerson
import com.alibaba.dubbo.common.model.person.BigPerson; //导入依赖的package包/类
static void assertEqualsBigPerson(BigPerson person, Object obj) {
JavaBeanDescriptor descriptor = (JavaBeanDescriptor) obj;
Assert.assertTrue(descriptor.isBeanType());
assertEqualsPrimitive(person.getPersonId(), descriptor.getProperty("personId"));
assertEqualsPrimitive(person.getLoginName(), descriptor.getProperty("loginName"));
assertEqualsEnum(person.getStatus(), descriptor.getProperty("status"));
assertEqualsPrimitive(person.getEmail(), descriptor.getProperty("email"));
assertEqualsPrimitive(person.getPenName(), descriptor.getProperty("penName"));
JavaBeanDescriptor infoProfile = (JavaBeanDescriptor) descriptor.getProperty("infoProfile");
Assert.assertTrue(infoProfile.isBeanType());
JavaBeanDescriptor phones = (JavaBeanDescriptor) infoProfile.getProperty("phones");
Assert.assertTrue(phones.isCollectionType());
assertEqualsPhone(person.getInfoProfile().getPhones().get(0), phones.getProperty(0));
assertEqualsPhone(person.getInfoProfile().getPhones().get(1), phones.getProperty(1));
assertEqualsPhone(person.getInfoProfile().getFax(), infoProfile.getProperty("fax"));
assertEqualsFullAddress(person.getInfoProfile().getFullAddress(), infoProfile.getProperty("fullAddress"));
assertEqualsPrimitive(person.getInfoProfile().getMobileNo(), infoProfile.getProperty("mobileNo"));
assertEqualsPrimitive(person.getInfoProfile().getName(), infoProfile.getProperty("name"));
assertEqualsPrimitive(person.getInfoProfile().getDepartment(), infoProfile.getProperty("department"));
assertEqualsPrimitive(person.getInfoProfile().getJobTitle(), infoProfile.getProperty("jobTitle"));
assertEqualsPrimitive(person.getInfoProfile().getHomepageUrl(), infoProfile.getProperty("homepageUrl"));
assertEqualsPrimitive(person.getInfoProfile().isFemale(), infoProfile.getProperty("female"));
assertEqualsPrimitive(person.getInfoProfile().isMale(), infoProfile.getProperty("male"));
}
示例4: test_total
import com.alibaba.dubbo.common.model.person.BigPerson; //导入依赖的package包/类
@Test
public void test_total() throws Exception {
Object generalize = PojoUtils.generalize(bigPerson);
Type gtype = getType("returnBigPersonMethod");
Object realize = PojoUtils.realize(generalize, BigPerson.class,gtype);
assertEquals(bigPerson, realize);
}