blob: fd0ac9744abb2653d86d65ff82839d87cb21da42 [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
Marc Slemko17859852006-08-15 00:21:31 +00005
Mark Sleee8540632006-05-30 09:24:40 +00006enum Numberz
7{
8 ONE = 1,
9 TWO,
10 THREE,
11 FIVE = 5,
12 SIX,
13 EIGHT = 8
14}
15
Mark Slee6e536442006-06-30 18:28:50 +000016typedef i64 UserId
Mark Sleee8540632006-05-30 09:24:40 +000017
Mark Sleee129a2d2007-02-21 05:17:48 +000018struct Bonk
19{
20 1: string message,
21 2: i32 type
22}
23
Mark Sleee8540632006-05-30 09:24:40 +000024struct Xtruct
25{
Mark Sleea3302652006-10-25 19:03:32 +000026 1: string string_thing,
27 4: byte byte_thing,
28 9: i32 i32_thing,
29 11: i64 i64_thing
Mark Sleee8540632006-05-30 09:24:40 +000030}
31
32struct Xtruct2
33{
Mark Sleea3302652006-10-25 19:03:32 +000034 1: byte byte_thing,
35 2: Xtruct struct_thing,
36 3: i32 i32_thing
Mark Sleee8540632006-05-30 09:24:40 +000037}
38
39struct Insanity
40{
Mark Sleea3302652006-10-25 19:03:32 +000041 1: map<Numberz, UserId> userMap,
42 2: list<Xtruct> xtructs
Mark Sleee8540632006-05-30 09:24:40 +000043}
44
Marc Slemkobf4fd192006-08-15 21:29:39 +000045exception Xception {
Mark Sleea3302652006-10-25 19:03:32 +000046 1: i32 errorCode,
47 2: string message
Marc Slemkod8b10512006-08-14 23:30:37 +000048}
49
Marc Slemkobf4fd192006-08-15 21:29:39 +000050exception Xception2 {
Mark Sleea3302652006-10-25 19:03:32 +000051 1: i32 errorCode,
52 2: Xtruct struct_thing
Marc Slemkod8b10512006-08-14 23:30:37 +000053}
Mark Slee27ed6ec2007-08-16 01:26:31 +000054
Mark Sleed3d733a2006-09-01 22:19:06 +000055struct EmptyStruct {}
56
Marc Slemkod8b10512006-08-14 23:30:37 +000057struct OneField {
Mark Sleea3302652006-10-25 19:03:32 +000058 1: EmptyStruct field
Marc Slemkod8b10512006-08-14 23:30:37 +000059}
Marc Slemko5b126d62006-08-11 23:03:42 +000060
Mark Sleee8540632006-05-30 09:24:40 +000061service ThriftTest
62{
Marc Slemkod8b10512006-08-14 23:30:37 +000063 void testVoid(),
Mark Sleea3302652006-10-25 19:03:32 +000064 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),
Mark Sleee8540632006-05-30 09:24:40 +000076
Mark Sleea3302652006-10-25 19:03:32 +000077 map<i32,map<i32,i32>> testMapMap(1: i32 hello),
Mark Sleee8540632006-05-30 09:24:40 +000078
79 /* So you think you've got this all worked, out eh? */
Mark Sleea3302652006-10-25 19:03:32 +000080 map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
Marc Slemkod8b10512006-08-14 23:30:37 +000081
82 /* Multiple parameters */
Mark Slee27ed6ec2007-08-16 01:26:31 +000083 Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
Marc Slemkod8b10512006-08-14 23:30:37 +000084
85 /* Exception specifier */
86
Marc Slemkobf4fd192006-08-15 21:29:39 +000087 void testException(string arg) throws(Xception err1),
Marc Slemkod8b10512006-08-14 23:30:37 +000088
89 /* Multiple exceptions specifier */
90
Mark Sleea3302652006-10-25 19:03:32 +000091 Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
Mark Sleee8540632006-05-30 09:24:40 +000092}
Mark Sleedafa3cf2006-09-02 23:56:49 +000093
94service SecondService
95{
96 void blahBlah()
97}