Index: third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java |
diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java |
similarity index 84% |
copy from third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java |
copy to third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java |
index 0ef414aac60fa7ef5e4f9cae020f47655ac77d66..e21e038993251498308f26e1c134d8a8bf33fa54 100644 |
--- a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java |
+++ b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// https://developers.google.com/protocol-buffers/ |
+// http://code.google.com/p/protobuf/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,7 +28,8 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-package com.google.protobuf; |
+package com.google.protobuf.test; |
+import com.google.protobuf.*; |
import protobuf_unittest.UnittestProto; |
@@ -89,31 +90,6 @@ public class LazyStringEndToEndTest extends TestCase { |
TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8, |
ByteString.copyFrom(sink)); |
} |
- |
- public void testCaching() { |
- String a = "a"; |
- String b = "b"; |
- String c = "c"; |
- UnittestProto.TestAllTypes proto = UnittestProto.TestAllTypes.newBuilder() |
- .setOptionalString(a) |
- .addRepeatedString(b) |
- .addRepeatedString(c) |
- .build(); |
- |
- // String should be the one we passed it. |
- assertSame(a, proto.getOptionalString()); |
- assertSame(b, proto.getRepeatedString(0)); |
- assertSame(c, proto.getRepeatedString(1)); |
- |
- |
- // Ensure serialization keeps strings cached. |
- proto.toByteString(); |
- |
- // And now the string should stay cached. |
- assertSame(a, proto.getOptionalString()); |
- assertSame(b, proto.getRepeatedString(0)); |
- assertSame(c, proto.getRepeatedString(1)); |
- } |
public void testNoStringCachingIfOnlyBytesAccessed() throws Exception { |
UnittestProto.TestAllTypes proto = |