blob: 2a42541c65537f69d0817012d6d8a6c7df119e77 [file] [log] [blame]
Mark Slee89f57162008-01-10 00:53:08 +00001#!/usr/bin/env ruby
2
3$:.push('gen-rb')
4$:.push('../../lib/rb/lib')
5
6require 'ThriftTest'
7
8class 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
73end