Ruby test server code

Reviewed By: tbr-doug


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664991 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/rb/TestClient.rb b/test/rb/TestClient.rb
index 80d2f7b..beb5af1 100755
--- a/test/rb/TestClient.rb
+++ b/test/rb/TestClient.rb
@@ -1,7 +1,7 @@
 #!/usr/bin/ruby
 
 $:.push('gen-rb')
-$:.push('../../lib/ruby/lib')
+$:.push('../../lib/rb/lib')
 
 require 'thrift/transport/tsocket'
 require 'thrift/protocol/tbinaryprotocol'
diff --git a/test/rb/TestServer.rb b/test/rb/TestServer.rb
new file mode 100755
index 0000000..62b73f7
--- /dev/null
+++ b/test/rb/TestServer.rb
@@ -0,0 +1,69 @@
+#!/usr/bin/ruby
+
+$:.push('gen-rb')
+$:.push('../../lib/rb/lib')
+
+require 'thrift/transport/tsocket'
+require 'thrift/protocol/tbinaryprotocol'
+require 'thrift/server/tserver'
+require 'ThriftTest'
+
+class TestHandler
+  include ThriftTest::Iface
+  
+  def testVoid()
+    print "testVoid()\n"
+  end
+
+  def testString(thing)
+    print "testString(#{thing})\n"
+    return thing
+  end
+
+  def testByte(thing)
+    print "testByte(#{thing})\n"
+    return thing
+  end
+
+  def testI32(thing)
+    print "testI32(#{thing})\n"
+    return thing
+  end
+
+  def testI64(thing)
+    print "testI64(#{thing})\n"
+    return thing
+  end
+
+  def testDouble(thing)
+    print "testDouble(#{thing})\n"
+    return thing
+  end
+
+  def testStruct(thing)
+    print "testStruct(#{thing})\n"
+    return thing
+  end
+
+  def testMap(thing)
+    print "testMap(#{thing})\n"
+    return thing
+  end
+    
+  def testSet(thing)
+    print "testSet(#{thing})\n"
+    return thing
+  end
+
+  def testList(thing)
+    print "testList(#{thing})\n"
+    return thing
+  end
+
+end
+
+handler = TestHandler.new()
+processor = ThriftTest::Processor.new(handler)
+transport = TServerSocket.new(9090)
+server = TSimpleServer.new(processor, transport)
+server.serve()