protobuf-cucumber 3.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rubocop.yml +70 -0
  4. data/.rubocop_todo.yml +145 -0
  5. data/.travis.yml +40 -0
  6. data/.yardopts +5 -0
  7. data/CHANGES.md +344 -0
  8. data/CONTRIBUTING.md +16 -0
  9. data/Gemfile +3 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +33 -0
  12. data/Rakefile +64 -0
  13. data/bin/protoc-gen-ruby +22 -0
  14. data/bin/rpc_server +5 -0
  15. data/install-protobuf.sh +28 -0
  16. data/lib/protobuf.rb +129 -0
  17. data/lib/protobuf/cli.rb +257 -0
  18. data/lib/protobuf/code_generator.rb +120 -0
  19. data/lib/protobuf/decoder.rb +28 -0
  20. data/lib/protobuf/deprecation.rb +117 -0
  21. data/lib/protobuf/descriptors.rb +3 -0
  22. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +62 -0
  23. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +301 -0
  24. data/lib/protobuf/encoder.rb +11 -0
  25. data/lib/protobuf/enum.rb +365 -0
  26. data/lib/protobuf/exceptions.rb +9 -0
  27. data/lib/protobuf/field.rb +74 -0
  28. data/lib/protobuf/field/base_field.rb +380 -0
  29. data/lib/protobuf/field/base_field_object_definitions.rb +504 -0
  30. data/lib/protobuf/field/bool_field.rb +64 -0
  31. data/lib/protobuf/field/bytes_field.rb +78 -0
  32. data/lib/protobuf/field/double_field.rb +25 -0
  33. data/lib/protobuf/field/enum_field.rb +61 -0
  34. data/lib/protobuf/field/field_array.rb +104 -0
  35. data/lib/protobuf/field/field_hash.rb +122 -0
  36. data/lib/protobuf/field/fixed32_field.rb +25 -0
  37. data/lib/protobuf/field/fixed64_field.rb +28 -0
  38. data/lib/protobuf/field/float_field.rb +43 -0
  39. data/lib/protobuf/field/int32_field.rb +21 -0
  40. data/lib/protobuf/field/int64_field.rb +34 -0
  41. data/lib/protobuf/field/integer_field.rb +23 -0
  42. data/lib/protobuf/field/message_field.rb +51 -0
  43. data/lib/protobuf/field/sfixed32_field.rb +27 -0
  44. data/lib/protobuf/field/sfixed64_field.rb +28 -0
  45. data/lib/protobuf/field/signed_integer_field.rb +29 -0
  46. data/lib/protobuf/field/sint32_field.rb +21 -0
  47. data/lib/protobuf/field/sint64_field.rb +21 -0
  48. data/lib/protobuf/field/string_field.rb +51 -0
  49. data/lib/protobuf/field/uint32_field.rb +21 -0
  50. data/lib/protobuf/field/uint64_field.rb +21 -0
  51. data/lib/protobuf/field/varint_field.rb +77 -0
  52. data/lib/protobuf/generators/base.rb +85 -0
  53. data/lib/protobuf/generators/enum_generator.rb +39 -0
  54. data/lib/protobuf/generators/extension_generator.rb +27 -0
  55. data/lib/protobuf/generators/field_generator.rb +193 -0
  56. data/lib/protobuf/generators/file_generator.rb +262 -0
  57. data/lib/protobuf/generators/group_generator.rb +122 -0
  58. data/lib/protobuf/generators/message_generator.rb +104 -0
  59. data/lib/protobuf/generators/option_generator.rb +17 -0
  60. data/lib/protobuf/generators/printable.rb +160 -0
  61. data/lib/protobuf/generators/service_generator.rb +50 -0
  62. data/lib/protobuf/lifecycle.rb +33 -0
  63. data/lib/protobuf/logging.rb +39 -0
  64. data/lib/protobuf/message.rb +260 -0
  65. data/lib/protobuf/message/fields.rb +233 -0
  66. data/lib/protobuf/message/serialization.rb +85 -0
  67. data/lib/protobuf/optionable.rb +70 -0
  68. data/lib/protobuf/rpc/buffer.rb +78 -0
  69. data/lib/protobuf/rpc/client.rb +140 -0
  70. data/lib/protobuf/rpc/connectors/base.rb +221 -0
  71. data/lib/protobuf/rpc/connectors/ping.rb +89 -0
  72. data/lib/protobuf/rpc/connectors/socket.rb +78 -0
  73. data/lib/protobuf/rpc/connectors/zmq.rb +319 -0
  74. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +50 -0
  75. data/lib/protobuf/rpc/env.rb +60 -0
  76. data/lib/protobuf/rpc/error.rb +28 -0
  77. data/lib/protobuf/rpc/error/client_error.rb +31 -0
  78. data/lib/protobuf/rpc/error/server_error.rb +43 -0
  79. data/lib/protobuf/rpc/middleware.rb +25 -0
  80. data/lib/protobuf/rpc/middleware/exception_handler.rb +40 -0
  81. data/lib/protobuf/rpc/middleware/logger.rb +95 -0
  82. data/lib/protobuf/rpc/middleware/request_decoder.rb +79 -0
  83. data/lib/protobuf/rpc/middleware/response_encoder.rb +83 -0
  84. data/lib/protobuf/rpc/middleware/runner.rb +18 -0
  85. data/lib/protobuf/rpc/rpc.pb.rb +64 -0
  86. data/lib/protobuf/rpc/rpc_method.rb +16 -0
  87. data/lib/protobuf/rpc/server.rb +39 -0
  88. data/lib/protobuf/rpc/servers/socket/server.rb +121 -0
  89. data/lib/protobuf/rpc/servers/socket/worker.rb +56 -0
  90. data/lib/protobuf/rpc/servers/socket_runner.rb +46 -0
  91. data/lib/protobuf/rpc/servers/zmq/broker.rb +194 -0
  92. data/lib/protobuf/rpc/servers/zmq/server.rb +321 -0
  93. data/lib/protobuf/rpc/servers/zmq/util.rb +48 -0
  94. data/lib/protobuf/rpc/servers/zmq/worker.rb +105 -0
  95. data/lib/protobuf/rpc/servers/zmq_runner.rb +70 -0
  96. data/lib/protobuf/rpc/service.rb +172 -0
  97. data/lib/protobuf/rpc/service_directory.rb +261 -0
  98. data/lib/protobuf/rpc/service_dispatcher.rb +45 -0
  99. data/lib/protobuf/rpc/service_filters.rb +250 -0
  100. data/lib/protobuf/rpc/stat.rb +119 -0
  101. data/lib/protobuf/socket.rb +21 -0
  102. data/lib/protobuf/tasks.rb +1 -0
  103. data/lib/protobuf/tasks/compile.rake +80 -0
  104. data/lib/protobuf/varint.rb +20 -0
  105. data/lib/protobuf/varint_pure.rb +31 -0
  106. data/lib/protobuf/version.rb +3 -0
  107. data/lib/protobuf/wire_type.rb +10 -0
  108. data/lib/protobuf/zmq.rb +21 -0
  109. data/profile.html +5103 -0
  110. data/proto/dynamic_discovery.proto +44 -0
  111. data/proto/google/protobuf/compiler/plugin.proto +147 -0
  112. data/proto/google/protobuf/descriptor.proto +779 -0
  113. data/proto/rpc.proto +69 -0
  114. data/protobuf-cucumber.gemspec +57 -0
  115. data/spec/benchmark/tasks.rb +143 -0
  116. data/spec/bin/protoc-gen-ruby_spec.rb +23 -0
  117. data/spec/encoding/all_types_spec.rb +103 -0
  118. data/spec/encoding/extreme_values_spec.rb +0 -0
  119. data/spec/functional/class_inheritance_spec.rb +52 -0
  120. data/spec/functional/code_generator_spec.rb +58 -0
  121. data/spec/functional/socket_server_spec.rb +59 -0
  122. data/spec/functional/zmq_server_spec.rb +105 -0
  123. data/spec/lib/protobuf/cli_spec.rb +317 -0
  124. data/spec/lib/protobuf/code_generator_spec.rb +87 -0
  125. data/spec/lib/protobuf/enum_spec.rb +307 -0
  126. data/spec/lib/protobuf/field/bool_field_spec.rb +91 -0
  127. data/spec/lib/protobuf/field/double_field_spec.rb +9 -0
  128. data/spec/lib/protobuf/field/enum_field_spec.rb +44 -0
  129. data/spec/lib/protobuf/field/field_array_spec.rb +105 -0
  130. data/spec/lib/protobuf/field/field_hash_spec.rb +168 -0
  131. data/spec/lib/protobuf/field/fixed32_field_spec.rb +7 -0
  132. data/spec/lib/protobuf/field/fixed64_field_spec.rb +7 -0
  133. data/spec/lib/protobuf/field/float_field_spec.rb +90 -0
  134. data/spec/lib/protobuf/field/int32_field_spec.rb +120 -0
  135. data/spec/lib/protobuf/field/int64_field_spec.rb +7 -0
  136. data/spec/lib/protobuf/field/message_field_spec.rb +132 -0
  137. data/spec/lib/protobuf/field/sfixed32_field_spec.rb +9 -0
  138. data/spec/lib/protobuf/field/sfixed64_field_spec.rb +9 -0
  139. data/spec/lib/protobuf/field/sint32_field_spec.rb +9 -0
  140. data/spec/lib/protobuf/field/sint64_field_spec.rb +9 -0
  141. data/spec/lib/protobuf/field/string_field_spec.rb +79 -0
  142. data/spec/lib/protobuf/field/uint32_field_spec.rb +7 -0
  143. data/spec/lib/protobuf/field/uint64_field_spec.rb +7 -0
  144. data/spec/lib/protobuf/field_spec.rb +192 -0
  145. data/spec/lib/protobuf/generators/base_spec.rb +154 -0
  146. data/spec/lib/protobuf/generators/enum_generator_spec.rb +82 -0
  147. data/spec/lib/protobuf/generators/extension_generator_spec.rb +42 -0
  148. data/spec/lib/protobuf/generators/field_generator_spec.rb +197 -0
  149. data/spec/lib/protobuf/generators/file_generator_spec.rb +119 -0
  150. data/spec/lib/protobuf/generators/message_generator_spec.rb +0 -0
  151. data/spec/lib/protobuf/generators/service_generator_spec.rb +99 -0
  152. data/spec/lib/protobuf/lifecycle_spec.rb +94 -0
  153. data/spec/lib/protobuf/message_spec.rb +944 -0
  154. data/spec/lib/protobuf/optionable_spec.rb +265 -0
  155. data/spec/lib/protobuf/rpc/client_spec.rb +66 -0
  156. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +226 -0
  157. data/spec/lib/protobuf/rpc/connectors/ping_spec.rb +69 -0
  158. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +34 -0
  159. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +110 -0
  160. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
  161. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
  162. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
  163. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +91 -0
  164. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +38 -0
  165. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +43 -0
  166. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +55 -0
  167. data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +35 -0
  168. data/spec/lib/protobuf/rpc/service_directory_spec.rb +293 -0
  169. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +35 -0
  170. data/spec/lib/protobuf/rpc/service_filters_spec.rb +517 -0
  171. data/spec/lib/protobuf/rpc/service_spec.rb +162 -0
  172. data/spec/lib/protobuf/rpc/stat_spec.rb +101 -0
  173. data/spec/lib/protobuf/varint_spec.rb +29 -0
  174. data/spec/lib/protobuf_spec.rb +105 -0
  175. data/spec/spec_helper.rb +42 -0
  176. data/spec/support/all.rb +6 -0
  177. data/spec/support/packed_field.rb +23 -0
  178. data/spec/support/protos/all_types.data.bin +0 -0
  179. data/spec/support/protos/all_types.data.txt +119 -0
  180. data/spec/support/protos/enum.pb.rb +63 -0
  181. data/spec/support/protos/enum.proto +37 -0
  182. data/spec/support/protos/extreme_values.data.bin +0 -0
  183. data/spec/support/protos/google_unittest.bin +0 -0
  184. data/spec/support/protos/google_unittest.pb.rb +798 -0
  185. data/spec/support/protos/google_unittest.proto +884 -0
  186. data/spec/support/protos/google_unittest_custom_options.bin +0 -0
  187. data/spec/support/protos/google_unittest_custom_options.pb.rb +361 -0
  188. data/spec/support/protos/google_unittest_custom_options.proto +424 -0
  189. data/spec/support/protos/google_unittest_import.pb.rb +55 -0
  190. data/spec/support/protos/google_unittest_import.proto +73 -0
  191. data/spec/support/protos/google_unittest_import_public.pb.rb +31 -0
  192. data/spec/support/protos/google_unittest_import_public.proto +41 -0
  193. data/spec/support/protos/map-test.bin +157 -0
  194. data/spec/support/protos/map-test.pb.rb +85 -0
  195. data/spec/support/protos/map-test.proto +68 -0
  196. data/spec/support/protos/multi_field_extensions.pb.rb +59 -0
  197. data/spec/support/protos/multi_field_extensions.proto +35 -0
  198. data/spec/support/protos/resource.pb.rb +172 -0
  199. data/spec/support/protos/resource.proto +137 -0
  200. data/spec/support/resource_service.rb +23 -0
  201. data/spec/support/server.rb +65 -0
  202. data/spec/support/test_app_file.rb +2 -0
  203. data/varint_prof.rb +82 -0
  204. metadata +579 -0
@@ -0,0 +1,23 @@
1
+ if defined?(RSpec)
2
+ shared_examples_for :packable_field do |field_klass|
3
+
4
+ before(:all) do
5
+ unless defined?(PackableFieldTest)
6
+ class PackableFieldTest < ::Protobuf::Message; end
7
+ end
8
+
9
+ field_name = "#{field_klass.name.split('::').last.underscore}_packed_field".to_sym
10
+ tag_num = PackableFieldTest.fields.size + 1
11
+ PackableFieldTest.repeated(field_klass, field_name, tag_num, :packed => true)
12
+ end
13
+
14
+ let(:field_name) { "#{field_klass.name.split('::').last.underscore}_packed_field".to_sym }
15
+ let(:value) { [100, 200, 300] }
16
+ let(:message_instance) { PackableFieldTest.new(field_name => value) }
17
+
18
+ subject { PackableFieldTest.get_field(field_name) }
19
+
20
+ specify { expect(subject).to be_packed }
21
+ specify { expect(PackableFieldTest.decode(message_instance.encode).send(field_name)).to eq value }
22
+ end
23
+ end
@@ -0,0 +1,119 @@
1
+ optional_int32: 101
2
+ optional_int64: 102
3
+ optional_uint32: 103
4
+ optional_uint64: 104
5
+ optional_sint32: 105
6
+ optional_sint64: 106
7
+ optional_fixed32: 107
8
+ optional_fixed64: 108
9
+ optional_sfixed32: 109
10
+ optional_sfixed64: 110
11
+ optional_float: 111
12
+ optional_double: 112
13
+ optional_bool: true
14
+ optional_string: "115"
15
+ optional_bytes: "116"
16
+ optional_nested_message {
17
+ bb: 118
18
+ }
19
+ optional_foreign_message {
20
+ c: 119
21
+ }
22
+ optional_import_message {
23
+ d: 120
24
+ }
25
+ optional_nested_enum: BAZ
26
+ optional_foreign_enum: FOREIGN_BAZ
27
+ optional_import_enum: IMPORT_BAZ
28
+ optional_string_piece: "124"
29
+ optional_cord: "125"
30
+ optional_public_import_message {
31
+ e: 126
32
+ }
33
+ optional_lazy_message {
34
+ bb: 127
35
+ }
36
+ repeated_int32: 201
37
+ repeated_int32: 301
38
+ repeated_int64: 202
39
+ repeated_int64: 302
40
+ repeated_uint32: 203
41
+ repeated_uint32: 303
42
+ repeated_uint64: 204
43
+ repeated_uint64: 304
44
+ repeated_sint32: 205
45
+ repeated_sint32: 305
46
+ repeated_sint64: 206
47
+ repeated_sint64: 306
48
+ repeated_fixed32: 207
49
+ repeated_fixed32: 307
50
+ repeated_fixed64: 208
51
+ repeated_fixed64: 308
52
+ repeated_sfixed32: 209
53
+ repeated_sfixed32: 309
54
+ repeated_sfixed64: 210
55
+ repeated_sfixed64: 310
56
+ repeated_float: 211
57
+ repeated_float: 311
58
+ repeated_double: 212
59
+ repeated_double: 312
60
+ repeated_bool: true
61
+ repeated_bool: false
62
+ repeated_string: "215"
63
+ repeated_string: "315"
64
+ repeated_bytes: "216"
65
+ repeated_bytes: "316"
66
+ repeated_nested_message {
67
+ bb: 218
68
+ }
69
+ repeated_nested_message {
70
+ bb: 318
71
+ }
72
+ repeated_foreign_message {
73
+ c: 219
74
+ }
75
+ repeated_foreign_message {
76
+ c: 319
77
+ }
78
+ repeated_import_message {
79
+ d: 220
80
+ }
81
+ repeated_import_message {
82
+ d: 320
83
+ }
84
+ repeated_nested_enum: BAR
85
+ repeated_nested_enum: BAZ
86
+ repeated_foreign_enum: FOREIGN_BAR
87
+ repeated_foreign_enum: FOREIGN_BAZ
88
+ repeated_import_enum: IMPORT_BAR
89
+ repeated_import_enum: IMPORT_BAZ
90
+ repeated_string_piece: "224"
91
+ repeated_string_piece: "324"
92
+ repeated_cord: "225"
93
+ repeated_cord: "325"
94
+ repeated_lazy_message {
95
+ bb: 227
96
+ }
97
+ repeated_lazy_message {
98
+ bb: 327
99
+ }
100
+ default_int32: 401
101
+ default_int64: 402
102
+ default_uint32: 403
103
+ default_uint64: 404
104
+ default_sint32: 405
105
+ default_sint64: 406
106
+ default_fixed32: 407
107
+ default_fixed64: 408
108
+ default_sfixed32: 409
109
+ default_sfixed64: 410
110
+ default_float: 411
111
+ default_double: 412
112
+ default_bool: false
113
+ default_string: "415"
114
+ default_bytes: "416"
115
+ default_nested_enum: FOO
116
+ default_foreign_enum: FOREIGN_FOO
117
+ default_import_enum: IMPORT_FOO
118
+ default_string_piece: "424"
119
+ default_cord: "425"
@@ -0,0 +1,63 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+
8
+
9
+ ##
10
+ # Imports
11
+ #
12
+ require 'protos/resource.pb'
13
+
14
+ module Test
15
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
16
+
17
+ ##
18
+ # Enum Classes
19
+ #
20
+ class EnumTestType < ::Protobuf::Enum
21
+ define :ZERO, 0
22
+ define :ONE, 1
23
+ define :TWO, 2
24
+ end
25
+
26
+ class AliasedEnum < ::Protobuf::Enum
27
+ set_option :allow_alias, true
28
+
29
+ define :THREE, 3
30
+ define :TRES, 3
31
+ define :FOUR, 4
32
+ define :CUATRO, 4
33
+ end
34
+
35
+
36
+ ##
37
+ # Message Classes
38
+ #
39
+ class EnumTestMessage < ::Protobuf::Message; end
40
+
41
+
42
+ ##
43
+ # Message Fields
44
+ #
45
+ class EnumTestMessage
46
+ optional ::Test::EnumTestType, :non_default_enum, 1
47
+ optional ::Test::EnumTestType, :default_enum, 2, :default => ::Test::EnumTestType::ONE
48
+ repeated ::Test::EnumTestType, :repeated_enums, 3
49
+ optional ::Test::AliasedEnum, :alias_non_default_enum, 4
50
+ optional ::Test::AliasedEnum, :alias_default_enum, 5, :default => ::Test::AliasedEnum::CUATRO
51
+ repeated ::Test::AliasedEnum, :alias_repeated_enums, 6
52
+ end
53
+
54
+
55
+ ##
56
+ # Extended Message Fields
57
+ #
58
+ class ::Test::Resource < ::Protobuf::Message
59
+ optional :int32, :".test.ext_other_file_defined_field", 200, :extension => true
60
+ end
61
+
62
+ end
63
+
@@ -0,0 +1,37 @@
1
+ syntax = "proto2";
2
+
3
+ package test;
4
+ import 'protos/resource.proto';
5
+
6
+ // Test extending another message from an imported file.
7
+
8
+ enum EnumTestType {
9
+ ZERO = 0;
10
+ ONE = 1;
11
+ TWO = 2;
12
+ }
13
+
14
+ // Uses aliases
15
+ enum AliasedEnum {
16
+ option allow_alias = true;
17
+
18
+ THREE = 3;
19
+ TRES = 3;
20
+
21
+ FOUR = 4;
22
+ CUATRO = 4;
23
+ }
24
+
25
+ message EnumTestMessage {
26
+ optional EnumTestType non_default_enum = 1;
27
+ optional EnumTestType default_enum = 2 [default=ONE];
28
+ repeated EnumTestType repeated_enums = 3;
29
+
30
+ optional AliasedEnum alias_non_default_enum = 4;
31
+ optional AliasedEnum alias_default_enum = 5 [default=CUATRO];
32
+ repeated AliasedEnum alias_repeated_enums = 6;
33
+ }
34
+
35
+ extend test.Resource {
36
+ optional int32 ext_other_file_defined_field = 200;
37
+ }
@@ -0,0 +1,798 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+ require 'protobuf/rpc/service'
8
+
9
+
10
+ ##
11
+ # Imports
12
+ #
13
+ require 'protos/google_unittest_import.pb'
14
+
15
+ module Protobuf_unittest
16
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
17
+
18
+ ##
19
+ # Enum Classes
20
+ #
21
+ class ForeignEnum < ::Protobuf::Enum
22
+ define :FOREIGN_FOO, 4
23
+ define :FOREIGN_BAR, 5
24
+ define :FOREIGN_BAZ, 6
25
+ end
26
+
27
+ class TestEnumWithDupValue < ::Protobuf::Enum
28
+ set_option :allow_alias, true
29
+
30
+ define :FOO1, 1
31
+ define :BAR1, 2
32
+ define :BAZ, 3
33
+ define :FOO2, 1
34
+ define :BAR2, 2
35
+ end
36
+
37
+ class TestSparseEnum < ::Protobuf::Enum
38
+ define :SPARSE_A, 123
39
+ define :SPARSE_B, 62374
40
+ define :SPARSE_C, 12589234
41
+ define :SPARSE_D, -15
42
+ define :SPARSE_E, -53452
43
+ define :SPARSE_F, 0
44
+ define :SPARSE_G, 2
45
+ end
46
+
47
+
48
+ ##
49
+ # Message Classes
50
+ #
51
+ class TestAllTypes < ::Protobuf::Message
52
+ class NestedEnum < ::Protobuf::Enum
53
+ define :FOO, 1
54
+ define :BAR, 2
55
+ define :BAZ, 3
56
+ define :NEG, -1
57
+ end
58
+
59
+ class NestedMessage < ::Protobuf::Message; end
60
+ class OptionalGroup < ::Protobuf::Message; end
61
+ class RepeatedGroup < ::Protobuf::Message; end
62
+
63
+ end
64
+
65
+ class NestedTestAllTypes < ::Protobuf::Message; end
66
+ class TestDeprecatedFields < ::Protobuf::Message; end
67
+ class ForeignMessage < ::Protobuf::Message; end
68
+ class TestReservedFields < ::Protobuf::Message; end
69
+ class TestAllExtensions < ::Protobuf::Message; end
70
+ class OptionalGroup_extension < ::Protobuf::Message; end
71
+ class RepeatedGroup_extension < ::Protobuf::Message; end
72
+ class TestNestedExtension < ::Protobuf::Message; end
73
+ class TestMoreNestedExtension < ::Protobuf::Message; end
74
+ class TestRequired < ::Protobuf::Message; end
75
+ class TestRequiredForeign < ::Protobuf::Message; end
76
+ class TestForeignNested < ::Protobuf::Message; end
77
+ class TestEmptyMessage < ::Protobuf::Message; end
78
+ class TestEmptyMessageWithExtensions < ::Protobuf::Message; end
79
+ class TestMultipleExtensionRanges < ::Protobuf::Message; end
80
+ class TestReallyLargeTagNumber < ::Protobuf::Message; end
81
+ class TestRecursiveMessage < ::Protobuf::Message; end
82
+ class TestMutualRecursionA < ::Protobuf::Message; end
83
+ class TestMutualRecursionB < ::Protobuf::Message; end
84
+ class TestDupFieldNumber < ::Protobuf::Message
85
+ class Foo < ::Protobuf::Message; end
86
+ class Bar < ::Protobuf::Message; end
87
+
88
+ end
89
+
90
+ class TestEagerMessage < ::Protobuf::Message; end
91
+ class TestLazyMessage < ::Protobuf::Message; end
92
+ class TestNestedMessageHasBits < ::Protobuf::Message
93
+ class NestedMessage < ::Protobuf::Message; end
94
+
95
+ end
96
+
97
+ class TestCamelCaseFieldNames < ::Protobuf::Message; end
98
+ class TestFieldOrderings < ::Protobuf::Message
99
+ class NestedMessage < ::Protobuf::Message; end
100
+
101
+ end
102
+
103
+ class TestExtremeDefaultValues < ::Protobuf::Message; end
104
+ class SparseEnumMessage < ::Protobuf::Message; end
105
+ class OneString < ::Protobuf::Message; end
106
+ class MoreString < ::Protobuf::Message; end
107
+ class OneBytes < ::Protobuf::Message; end
108
+ class MoreBytes < ::Protobuf::Message; end
109
+ class Int32Message < ::Protobuf::Message; end
110
+ class Uint32Message < ::Protobuf::Message; end
111
+ class Int64Message < ::Protobuf::Message; end
112
+ class Uint64Message < ::Protobuf::Message; end
113
+ class BoolMessage < ::Protobuf::Message; end
114
+ class TestOneof < ::Protobuf::Message
115
+ class FooGroup < ::Protobuf::Message; end
116
+
117
+ end
118
+
119
+ class TestOneofBackwardsCompatible < ::Protobuf::Message
120
+ class FooGroup < ::Protobuf::Message; end
121
+
122
+ end
123
+
124
+ class TestOneof2 < ::Protobuf::Message
125
+ class NestedEnum < ::Protobuf::Enum
126
+ define :FOO, 1
127
+ define :BAR, 2
128
+ define :BAZ, 3
129
+ end
130
+
131
+ class FooGroup < ::Protobuf::Message; end
132
+ class NestedMessage < ::Protobuf::Message; end
133
+
134
+ end
135
+
136
+ class TestRequiredOneof < ::Protobuf::Message
137
+ class NestedMessage < ::Protobuf::Message; end
138
+
139
+ end
140
+
141
+ class TestPackedTypes < ::Protobuf::Message; end
142
+ class TestUnpackedTypes < ::Protobuf::Message; end
143
+ class TestPackedExtensions < ::Protobuf::Message; end
144
+ class TestUnpackedExtensions < ::Protobuf::Message; end
145
+ class TestDynamicExtensions < ::Protobuf::Message
146
+ class DynamicEnumType < ::Protobuf::Enum
147
+ define :DYNAMIC_FOO, 2200
148
+ define :DYNAMIC_BAR, 2201
149
+ define :DYNAMIC_BAZ, 2202
150
+ end
151
+
152
+ class DynamicMessageType < ::Protobuf::Message; end
153
+
154
+ end
155
+
156
+ class TestRepeatedScalarDifferentTagSizes < ::Protobuf::Message; end
157
+ class TestParsingMerge < ::Protobuf::Message
158
+ class RepeatedFieldsGenerator < ::Protobuf::Message
159
+ class Group1 < ::Protobuf::Message; end
160
+ class Group2 < ::Protobuf::Message; end
161
+
162
+ end
163
+
164
+ class OptionalGroup < ::Protobuf::Message; end
165
+ class RepeatedGroup < ::Protobuf::Message; end
166
+
167
+ end
168
+
169
+ class TestCommentInjectionMessage < ::Protobuf::Message; end
170
+ class FooRequest < ::Protobuf::Message; end
171
+ class FooResponse < ::Protobuf::Message; end
172
+ class FooClientMessage < ::Protobuf::Message; end
173
+ class FooServerMessage < ::Protobuf::Message; end
174
+ class BarRequest < ::Protobuf::Message; end
175
+ class BarResponse < ::Protobuf::Message; end
176
+
177
+
178
+ ##
179
+ # File Options
180
+ #
181
+ set_option :java_outer_classname, "UnittestProto"
182
+ set_option :optimize_for, ::Google::Protobuf::FileOptions::OptimizeMode::SPEED
183
+ set_option :cc_generic_services, true
184
+ set_option :java_generic_services, true
185
+ set_option :py_generic_services, true
186
+ set_option :cc_enable_arenas, true
187
+
188
+
189
+ ##
190
+ # Message Fields
191
+ #
192
+ class TestAllTypes
193
+ class NestedMessage
194
+ optional :int32, :bb, 1
195
+ end
196
+
197
+ class OptionalGroup
198
+ optional :int32, :a, 17
199
+ end
200
+
201
+ class RepeatedGroup
202
+ optional :int32, :a, 47
203
+ end
204
+
205
+ optional :int32, :optional_int32, 1
206
+ optional :int64, :optional_int64, 2
207
+ optional :uint32, :optional_uint32, 3
208
+ optional :uint64, :optional_uint64, 4
209
+ optional :sint32, :optional_sint32, 5
210
+ optional :sint64, :optional_sint64, 6
211
+ optional :fixed32, :optional_fixed32, 7
212
+ optional :fixed64, :optional_fixed64, 8
213
+ optional :sfixed32, :optional_sfixed32, 9
214
+ optional :sfixed64, :optional_sfixed64, 10
215
+ optional :float, :optional_float, 11
216
+ optional :double, :optional_double, 12
217
+ optional :bool, :optional_bool, 13
218
+ optional :string, :optional_string, 14
219
+ optional :bytes, :optional_bytes, 15
220
+ optional ::Protobuf_unittest::TestAllTypes::OptionalGroup, :optionalgroup, 16
221
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :optional_nested_message, 18
222
+ optional ::Protobuf_unittest::ForeignMessage, :optional_foreign_message, 19
223
+ optional ::Protobuf_unittest_import::ImportMessage, :optional_import_message, 20
224
+ optional ::Protobuf_unittest::TestAllTypes::NestedEnum, :optional_nested_enum, 21
225
+ optional ::Protobuf_unittest::ForeignEnum, :optional_foreign_enum, 22
226
+ optional ::Protobuf_unittest_import::ImportEnum, :optional_import_enum, 23
227
+ optional :string, :optional_string_piece, 24, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
228
+ optional :string, :optional_cord, 25, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
229
+ optional ::Protobuf_unittest_import::PublicImportMessage, :optional_public_import_message, 26
230
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :optional_lazy_message, 27, :lazy => true
231
+ repeated :int32, :repeated_int32, 31
232
+ repeated :int64, :repeated_int64, 32
233
+ repeated :uint32, :repeated_uint32, 33
234
+ repeated :uint64, :repeated_uint64, 34
235
+ repeated :sint32, :repeated_sint32, 35
236
+ repeated :sint64, :repeated_sint64, 36
237
+ repeated :fixed32, :repeated_fixed32, 37
238
+ repeated :fixed64, :repeated_fixed64, 38
239
+ repeated :sfixed32, :repeated_sfixed32, 39
240
+ repeated :sfixed64, :repeated_sfixed64, 40
241
+ repeated :float, :repeated_float, 41
242
+ repeated :double, :repeated_double, 42
243
+ repeated :bool, :repeated_bool, 43
244
+ repeated :string, :repeated_string, 44
245
+ repeated :bytes, :repeated_bytes, 45
246
+ repeated ::Protobuf_unittest::TestAllTypes::RepeatedGroup, :repeatedgroup, 46
247
+ repeated ::Protobuf_unittest::TestAllTypes::NestedMessage, :repeated_nested_message, 48
248
+ repeated ::Protobuf_unittest::ForeignMessage, :repeated_foreign_message, 49
249
+ repeated ::Protobuf_unittest_import::ImportMessage, :repeated_import_message, 50
250
+ repeated ::Protobuf_unittest::TestAllTypes::NestedEnum, :repeated_nested_enum, 51
251
+ repeated ::Protobuf_unittest::ForeignEnum, :repeated_foreign_enum, 52
252
+ repeated ::Protobuf_unittest_import::ImportEnum, :repeated_import_enum, 53
253
+ repeated :string, :repeated_string_piece, 54, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
254
+ repeated :string, :repeated_cord, 55, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
255
+ repeated ::Protobuf_unittest::TestAllTypes::NestedMessage, :repeated_lazy_message, 57, :lazy => true
256
+ optional :int32, :default_int32, 61, :default => 41
257
+ optional :int64, :default_int64, 62, :default => 42
258
+ optional :uint32, :default_uint32, 63, :default => 43
259
+ optional :uint64, :default_uint64, 64, :default => 44
260
+ optional :sint32, :default_sint32, 65, :default => -45
261
+ optional :sint64, :default_sint64, 66, :default => 46
262
+ optional :fixed32, :default_fixed32, 67, :default => 47
263
+ optional :fixed64, :default_fixed64, 68, :default => 48
264
+ optional :sfixed32, :default_sfixed32, 69, :default => 49
265
+ optional :sfixed64, :default_sfixed64, 70, :default => -50
266
+ optional :float, :default_float, 71, :default => 51.5
267
+ optional :double, :default_double, 72, :default => 52000
268
+ optional :bool, :default_bool, 73, :default => true
269
+ optional :string, :default_string, 74, :default => "hello"
270
+ optional :bytes, :default_bytes, 75, :default => "world"
271
+ optional ::Protobuf_unittest::TestAllTypes::NestedEnum, :default_nested_enum, 81, :default => ::Protobuf_unittest::TestAllTypes::NestedEnum::BAR
272
+ optional ::Protobuf_unittest::ForeignEnum, :default_foreign_enum, 82, :default => ::Protobuf_unittest::ForeignEnum::FOREIGN_BAR
273
+ optional ::Protobuf_unittest_import::ImportEnum, :default_import_enum, 83, :default => ::Protobuf_unittest_import::ImportEnum::IMPORT_BAR
274
+ optional :string, :default_string_piece, 84, :default => "abc", :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
275
+ optional :string, :default_cord, 85, :default => "123", :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
276
+ optional :uint32, :oneof_uint32, 111
277
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :oneof_nested_message, 112
278
+ optional :string, :oneof_string, 113
279
+ optional :bytes, :oneof_bytes, 114
280
+ end
281
+
282
+ class NestedTestAllTypes
283
+ optional ::Protobuf_unittest::NestedTestAllTypes, :child, 1
284
+ optional ::Protobuf_unittest::TestAllTypes, :payload, 2
285
+ repeated ::Protobuf_unittest::NestedTestAllTypes, :repeated_child, 3
286
+ end
287
+
288
+ class TestDeprecatedFields
289
+ optional :int32, :deprecated_int32, 1, :deprecated => true
290
+ end
291
+
292
+ class ForeignMessage
293
+ optional :int32, :c, 1
294
+ end
295
+
296
+ class TestAllExtensions
297
+ # Extension Fields
298
+ extensions 1...536870912
299
+ optional :int32, :".protobuf_unittest.optional_int32_extension", 1, :extension => true
300
+ optional :int64, :".protobuf_unittest.optional_int64_extension", 2, :extension => true
301
+ optional :uint32, :".protobuf_unittest.optional_uint32_extension", 3, :extension => true
302
+ optional :uint64, :".protobuf_unittest.optional_uint64_extension", 4, :extension => true
303
+ optional :sint32, :".protobuf_unittest.optional_sint32_extension", 5, :extension => true
304
+ optional :sint64, :".protobuf_unittest.optional_sint64_extension", 6, :extension => true
305
+ optional :fixed32, :".protobuf_unittest.optional_fixed32_extension", 7, :extension => true
306
+ optional :fixed64, :".protobuf_unittest.optional_fixed64_extension", 8, :extension => true
307
+ optional :sfixed32, :".protobuf_unittest.optional_sfixed32_extension", 9, :extension => true
308
+ optional :sfixed64, :".protobuf_unittest.optional_sfixed64_extension", 10, :extension => true
309
+ optional :float, :".protobuf_unittest.optional_float_extension", 11, :extension => true
310
+ optional :double, :".protobuf_unittest.optional_double_extension", 12, :extension => true
311
+ optional :bool, :".protobuf_unittest.optional_bool_extension", 13, :extension => true
312
+ optional :string, :".protobuf_unittest.optional_string_extension", 14, :extension => true
313
+ optional :bytes, :".protobuf_unittest.optional_bytes_extension", 15, :extension => true
314
+ optional ::Protobuf_unittest::OptionalGroup_extension, :".protobuf_unittest.optionalgroup_extension", 16, :extension => true
315
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :".protobuf_unittest.optional_nested_message_extension", 18, :extension => true
316
+ optional ::Protobuf_unittest::ForeignMessage, :".protobuf_unittest.optional_foreign_message_extension", 19, :extension => true
317
+ optional ::Protobuf_unittest_import::ImportMessage, :".protobuf_unittest.optional_import_message_extension", 20, :extension => true
318
+ optional ::Protobuf_unittest::TestAllTypes::NestedEnum, :".protobuf_unittest.optional_nested_enum_extension", 21, :extension => true
319
+ optional ::Protobuf_unittest::ForeignEnum, :".protobuf_unittest.optional_foreign_enum_extension", 22, :extension => true
320
+ optional ::Protobuf_unittest_import::ImportEnum, :".protobuf_unittest.optional_import_enum_extension", 23, :extension => true
321
+ optional :string, :".protobuf_unittest.optional_string_piece_extension", 24, :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
322
+ optional :string, :".protobuf_unittest.optional_cord_extension", 25, :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
323
+ optional ::Protobuf_unittest_import::PublicImportMessage, :".protobuf_unittest.optional_public_import_message_extension", 26, :extension => true
324
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :".protobuf_unittest.optional_lazy_message_extension", 27, :extension => true, :lazy => true
325
+ repeated :int32, :".protobuf_unittest.repeated_int32_extension", 31, :extension => true
326
+ repeated :int64, :".protobuf_unittest.repeated_int64_extension", 32, :extension => true
327
+ repeated :uint32, :".protobuf_unittest.repeated_uint32_extension", 33, :extension => true
328
+ repeated :uint64, :".protobuf_unittest.repeated_uint64_extension", 34, :extension => true
329
+ repeated :sint32, :".protobuf_unittest.repeated_sint32_extension", 35, :extension => true
330
+ repeated :sint64, :".protobuf_unittest.repeated_sint64_extension", 36, :extension => true
331
+ repeated :fixed32, :".protobuf_unittest.repeated_fixed32_extension", 37, :extension => true
332
+ repeated :fixed64, :".protobuf_unittest.repeated_fixed64_extension", 38, :extension => true
333
+ repeated :sfixed32, :".protobuf_unittest.repeated_sfixed32_extension", 39, :extension => true
334
+ repeated :sfixed64, :".protobuf_unittest.repeated_sfixed64_extension", 40, :extension => true
335
+ repeated :float, :".protobuf_unittest.repeated_float_extension", 41, :extension => true
336
+ repeated :double, :".protobuf_unittest.repeated_double_extension", 42, :extension => true
337
+ repeated :bool, :".protobuf_unittest.repeated_bool_extension", 43, :extension => true
338
+ repeated :string, :".protobuf_unittest.repeated_string_extension", 44, :extension => true
339
+ repeated :bytes, :".protobuf_unittest.repeated_bytes_extension", 45, :extension => true
340
+ repeated ::Protobuf_unittest::RepeatedGroup_extension, :".protobuf_unittest.repeatedgroup_extension", 46, :extension => true
341
+ repeated ::Protobuf_unittest::TestAllTypes::NestedMessage, :".protobuf_unittest.repeated_nested_message_extension", 48, :extension => true
342
+ repeated ::Protobuf_unittest::ForeignMessage, :".protobuf_unittest.repeated_foreign_message_extension", 49, :extension => true
343
+ repeated ::Protobuf_unittest_import::ImportMessage, :".protobuf_unittest.repeated_import_message_extension", 50, :extension => true
344
+ repeated ::Protobuf_unittest::TestAllTypes::NestedEnum, :".protobuf_unittest.repeated_nested_enum_extension", 51, :extension => true
345
+ repeated ::Protobuf_unittest::ForeignEnum, :".protobuf_unittest.repeated_foreign_enum_extension", 52, :extension => true
346
+ repeated ::Protobuf_unittest_import::ImportEnum, :".protobuf_unittest.repeated_import_enum_extension", 53, :extension => true
347
+ repeated :string, :".protobuf_unittest.repeated_string_piece_extension", 54, :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
348
+ repeated :string, :".protobuf_unittest.repeated_cord_extension", 55, :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
349
+ repeated ::Protobuf_unittest::TestAllTypes::NestedMessage, :".protobuf_unittest.repeated_lazy_message_extension", 57, :extension => true, :lazy => true
350
+ optional :int32, :".protobuf_unittest.default_int32_extension", 61, :default => 41, :extension => true
351
+ optional :int64, :".protobuf_unittest.default_int64_extension", 62, :default => 42, :extension => true
352
+ optional :uint32, :".protobuf_unittest.default_uint32_extension", 63, :default => 43, :extension => true
353
+ optional :uint64, :".protobuf_unittest.default_uint64_extension", 64, :default => 44, :extension => true
354
+ optional :sint32, :".protobuf_unittest.default_sint32_extension", 65, :default => -45, :extension => true
355
+ optional :sint64, :".protobuf_unittest.default_sint64_extension", 66, :default => 46, :extension => true
356
+ optional :fixed32, :".protobuf_unittest.default_fixed32_extension", 67, :default => 47, :extension => true
357
+ optional :fixed64, :".protobuf_unittest.default_fixed64_extension", 68, :default => 48, :extension => true
358
+ optional :sfixed32, :".protobuf_unittest.default_sfixed32_extension", 69, :default => 49, :extension => true
359
+ optional :sfixed64, :".protobuf_unittest.default_sfixed64_extension", 70, :default => -50, :extension => true
360
+ optional :float, :".protobuf_unittest.default_float_extension", 71, :default => 51.5, :extension => true
361
+ optional :double, :".protobuf_unittest.default_double_extension", 72, :default => 52000, :extension => true
362
+ optional :bool, :".protobuf_unittest.default_bool_extension", 73, :default => true, :extension => true
363
+ optional :string, :".protobuf_unittest.default_string_extension", 74, :default => "hello", :extension => true
364
+ optional :bytes, :".protobuf_unittest.default_bytes_extension", 75, :default => "world", :extension => true
365
+ optional ::Protobuf_unittest::TestAllTypes::NestedEnum, :".protobuf_unittest.default_nested_enum_extension", 81, :default => ::Protobuf_unittest::TestAllTypes::NestedEnum::BAR, :extension => true
366
+ optional ::Protobuf_unittest::ForeignEnum, :".protobuf_unittest.default_foreign_enum_extension", 82, :default => ::Protobuf_unittest::ForeignEnum::FOREIGN_BAR, :extension => true
367
+ optional ::Protobuf_unittest_import::ImportEnum, :".protobuf_unittest.default_import_enum_extension", 83, :default => ::Protobuf_unittest_import::ImportEnum::IMPORT_BAR, :extension => true
368
+ optional :string, :".protobuf_unittest.default_string_piece_extension", 84, :default => "abc", :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
369
+ optional :string, :".protobuf_unittest.default_cord_extension", 85, :default => "123", :extension => true, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
370
+ optional :uint32, :".protobuf_unittest.oneof_uint32_extension", 111, :extension => true
371
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :".protobuf_unittest.oneof_nested_message_extension", 112, :extension => true
372
+ optional :string, :".protobuf_unittest.oneof_string_extension", 113, :extension => true
373
+ optional :bytes, :".protobuf_unittest.oneof_bytes_extension", 114, :extension => true
374
+ optional :string, :".protobuf_unittest.TestNestedExtension.test", 1002, :default => "test", :extension => true
375
+ optional :string, :".protobuf_unittest.TestNestedExtension.nested_string_extension", 1003, :extension => true
376
+ optional :string, :".protobuf_unittest.TestMoreNestedExtension.test", 1004, :default => "a different test", :extension => true
377
+ optional ::Protobuf_unittest::TestRequired, :".protobuf_unittest.TestRequired.single", 1000, :extension => true
378
+ repeated ::Protobuf_unittest::TestRequired, :".protobuf_unittest.TestRequired.multi", 1001, :extension => true
379
+ end
380
+
381
+ class OptionalGroup_extension
382
+ optional :int32, :a, 17
383
+ end
384
+
385
+ class RepeatedGroup_extension
386
+ optional :int32, :a, 47
387
+ end
388
+
389
+ class TestRequired
390
+ required :int32, :a, 1
391
+ optional :int32, :dummy2, 2
392
+ required :int32, :b, 3
393
+ optional :int32, :dummy4, 4
394
+ optional :int32, :dummy5, 5
395
+ optional :int32, :dummy6, 6
396
+ optional :int32, :dummy7, 7
397
+ optional :int32, :dummy8, 8
398
+ optional :int32, :dummy9, 9
399
+ optional :int32, :dummy10, 10
400
+ optional :int32, :dummy11, 11
401
+ optional :int32, :dummy12, 12
402
+ optional :int32, :dummy13, 13
403
+ optional :int32, :dummy14, 14
404
+ optional :int32, :dummy15, 15
405
+ optional :int32, :dummy16, 16
406
+ optional :int32, :dummy17, 17
407
+ optional :int32, :dummy18, 18
408
+ optional :int32, :dummy19, 19
409
+ optional :int32, :dummy20, 20
410
+ optional :int32, :dummy21, 21
411
+ optional :int32, :dummy22, 22
412
+ optional :int32, :dummy23, 23
413
+ optional :int32, :dummy24, 24
414
+ optional :int32, :dummy25, 25
415
+ optional :int32, :dummy26, 26
416
+ optional :int32, :dummy27, 27
417
+ optional :int32, :dummy28, 28
418
+ optional :int32, :dummy29, 29
419
+ optional :int32, :dummy30, 30
420
+ optional :int32, :dummy31, 31
421
+ optional :int32, :dummy32, 32
422
+ required :int32, :c, 33
423
+ end
424
+
425
+ class TestRequiredForeign
426
+ optional ::Protobuf_unittest::TestRequired, :optional_message, 1
427
+ repeated ::Protobuf_unittest::TestRequired, :repeated_message, 2
428
+ optional :int32, :dummy, 3
429
+ end
430
+
431
+ class TestForeignNested
432
+ optional ::Protobuf_unittest::TestAllTypes::NestedMessage, :foreign_nested, 1
433
+ end
434
+
435
+ class TestReallyLargeTagNumber
436
+ optional :int32, :a, 1
437
+ optional :int32, :bb, 268435455
438
+ end
439
+
440
+ class TestRecursiveMessage
441
+ optional ::Protobuf_unittest::TestRecursiveMessage, :a, 1
442
+ optional :int32, :i, 2
443
+ end
444
+
445
+ class TestMutualRecursionA
446
+ optional ::Protobuf_unittest::TestMutualRecursionB, :bb, 1
447
+ end
448
+
449
+ class TestMutualRecursionB
450
+ optional ::Protobuf_unittest::TestMutualRecursionA, :a, 1
451
+ optional :int32, :optional_int32, 2
452
+ end
453
+
454
+ class TestDupFieldNumber
455
+ class Foo
456
+ optional :int32, :a, 1
457
+ end
458
+
459
+ class Bar
460
+ optional :int32, :a, 1
461
+ end
462
+
463
+ optional :int32, :a, 1
464
+ optional ::Protobuf_unittest::TestDupFieldNumber::Foo, :foo, 2
465
+ optional ::Protobuf_unittest::TestDupFieldNumber::Bar, :bar, 3
466
+ end
467
+
468
+ class TestEagerMessage
469
+ optional ::Protobuf_unittest::TestAllTypes, :sub_message, 1, :lazy => false
470
+ end
471
+
472
+ class TestLazyMessage
473
+ optional ::Protobuf_unittest::TestAllTypes, :sub_message, 1, :lazy => true
474
+ end
475
+
476
+ class TestNestedMessageHasBits
477
+ class NestedMessage
478
+ repeated :int32, :nestedmessage_repeated_int32, 1
479
+ repeated ::Protobuf_unittest::ForeignMessage, :nestedmessage_repeated_foreignmessage, 2
480
+ end
481
+
482
+ optional ::Protobuf_unittest::TestNestedMessageHasBits::NestedMessage, :optional_nested_message, 1
483
+ end
484
+
485
+ class TestCamelCaseFieldNames
486
+ optional :int32, :PrimitiveField, 1
487
+ optional :string, :StringField, 2
488
+ optional ::Protobuf_unittest::ForeignEnum, :EnumField, 3
489
+ optional ::Protobuf_unittest::ForeignMessage, :MessageField, 4
490
+ optional :string, :StringPieceField, 5, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
491
+ optional :string, :CordField, 6, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
492
+ repeated :int32, :RepeatedPrimitiveField, 7
493
+ repeated :string, :RepeatedStringField, 8
494
+ repeated ::Protobuf_unittest::ForeignEnum, :RepeatedEnumField, 9
495
+ repeated ::Protobuf_unittest::ForeignMessage, :RepeatedMessageField, 10
496
+ repeated :string, :RepeatedStringPieceField, 11, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
497
+ repeated :string, :RepeatedCordField, 12, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
498
+ end
499
+
500
+ class TestFieldOrderings
501
+ class NestedMessage
502
+ optional :int64, :oo, 2
503
+ optional :int32, :bb, 1
504
+ end
505
+
506
+ optional :string, :my_string, 11
507
+ optional :int64, :my_int, 1
508
+ optional :float, :my_float, 101
509
+ optional ::Protobuf_unittest::TestFieldOrderings::NestedMessage, :optional_nested_message, 200
510
+ # Extension Fields
511
+ extensions 2...11
512
+ extensions 12...101
513
+ optional :string, :".protobuf_unittest.my_extension_string", 50, :extension => true
514
+ optional :int32, :".protobuf_unittest.my_extension_int", 5, :extension => true
515
+ end
516
+
517
+ class TestExtremeDefaultValues
518
+ optional :bytes, :escaped_bytes, 1, :default => "\000\001\007\010\014\n\r\t\013\\\\'\"\376"
519
+ optional :uint32, :large_uint32, 2, :default => 4294967295
520
+ optional :uint64, :large_uint64, 3, :default => 18446744073709551615
521
+ optional :int32, :small_int32, 4, :default => -2147483647
522
+ optional :int64, :small_int64, 5, :default => -9223372036854775807
523
+ optional :int32, :really_small_int32, 21, :default => -2147483648
524
+ optional :int64, :really_small_int64, 22, :default => -9223372036854775808
525
+ optional :string, :utf8_string, 6, :default => "ሴ"
526
+ optional :float, :zero_float, 7, :default => 0
527
+ optional :float, :one_float, 8, :default => 1
528
+ optional :float, :small_float, 9, :default => 1.5
529
+ optional :float, :negative_one_float, 10, :default => -1
530
+ optional :float, :negative_float, 11, :default => -1.5
531
+ optional :float, :large_float, 12, :default => 2e+08
532
+ optional :float, :small_negative_float, 13, :default => -8e-28
533
+ optional :double, :inf_double, 14, :default => ::Float::INFINITY
534
+ optional :double, :neg_inf_double, 15, :default => -::Float::INFINITY
535
+ optional :double, :nan_double, 16, :default => ::Float::NAN
536
+ optional :float, :inf_float, 17, :default => ::Float::INFINITY
537
+ optional :float, :neg_inf_float, 18, :default => -::Float::INFINITY
538
+ optional :float, :nan_float, 19, :default => ::Float::NAN
539
+ optional :string, :cpp_trigraph, 20, :default => "? ? ?? ?? ??? ??/ ??-"
540
+ optional :string, :string_with_zero, 23, :default => "hello"
541
+ optional :bytes, :bytes_with_zero, 24, :default => "wor\000ld"
542
+ optional :string, :string_piece_with_zero, 25, :default => "abc", :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
543
+ optional :string, :cord_with_zero, 26, :default => "123", :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
544
+ optional :string, :replacement_string, 27, :default => "${unknown}"
545
+ end
546
+
547
+ class SparseEnumMessage
548
+ optional ::Protobuf_unittest::TestSparseEnum, :sparse_enum, 1
549
+ end
550
+
551
+ class OneString
552
+ optional :string, :data, 1
553
+ end
554
+
555
+ class MoreString
556
+ repeated :string, :data, 1
557
+ end
558
+
559
+ class OneBytes
560
+ optional :bytes, :data, 1
561
+ end
562
+
563
+ class MoreBytes
564
+ repeated :bytes, :data, 1
565
+ end
566
+
567
+ class Int32Message
568
+ optional :int32, :data, 1
569
+ end
570
+
571
+ class Uint32Message
572
+ optional :uint32, :data, 1
573
+ end
574
+
575
+ class Int64Message
576
+ optional :int64, :data, 1
577
+ end
578
+
579
+ class Uint64Message
580
+ optional :uint64, :data, 1
581
+ end
582
+
583
+ class BoolMessage
584
+ optional :bool, :data, 1
585
+ end
586
+
587
+ class TestOneof
588
+ class FooGroup
589
+ optional :int32, :a, 5
590
+ optional :string, :b, 6
591
+ end
592
+
593
+ optional :int32, :foo_int, 1
594
+ optional :string, :foo_string, 2
595
+ optional ::Protobuf_unittest::TestAllTypes, :foo_message, 3
596
+ optional ::Protobuf_unittest::TestOneof::FooGroup, :foogroup, 4
597
+ end
598
+
599
+ class TestOneofBackwardsCompatible
600
+ class FooGroup
601
+ optional :int32, :a, 5
602
+ optional :string, :b, 6
603
+ end
604
+
605
+ optional :int32, :foo_int, 1
606
+ optional :string, :foo_string, 2
607
+ optional ::Protobuf_unittest::TestAllTypes, :foo_message, 3
608
+ optional ::Protobuf_unittest::TestOneofBackwardsCompatible::FooGroup, :foogroup, 4
609
+ end
610
+
611
+ class TestOneof2
612
+ class FooGroup
613
+ optional :int32, :a, 9
614
+ optional :string, :b, 10
615
+ end
616
+
617
+ class NestedMessage
618
+ optional :int64, :qux_int, 1
619
+ repeated :int32, :corge_int, 2
620
+ end
621
+
622
+ optional :int32, :foo_int, 1
623
+ optional :string, :foo_string, 2
624
+ optional :string, :foo_cord, 3, :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
625
+ optional :string, :foo_string_piece, 4, :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
626
+ optional :bytes, :foo_bytes, 5
627
+ optional ::Protobuf_unittest::TestOneof2::NestedEnum, :foo_enum, 6
628
+ optional ::Protobuf_unittest::TestOneof2::NestedMessage, :foo_message, 7
629
+ optional ::Protobuf_unittest::TestOneof2::FooGroup, :foogroup, 8
630
+ optional ::Protobuf_unittest::TestOneof2::NestedMessage, :foo_lazy_message, 11, :lazy => true
631
+ optional :int32, :bar_int, 12, :default => 5
632
+ optional :string, :bar_string, 13, :default => "STRING"
633
+ optional :string, :bar_cord, 14, :default => "CORD", :ctype => ::Google::Protobuf::FieldOptions::CType::CORD
634
+ optional :string, :bar_string_piece, 15, :default => "SPIECE", :ctype => ::Google::Protobuf::FieldOptions::CType::STRING_PIECE
635
+ optional :bytes, :bar_bytes, 16, :default => "BYTES"
636
+ optional ::Protobuf_unittest::TestOneof2::NestedEnum, :bar_enum, 17, :default => ::Protobuf_unittest::TestOneof2::NestedEnum::BAR
637
+ optional :int32, :baz_int, 18
638
+ optional :string, :baz_string, 19, :default => "BAZ"
639
+ end
640
+
641
+ class TestRequiredOneof
642
+ class NestedMessage
643
+ required :double, :required_double, 1
644
+ end
645
+
646
+ optional :int32, :foo_int, 1
647
+ optional :string, :foo_string, 2
648
+ optional ::Protobuf_unittest::TestRequiredOneof::NestedMessage, :foo_message, 3
649
+ end
650
+
651
+ class TestPackedTypes
652
+ repeated :int32, :packed_int32, 90, :packed => true
653
+ repeated :int64, :packed_int64, 91, :packed => true
654
+ repeated :uint32, :packed_uint32, 92, :packed => true
655
+ repeated :uint64, :packed_uint64, 93, :packed => true
656
+ repeated :sint32, :packed_sint32, 94, :packed => true
657
+ repeated :sint64, :packed_sint64, 95, :packed => true
658
+ repeated :fixed32, :packed_fixed32, 96, :packed => true
659
+ repeated :fixed64, :packed_fixed64, 97, :packed => true
660
+ repeated :sfixed32, :packed_sfixed32, 98, :packed => true
661
+ repeated :sfixed64, :packed_sfixed64, 99, :packed => true
662
+ repeated :float, :packed_float, 100, :packed => true
663
+ repeated :double, :packed_double, 101, :packed => true
664
+ repeated :bool, :packed_bool, 102, :packed => true
665
+ repeated ::Protobuf_unittest::ForeignEnum, :packed_enum, 103, :packed => true
666
+ end
667
+
668
+ class TestUnpackedTypes
669
+ repeated :int32, :unpacked_int32, 90, :packed => false
670
+ repeated :int64, :unpacked_int64, 91, :packed => false
671
+ repeated :uint32, :unpacked_uint32, 92, :packed => false
672
+ repeated :uint64, :unpacked_uint64, 93, :packed => false
673
+ repeated :sint32, :unpacked_sint32, 94, :packed => false
674
+ repeated :sint64, :unpacked_sint64, 95, :packed => false
675
+ repeated :fixed32, :unpacked_fixed32, 96, :packed => false
676
+ repeated :fixed64, :unpacked_fixed64, 97, :packed => false
677
+ repeated :sfixed32, :unpacked_sfixed32, 98, :packed => false
678
+ repeated :sfixed64, :unpacked_sfixed64, 99, :packed => false
679
+ repeated :float, :unpacked_float, 100, :packed => false
680
+ repeated :double, :unpacked_double, 101, :packed => false
681
+ repeated :bool, :unpacked_bool, 102, :packed => false
682
+ repeated ::Protobuf_unittest::ForeignEnum, :unpacked_enum, 103, :packed => false
683
+ end
684
+
685
+ class TestPackedExtensions
686
+ # Extension Fields
687
+ extensions 1...536870912
688
+ repeated :int32, :".protobuf_unittest.packed_int32_extension", 90, :packed => true, :extension => true
689
+ repeated :int64, :".protobuf_unittest.packed_int64_extension", 91, :packed => true, :extension => true
690
+ repeated :uint32, :".protobuf_unittest.packed_uint32_extension", 92, :packed => true, :extension => true
691
+ repeated :uint64, :".protobuf_unittest.packed_uint64_extension", 93, :packed => true, :extension => true
692
+ repeated :sint32, :".protobuf_unittest.packed_sint32_extension", 94, :packed => true, :extension => true
693
+ repeated :sint64, :".protobuf_unittest.packed_sint64_extension", 95, :packed => true, :extension => true
694
+ repeated :fixed32, :".protobuf_unittest.packed_fixed32_extension", 96, :packed => true, :extension => true
695
+ repeated :fixed64, :".protobuf_unittest.packed_fixed64_extension", 97, :packed => true, :extension => true
696
+ repeated :sfixed32, :".protobuf_unittest.packed_sfixed32_extension", 98, :packed => true, :extension => true
697
+ repeated :sfixed64, :".protobuf_unittest.packed_sfixed64_extension", 99, :packed => true, :extension => true
698
+ repeated :float, :".protobuf_unittest.packed_float_extension", 100, :packed => true, :extension => true
699
+ repeated :double, :".protobuf_unittest.packed_double_extension", 101, :packed => true, :extension => true
700
+ repeated :bool, :".protobuf_unittest.packed_bool_extension", 102, :packed => true, :extension => true
701
+ repeated ::Protobuf_unittest::ForeignEnum, :".protobuf_unittest.packed_enum_extension", 103, :packed => true, :extension => true
702
+ end
703
+
704
+ class TestUnpackedExtensions
705
+ # Extension Fields
706
+ extensions 1...536870912
707
+ repeated :int32, :".protobuf_unittest.unpacked_int32_extension", 90, :extension => true, :packed => false
708
+ repeated :int64, :".protobuf_unittest.unpacked_int64_extension", 91, :extension => true, :packed => false
709
+ repeated :uint32, :".protobuf_unittest.unpacked_uint32_extension", 92, :extension => true, :packed => false
710
+ repeated :uint64, :".protobuf_unittest.unpacked_uint64_extension", 93, :extension => true, :packed => false
711
+ repeated :sint32, :".protobuf_unittest.unpacked_sint32_extension", 94, :extension => true, :packed => false
712
+ repeated :sint64, :".protobuf_unittest.unpacked_sint64_extension", 95, :extension => true, :packed => false
713
+ repeated :fixed32, :".protobuf_unittest.unpacked_fixed32_extension", 96, :extension => true, :packed => false
714
+ repeated :fixed64, :".protobuf_unittest.unpacked_fixed64_extension", 97, :extension => true, :packed => false
715
+ repeated :sfixed32, :".protobuf_unittest.unpacked_sfixed32_extension", 98, :extension => true, :packed => false
716
+ repeated :sfixed64, :".protobuf_unittest.unpacked_sfixed64_extension", 99, :extension => true, :packed => false
717
+ repeated :float, :".protobuf_unittest.unpacked_float_extension", 100, :extension => true, :packed => false
718
+ repeated :double, :".protobuf_unittest.unpacked_double_extension", 101, :extension => true, :packed => false
719
+ repeated :bool, :".protobuf_unittest.unpacked_bool_extension", 102, :extension => true, :packed => false
720
+ repeated ::Protobuf_unittest::ForeignEnum, :".protobuf_unittest.unpacked_enum_extension", 103, :extension => true, :packed => false
721
+ end
722
+
723
+ class TestDynamicExtensions
724
+ class DynamicMessageType
725
+ optional :int32, :dynamic_field, 2100
726
+ end
727
+
728
+ optional :fixed32, :scalar_extension, 2000
729
+ optional ::Protobuf_unittest::ForeignEnum, :enum_extension, 2001
730
+ optional ::Protobuf_unittest::TestDynamicExtensions::DynamicEnumType, :dynamic_enum_extension, 2002
731
+ optional ::Protobuf_unittest::ForeignMessage, :message_extension, 2003
732
+ optional ::Protobuf_unittest::TestDynamicExtensions::DynamicMessageType, :dynamic_message_extension, 2004
733
+ repeated :string, :repeated_extension, 2005
734
+ repeated :sint32, :packed_extension, 2006, :packed => true
735
+ end
736
+
737
+ class TestRepeatedScalarDifferentTagSizes
738
+ repeated :fixed32, :repeated_fixed32, 12
739
+ repeated :int32, :repeated_int32, 13
740
+ repeated :fixed64, :repeated_fixed64, 2046
741
+ repeated :int64, :repeated_int64, 2047
742
+ repeated :float, :repeated_float, 262142
743
+ repeated :uint64, :repeated_uint64, 262143
744
+ end
745
+
746
+ class TestParsingMerge
747
+ class RepeatedFieldsGenerator
748
+ class Group1
749
+ optional ::Protobuf_unittest::TestAllTypes, :field1, 11
750
+ end
751
+
752
+ class Group2
753
+ optional ::Protobuf_unittest::TestAllTypes, :field1, 21
754
+ end
755
+
756
+ repeated ::Protobuf_unittest::TestAllTypes, :field1, 1
757
+ repeated ::Protobuf_unittest::TestAllTypes, :field2, 2
758
+ repeated ::Protobuf_unittest::TestAllTypes, :field3, 3
759
+ repeated ::Protobuf_unittest::TestParsingMerge::RepeatedFieldsGenerator::Group1, :group1, 10
760
+ repeated ::Protobuf_unittest::TestParsingMerge::RepeatedFieldsGenerator::Group2, :group2, 20
761
+ repeated ::Protobuf_unittest::TestAllTypes, :ext1, 1000
762
+ repeated ::Protobuf_unittest::TestAllTypes, :ext2, 1001
763
+ end
764
+
765
+ class OptionalGroup
766
+ optional ::Protobuf_unittest::TestAllTypes, :optional_group_all_types, 11
767
+ end
768
+
769
+ class RepeatedGroup
770
+ optional ::Protobuf_unittest::TestAllTypes, :repeated_group_all_types, 21
771
+ end
772
+
773
+ required ::Protobuf_unittest::TestAllTypes, :required_all_types, 1
774
+ optional ::Protobuf_unittest::TestAllTypes, :optional_all_types, 2
775
+ repeated ::Protobuf_unittest::TestAllTypes, :repeated_all_types, 3
776
+ optional ::Protobuf_unittest::TestParsingMerge::OptionalGroup, :optionalgroup, 10
777
+ repeated ::Protobuf_unittest::TestParsingMerge::RepeatedGroup, :repeatedgroup, 20
778
+ # Extension Fields
779
+ extensions 1000...536870912
780
+ optional ::Protobuf_unittest::TestAllTypes, :".protobuf_unittest.TestParsingMerge.optional_ext", 1000, :extension => true
781
+ repeated ::Protobuf_unittest::TestAllTypes, :".protobuf_unittest.TestParsingMerge.repeated_ext", 1001, :extension => true
782
+ end
783
+
784
+ class TestCommentInjectionMessage
785
+ optional :string, :a, 1, :default => "*/ <- Neither should this."
786
+ end
787
+
788
+
789
+ ##
790
+ # Service Classes
791
+ #
792
+ class TestService < ::Protobuf::Rpc::Service
793
+ rpc :foo, ::Protobuf_unittest::FooRequest, ::Protobuf_unittest::FooResponse
794
+ rpc :bar, ::Protobuf_unittest::BarRequest, ::Protobuf_unittest::BarResponse
795
+ end
796
+
797
+ end
798
+