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); }
public void testPackedSerialization() throws Exception { Message abstractMessage = new AbstractMessageWrapper(TestUtil.getPackedSet()); TestUtil.assertPackedFieldsSet(TestPackedTypes.parseFrom(abstractMessage.toByteString())); assertEquals(TestUtil.getPackedSet().toByteString(), abstractMessage.toByteString()); }