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

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

Issue 2600753002: Reverts third_party/protobuf: Update to HEAD (f52e188fe4) (Closed)
Patch Set: Created 3 years, 12 months 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 13 matching lines...) Expand all
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 30
31 package com.google.protobuf; 31 package com.google.protobuf;
32 32
33 import com.google.protobuf.ByteString.Output; 33 import com.google.protobuf.ByteString.Output;
34
35 import junit.framework.TestCase;
36
34 import java.io.ByteArrayInputStream; 37 import java.io.ByteArrayInputStream;
35 import java.io.ByteArrayOutputStream; 38 import java.io.ByteArrayOutputStream;
36 import java.io.IOException; 39 import java.io.IOException;
37 import java.io.InputStream; 40 import java.io.InputStream;
38 import java.io.OutputStream; 41 import java.io.OutputStream;
39 import java.lang.reflect.Field; 42 import java.lang.reflect.Field;
40 import java.nio.ByteBuffer; 43 import java.nio.ByteBuffer;
41 import java.nio.charset.Charset; 44 import java.nio.charset.Charset;
42 import java.util.ArrayList; 45 import java.util.ArrayList;
43 import java.util.Arrays; 46 import java.util.Arrays;
44 import java.util.Iterator; 47 import java.util.Iterator;
45 import java.util.List; 48 import java.util.List;
46 import java.util.NoSuchElementException; 49 import java.util.NoSuchElementException;
47 import java.util.Random; 50 import java.util.Random;
48 import junit.framework.TestCase;
49 51
50 /** 52 /**
51 * Test methods with implementations in {@link ByteString}, plus do some top-lev el "integration" 53 * Test methods with implementations in {@link ByteString}, plus do some top-lev el "integration"
52 * tests. 54 * tests.
53 * 55 *
54 * @author carlanton@google.com (Carl Haverl) 56 * @author carlanton@google.com (Carl Haverl)
55 */ 57 */
56 public class ByteStringTest extends TestCase { 58 public class ByteStringTest extends TestCase {
57 59
58 private static final Charset UTF_16 = Charset.forName("UTF-16"); 60 private static final Charset UTF_16 = Charset.forName("UTF-16");
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 public void testByteArrayCopier() throws Exception { 765 public void testByteArrayCopier() throws Exception {
764 Field field = ByteString.class.getDeclaredField("byteArrayCopier"); 766 Field field = ByteString.class.getDeclaredField("byteArrayCopier");
765 field.setAccessible(true); 767 field.setAccessible(true);
766 Object byteArrayCopier = field.get(null); 768 Object byteArrayCopier = field.get(null);
767 assertNotNull(byteArrayCopier); 769 assertNotNull(byteArrayCopier);
768 assertTrue( 770 assertTrue(
769 byteArrayCopier.toString(), 771 byteArrayCopier.toString(),
770 byteArrayCopier.getClass().getSimpleName().endsWith("ArraysByteArrayCopi er")); 772 byteArrayCopier.getClass().getSimpleName().endsWith("ArraysByteArrayCopi er"));
771 } 773 }
772 } 774 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698