webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Static Public Member Functions | List of all members
com.google.protobuf.TestUtil Class Reference

Classes

class  MockBuilderParent
 
class  ReflectionTester
 

Static Public Member Functions

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

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

Member Function Documentation

◆ assertAllExtensionsSet() [1/2]

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

.

◆ assertAllExtensionsSet() [2/2]

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

.

◆ assertAllFieldsSet()

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

.

◆ assertAtMostOneFieldSetOneof()

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

◆ assertClear()

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.

◆ assertExtensionsClear() [1/2]

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.

◆ assertExtensionsClear() [2/2]

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.

◆ assertOneofSet()

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

◆ assertPackedExtensionsSet() [1/2]

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

◆ assertPackedExtensionsSet() [2/2]

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

◆ assertPackedFieldsSet()

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

.

◆ assertRepeatedExtensionsModified() [1/2]

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

.

◆ assertRepeatedExtensionsModified() [2/2]

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

.

◆ assertRepeatedFieldsModified()

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

.

◆ assertUnpackedFieldsSet()

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

.

◆ getAllExtensionsSet()

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

Get a

TestAllExtensions

with all fields set as they would be by setAllExtensions(TestAllExtensions.Builder).

◆ getAllSet()

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

Get a

TestAllTypes

with all fields set as they would be by setAllFields(TestAllTypes.Builder).

◆ getAllSetBuilder()

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

Get a

TestAllTypes.Builder

with all fields set as they would be by setAllFields(TestAllTypes.Builder).

◆ getExtensionRegistry()

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

Get an unmodifiable ExtensionRegistry containing all the extensions of

TestAllExtensions

.

◆ getGoldenMessage()

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++.

◆ getGoldenPackedFieldsMessage()

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++.

◆ getPackedExtensionsSet()

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

◆ getPackedSet()

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

◆ getUnpackedSet()

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

◆ modifyRepeatedExtensions()

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

Modify the repeated extensions of

to contain the values expected by

.

◆ modifyRepeatedFields()

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

Modify the repeated fields of

to contain the values expected by

.

◆ readBytesFromFile()

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

◆ readTextFromFile()

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

◆ registerAllExtensions()

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

Register all of

TestAllExtensions

's extensions with the given ExtensionRegistry.

◆ setAllExtensions()

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

Set every field of

to the values expected by

.

◆ setAllFields()

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

Set every field of

to the values expected by

.

◆ setOneof()

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

◆ setPackedExtensions()

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

◆ setPackedFields()

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

Set every field of

to a unique value.

◆ setUnpackedFields()

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

.


The documentation for this class was generated from the following file: