Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 1 | #!/usr/bin/env ruby |
| 2 | |
| 3 | $:.push('gen-rb') |
| 4 | $:.push('../../lib/rb/lib') |
| 5 | |
| 6 | require 'ThriftTest' |
| 7 | |
| 8 | class TestHandler |
| 9 | def testVoid |
| 10 | end |
| 11 | |
| 12 | def testString(thing) |
| 13 | return thing |
| 14 | end |
| 15 | |
| 16 | def testByte(thing) |
| 17 | return thing |
| 18 | end |
| 19 | |
| 20 | def testI32(thing) |
| 21 | return thing |
| 22 | end |
| 23 | |
| 24 | def testI64(thing) |
| 25 | return thing |
| 26 | end |
| 27 | |
| 28 | def testDouble(thing) |
| 29 | return thing |
| 30 | end |
| 31 | |
| 32 | def testStruct(thing) |
| 33 | return thing |
| 34 | end |
| 35 | |
| 36 | def testMap(thing) |
| 37 | return thing |
| 38 | end |
| 39 | |
| 40 | def testSet(thing) |
| 41 | return thing |
| 42 | end |
| 43 | |
| 44 | def testList(thing) |
| 45 | return thing |
| 46 | end |
| 47 | |
| 48 | def testNest(thing) |
| 49 | return thing |
| 50 | end |
| 51 | |
| 52 | def testInsanity(thing) |
| 53 | num, uid = thing.userMap.find { true } |
| 54 | return {uid => {num => thing}} |
| 55 | end |
| 56 | |
| 57 | def testMapMap(thing) |
| 58 | return {thing => {thing => thing}} |
| 59 | end |
| 60 | |
| 61 | def testEnum(thing) |
| 62 | return thing |
| 63 | end |
| 64 | |
| 65 | def testTypedef(thing) |
| 66 | return thing |
| 67 | end |
| 68 | |
| 69 | def testException(thing) |
| 70 | raise Thrift::Test::Xception, 'error' |
| 71 | end |
| 72 | |
| 73 | end |