Exemplo n.º 1
0
 public void testParseUnpackedToPacked() throws Exception {
   AbstractMessageWrapper.Builder builder =
       new AbstractMessageWrapper.Builder(TestPackedTypes.newBuilder());
   AbstractMessageWrapper message =
       builder.mergeFrom(TestUtil.getUnpackedSet().toByteString()).build();
   TestUtil.assertPackedFieldsSet((TestPackedTypes) message.wrappedMessage);
 }
Exemplo n.º 2
0
  public void testPackedSerialization() throws Exception {
    Message abstractMessage = new AbstractMessageWrapper(TestUtil.getPackedSet());

    TestUtil.assertPackedFieldsSet(TestPackedTypes.parseFrom(abstractMessage.toByteString()));

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