aboutsummaryrefslogtreecommitdiff
path: root/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2018-09-04 10:58:54 -0700
committerJosh Haberman <jhaberman@gmail.com>2018-09-04 10:58:54 -0700
commitd61aede89cf188367766b971f59cf57d7835d8e8 (patch)
treea19842c62c3c8f51389912ecafdf932d0a572bea /java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java
parent45d03a977193d1dcce5251e4bffe17bf0ba738ec (diff)
downloadprotobuf-d61aede89cf188367766b971f59cf57d7835d8e8.tar.gz
protobuf-d61aede89cf188367766b971f59cf57d7835d8e8.tar.bz2
protobuf-d61aede89cf188367766b971f59cf57d7835d8e8.zip
Down-integrate from google3.
Diffstat (limited to 'java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java')
-rw-r--r--java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java38
1 files changed, 22 insertions, 16 deletions
diff --git a/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java b/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java
index dc56f2e9..d7262161 100644
--- a/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java
+++ b/java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java
@@ -34,8 +34,8 @@ import java.io.UnsupportedEncodingException;
import java.util.Iterator;
/**
- * This class tests {@link RopeByteString#substring(int, int)} by inheriting the tests from
- * {@link LiteralByteStringTest}. Only a couple of methods are overridden.
+ * This class tests {@link RopeByteString#substring(int, int)} by inheriting the tests from {@link
+ * LiteralByteStringTest}. Only a couple of methods are overridden.
*
* @author carlanton@google.com (Carl Haverl)
*/
@@ -61,8 +61,8 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest {
@Override
public void testGetTreeDepth() {
- assertEquals(classUnderTest + " must have the expected tree depth",
- 3, stringUnderTest.getTreeDepth());
+ assertEquals(
+ classUnderTest + " must have the expected tree depth", 3, stringUnderTest.getTreeDepth());
}
@Override
@@ -84,15 +84,18 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest {
testString = testString.substring(2, testString.length() - 6);
unicode = unicode.substring(2, unicode.size() - 6);
- assertEquals(classUnderTest + " from string must have the expected type",
- classUnderTest, getActualClassName(unicode));
+ assertEquals(
+ classUnderTest + " from string must have the expected type",
+ classUnderTest,
+ getActualClassName(unicode));
String roundTripString = unicode.toString(UTF_8);
- assertEquals(classUnderTest + " unicode bytes must match",
- testString, roundTripString);
+ assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString);
ByteString flatString = ByteString.copyFromUtf8(testString);
assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode);
- assertEquals(classUnderTest + " string must must have same hashCode as the flat string",
- flatString.hashCode(), unicode.hashCode());
+ assertEquals(
+ classUnderTest + " string must must have same hashCode as the flat string",
+ flatString.hashCode(),
+ unicode.hashCode());
}
@Override
@@ -114,14 +117,17 @@ public class RopeByteStringSubstringTest extends LiteralByteStringTest {
testString = testString.substring(2, testString.length() - 6);
unicode = unicode.substring(2, unicode.size() - 6);
- assertEquals(classUnderTest + " from string must have the expected type",
- classUnderTest, getActualClassName(unicode));
+ assertEquals(
+ classUnderTest + " from string must have the expected type",
+ classUnderTest,
+ getActualClassName(unicode));
String roundTripString = unicode.toString(Internal.UTF_8);
- assertEquals(classUnderTest + " unicode bytes must match",
- testString, roundTripString);
+ assertEquals(classUnderTest + " unicode bytes must match", testString, roundTripString);
ByteString flatString = ByteString.copyFromUtf8(testString);
assertEquals(classUnderTest + " string must equal the flat string", flatString, unicode);
- assertEquals(classUnderTest + " string must must have same hashCode as the flat string",
- flatString.hashCode(), unicode.hashCode());
+ assertEquals(
+ classUnderTest + " string must must have same hashCode as the flat string",
+ flatString.hashCode(),
+ unicode.hashCode());
}
}