| OLD | NEW |
| 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 20 matching lines...) Expand all Loading... |
| 31 package com.google.protobuf; | 31 package com.google.protobuf; |
| 32 | 32 |
| 33 import protobuf_unittest.UnittestProto; | 33 import protobuf_unittest.UnittestProto; |
| 34 import protobuf_unittest.UnittestProto.ForeignEnum; | 34 import protobuf_unittest.UnittestProto.ForeignEnum; |
| 35 import protobuf_unittest.UnittestProto.TestAllExtensions; | 35 import protobuf_unittest.UnittestProto.TestAllExtensions; |
| 36 import protobuf_unittest.UnittestProto.TestAllTypes; | 36 import protobuf_unittest.UnittestProto.TestAllTypes; |
| 37 import protobuf_unittest.UnittestProto.TestEmptyMessage; | 37 import protobuf_unittest.UnittestProto.TestEmptyMessage; |
| 38 import protobuf_unittest.UnittestProto.TestEmptyMessageWithExtensions; | 38 import protobuf_unittest.UnittestProto.TestEmptyMessageWithExtensions; |
| 39 import protobuf_unittest.UnittestProto.TestPackedExtensions; | 39 import protobuf_unittest.UnittestProto.TestPackedExtensions; |
| 40 import protobuf_unittest.UnittestProto.TestPackedTypes; | 40 import protobuf_unittest.UnittestProto.TestPackedTypes; |
| 41 |
| 42 import junit.framework.TestCase; |
| 43 |
| 41 import java.util.Arrays; | 44 import java.util.Arrays; |
| 42 import java.util.Map; | 45 import java.util.Map; |
| 43 import junit.framework.TestCase; | |
| 44 | 46 |
| 45 /** | 47 /** |
| 46 * Tests related to unknown field handling. | 48 * Tests related to unknown field handling. |
| 47 * | 49 * |
| 48 * @author kenton@google.com (Kenton Varda) | 50 * @author kenton@google.com (Kenton Varda) |
| 49 */ | 51 */ |
| 50 public class UnknownFieldSetTest extends TestCase { | 52 public class UnknownFieldSetTest extends TestCase { |
| 51 @Override | 53 @Override |
| 52 public void setUp() throws Exception { | 54 public void setUp() throws Exception { |
| 53 descriptor = TestAllTypes.getDescriptor(); | 55 descriptor = TestAllTypes.getDescriptor(); |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData); | 645 UnittestLite.TestEmptyMessageLite.parseFrom(allFieldsData); |
| 644 UnittestLite.TestEmptyMessageLite emptyMessageLite2 = | 646 UnittestLite.TestEmptyMessageLite emptyMessageLite2 = |
| 645 UnittestLite.TestEmptyMessageLite.newBuilder() | 647 UnittestLite.TestEmptyMessageLite.newBuilder() |
| 646 .mergeFrom(emptyMessageLite1).clear().build(); | 648 .mergeFrom(emptyMessageLite1).clear().build(); |
| 647 assertEquals(0, emptyMessageLite2.getSerializedSize()); | 649 assertEquals(0, emptyMessageLite2.getSerializedSize()); |
| 648 ByteString data = emptyMessageLite2.toByteString(); | 650 ByteString data = emptyMessageLite2.toByteString(); |
| 649 assertEquals(0, data.size()); | 651 assertEquals(0, data.size()); |
| 650 } | 652 } |
| 651 | 653 |
| 652 } | 654 } |
| OLD | NEW |