Package org.apache.avro.thrift.test

Examples of org.apache.avro.thrift.test.Test


  @org.junit.Test public void testStruct() throws Exception {

    System.out.println(ThriftData.get().getSchema(Test.class).toString(true));

    Test test = new Test();
    test.setBoolField(true);
    test.setByteField((byte)2);
    test.setI16Field((short)3);
    test.setI16OptionalField((short)14);
    test.setI32Field(4);
    test.setI64Field(5L);
    test.setDoubleField(2.0);
    test.setStringField("foo");
    test.setBinaryField(ByteBuffer.wrap(new byte[] {0,-1}));
    test.setMapField(Collections.singletonMap("x", 1));
    test.setListField(Collections.singletonList(7));
    test.setSetField(Collections.singleton(8));
    test.setEnumField(E.X);
    test.setStructField(new Nested(9));
    test.setFooOrBar(FooOrBar.foo("x"));

    System.out.println(test);

    check(test);
  }
View Full Code Here


    check(test);
  }

  @org.junit.Test public void testOptionals() throws Exception {

    Test test = new Test();
    test.setBoolField(true);
    test.setByteField((byte)2);
    test.setI16Field((short)3);
    test.setI64Field(5L);
    test.setDoubleField(2.0);

    System.out.println(test);

    check(test);
  }
View Full Code Here

  @org.junit.Test public void testStruct() throws Exception {

    System.out.println(ThriftData.get().getSchema(Test.class).toString(true));

    Test test = new Test();
    test.setBoolField(true);
    test.setByteField((byte)2);
    test.setI16Field((short)3);
    test.setI32Field(4);
    test.setI64Field(5L);
    test.setDoubleField(2.0);
    test.setStringField("foo");
    test.setBinaryField(ByteBuffer.wrap(new byte[] {0,-1}));
    test.setMapField(Collections.singletonMap("x", 1));
    test.setListField(Collections.singletonList(7));
    test.setSetField(Collections.singleton(8));
    test.setEnumField(E.X);
    test.setStructField(new Nested(9));

    System.out.println(test);

    check(test);
  }
View Full Code Here

    check(test);
  }

  @org.junit.Test public void testOptionals() throws Exception {

    Test test = new Test();
    test.setBoolField(true);
    test.setByteField((byte)2);
    test.setI16Field((short)3);
    test.setI64Field(5L);
    test.setDoubleField(2.0);

    System.out.println(test);

    check(test);
  }
View Full Code Here

TOP

Related Classes of org.apache.avro.thrift.test.Test

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.