mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
89f5716421
Summary: Submitted by Dan Sully, reviewed by Kevin Clark Reviewed By: dreiss Test Plan: New ruby generated code with default vals, and new test scripts git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
74 lines
948 B
Ruby
74 lines
948 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
$:.push('gen-rb')
|
|
$:.push('../../lib/rb/lib')
|
|
|
|
require 'ThriftTest'
|
|
|
|
class TestHandler
|
|
def testVoid
|
|
end
|
|
|
|
def testString(thing)
|
|
return thing
|
|
end
|
|
|
|
def testByte(thing)
|
|
return thing
|
|
end
|
|
|
|
def testI32(thing)
|
|
return thing
|
|
end
|
|
|
|
def testI64(thing)
|
|
return thing
|
|
end
|
|
|
|
def testDouble(thing)
|
|
return thing
|
|
end
|
|
|
|
def testStruct(thing)
|
|
return thing
|
|
end
|
|
|
|
def testMap(thing)
|
|
return thing
|
|
end
|
|
|
|
def testSet(thing)
|
|
return thing
|
|
end
|
|
|
|
def testList(thing)
|
|
return thing
|
|
end
|
|
|
|
def testNest(thing)
|
|
return thing
|
|
end
|
|
|
|
def testInsanity(thing)
|
|
num, uid = thing.userMap.find { true }
|
|
return {uid => {num => thing}}
|
|
end
|
|
|
|
def testMapMap(thing)
|
|
return {thing => {thing => thing}}
|
|
end
|
|
|
|
def testEnum(thing)
|
|
return thing
|
|
end
|
|
|
|
def testTypedef(thing)
|
|
return thing
|
|
end
|
|
|
|
def testException(thing)
|
|
raise Thrift::Test::Xception, 'error'
|
|
end
|
|
|
|
end
|