Package com.datasalt.pangool.thrift.test

Examples of com.datasalt.pangool.thrift.test.A


  public void testCompareObjects() throws IOException {
    // Testing behaviour of the method with non Object types.
    // Object behaviour not tested here.
    SortComparator sortComparator = new SortComparator();
    MyThriftComparator thriftComp = new MyThriftComparator(getConf());
    assertEquals(1, sortComparator.compareObjects(new A("1", null), new A("2", null), thriftComp, Type.OBJECT, null));
    assertEquals(0, sortComparator.compareObjects(new A("2", null), new A("2", null), thriftComp, Type.OBJECT, null));
    assertEquals(-1, sortComparator.compareObjects(new A("3", null), new A("2", null), thriftComp, Type.OBJECT, null));

    assertEquals(1, sortComparator.compareObjects(new A("1", null), new A("2", null), thriftComp, Type.OBJECT, null));
    assertEquals(0, sortComparator.compareObjects(new A("2", null), new A("2", null), thriftComp, Type.OBJECT, null));
    assertEquals(-1, sortComparator.compareObjects(new A("3", null), new A("2", null), thriftComp, Type.OBJECT, null));
  }
View Full Code Here


    Object instance = tuple.get(index);
    if (field.getObjectClass() == A.class) {
      if (instance == null) {
        instance = ReflectionUtils.newInstance(field.getObjectClass(), null);
      }
      A a = (A) instance;
      a.setId(isRandom ? random.nextInt() + "" : "");
      a.setUrl(isRandom ? random.nextLong() + "" : "");
    } else if (field.getObjectSerialization() == AvroFieldSerialization.class) {
      if (instance == null || !(instance instanceof Record)) {
        instance = new Record(AVRO_SCHEMA);
      }
      Record record = (Record) instance;
View Full Code Here

TOP

Related Classes of com.datasalt.pangool.thrift.test.A

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.