Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 1 | java_package thrift.test |
| 2 | cpp_namespace thrift.test |
Mark Slee | 58dfb4f | 2007-07-06 02:45:25 +0000 | [diff] [blame] | 3 | ruby_namespace Thrift.Test |
Mark Slee | 27ed6ec | 2007-08-16 01:26:31 +0000 | [diff] [blame] | 4 | perl_package ThriftTest |
David Reiss | 7f42bcf | 2008-01-11 20:59:12 +0000 | [diff] [blame^] | 5 | csharp_namespace Thrift.Test |
Marc Slemko | 1785985 | 2006-08-15 00:21:31 +0000 | [diff] [blame] | 6 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 7 | enum Numberz |
| 8 | { |
| 9 | ONE = 1, |
| 10 | TWO, |
| 11 | THREE, |
| 12 | FIVE = 5, |
| 13 | SIX, |
| 14 | EIGHT = 8 |
| 15 | } |
| 16 | |
Mark Slee | 6e53644 | 2006-06-30 18:28:50 +0000 | [diff] [blame] | 17 | typedef i64 UserId |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 18 | |
Mark Slee | e129a2d | 2007-02-21 05:17:48 +0000 | [diff] [blame] | 19 | struct Bonk |
| 20 | { |
| 21 | 1: string message, |
| 22 | 2: i32 type |
| 23 | } |
| 24 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 25 | struct Xtruct |
| 26 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 27 | 1: string string_thing, |
| 28 | 4: byte byte_thing, |
| 29 | 9: i32 i32_thing, |
| 30 | 11: i64 i64_thing |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | struct Xtruct2 |
| 34 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 35 | 1: byte byte_thing, |
| 36 | 2: Xtruct struct_thing, |
| 37 | 3: i32 i32_thing |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | struct Insanity |
| 41 | { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 42 | 1: map<Numberz, UserId> userMap, |
| 43 | 2: list<Xtruct> xtructs |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 44 | } |
| 45 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 46 | exception Xception { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 47 | 1: i32 errorCode, |
| 48 | 2: string message |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 49 | } |
| 50 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 51 | exception Xception2 { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 52 | 1: i32 errorCode, |
| 53 | 2: Xtruct struct_thing |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 54 | } |
Mark Slee | 27ed6ec | 2007-08-16 01:26:31 +0000 | [diff] [blame] | 55 | |
Mark Slee | d3d733a | 2006-09-01 22:19:06 +0000 | [diff] [blame] | 56 | struct EmptyStruct {} |
| 57 | |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 58 | struct OneField { |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 59 | 1: EmptyStruct field |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 60 | } |
Marc Slemko | 5b126d6 | 2006-08-11 23:03:42 +0000 | [diff] [blame] | 61 | |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 62 | service ThriftTest |
| 63 | { |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 64 | void testVoid(), |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 65 | string testString(1: string thing), |
| 66 | byte testByte(1: byte thing), |
| 67 | i32 testI32(1: i32 thing), |
| 68 | i64 testI64(1: i64 thing), |
| 69 | double testDouble(1: double thing), |
| 70 | Xtruct testStruct(1: Xtruct thing), |
| 71 | Xtruct2 testNest(1: Xtruct2 thing), |
| 72 | map<i32,i32> testMap(1: map<i32,i32> thing), |
| 73 | set<i32> testSet(1: set<i32> thing), |
| 74 | list<i32> testList(1: list<i32> thing), |
| 75 | Numberz testEnum(1: Numberz thing), |
| 76 | UserId testTypedef(1: UserId thing), |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 77 | |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 78 | map<i32,map<i32,i32>> testMapMap(1: i32 hello), |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 79 | |
| 80 | /* So you think you've got this all worked, out eh? */ |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 81 | map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 82 | |
| 83 | /* Multiple parameters */ |
Mark Slee | 27ed6ec | 2007-08-16 01:26:31 +0000 | [diff] [blame] | 84 | Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 85 | |
| 86 | /* Exception specifier */ |
| 87 | |
Marc Slemko | bf4fd19 | 2006-08-15 21:29:39 +0000 | [diff] [blame] | 88 | void testException(string arg) throws(Xception err1), |
Marc Slemko | d8b1051 | 2006-08-14 23:30:37 +0000 | [diff] [blame] | 89 | |
| 90 | /* Multiple exceptions specifier */ |
| 91 | |
Mark Slee | a330265 | 2006-10-25 19:03:32 +0000 | [diff] [blame] | 92 | Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2) |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 93 | } |
Mark Slee | dafa3cf | 2006-09-02 23:56:49 +0000 | [diff] [blame] | 94 | |
| 95 | service SecondService |
| 96 | { |
| 97 | void blahBlah() |
| 98 | } |