Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.google.protobuf.test.TextFormatTest Class Reference
Inheritance diagram for com.google.protobuf.test.TextFormatTest:
Inheritance graph
[legend]

Public Member Functions

void testParse () throws Exception
 
void testParseAdjacentStringLiterals () throws Exception
 
void testParseAngleBrackets () throws Exception
 
void testParseBoolean () throws Exception
 
void testParseComment () throws Exception
 
void testParseCompatibility () throws Exception
 
void testParseExotic () throws Exception
 
void testParseExtensions () throws Exception
 
void testParseLongString () throws Exception
 
void testParseMessageSet () throws Exception
 
void testParseNumericEnum () throws Exception
 
void testParseReader () throws Exception
 
void testParseString () throws Exception
 
void testPrintExotic () throws Exception
 
void testPrintExtensions () throws Exception
 
void testPrintField () throws Exception
 
void testPrintFieldValue () throws Exception
 
void testPrintMessage () throws Exception
 
void testPrintMessageBuilder () throws Exception
 
void testPrintMessageSet () throws Exception
 
void testPrintToUnicodeString ()
 
void testPrintToUnicodeString_unknown ()
 
void testPrintUnknownFields () throws Exception
 
void testShortDebugString ()
 
void testShortDebugString_unknown ()
 

Private Member Functions

void assertPrintFieldValue (String expect, Object value, String fieldName) throws Exception
 
ByteString bytes (int... bytesAsInts)
 
ByteString bytes (String str) throws Exception
 
UnknownFieldSet makeUnknownFieldSet ()
 

Private Attributes

String messageSetText
 

Static Private Attributes

static String allExtensionsSetText
 
static String allFieldsSetText
 
static String canonicalExoticText
 
static String exoticText
 
static final String kEscapeTestString
 
static final String kEscapeTestStringEscaped
 

Detailed Description

Test case for TextFormat.

TODO(wenboz): ExtensionTest and rest of text_format_unittest.cc.

Author
wenbo.nosp@m.z@go.nosp@m.ogle..nosp@m.com (Wenbo Zhu)

Definition at line 55 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

Member Function Documentation

◆ assertPrintFieldValue()

void com.google.protobuf.test.TextFormatTest.assertPrintFieldValue ( String  expect,
Object  value,
String  fieldName 
) throws Exception
inlineprivate

◆ bytes() [1/2]

ByteString com.google.protobuf.test.TextFormatTest.bytes ( int...  bytesAsInts)
inlineprivate

Helper to construct a ByteString from a bunch of bytes. The inputs are actually ints so that I can use hex notation and not get stupid errors about precision.

Definition at line 236 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ bytes() [2/2]

ByteString com.google.protobuf.test.TextFormatTest.bytes ( String  str) throws Exception
inlineprivate

Helper to construct a ByteString from a String containing only 8-bit characters. The characters are converted directly to bytes, not encoded using UTF-8.

Definition at line 227 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ makeUnknownFieldSet()

UnknownFieldSet com.google.protobuf.test.TextFormatTest.makeUnknownFieldSet ( )
inlineprivate

◆ testParse()

void com.google.protobuf.test.TextFormatTest.testParse ( ) throws Exception
inline

◆ testParseAdjacentStringLiterals()

void com.google.protobuf.test.TextFormatTest.testParseAdjacentStringLiterals ( ) throws Exception
inline

◆ testParseAngleBrackets()

void com.google.protobuf.test.TextFormatTest.testParseAngleBrackets ( ) throws Exception
inline

◆ testParseBoolean()

void com.google.protobuf.test.TextFormatTest.testParseBoolean ( ) throws Exception
inline

◆ testParseComment()

void com.google.protobuf.test.TextFormatTest.testParseComment ( ) throws Exception
inline

◆ testParseCompatibility()

void com.google.protobuf.test.TextFormatTest.testParseCompatibility ( ) throws Exception
inline

◆ testParseExotic()

void com.google.protobuf.test.TextFormatTest.testParseExotic ( ) throws Exception
inline

◆ testParseExtensions()

void com.google.protobuf.test.TextFormatTest.testParseExtensions ( ) throws Exception
inline

◆ testParseLongString()

void com.google.protobuf.test.TextFormatTest.testParseLongString ( ) throws Exception
inline

◆ testParseMessageSet()

void com.google.protobuf.test.TextFormatTest.testParseMessageSet ( ) throws Exception
inline

◆ testParseNumericEnum()

void com.google.protobuf.test.TextFormatTest.testParseNumericEnum ( ) throws Exception
inline

◆ testParseReader()

void com.google.protobuf.test.TextFormatTest.testParseReader ( ) throws Exception
inline

◆ testParseString()

void com.google.protobuf.test.TextFormatTest.testParseString ( ) throws Exception
inline

◆ testPrintExotic()

void com.google.protobuf.test.TextFormatTest.testPrintExotic ( ) throws Exception
inline

◆ testPrintExtensions()

void com.google.protobuf.test.TextFormatTest.testPrintExtensions ( ) throws Exception
inline

Print TestAllExtensions and compare with golden file.

Definition at line 138 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ testPrintField()

void com.google.protobuf.test.TextFormatTest.testPrintField ( ) throws Exception
inline

◆ testPrintFieldValue()

void com.google.protobuf.test.TextFormatTest.testPrintFieldValue ( ) throws Exception
inline

◆ testPrintMessage()

void com.google.protobuf.test.TextFormatTest.testPrintMessage ( ) throws Exception
inline

◆ testPrintMessageBuilder()

void com.google.protobuf.test.TextFormatTest.testPrintMessageBuilder ( ) throws Exception
inline

◆ testPrintMessageSet()

void com.google.protobuf.test.TextFormatTest.testPrintMessageSet ( ) throws Exception
inline

◆ testPrintToUnicodeString()

void com.google.protobuf.test.TextFormatTest.testPrintToUnicodeString ( )
inline

◆ testPrintToUnicodeString_unknown()

void com.google.protobuf.test.TextFormatTest.testPrintToUnicodeString_unknown ( )
inline

◆ testPrintUnknownFields()

void com.google.protobuf.test.TextFormatTest.testPrintUnknownFields ( ) throws Exception
inline

◆ testShortDebugString()

void com.google.protobuf.test.TextFormatTest.testShortDebugString ( )
inline

◆ testShortDebugString_unknown()

void com.google.protobuf.test.TextFormatTest.testShortDebugString_unknown ( )
inline

Member Data Documentation

◆ allExtensionsSetText

String com.google.protobuf.test.TextFormatTest.allExtensionsSetText
staticprivate
Initial value:
= TestUtil.readTextFromFile(
"text_format_unittest_extensions_data.txt")

Definition at line 69 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ allFieldsSetText

String com.google.protobuf.test.TextFormatTest.allFieldsSetText
staticprivate
Initial value:
= TestUtil.readTextFromFile(
"text_format_unittest_data.txt")

Definition at line 67 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ canonicalExoticText

String com.google.protobuf.test.TextFormatTest.canonicalExoticText
staticprivate
Initial value:
=
exoticText.replace(": .", ": 0.").replace(": -.", ": -0.")
.replace("23e", "23E").replace("E+", "E").replace("0.23E17", "2.3E16")

Definition at line 101 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ exoticText

String com.google.protobuf.test.TextFormatTest.exoticText
staticprivate
Initial value:
=
"repeated_int32: -1\n" +
"repeated_int32: -2147483648\n" +
"repeated_int64: -1\n" +
"repeated_int64: -9223372036854775808\n" +
"repeated_uint32: 4294967295\n" +
"repeated_uint32: 2147483648\n" +
"repeated_uint64: 18446744073709551615\n" +
"repeated_uint64: 9223372036854775808\n" +
"repeated_double: 123.0\n" +
"repeated_double: 123.5\n" +
"repeated_double: 0.125\n" +
"repeated_double: .125\n" +
"repeated_double: -.125\n" +
"repeated_double: 1.23E17\n" +
"repeated_double: 1.23E+17\n" +
"repeated_double: -1.23e-17\n" +
"repeated_double: .23e+17\n" +
"repeated_double: -.23E17\n" +
"repeated_double: 1.235E22\n" +
"repeated_double: 1.235E-18\n" +
"repeated_double: 123.456789\n" +
"repeated_double: Infinity\n" +
"repeated_double: -Infinity\n" +
"repeated_double: NaN\n" +
"repeated_string: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"" +
"\\341\\210\\264\"\n" +
"repeated_bytes: \"\\000\\001\\a\\b\\f\\n\\r\\t\\v\\\\\\'\\\"\\376\"\n"

Definition at line 72 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ kEscapeTestString

final String com.google.protobuf.test.TextFormatTest.kEscapeTestString
staticprivate
Initial value:
=
"\"A string with ' characters \n and \r newlines and \t tabs and \001 "
+ "slashes \\"

Definition at line 58 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ kEscapeTestStringEscaped

final String com.google.protobuf.test.TextFormatTest.kEscapeTestStringEscaped
staticprivate
Initial value:
=
"\\\"A string with \\' characters \\n and \\r newlines "
+ "and \\t tabs and \\001 slashes \\\\"

Definition at line 63 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.

◆ messageSetText

String com.google.protobuf.test.TextFormatTest.messageSetText
private
Initial value:
=
"[protobuf_unittest.TestMessageSetExtension1] {\n" +
" i: 123\n" +
"}\n" +
"[protobuf_unittest.TestMessageSetExtension2] {\n" +
" str: \"foo\"\n" +
"}\n"

Definition at line 105 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java.


The documentation for this class was generated from the following file:
com.google.protobuf.test.TextFormatTest.exoticText
static String exoticText
Definition: bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/TextFormatTest.java:72


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:09