blob: 8c91cb7f5466e250a5193f11ea4b247210d69137 [file] [log] [blame]
Mark Sleea3302652006-10-25 19:03:32 +00001java_package thrift.test
2cpp_namespace thrift.test
Mark Slee58dfb4f2007-07-06 02:45:25 +00003ruby_namespace Thrift.Test
Mark Slee27ed6ec2007-08-16 01:26:31 +00004perl_package ThriftTest
David Reiss7f42bcf2008-01-11 20:59:12 +00005csharp_namespace Thrift.Test
Marc Slemko17859852006-08-15 00:21:31 +00006
Mark Sleee8540632006-05-30 09:24:40 +00007enum Numberz
8{
9 ONE = 1,
10 TWO,
11 THREE,
12 FIVE = 5,
13 SIX,
14 EIGHT = 8
15}
16
Mark Slee6e536442006-06-30 18:28:50 +000017typedef i64 UserId
Mark Sleee8540632006-05-30 09:24:40 +000018
Mark Sleee129a2d2007-02-21 05:17:48 +000019struct Bonk
20{
21 1: string message,
22 2: i32 type
23}
24
Mark Sleee8540632006-05-30 09:24:40 +000025struct Xtruct
26{
Mark Sleea3302652006-10-25 19:03:32 +000027 1: string string_thing,
28 4: byte byte_thing,
29 9: i32 i32_thing,
30 11: i64 i64_thing
Mark Sleee8540632006-05-30 09:24:40 +000031}
32
33struct Xtruct2
34{
Mark Sleea3302652006-10-25 19:03:32 +000035 1: byte byte_thing,
36 2: Xtruct struct_thing,
37 3: i32 i32_thing
Mark Sleee8540632006-05-30 09:24:40 +000038}
39
40struct Insanity
41{
Mark Sleea3302652006-10-25 19:03:32 +000042 1: map<Numberz, UserId> userMap,
43 2: list<Xtruct> xtructs
Mark Sleee8540632006-05-30 09:24:40 +000044}
45
Marc Slemkobf4fd192006-08-15 21:29:39 +000046exception Xception {
Mark Sleea3302652006-10-25 19:03:32 +000047 1: i32 errorCode,
48 2: string message
Marc Slemkod8b10512006-08-14 23:30:37 +000049}
50
Marc Slemkobf4fd192006-08-15 21:29:39 +000051exception Xception2 {
Mark Sleea3302652006-10-25 19:03:32 +000052 1: i32 errorCode,
53 2: Xtruct struct_thing
Marc Slemkod8b10512006-08-14 23:30:37 +000054}
Mark Slee27ed6ec2007-08-16 01:26:31 +000055
Mark Sleed3d733a2006-09-01 22:19:06 +000056struct EmptyStruct {}
57
Marc Slemkod8b10512006-08-14 23:30:37 +000058struct OneField {
Mark Sleea3302652006-10-25 19:03:32 +000059 1: EmptyStruct field
Marc Slemkod8b10512006-08-14 23:30:37 +000060}
Marc Slemko5b126d62006-08-11 23:03:42 +000061
Mark Sleee8540632006-05-30 09:24:40 +000062service ThriftTest
63{
Marc Slemkod8b10512006-08-14 23:30:37 +000064 void testVoid(),
Mark Sleea3302652006-10-25 19:03:32 +000065 string testString(1: string thing),
66 byte testByte(1: byte thing),
67 i32 testI32(1: i32 thing),
68 i64 testI64(1: i64 thing),
69 double testDouble(1: double thing),
70 Xtruct testStruct(1: Xtruct thing),
71 Xtruct2 testNest(1: Xtruct2 thing),
72 map<i32,i32> testMap(1: map<i32,i32> thing),
73 set<i32> testSet(1: set<i32> thing),
74 list<i32> testList(1: list<i32> thing),
75 Numberz testEnum(1: Numberz thing),
76 UserId testTypedef(1: UserId thing),
Mark Sleee8540632006-05-30 09:24:40 +000077
Mark Sleea3302652006-10-25 19:03:32 +000078 map<i32,map<i32,i32>> testMapMap(1: i32 hello),
Mark Sleee8540632006-05-30 09:24:40 +000079
80 /* So you think you've got this all worked, out eh? */
Mark Sleea3302652006-10-25 19:03:32 +000081 map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
Marc Slemkod8b10512006-08-14 23:30:37 +000082
83 /* Multiple parameters */
Mark Slee27ed6ec2007-08-16 01:26:31 +000084 Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
Marc Slemkod8b10512006-08-14 23:30:37 +000085
86 /* Exception specifier */
87
Marc Slemkobf4fd192006-08-15 21:29:39 +000088 void testException(string arg) throws(Xception err1),
Marc Slemkod8b10512006-08-14 23:30:37 +000089
90 /* Multiple exceptions specifier */
91
Mark Sleea3302652006-10-25 19:03:32 +000092 Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
Mark Sleee8540632006-05-30 09:24:40 +000093}
Mark Sleedafa3cf2006-09-02 23:56:49 +000094
95service SecondService
96{
97 void blahBlah()
98}