Example #1
0
 public void testUnpackedParsing() throws Exception {
   AbstractMessageWrapper.Builder builder =
       new AbstractMessageWrapper.Builder(TestUnpackedTypes.newBuilder());
   AbstractMessageWrapper message =
       builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build();
   TestUtil.assertUnpackedFieldsSet((TestUnpackedTypes) message.wrappedMessage);
 }
Example #2
0
  public void testUnpackedSerialization() throws Exception {
    Message abstractMessage = new AbstractMessageWrapper(TestUtil.getUnpackedSet());

    TestUtil.assertUnpackedFieldsSet(TestUnpackedTypes.parseFrom(abstractMessage.toByteString()));

    assertEquals(TestUtil.getUnpackedSet().toByteString(), abstractMessage.toByteString());
  }