r1322@dev030 (orig r67037): dweatherford | 2007-11-01 19:22:25 -0700
[amiethrift.git] / test / ThriftTest.thrift
blobfd0ac9744abb2653d86d65ff82839d87cb21da42
1 java_package thrift.test
2 cpp_namespace thrift.test
3 ruby_namespace Thrift.Test
4 perl_package ThriftTest
6 enum Numberz
8   ONE = 1,
9   TWO,
10   THREE,
11   FIVE = 5,
12   SIX,
13   EIGHT = 8
16 typedef i64 UserId
18 struct Bonk
20   1: string message,
21   2: i32 type
24 struct Xtruct
26   1:  string string_thing,
27   4:  byte   byte_thing,
28   9:  i32    i32_thing,
29   11: i64    i64_thing
32 struct Xtruct2
34   1: byte   byte_thing,
35   2: Xtruct struct_thing,
36   3: i32    i32_thing
39 struct Insanity
41   1: map<Numberz, UserId> userMap,
42   2: list<Xtruct> xtructs
45 exception Xception {
46   1: i32 errorCode,
47   2: string message
50 exception Xception2 {
51   1: i32 errorCode,
52   2: Xtruct struct_thing
55 struct EmptyStruct {}
57 struct OneField {
58   1: EmptyStruct field
61 service ThriftTest
63   void         testVoid(),
64   string       testString(1: string thing),
65   byte         testByte(1: byte thing),
66   i32          testI32(1: i32 thing),
67   i64          testI64(1: i64 thing),
68   double       testDouble(1: double thing),
69   Xtruct       testStruct(1: Xtruct thing),
70   Xtruct2      testNest(1: Xtruct2 thing),
71   map<i32,i32> testMap(1: map<i32,i32> thing),
72   set<i32>     testSet(1: set<i32> thing),
73   list<i32>    testList(1: list<i32> thing),
74   Numberz      testEnum(1: Numberz thing),
75   UserId       testTypedef(1: UserId thing),
77   map<i32,map<i32,i32>> testMapMap(1: i32 hello),
79   /* So you think you've got this all worked, out eh? */
80   map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
82   /* Multiple parameters */
83   Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
85   /* Exception specifier */
87   void testException(string arg) throws(Xception err1),
89   /* Multiple exceptions specifier */
91   Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
94 service SecondService
96   void blahBlah()