Classes | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
com.google.protobuf.TestUtil Class Reference

Classes

class  MockBuilderParent
 
class  ReflectionTester
 
class  TestLogHandler
 

Static Public Member Functions

static void assertAllExtensionsSet (TestAllExtensionsLiteOrBuilder message)
 
static void assertAllExtensionsSet (TestAllExtensionsLiteOrBuilder message)
 
static void assertAllExtensionsSet (TestAllExtensionsOrBuilder message)
 
static void assertAllExtensionsSet (TestAllExtensionsOrBuilder message)
 
static void assertAllFieldsSet (TestAllTypesOrBuilder message)
 
static void assertAllFieldsSet (TestAllTypesOrBuilder message)
 
static void assertAtMostOneFieldSetOneof (TestOneof2 message)
 
static void assertAtMostOneFieldSetOneof (TestOneof2 message)
 
static void assertClear (TestAllTypesOrBuilder message)
 
static void assertClear (TestAllTypesOrBuilder message)
 
static void assertExtensionsClear (TestAllExtensionsLiteOrBuilder message)
 
static void assertExtensionsClear (TestAllExtensionsLiteOrBuilder message)
 
static void assertExtensionsClear (TestAllExtensionsOrBuilder message)
 
static void assertExtensionsClear (TestAllExtensionsOrBuilder message)
 
static void assertOneofSet (TestOneof2 message)
 
static void assertOneofSet (TestOneof2 message)
 
static void assertPackedExtensionsSet (TestPackedExtensions message)
 
static void assertPackedExtensionsSet (TestPackedExtensions message)
 
static void assertPackedExtensionsSet (TestPackedExtensionsLite message)
 
static void assertPackedExtensionsSet (TestPackedExtensionsLite message)
 
static void assertPackedFieldsSet (TestPackedTypes message)
 
static void assertPackedFieldsSet (TestPackedTypes message)
 
static void assertRepeatedExtensionsModified (TestAllExtensionsLiteOrBuilder message)
 
static void assertRepeatedExtensionsModified (TestAllExtensionsLiteOrBuilder message)
 
static void assertRepeatedExtensionsModified (TestAllExtensionsOrBuilder message)
 
static void assertRepeatedExtensionsModified (TestAllExtensionsOrBuilder message)
 
static void assertRepeatedFieldsModified (TestAllTypesOrBuilder message)
 
static void assertRepeatedFieldsModified (TestAllTypesOrBuilder message)
 
static void assertUnpackedFieldsSet (TestUnpackedTypes message)
 
static void assertUnpackedFieldsSet (TestUnpackedTypes message)
 
static TestAllExtensions getAllExtensionsSet ()
 
static TestAllExtensions getAllExtensionsSet ()
 
static TestAllTypes getAllSet ()
 
static TestAllTypes getAllSet ()
 
static TestAllTypes.Builder getAllSetBuilder ()
 
static TestAllTypes.Builder getAllSetBuilder ()
 
static ExtensionRegistryLite getExtensionRegistry ()
 
static ExtensionRegistryLite getExtensionRegistry ()
 
static ExtensionRegistry getFullExtensionRegistry ()
 
static ExtensionRegistry getFullExtensionRegistry ()
 
static ByteString getGoldenMessage ()
 
static ByteString getGoldenMessage ()
 
static ByteString getGoldenPackedFieldsMessage ()
 
static ByteString getGoldenPackedFieldsMessage ()
 
static TestPackedExtensions getPackedExtensionsSet ()
 
static TestPackedExtensions getPackedExtensionsSet ()
 
static TestPackedTypes getPackedSet ()
 
static TestPackedTypes getPackedSet ()
 
static TestUnpackedTypes getUnpackedSet ()
 
static TestUnpackedTypes getUnpackedSet ()
 
static void modifyRepeatedExtensions (TestAllExtensions.Builder message)
 
static void modifyRepeatedExtensions (TestAllExtensions.Builder message)
 
static void modifyRepeatedFields (TestAllTypes.Builder message)
 
static void modifyRepeatedFields (TestAllTypes.Builder message)
 
static ByteString readBytesFromFile (String filename)
 
static ByteString readBytesFromFile (String filename)
 
static String readTextFromFile (String filePath)
 
static String readTextFromFile (String filePath)
 
static void registerAllExtensions (ExtensionRegistryLite registry)
 
static void registerAllExtensions (ExtensionRegistryLite registry)
 
static void resetMemoizedSize (AbstractMessage message)
 
static void resetMemoizedSize (AbstractMessage message)
 
static void setAllExtensions (TestAllExtensions.Builder message)
 
static void setAllExtensions (TestAllExtensions.Builder message)
 
static void setAllFields (TestAllTypes.Builder message)
 
static void setAllFields (TestAllTypes.Builder message)
 
static void setOneof (TestOneof2.Builder message)
 
static void setOneof (TestOneof2.Builder message)
 
static void setPackedExtensions (TestPackedExtensions.Builder message)
 
static void setPackedExtensions (TestPackedExtensions.Builder message)
 
static void setPackedFields (TestPackedTypes.Builder message)
 
static void setPackedFields (TestPackedTypes.Builder message)
 
static void setUnpackedFields (TestUnpackedTypes.Builder message)
 
static void setUnpackedFields (TestUnpackedTypes.Builder message)
 
static ByteString toBytes (String str)
 

Static Public Attributes

static final TestRequired TEST_REQUIRED_INITIALIZED
 
static final TestRequired TEST_REQUIRED_UNINITIALIZED
 

Private Member Functions

 TestUtil ()
 
 TestUtil ()
 

Static Private Member Functions

static void assertEqualsExactType (boolean a, boolean b)
 
static void assertEqualsExactType (boolean a, boolean b)
 
static void assertEqualsExactType (ByteString a, ByteString b)
 
static void assertEqualsExactType (ByteString a, ByteString b)
 
static void assertEqualsExactType (double a, double b)
 
static void assertEqualsExactType (double a, double b)
 
static void assertEqualsExactType (float a, float b)
 
static void assertEqualsExactType (float a, float b)
 
static void assertEqualsExactType (ForeignEnum a, ForeignEnum b)
 
static void assertEqualsExactType (ForeignEnum a, ForeignEnum b)
 
static void assertEqualsExactType (ForeignEnumLite a, ForeignEnumLite b)
 
static void assertEqualsExactType (ForeignEnumLite a, ForeignEnumLite b)
 
static void assertEqualsExactType (ImportEnum a, ImportEnum b)
 
static void assertEqualsExactType (ImportEnum a, ImportEnum b)
 
static void assertEqualsExactType (ImportEnumLite a, ImportEnumLite b)
 
static void assertEqualsExactType (ImportEnumLite a, ImportEnumLite b)
 
static void assertEqualsExactType (int a, int b)
 
static void assertEqualsExactType (int a, int b)
 
static void assertEqualsExactType (long a, long b)
 
static void assertEqualsExactType (long a, long b)
 
static void assertEqualsExactType (String a, String b)
 
static void assertEqualsExactType (String a, String b)
 
static void assertEqualsExactType (TestAllTypes.NestedEnum a, TestAllTypes.NestedEnum b)
 
static void assertEqualsExactType (TestAllTypes.NestedEnum a, TestAllTypes.NestedEnum b)
 
static void assertEqualsExactType (TestAllTypesLite.NestedEnum a, TestAllTypesLite.NestedEnum b)
 
static void assertEqualsExactType (TestAllTypesLite.NestedEnum a, TestAllTypesLite.NestedEnum b)
 
static File getTestDataDir ()
 
static File getTestDataDir ()
 
static ByteString readBytesFromResource (String name)
 
static ByteString readBytesFromResource (String name)
 

Static Private Attributes

static ByteString goldenMessage = null
 
static ByteString goldenPackedFieldsMessage = null
 

Detailed Description

Contains methods for setting all fields of

TestAllTypes

to some values as well as checking that all the fields are set to those values. These are useful for testing various protocol message features, e.g. set all fields of a message, serialize it, parse it, and check that all fields are set.

This code is not to be used outside of

and subpackages.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Definition at line 254 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

Constructor & Destructor Documentation

◆ TestUtil() [1/2]

com.google.protobuf.TestUtil.TestUtil ( )
inlineprivate

◆ TestUtil() [2/2]

com.google.protobuf.TestUtil.TestUtil ( )
inlineprivate

Member Function Documentation

◆ assertAllExtensionsSet() [1/4]

static void com.google.protobuf.TestUtil.assertAllExtensionsSet ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

.

Definition at line 1997 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAllExtensionsSet() [2/4]

static void com.google.protobuf.TestUtil.assertAllExtensionsSet ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

.

Definition at line 1997 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAllExtensionsSet() [3/4]

static void com.google.protobuf.TestUtil.assertAllExtensionsSet ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

.

Definition at line 1406 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAllExtensionsSet() [4/4]

static void com.google.protobuf.TestUtil.assertAllExtensionsSet ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

.

Definition at line 1406 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAllFieldsSet() [1/2]

static void com.google.protobuf.TestUtil.assertAllFieldsSet ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 489 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAllFieldsSet() [2/2]

static void com.google.protobuf.TestUtil.assertAllFieldsSet ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 489 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertAtMostOneFieldSetOneof() [1/2]

static void com.google.protobuf.TestUtil.assertAtMostOneFieldSetOneof ( TestOneof2  message)
inlinestatic

◆ assertAtMostOneFieldSetOneof() [2/2]

static void com.google.protobuf.TestUtil.assertAtMostOneFieldSetOneof ( TestOneof2  message)
inlinestatic

◆ assertClear() [1/2]

static void com.google.protobuf.TestUtil.assertClear ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are cleared, and that getting the fields returns their default values.

Definition at line 703 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertClear() [2/2]

static void com.google.protobuf.TestUtil.assertClear ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are cleared, and that getting the fields returns their default values.

Definition at line 703 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertEqualsExactType() [1/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( boolean  a,
boolean  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [2/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( boolean  a,
boolean  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [3/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ByteString  a,
ByteString  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [4/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ByteString  a,
ByteString  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [5/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( double  a,
double  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [6/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( double  a,
double  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [7/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( float  a,
float  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [8/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( float  a,
float  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [9/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ForeignEnum  a,
ForeignEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [10/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ForeignEnum  a,
ForeignEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [11/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ForeignEnumLite  a,
ForeignEnumLite  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [12/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ForeignEnumLite  a,
ForeignEnumLite  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [13/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ImportEnum  a,
ImportEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [14/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ImportEnum  a,
ImportEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [15/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ImportEnumLite  a,
ImportEnumLite  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [16/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( ImportEnumLite  a,
ImportEnumLite  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [17/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( int  a,
int  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [18/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( int  a,
int  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [19/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( long  a,
long  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [20/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( long  a,
long  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [21/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( String  a,
String  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [22/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( String  a,
String  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [23/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( TestAllTypes.NestedEnum  a,
TestAllTypes.NestedEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [24/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( TestAllTypes.NestedEnum  a,
TestAllTypes.NestedEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [25/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( TestAllTypesLite.NestedEnum  a,
TestAllTypesLite.NestedEnum  b 
)
inlinestaticprivate

◆ assertEqualsExactType() [26/26]

static void com.google.protobuf.TestUtil.assertEqualsExactType ( TestAllTypesLite.NestedEnum  a,
TestAllTypesLite.NestedEnum  b 
)
inlinestaticprivate

◆ assertExtensionsClear() [1/4]

static void com.google.protobuf.TestUtil.assertExtensionsClear ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are cleared, and that getting the extensions returns their default values.

Definition at line 2223 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertExtensionsClear() [2/4]

static void com.google.protobuf.TestUtil.assertExtensionsClear ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are cleared, and that getting the extensions returns their default values.

Definition at line 2223 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertExtensionsClear() [3/4]

static void com.google.protobuf.TestUtil.assertExtensionsClear ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are cleared, and that getting the extensions returns their default values.

Definition at line 1627 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertExtensionsClear() [4/4]

static void com.google.protobuf.TestUtil.assertExtensionsClear ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are cleared, and that getting the extensions returns their default values.

Definition at line 1627 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertOneofSet() [1/2]

static void com.google.protobuf.TestUtil.assertOneofSet ( TestOneof2  message)
inlinestatic

◆ assertOneofSet() [2/2]

static void com.google.protobuf.TestUtil.assertOneofSet ( TestOneof2  message)
inlinestatic

◆ assertPackedExtensionsSet() [1/4]

static void com.google.protobuf.TestUtil.assertPackedExtensionsSet ( TestPackedExtensions  message)
inlinestatic

◆ assertPackedExtensionsSet() [2/4]

static void com.google.protobuf.TestUtil.assertPackedExtensionsSet ( TestPackedExtensions  message)
inlinestatic

◆ assertPackedExtensionsSet() [3/4]

static void com.google.protobuf.TestUtil.assertPackedExtensionsSet ( TestPackedExtensionsLite  message)
inlinestatic

◆ assertPackedExtensionsSet() [4/4]

static void com.google.protobuf.TestUtil.assertPackedExtensionsSet ( TestPackedExtensionsLite  message)
inlinestatic

◆ assertPackedFieldsSet() [1/2]

static void com.google.protobuf.TestUtil.assertPackedFieldsSet ( TestPackedTypes  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 1027 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertPackedFieldsSet() [2/2]

static void com.google.protobuf.TestUtil.assertPackedFieldsSet ( TestPackedTypes  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 1027 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedExtensionsModified() [1/4]

static void com.google.protobuf.TestUtil.assertRepeatedExtensionsModified ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

followed by

.

Definition at line 2390 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedExtensionsModified() [2/4]

static void com.google.protobuf.TestUtil.assertRepeatedExtensionsModified ( TestAllExtensionsLiteOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

followed by

.

Definition at line 2390 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedExtensionsModified() [3/4]

static void com.google.protobuf.TestUtil.assertRepeatedExtensionsModified ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

followed by

.

Definition at line 1815 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedExtensionsModified() [4/4]

static void com.google.protobuf.TestUtil.assertRepeatedExtensionsModified ( TestAllExtensionsOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all extensions of

are set to the values assigned by

followed by

.

Definition at line 1815 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedFieldsModified() [1/2]

static void com.google.protobuf.TestUtil.assertRepeatedFieldsModified ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

followed by

.

Definition at line 862 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertRepeatedFieldsModified() [2/2]

static void com.google.protobuf.TestUtil.assertRepeatedFieldsModified ( TestAllTypesOrBuilder  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

followed by

.

Definition at line 862 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertUnpackedFieldsSet() [1/2]

static void com.google.protobuf.TestUtil.assertUnpackedFieldsSet ( TestUnpackedTypes  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 1076 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ assertUnpackedFieldsSet() [2/2]

static void com.google.protobuf.TestUtil.assertUnpackedFieldsSet ( TestUnpackedTypes  message)
inlinestatic

Assert (using

junit.framework.Assert

} that all fields of

are set to the values assigned by

.

Definition at line 1076 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllExtensionsSet() [1/2]

static TestAllExtensions com.google.protobuf.TestUtil.getAllExtensionsSet ( )
inlinestatic

Get a

TestAllExtensions

with all fields set as they would be by {}.

Definition at line 298 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllExtensionsSet() [2/2]

static TestAllExtensions com.google.protobuf.TestUtil.getAllExtensionsSet ( )
inlinestatic

Get a

TestAllExtensions

with all fields set as they would be by {}.

Definition at line 298 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllSet() [1/2]

static TestAllTypes com.google.protobuf.TestUtil.getAllSet ( )
inlinestatic

Get a

TestAllTypes

with all fields set as they would be by {}.

Definition at line 278 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllSet() [2/2]

static TestAllTypes com.google.protobuf.TestUtil.getAllSet ( )
inlinestatic

Get a

TestAllTypes

with all fields set as they would be by {}.

Definition at line 278 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllSetBuilder() [1/2]

static TestAllTypes.Builder com.google.protobuf.TestUtil.getAllSetBuilder ( )
inlinestatic

Get a

TestAllTypes.Builder

with all fields set as they would be by {}.

Definition at line 288 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getAllSetBuilder() [2/2]

static TestAllTypes.Builder com.google.protobuf.TestUtil.getAllSetBuilder ( )
inlinestatic

Get a

TestAllTypes.Builder

with all fields set as they would be by {}.

Definition at line 288 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getExtensionRegistry() [1/2]

static ExtensionRegistryLite com.google.protobuf.TestUtil.getExtensionRegistry ( )
inlinestatic

Get an unmodifiable ExtensionRegistry containing all the extensions of

TestAllExtensions

.

Definition at line 1184 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getExtensionRegistry() [2/2]

static ExtensionRegistryLite com.google.protobuf.TestUtil.getExtensionRegistry ( )
inlinestatic

Get an unmodifiable ExtensionRegistry containing all the extensions of

TestAllExtensions

.

Definition at line 1184 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getFullExtensionRegistry() [1/2]

static ExtensionRegistry com.google.protobuf.TestUtil.getFullExtensionRegistry ( )
inlinestatic

Get an unmodifiable ExtensionRegistry containing all the extensions of

TestAllExtensions

.

Definition at line 1195 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getFullExtensionRegistry() [2/2]

static ExtensionRegistry com.google.protobuf.TestUtil.getFullExtensionRegistry ( )
inlinestatic

Get an unmodifiable ExtensionRegistry containing all the extensions of

TestAllExtensions

.

Definition at line 1195 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getGoldenMessage() [1/2]

static ByteString com.google.protobuf.TestUtil.getGoldenMessage ( )
inlinestatic

Get the bytes of the "golden message". This is a serialized TestAllTypes with all fields set as they would be by setAllFields(TestAllTypes.Builder), but it is loaded from a file on disk rather than generated dynamically. The file is actually generated by C++ code, so testing against it verifies compatibility with C++.

Definition at line 3818 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getGoldenMessage() [2/2]

static ByteString com.google.protobuf.TestUtil.getGoldenMessage ( )
inlinestatic

Get the bytes of the "golden message". This is a serialized TestAllTypes with all fields set as they would be by setAllFields(TestAllTypes.Builder), but it is loaded from a file on disk rather than generated dynamically. The file is actually generated by C++ code, so testing against it verifies compatibility with C++.

Definition at line 3830 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getGoldenPackedFieldsMessage() [1/2]

static ByteString com.google.protobuf.TestUtil.getGoldenPackedFieldsMessage ( )
inlinestatic

Get the bytes of the "golden packed fields message". This is a serialized TestPackedTypes with all fields set as they would be by setPackedFields(TestPackedTypes.Builder), but it is loaded from a file on disk rather than generated dynamically. The file is actually generated by C++ code, so testing against it verifies compatibility with C++.

Definition at line 3834 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getGoldenPackedFieldsMessage() [2/2]

static ByteString com.google.protobuf.TestUtil.getGoldenPackedFieldsMessage ( )
inlinestatic

Get the bytes of the "golden packed fields message". This is a serialized TestPackedTypes with all fields set as they would be by setPackedFields(TestPackedTypes.Builder), but it is loaded from a file on disk rather than generated dynamically. The file is actually generated by C++ code, so testing against it verifies compatibility with C++.

Definition at line 3846 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ getPackedExtensionsSet() [1/2]

static TestPackedExtensions com.google.protobuf.TestUtil.getPackedExtensionsSet ( )
inlinestatic

◆ getPackedExtensionsSet() [2/2]

static TestPackedExtensions com.google.protobuf.TestUtil.getPackedExtensionsSet ( )
inlinestatic

◆ getPackedSet() [1/2]

static TestPackedTypes com.google.protobuf.TestUtil.getPackedSet ( )
inlinestatic

◆ getPackedSet() [2/2]

static TestPackedTypes com.google.protobuf.TestUtil.getPackedSet ( )
inlinestatic

◆ getTestDataDir() [1/2]

static File com.google.protobuf.TestUtil.getTestDataDir ( )
inlinestaticprivate

◆ getTestDataDir() [2/2]

static File com.google.protobuf.TestUtil.getTestDataDir ( )
inlinestaticprivate

◆ getUnpackedSet() [1/2]

static TestUnpackedTypes com.google.protobuf.TestUtil.getUnpackedSet ( )
inlinestatic

◆ getUnpackedSet() [2/2]

static TestUnpackedTypes com.google.protobuf.TestUtil.getUnpackedSet ( )
inlinestatic

◆ modifyRepeatedExtensions() [1/2]

static void com.google.protobuf.TestUtil.modifyRepeatedExtensions ( TestAllExtensions.Builder  message)
inlinestatic

Modify the repeated extensions of

to contain the values expected by

.

Definition at line 1360 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ modifyRepeatedExtensions() [2/2]

static void com.google.protobuf.TestUtil.modifyRepeatedExtensions ( TestAllExtensions.Builder  message)
inlinestatic

Modify the repeated extensions of

to contain the values expected by

.

Definition at line 1360 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ modifyRepeatedFields() [1/2]

static void com.google.protobuf.TestUtil.modifyRepeatedFields ( TestAllTypes.Builder  message)
inlinestatic

Modify the repeated fields of

to contain the values expected by

.

Definition at line 452 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ modifyRepeatedFields() [2/2]

static void com.google.protobuf.TestUtil.modifyRepeatedFields ( TestAllTypes.Builder  message)
inlinestatic

Modify the repeated fields of

to contain the values expected by

.

Definition at line 452 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ readBytesFromFile() [1/2]

static ByteString com.google.protobuf.TestUtil.readBytesFromFile ( String  filename)
inlinestatic
Parameters
filenameThe path relative to getTestDataDir.

Definition at line 3788 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ readBytesFromFile() [2/2]

static ByteString com.google.protobuf.TestUtil.readBytesFromFile ( String  filename)
inlinestatic
Parameters
filenameThe path relative to getTestDataDir.

Definition at line 3801 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ readBytesFromResource() [1/2]

static ByteString com.google.protobuf.TestUtil.readBytesFromResource ( String  name)
inlinestaticprivate

◆ readBytesFromResource() [2/2]

static ByteString com.google.protobuf.TestUtil.readBytesFromResource ( String  name)
inlinestaticprivate

◆ readTextFromFile() [1/2]

static String com.google.protobuf.TestUtil.readTextFromFile ( String  filePath)
inlinestatic
Parameters
filePathThe path relative to getTestDataDir.

Definition at line 3760 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ readTextFromFile() [2/2]

static String com.google.protobuf.TestUtil.readTextFromFile ( String  filePath)
inlinestatic
Parameters
filePathThe path relative to getTestDataDir.

Definition at line 3760 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ registerAllExtensions() [1/2]

static void com.google.protobuf.TestUtil.registerAllExtensions ( ExtensionRegistryLite  registry)
inlinestatic

Register all of

TestAllExtensions

's extensions with the given {}.

Definition at line 1206 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ registerAllExtensions() [2/2]

static void com.google.protobuf.TestUtil.registerAllExtensions ( ExtensionRegistryLite  registry)
inlinestatic

Register all of

TestAllExtensions

's extensions with the given {}.

Definition at line 1206 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ resetMemoizedSize() [1/2]

static void com.google.protobuf.TestUtil.resetMemoizedSize ( AbstractMessage  message)
inlinestatic

Dirties the message by resetting the momoized serialized size.

Definition at line 269 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ resetMemoizedSize() [2/2]

static void com.google.protobuf.TestUtil.resetMemoizedSize ( AbstractMessage  message)
inlinestatic

Dirties the message by resetting the momoized serialized size.

Definition at line 269 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setAllExtensions() [1/2]

static void com.google.protobuf.TestUtil.setAllExtensions ( TestAllExtensions.Builder  message)
inlinestatic

Set every field of

to the values expected by

.

Definition at line 1214 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setAllExtensions() [2/2]

static void com.google.protobuf.TestUtil.setAllExtensions ( TestAllExtensions.Builder  message)
inlinestatic

Set every field of

to the values expected by

.

Definition at line 1214 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setAllFields() [1/2]

static void com.google.protobuf.TestUtil.setAllFields ( TestAllTypes.Builder  message)
inlinestatic

Set every field of

to the values expected by

.

Definition at line 323 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setAllFields() [2/2]

static void com.google.protobuf.TestUtil.setAllFields ( TestAllTypes.Builder  message)
inlinestatic

Set every field of

to the values expected by

.

Definition at line 323 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setOneof() [1/2]

static void com.google.protobuf.TestUtil.setOneof ( TestOneof2.Builder  message)
inlinestatic

◆ setOneof() [2/2]

static void com.google.protobuf.TestUtil.setOneof ( TestOneof2.Builder  message)
inlinestatic

◆ setPackedExtensions() [1/2]

static void com.google.protobuf.TestUtil.setPackedExtensions ( TestPackedExtensions.Builder  message)
inlinestatic

◆ setPackedExtensions() [2/2]

static void com.google.protobuf.TestUtil.setPackedExtensions ( TestPackedExtensions.Builder  message)
inlinestatic

◆ setPackedFields() [1/2]

static void com.google.protobuf.TestUtil.setPackedFields ( TestPackedTypes.Builder  message)
inlinestatic

Set every field of

to a unique value.

Definition at line 955 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setPackedFields() [2/2]

static void com.google.protobuf.TestUtil.setPackedFields ( TestPackedTypes.Builder  message)
inlinestatic

Set every field of

to a unique value.

Definition at line 955 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setUnpackedFields() [1/2]

static void com.google.protobuf.TestUtil.setUnpackedFields ( TestUnpackedTypes.Builder  message)
inlinestatic

Set every field of

to a unique value. Must correspond with the values applied by

.

Definition at line 991 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ setUnpackedFields() [2/2]

static void com.google.protobuf.TestUtil.setUnpackedFields ( TestUnpackedTypes.Builder  message)
inlinestatic

Set every field of

to a unique value. Must correspond with the values applied by

.

Definition at line 991 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ toBytes()

static ByteString com.google.protobuf.TestUtil.toBytes ( String  str)
inlinestatic

Helper to convert a String to ByteString.

Definition at line 263 of file protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

Member Data Documentation

◆ goldenMessage

static ByteString com.google.protobuf.TestUtil.goldenMessage = null
staticprivate

◆ goldenPackedFieldsMessage

static ByteString com.google.protobuf.TestUtil.goldenPackedFieldsMessage = null
staticprivate

◆ TEST_REQUIRED_INITIALIZED

static final TestRequired com.google.protobuf.TestUtil.TEST_REQUIRED_INITIALIZED
static
Initial value:
=
TestRequired.newBuilder().setA(1).setB(2).setC(3).build()

Definition at line 259 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.

◆ TEST_REQUIRED_UNINITIALIZED

static final TestRequired com.google.protobuf.TestUtil.TEST_REQUIRED_UNINITIALIZED
static
Initial value:
=
TestRequired.newBuilder().setA(1).buildPartial()

Definition at line 257 of file bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java.


The documentation for this class was generated from the following file:
com.google.protobuf
Definition: bloaty/third_party/protobuf/benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java:2
com.google.protobuf.TestUtil.assertRepeatedExtensionsModified
static void assertRepeatedExtensionsModified(TestAllExtensionsOrBuilder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:1815
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
com.google.protobuf.TestUtil.setAllExtensions
static void setAllExtensions(TestAllExtensions.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:1214
com.google.protobuf.TestUtil.assertAllExtensionsSet
static void assertAllExtensionsSet(TestAllExtensionsOrBuilder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:1406
com.google.protobuf.TestUtil.setPackedFields
static void setPackedFields(TestPackedTypes.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:955
com.google.protobuf.TestUtil.modifyRepeatedFields
static void modifyRepeatedFields(TestAllTypes.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:452
com.google.protobuf.TestUtil.setUnpackedFields
static void setUnpackedFields(TestUnpackedTypes.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:991
com.google
com
com.google.protobuf.TestUtil.assertRepeatedFieldsModified
static void assertRepeatedFieldsModified(TestAllTypesOrBuilder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:862
com.google.protobuf.TestUtil.setAllFields
static void setAllFields(TestAllTypes.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:323
com.google.protobuf.TestUtil.modifyRepeatedExtensions
static void modifyRepeatedExtensions(TestAllExtensions.Builder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:1360
com.google.protobuf.TestUtil.assertAllFieldsSet
static void assertAllFieldsSet(TestAllTypesOrBuilder message)
Definition: bloaty/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java:489


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