| Index: third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java
|
| diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java
|
| similarity index 68%
|
| copy from third_party/protobuf/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java
|
| copy to third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.java
|
| index b1c75fc33c59ea65058888e5e449eca682343b2b..cb75d74b0c6b34f068653aa85cbd49ea709dca39 100644
|
| --- a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java
|
| +++ b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/UnmodifiableLazyStringListTest.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,12 +28,12 @@
|
| // (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 junit.framework.TestCase;
|
|
|
| import java.util.Iterator;
|
| -import java.util.List;
|
| import java.util.ListIterator;
|
|
|
| /**
|
| @@ -61,11 +61,6 @@ public class UnmodifiableLazyStringListTest extends TestCase {
|
| assertEquals(BYTE_STRING_A, list.getByteString(0));
|
| assertEquals(BYTE_STRING_B, list.getByteString(1));
|
| assertEquals(BYTE_STRING_C, list.getByteString(2));
|
| -
|
| - List<ByteString> byteStringList = list.asByteStringList();
|
| - assertSame(list.getByteString(0), byteStringList.get(0));
|
| - assertSame(list.getByteString(1), byteStringList.get(1));
|
| - assertSame(list.getByteString(2), byteStringList.get(2));
|
| }
|
|
|
| public void testModifyMethods() {
|
| @@ -94,35 +89,6 @@ public class UnmodifiableLazyStringListTest extends TestCase {
|
| } catch (UnsupportedOperationException e) {
|
| // expected
|
| }
|
| - assertEquals(3, list.size());
|
| -
|
| - List<ByteString> byteStringList = list.asByteStringList();
|
| - try {
|
| - byteStringList.remove(0);
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - assertEquals(3, list.size());
|
| - assertEquals(3, byteStringList.size());
|
| -
|
| - try {
|
| - byteStringList.add(BYTE_STRING_B);
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - assertEquals(3, list.size());
|
| - assertEquals(3, byteStringList.size());
|
| -
|
| - try {
|
| - byteStringList.set(1, BYTE_STRING_B);
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - assertEquals(3, list.size());
|
| - assertEquals(3, byteStringList.size());
|
| }
|
|
|
| public void testIterator() {
|
| @@ -143,20 +109,6 @@ public class UnmodifiableLazyStringListTest extends TestCase {
|
| }
|
| assertEquals(3, count);
|
|
|
| - List<ByteString> byteStringList = list.asByteStringList();
|
| - Iterator<ByteString> byteIter = byteStringList.iterator();
|
| - count = 0;
|
| - while (byteIter.hasNext()) {
|
| - byteIter.next();
|
| - count++;
|
| - try {
|
| - byteIter.remove();
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - }
|
| - assertEquals(3, count);
|
| }
|
|
|
| public void testListIterator() {
|
| @@ -189,32 +141,6 @@ public class UnmodifiableLazyStringListTest extends TestCase {
|
| }
|
| assertEquals(3, count);
|
|
|
| - List<ByteString> byteStringList = list.asByteStringList();
|
| - ListIterator<ByteString> byteIter = byteStringList.listIterator();
|
| - count = 0;
|
| - while (byteIter.hasNext()) {
|
| - byteIter.next();
|
| - count++;
|
| - try {
|
| - byteIter.remove();
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - try {
|
| - byteIter.set(BYTE_STRING_A);
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - try {
|
| - byteIter.add(BYTE_STRING_A);
|
| - fail();
|
| - } catch (UnsupportedOperationException e) {
|
| - // expected
|
| - }
|
| - }
|
| - assertEquals(3, count);
|
| }
|
|
|
| private LazyStringArrayList createSampleList() {
|
|
|