Subversion Repositories SmartDukaan

Rev

Rev 30 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
30 ashish 1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements. See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership. The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License. You may obtain a copy of the License at
9
 *
10
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied. See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 *
19
 * Contains some contributions under the Thrift Software License.
20
 * Please see doc/old-thrift-license.txt in the Thrift distribution for
21
 * details.
22
 */
23
 
24
namespace java thrift.test
25
namespace cpp thrift.test
26
namespace rb Thrift.Test
27
namespace perl ThriftTest
28
namespace csharp Thrift.Test
29
 
30
/**
31
 * Docstring!
32
 */
33
enum Numberz
34
{
35
  ONE = 1,
36
  TWO,
37
  THREE,
38
  FIVE = 5,
39
  SIX,
40
  EIGHT = 8
41
}
42
 
43
typedef i64 UserId
44
 
45
struct Bonk
46
{
47
  1: string message,
48
  2: i32 type
49
}
50
 
51
struct Bools {
52
  1: bool im_true,
53
  2: bool im_false,
54
}
55
 
56
struct Xtruct
57
{
58
  1:  string string_thing,
59
  4:  byte   byte_thing,
60
  9:  i32    i32_thing,
61
  11: i64    i64_thing
62
}
63
 
64
struct Xtruct2
65
{
66
  1: byte   byte_thing,
67
  2: Xtruct struct_thing,
68
  3: i32    i32_thing
69
}
70
 
71
struct Xtruct3
72
{
73
  1:  string string_thing,
74
  4:  i32    changed,
75
  9:  i32    i32_thing,
76
  11: i64    i64_thing
77
}
78
 
79
 
80
struct Insanity
81
{
82
  1: map<Numberz, UserId> userMap,
83
  2: list<Xtruct> xtructs
84
}
85
 
86
struct CrazyNesting {
87
  1: string string_field,
88
  2: optional set<Insanity> set_field,
89
  3: required list< map<set<i32>,map<i32,set<list<map<Insanity,string>>>>>> list_field
90
}
91
 
92
exception Xception {
93
  1: i32 errorCode,
94
  2: string message
95
}
96
 
97
exception Xception2 {
98
  1: i32 errorCode,
99
  2: Xtruct struct_thing
100
}
101
 
102
struct EmptyStruct {}
103
 
104
struct OneField {
105
  1: EmptyStruct field
106
}
107
 
108
service ThriftTest
109
{
110
  void         testVoid(),
111
  string       testString(1: string thing),
112
  byte         testByte(1: byte thing),
113
  i32          testI32(1: i32 thing),
114
  i64          testI64(1: i64 thing),
115
  double       testDouble(1: double thing),
116
  Xtruct       testStruct(1: Xtruct thing),
117
  Xtruct2      testNest(1: Xtruct2 thing),
118
  map<i32,i32> testMap(1: map<i32,i32> thing),
119
  set<i32>     testSet(1: set<i32> thing),
120
  list<i32>    testList(1: list<i32> thing),
121
  Numberz      testEnum(1: Numberz thing),
122
  UserId       testTypedef(1: UserId thing),
123
 
124
  map<i32,map<i32,i32>> testMapMap(1: i32 hello),
125
 
126
  /* So you think you've got this all worked, out eh? */
127
  map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
128
 
129
  /* Multiple parameters */
130
  Xtruct testMulti(1: byte arg0, 2: i32 arg1, 3: i64 arg2, 4: map<i16, string> arg3, 5: Numberz arg4, 6: UserId arg5),
131
 
132
  /* Exception specifier */
133
 
134
  void testException(1: string arg) throws(1: Xception err1),
135
 
136
  /* Multiple exceptions specifier */
137
 
138
  Xtruct testMultiException(1: string arg0, 2: string arg1) throws(1: Xception err1, 2: Xception2 err2)
139
 
140
  /* Test oneway void */
141
  oneway void testOneway(1:i32 secondsToSleep)
142
}
143
 
144
service SecondService
145
{
146
  void blahBlah()
147
}
148
 
149
struct VersioningTestV1 {
150
       1: i32 begin_in_both,
151
       3: string old_string,
152
       12: i32 end_in_both
153
}
154
 
155
struct VersioningTestV2 {
156
       1: i32 begin_in_both,
157
 
158
       2: i32 newint,
159
       3: byte newbyte,
160
       4: i16 newshort,
161
       5: i64 newlong,
162
       6: double newdouble
163
       7: Bonk newstruct,
164
       8: list<i32> newlist,
165
       9: set<i32> newset,
166
       10: map<i32, i32> newmap,
167
       11: string newstring,
168
       12: i32 end_in_both
169
}
170
 
171
struct ListTypeVersioningV1 {
172
       1: list<i32> myints;
173
       2: string hello;
174
}
175
 
176
struct ListTypeVersioningV2 {
177
       1: list<string> strings;
178
       2: string hello;
179
}