Package protobuf_unittest.UnittestProto

Examples of protobuf_unittest.UnittestProto.TestOneofBackwardsCompatible.toByteString()


  public void testOneofOnlyLastSet() throws Exception {
    TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible
        .newBuilder().setFooInt(100).setFooString("101").build();

    ByteString rawBytes = source.toByteString();
    TestOneof2 message = TestOneof2.parseFrom(rawBytes);
    assertFalse(message.hasFooInt());
    assertTrue(message.hasFooString());
  }
}
View Full Code Here


  public void testOneofOnlyLastSet() throws Exception {
    TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible
        .newBuilder().setFooInt(100).setFooString("101").build();

    ByteString rawBytes = source.toByteString();
    TestOneof2 message = TestOneof2.parseFrom(rawBytes);
    assertFalse(message.hasFooInt());
    assertTrue(message.hasFooString());
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.