Merge commit 'remotes/trunk'
[amiethrift.git] / test / rb / TestHandler.rb
blob2a42541c65537f69d0817012d6d8a6c7df119e77
1 #!/usr/bin/env ruby
3 $:.push('gen-rb')
4 $:.push('../../lib/rb/lib')
6 require 'ThriftTest'
8 class TestHandler
9   def testVoid
10   end
12   def testString(thing)
13     return thing
14   end
16   def testByte(thing)
17     return thing
18   end
20   def testI32(thing)
21     return thing
22   end
24   def testI64(thing)
25     return thing
26   end
28   def testDouble(thing)
29     return thing
30   end
32   def testStruct(thing)
33     return thing
34   end
36   def testMap(thing)
37     return thing
38   end
40   def testSet(thing)
41     return thing
42   end
44   def testList(thing)
45     return thing
46   end
48   def testNest(thing)
49     return thing
50   end
52   def testInsanity(thing)
53     num, uid = thing.userMap.find { true }
54     return {uid => {num => thing}}
55   end
57   def testMapMap(thing)
58     return {thing => {thing => thing}}
59   end
61   def testEnum(thing)
62     return thing
63   end
65   def testTypedef(thing)
66     return thing
67   end
69   def testException(thing)
70     raise Thrift::Test::Xception, 'error'
71   end
73 end