Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Side by Side Diff: third_party/protobuf/java/core/src/test/java/com/google/protobuf/WireFormatTest.java

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 26 matching lines...) Expand all
37 import protobuf_unittest.UnittestMset.TestMessageSetExtension2; 37 import protobuf_unittest.UnittestMset.TestMessageSetExtension2;
38 import protobuf_unittest.UnittestProto; 38 import protobuf_unittest.UnittestProto;
39 import protobuf_unittest.UnittestProto.TestAllExtensions; 39 import protobuf_unittest.UnittestProto.TestAllExtensions;
40 import protobuf_unittest.UnittestProto.TestAllTypes; 40 import protobuf_unittest.UnittestProto.TestAllTypes;
41 import protobuf_unittest.UnittestProto.TestFieldOrderings; 41 import protobuf_unittest.UnittestProto.TestFieldOrderings;
42 import protobuf_unittest.UnittestProto.TestOneof2; 42 import protobuf_unittest.UnittestProto.TestOneof2;
43 import protobuf_unittest.UnittestProto.TestOneofBackwardsCompatible; 43 import protobuf_unittest.UnittestProto.TestOneofBackwardsCompatible;
44 import protobuf_unittest.UnittestProto.TestPackedExtensions; 44 import protobuf_unittest.UnittestProto.TestPackedExtensions;
45 import protobuf_unittest.UnittestProto.TestPackedTypes; 45 import protobuf_unittest.UnittestProto.TestPackedTypes;
46 import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet; 46 import proto2_wireformat_unittest.UnittestMsetWireFormat.TestMessageSet;
47
48 import junit.framework.TestCase;
49
50 import java.io.ByteArrayInputStream; 47 import java.io.ByteArrayInputStream;
51 import java.io.ByteArrayOutputStream; 48 import java.io.ByteArrayOutputStream;
52 import java.util.List; 49 import java.util.List;
50 import junit.framework.TestCase;
53 51
54 /** 52 /**
55 * Tests related to parsing and serialization. 53 * Tests related to parsing and serialization.
56 * 54 *
57 * @author kenton@google.com (Kenton Varda) 55 * @author kenton@google.com (Kenton Varda)
58 */ 56 */
59 public class WireFormatTest extends TestCase { 57 public class WireFormatTest extends TestCase {
60 public void testSerialization() throws Exception { 58 public void testSerialization() throws Exception {
61 TestAllTypes message = TestUtil.getAllSet(); 59 TestAllTypes message = TestUtil.getAllSet();
62 60
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 public void testOneofOnlyLastSet() throws Exception { 595 public void testOneofOnlyLastSet() throws Exception {
598 TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible 596 TestOneofBackwardsCompatible source = TestOneofBackwardsCompatible
599 .newBuilder().setFooInt(100).setFooString("101").build(); 597 .newBuilder().setFooInt(100).setFooString("101").build();
600 598
601 ByteString rawBytes = source.toByteString(); 599 ByteString rawBytes = source.toByteString();
602 TestOneof2 message = TestOneof2.parseFrom(rawBytes); 600 TestOneof2 message = TestOneof2.parseFrom(rawBytes);
603 assertFalse(message.hasFooInt()); 601 assertFalse(message.hasFooInt());
604 assertTrue(message.hasFooString()); 602 assertTrue(message.hasFooString());
605 } 603 }
606 } 604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698