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


Java TestPerson类代码示例

本文整理汇总了Java中com.twitter.elephantbird.thrift.test.TestPerson的典型用法代码示例。如果您正苦于以下问题:Java TestPerson类的具体用法?Java TestPerson怎么用?Java TestPerson使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TestPerson类属于com.twitter.elephantbird.thrift.test包,在下文中一共展示了TestPerson类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testStructInMap

import com.twitter.elephantbird.thrift.test.TestPerson; //导入依赖的package包/类
@Test
public void testStructInMap() throws Exception {
  final Map<String, TestPerson> map = new HashMap<String, TestPerson>();
  map.put("foo", new TestPerson(new TestName("john", "johnson"), new HashMap<TestPhoneType, String>()));
  final Map<String, Integer> stringToIntMap = Collections.singletonMap("bar", 10);
  TestStructInMap testMap = new TestStructInMap("map_name", map, stringToIntMap);
  validate(testMap);
}
 
开发者ID:apache,项目名称:parquet-mr,代码行数:9,代码来源:TestParquetReadProtocol.java

示例2: testStructInMap

import com.twitter.elephantbird.thrift.test.TestPerson; //导入依赖的package包/类
@Test
public void testStructInMap() throws Exception {

  final Map<String, TestPerson> map = new HashMap<String, TestPerson>();
  map.put("foo", new TestPerson(new TestName("john", "johnson"), new HashMap<TestPhoneType, String>()));
  final Map<String, Integer> stringToIntMap = Collections.singletonMap("bar", 10);
  TestStructInMap testMap = new TestStructInMap("map_name", map, stringToIntMap);
  validateSameTupleAsEB(testMap);
}
 
开发者ID:apache,项目名称:parquet-mr,代码行数:10,代码来源:TestThriftToPigCompatibility.java

示例3: testStructInMap

import com.twitter.elephantbird.thrift.test.TestPerson; //导入依赖的package包/类
@Test
public void testStructInMap() throws Exception {
  String[] expectations = {
      "startMessage()",
        "startField(name, 0)",
          "addBinary(map_name)",
        "endField(name, 0)",
        "startField(names, 1)",
          "startGroup()",
            "startField(map, 0)",
              "startGroup()",
                "startField(key, 0)",
                  "addBinary(foo)",
                "endField(key, 0)",
                "startField(value, 1)",
                  "startGroup()",
                    "startField(name, 0)",
                      "startGroup()",
                        "startField(first_name, 0)",
                          "addBinary(john)",
                        "endField(first_name, 0)",
                        "startField(last_name, 1)",
                          "addBinary(johnson)",
                        "endField(last_name, 1)",
                      "endGroup()",
                    "endField(name, 0)",
                    "startField(phones, 1)",
                      "startGroup()",
                      "endGroup()",
                    "endField(phones, 1)",
                  "endGroup()",
                "endField(value, 1)",
              "endGroup()",
            "endField(map, 0)",
          "endGroup()",
        "endField(names, 1)",
        "startField(name_to_id, 2)",
          "startGroup()",
            "startField(map, 0)",
              "startGroup()",
                "startField(key, 0)",
                  "addBinary(bar)",
                "endField(key, 0)",
                "startField(value, 1)",
                  "addInt(10)",
                "endField(value, 1)",
              "endGroup()",
            "endField(map, 0)",
          "endGroup()",
        "endField(name_to_id, 2)",
      "endMessage()"
  };

  final Map<String, TestPerson> map = new HashMap<String, TestPerson>();
  map.put("foo", new TestPerson(new TestName("john", "johnson"), new HashMap<TestPhoneType, String>()));
  final Map<String, Integer> stringToIntMap = Collections.singletonMap("bar", 10);
  TestStructInMap testMap = new TestStructInMap("map_name", map, stringToIntMap);
  validatePig(expectations, testMap);
  validateThrift(expectations, testMap);
}
 
开发者ID:apache,项目名称:parquet-mr,代码行数:61,代码来源:TestParquetWriteProtocol.java


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