当前位置: 首页>>代码示例>>Java>>正文


Java BigPerson类代码示例

本文整理汇总了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) {
    }
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:27,代码来源:AbstractSerializationTest.java

示例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"));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:26,代码来源:JavaBeanSerializeUtilTest.java

示例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"));
}
 
开发者ID:hufeng,项目名称:dubbo2.js,代码行数:26,代码来源:JavaBeanSerializeUtilTest.java

示例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);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:8,代码来源:PojoUtilsTest.java


注:本文中的com.alibaba.dubbo.common.model.person.BigPerson类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。