blob: 897d707fa1e58d99f8afcabf82dbf6fccee6ca33 [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{
Mark Sleed3d733a2006-09-01 22:19:06 +000017 string string_thing = 1,
18 byte byte_thing = 4,
19 i32 i32_thing = 9,
20 i64 i64_thing = 11
Mark Sleee8540632006-05-30 09:24:40 +000021}
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 {
Mark Sleed3d733a2006-09-01 22:19:06 +000037 i32 errorCode,
Marc Slemkod8b10512006-08-14 23:30:37 +000038 string message
39}
40
Marc Slemkobf4fd192006-08-15 21:29:39 +000041exception Xception2 {
Mark Sleed3d733a2006-09-01 22:19:06 +000042 i32 errorCode,
Marc Slemkod8b10512006-08-14 23:30:37 +000043 Xtruct struct_thing
44}
45
Mark Sleed3d733a2006-09-01 22:19:06 +000046struct EmptyStruct {}
47
Marc Slemkod8b10512006-08-14 23:30:37 +000048struct OneField {
Mark Sleed3d733a2006-09-01 22:19:06 +000049 EmptyStruct field
Marc Slemkod8b10512006-08-14 23:30:37 +000050}
Marc Slemko5b126d62006-08-11 23:03:42 +000051
Mark Sleee8540632006-05-30 09:24:40 +000052service ThriftTest
53{
Marc Slemkod8b10512006-08-14 23:30:37 +000054 void testVoid(),
Mark Sleed3d733a2006-09-01 22:19:06 +000055 string testString(string thing = 1),
56 byte testByte(byte thing = 1),
57 i32 testI32(i32 thing = 1),
58 i64 testI64(i64 thing = 1),
59 Xtruct testStruct(Xtruct thing = 1),
60 Xtruct2 testNest(Xtruct2 thing = 1),
61 map<i32,i32> testMap(map<i32,i32> thing = 1),
62 set<i32> testSet(set<i32> thing = 1),
63 list<i32> testList(list<i32> thing = 1),
64 Numberz testEnum(Numberz thing = 1),
65 UserId testTypedef(UserId thing = 1),
Mark Sleee8540632006-05-30 09:24:40 +000066
Mark Sleed3d733a2006-09-01 22:19:06 +000067 map<i32,map<i32,i32>> testMapMap(i32 hello = 1),
Mark Sleee8540632006-05-30 09:24:40 +000068
69 /* So you think you've got this all worked, out eh? */
Mark Sleed3d733a2006-09-01 22:19:06 +000070 map<UserId, map<Numberz,Insanity>> testInsanity(Insanity argument = 1),
Marc Slemkod8b10512006-08-14 23:30:37 +000071
72 /* Multiple parameters */
Marc Slemko0b4ffa92006-08-11 02:49:29 +000073
Mark Sleed3d733a2006-09-01 22:19:06 +000074 Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
Marc Slemkod8b10512006-08-14 23:30:37 +000075
76 /* Exception specifier */
77
Marc Slemkobf4fd192006-08-15 21:29:39 +000078 void testException(string arg) throws(Xception err1),
Marc Slemkod8b10512006-08-14 23:30:37 +000079
80 /* Multiple exceptions specifier */
81
Marc Slemkobf4fd192006-08-15 21:29:39 +000082 Xtruct testMultiException(string arg0, string arg1) throws(Xception err1=1, Xception2 err2)
Mark Sleee8540632006-05-30 09:24:40 +000083}
Mark Sleedafa3cf2006-09-02 23:56:49 +000084
85service SecondService
86{
87 void blahBlah()
88}