Merge branch 'fastbinary'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/rb/integration/simple_server.rb b/test/rb/integration/simple_server.rb
new file mode 100644
index 0000000..6b029ba
--- /dev/null
+++ b/test/rb/integration/simple_server.rb
@@ -0,0 +1,46 @@
+$:.push File.dirname(__FILE__) + '/../gen-rb'
+$:.push File.join(File.dirname(__FILE__), '../../../lib/rb/lib')
+
+require 'thrift'
+require 'thrift/protocol/binaryprotocol'
+require 'ThriftTest'
+
+class SimpleHandler
+ [:testString, :testByte, :testI32, :testI64, :testDouble,
+ :testStruct, :testMap, :testSet, :testList, :testNest,
+ :testEnum, :testTypedef].each do |meth|
+
+ define_method(meth) do |thing|
+ thing
+ end
+
+ 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, :message => 'error'
+ end
+end
+
+@handler = SimpleHandler.new
+@processor = Thrift::Test::ThriftTest::Processor.new(@handler)
+@transport = Thrift::ServerSocket.new(9090)
+@server = Thrift::ThreadedServer.new(@processor, @transport)
+
+@server.serve