Imported Upstream version 3.8.0
[platform/upstream/protobuf.git] / js / test12.proto
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 //     * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //     * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 //     * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 syntax = "proto2";
32
33
34 package jspb.circulartest;
35
36 message MessageField1 {
37   optional int32 a = 1;
38   optional MessageField2 b = 2;
39 }
40
41 message MessageField2 {
42   optional int32 a = 1;
43   optional MessageField1 b = 2;
44 }
45
46
47 message RepeatedMessageField1 {
48   optional int32 a = 1;
49   optional RepeatedMessageField2 b = 2;
50 }
51
52 message RepeatedMessageField2 {
53   optional int32 a = 1;
54   repeated RepeatedMessageField1 b = 2;
55 }
56
57 message MapField1 {
58   optional int32 a = 1;
59   optional MapField2 b = 2;
60 }
61
62 message MapField2 {
63   optional int32 a = 1;
64   map<int32, MapField1> b = 2;
65 }
66
67 message NestedMessage1 {
68   optional NestedMessage2 b = 2;
69   message NestedNestedMessage {
70     optional int32 a = 1;
71   }
72 }
73
74 message NestedMessage2 {
75   optional int32 a = 1;
76   optional NestedMessage1.NestedNestedMessage b = 2;
77 }
78
79 message NestedEnum1 {
80   optional NestedEnum2 b = 2;
81   enum NestedNestedEnum {
82     UNDEFINED = 0;
83     VALUE_1 = 1;
84   }
85 }
86
87 message NestedEnum2 {
88   optional int32 a = 1;
89   optional NestedEnum1.NestedNestedEnum b = 2;
90 }
91
92 message ExtensionContainingType1 {
93   optional int32 a = 1;
94   optional ExtensionContainingType2 b = 2;
95   extensions 99 to 100;
96 }
97
98 message ExtensionContainingType2 {
99   optional int32 a = 1;
100   extend ExtensionContainingType1 {
101     optional int32 c = 99;
102   }
103 }
104
105 message ExtensionField1 {
106   optional int32 a = 1;
107   optional ExtensionField2 b = 2;
108 }
109
110 message ExtensionField2 {
111   optional int32 a = 1;
112   extend ExtensionField3 {
113     optional ExtensionField1 c = 99;
114   }
115 }
116
117 message ExtensionField3 {
118   extensions 99 to 100;
119 }