blob: 50021ba32819498d344cc7d6d489b12b45310952 [file] [log] [blame]
Marc Slemkoaeb36f82006-08-15 00:21:45 +00001namespace thrift.test
Marc Slemko17859852006-08-15 00:21:31 +00002
Mark Sleee8540632006-05-30 09:24:40 +00003enum Numberz
4{
5 ONE = 1,
6 TWO,
7 THREE,
8 FIVE = 5,
9 SIX,
10 EIGHT = 8
11}
12
Mark Slee6e536442006-06-30 18:28:50 +000013typedef i64 UserId
Mark Sleee8540632006-05-30 09:24:40 +000014
15struct Xtruct
16{
17 string string_thing = 0,
18 byte byte_thing = 1,
Mark Sleee8540632006-05-30 09:24:40 +000019 i32 i32_thing = 3,
Mark Sleee8540632006-05-30 09:24:40 +000020 i64 i64_thing = 5
21}
22
23struct Xtruct2
24{
Marc Slemko0b4ffa92006-08-11 02:49:29 +000025 byte byte_thing,
26 Xtruct struct_thing,
27 i32 i32_thing
Mark Sleee8540632006-05-30 09:24:40 +000028}
29
30struct Insanity
31{
32 map<Numberz, UserId> userMap = 0,
Marc Slemkoe6889de2006-08-12 00:32:53 +000033 list<Xtruct> xtructs = 1
Mark Sleee8540632006-05-30 09:24:40 +000034}
35
Marc Slemkobf4fd192006-08-15 21:29:39 +000036exception Xception {
Marc Slemkod8b10512006-08-14 23:30:37 +000037 u32 errorCode,
38 string message
39}
40
Marc Slemkobf4fd192006-08-15 21:29:39 +000041exception Xception2 {
Marc Slemkod8b10512006-08-14 23:30:37 +000042 u32 errorCode,
43 Xtruct struct_thing
44}
45
Marc Slemko5b126d62006-08-11 23:03:42 +000046struct Empty {}
Marc Slemkod8b10512006-08-14 23:30:37 +000047struct OneField {
48 Empty field
49}
Marc Slemko5b126d62006-08-11 23:03:42 +000050
Mark Sleee8540632006-05-30 09:24:40 +000051service ThriftTest
52{
Marc Slemkod8b10512006-08-14 23:30:37 +000053 void testVoid(),
54 string testString(string thing = 0),
55 byte testByte(byte thing = 0),
56 i32 testI32(i32 thing = 0),
57 i64 testI64(i64 thing = 0),
58 Xtruct testStruct(Xtruct thing = 0),
59 Xtruct2 testNest(Xtruct2 thing = 0),
60 map<i32,i32> testMap(map<i32,i32> thing = 0),
61 set<i32> testSet(set<i32> thing = 0),
62 list<i32> testList(list<i32> thing = 0),
63 Numberz testEnum(Numberz thing = 0),
64 UserId testTypedef(UserId thing = 0),
Mark Sleee8540632006-05-30 09:24:40 +000065
Marc Slemkod8b10512006-08-14 23:30:37 +000066 map<i32,map<i32,i32>> testMapMap(i32 hello = 0),
Mark Sleee8540632006-05-30 09:24:40 +000067
68 /* So you think you've got this all worked, out eh? */
Marc Slemkod8b10512006-08-14 23:30:37 +000069 map<UserId, map<Numberz,Insanity>> testInsanity(Insanity argument = 0),
70
71 /* Multiple parameters */
Marc Slemko0b4ffa92006-08-11 02:49:29 +000072
Marc Slemkod8b10512006-08-14 23:30:37 +000073 Xtruct testMulti(byte arg0, i32 arg1, u64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
74
75 /* Exception specifier */
76
Marc Slemkobf4fd192006-08-15 21:29:39 +000077 void testException(string arg) throws(Xception err1),
Marc Slemkod8b10512006-08-14 23:30:37 +000078
79 /* Multiple exceptions specifier */
80
Marc Slemkobf4fd192006-08-15 21:29:39 +000081 Xtruct testMultiException(string arg0, string arg1) throws(Xception err1=1, Xception2 err2)
Mark Sleee8540632006-05-30 09:24:40 +000082}