blob: d4b0a4dde2cae62eaf499e56918fb840f27917aa [file] [log] [blame]
Mark Sleea3302652006-10-25 19:03:32 +00001java_package thrift.test
2cpp_namespace thrift.test
Marc Slemko17859852006-08-15 00:21:31 +00003
Mark Sleee8540632006-05-30 09:24:40 +00004enum Numberz
5{
6 ONE = 1,
7 TWO,
8 THREE,
9 FIVE = 5,
10 SIX,
11 EIGHT = 8
12}
13
Mark Slee6e536442006-06-30 18:28:50 +000014typedef i64 UserId
Mark Sleee8540632006-05-30 09:24:40 +000015
Mark Sleee129a2d2007-02-21 05:17:48 +000016struct Bonk
17{
18 1: string message,
19 2: i32 type
20}
21
Mark Sleee8540632006-05-30 09:24:40 +000022struct Xtruct
23{
Mark Sleea3302652006-10-25 19:03:32 +000024 1: string string_thing,
25 4: byte byte_thing,
26 9: i32 i32_thing,
27 11: i64 i64_thing
Mark Sleee8540632006-05-30 09:24:40 +000028}
29
30struct Xtruct2
31{
Mark Sleea3302652006-10-25 19:03:32 +000032 1: byte byte_thing,
33 2: Xtruct struct_thing,
34 3: i32 i32_thing
Mark Sleee8540632006-05-30 09:24:40 +000035}
36
37struct Insanity
38{
Mark Sleea3302652006-10-25 19:03:32 +000039 1: map<Numberz, UserId> userMap,
40 2: list<Xtruct> xtructs
Mark Sleee8540632006-05-30 09:24:40 +000041}
42
Marc Slemkobf4fd192006-08-15 21:29:39 +000043exception Xception {
Mark Sleea3302652006-10-25 19:03:32 +000044 1: i32 errorCode,
45 2: string message
Marc Slemkod8b10512006-08-14 23:30:37 +000046}
47
Marc Slemkobf4fd192006-08-15 21:29:39 +000048exception Xception2 {
Mark Sleea3302652006-10-25 19:03:32 +000049 1: i32 errorCode,
50 2: Xtruct struct_thing
Marc Slemkod8b10512006-08-14 23:30:37 +000051}
52
Mark Sleed3d733a2006-09-01 22:19:06 +000053struct EmptyStruct {}
54
Marc Slemkod8b10512006-08-14 23:30:37 +000055struct OneField {
Mark Sleea3302652006-10-25 19:03:32 +000056 1: EmptyStruct field
Marc Slemkod8b10512006-08-14 23:30:37 +000057}
Marc Slemko5b126d62006-08-11 23:03:42 +000058
Mark Sleee8540632006-05-30 09:24:40 +000059service ThriftTest
60{
Marc Slemkod8b10512006-08-14 23:30:37 +000061 void testVoid(),
Mark Sleea3302652006-10-25 19:03:32 +000062 string testString(1: string thing),
63 byte testByte(1: byte thing),
64 i32 testI32(1: i32 thing),
65 i64 testI64(1: i64 thing),
66 double testDouble(1: double thing),
67 Xtruct testStruct(1: Xtruct thing),
68 Xtruct2 testNest(1: Xtruct2 thing),
69 map<i32,i32> testMap(1: map<i32,i32> thing),
70 set<i32> testSet(1: set<i32> thing),
71 list<i32> testList(1: list<i32> thing),
72 Numberz testEnum(1: Numberz thing),
73 UserId testTypedef(1: UserId thing),
Mark Sleee8540632006-05-30 09:24:40 +000074
Mark Sleea3302652006-10-25 19:03:32 +000075 map<i32,map<i32,i32>> testMapMap(1: i32 hello),
Mark Sleee8540632006-05-30 09:24:40 +000076
77 /* So you think you've got this all worked, out eh? */
Mark Sleea3302652006-10-25 19:03:32 +000078 map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
Marc Slemkod8b10512006-08-14 23:30:37 +000079
80 /* Multiple parameters */
Marc Slemko0b4ffa92006-08-11 02:49:29 +000081
Mark Sleed3d733a2006-09-01 22:19:06 +000082 Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
Marc Slemkod8b10512006-08-14 23:30:37 +000083
84 /* Exception specifier */
85
Marc Slemkobf4fd192006-08-15 21:29:39 +000086 void testException(string arg) throws(Xception err1),
Marc Slemkod8b10512006-08-14 23:30:37 +000087
88 /* Multiple exceptions specifier */
89
Mark Sleea3302652006-10-25 19:03:32 +000090 Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
Mark Sleee8540632006-05-30 09:24:40 +000091}
Mark Sleedafa3cf2006-09-02 23:56:49 +000092
93service SecondService
94{
95 void blahBlah()
96}