diff --git a/test/rb/integration/simple_client.rb b/test/rb/integration/TestClient.rb
old mode 100755
new mode 100644
similarity index 60%
rename from test/rb/integration/simple_client.rb
rename to test/rb/integration/TestClient.rb
index f7516fc..f3450db
--- a/test/rb/integration/simple_client.rb
+++ b/test/rb/integration/TestClient.rb
@@ -23,16 +23,68 @@
 require 'thrift'
 require 'thrift_test'
 
+$protocolType = "binary"
+$host = "localhost"
+$port = 9090
+$transport = "buffered"
+ARGV.each do|a|
+  if a == "--help"
+    puts "Allowed options:"
+    puts "\t -h [ --help ] \t produce help message"
+    puts "\t--host arg (=localhost) \t Host to connect"
+    puts "\t--port arg (=9090) \t Port number to listen"
+    puts "\t--protocol arg (=binary) \t protocol: binary, accel"
+    puts "\t--transport arg (=buffered) transport: buffered, framed, http"
+    exit
+  elsif a.start_with?("--host")
+    $host = a.split("=")[1]
+  elsif a.start_with?("--protocol")
+    $protocolType = a.split("=")[1]
+  elsif a.start_with?("--transport")
+    $transport = a.split("=")[1]
+  elsif a.start_with?("--port")
+    $port = a.split("=")[1].to_i 
+  end
+end
+ARGV=[]
+
 class SimpleClientTest < Test::Unit::TestCase
-  def setup    
+  def setup 
     unless @socket
-      @socket   = Thrift::Socket.new('localhost', 9090)
-      @protocol = Thrift::BinaryProtocol.new(@socket)
+      @socket   = Thrift::Socket.new($host, $port)
+      transportFactory = Thrift::BufferedTransport.new(@socket)
+      if $transport == "buffered"
+        transportFactory = Thrift::BufferedTransport.new(@socket)
+      elsif $transport == ""
+        transportFactory = Thrift::BufferedTransport.new(@socket)
+      elsif $transport == "framed"
+        transportFactory = Thrift::FramedTransport.new(@socket)
+      else
+        raise 'Unknown transport type'
+      end
+
+      if $protocolType == "binary"
+        @protocol = Thrift::BinaryProtocol.new(transportFactory)
+      elsif $protocolType == ""
+        @protocol = Thrift::BinaryProtocol.new(transportFactory)
+      elsif $protocolType == "compact"
+        @protocol = Thrift::CompactProtocol.new(transportFactory)
+      elsif $protocolType == "json"
+        @protocol = Thrift::JsonProtocol.new(transportFactory)
+      elsif $protocolType == "accel"
+        @protocol = Thrift::BinaryProtocolAccelerated.new(transportFactory)
+      else
+        raise 'Unknown protocol type'
+      end
       @client   = Thrift::Test::ThriftTest::Client.new(@protocol)
       @socket.open
     end
   end
   
+  def test_void
+    @client.testVoid()
+  end
+
   def test_string
     assert_equal(@client.testString('string'), 'string')
   end
@@ -84,6 +136,8 @@
 
   def test_typedef
     #UserId  testTypedef(1: UserId thing),
+    assert_equal(@client.testTypedef(309858235082523), 309858235082523)
+    assert_kind_of(Fixnum, @client.testTypedef(309858235082523))
     true
   end
 
@@ -122,7 +176,7 @@
     assert_kind_of(Thrift::Test::Xtruct2, ret)
   end
 
-  def test_insane
+  def test_insanity
     insane = Thrift::Test::Insanity.new({
       'userMap' => { Thrift::Test::Numberz::ONE => 44 },
       'xtructs' => [get_struct,
@@ -157,8 +211,30 @@
 
   def test_exception
     assert_raise Thrift::Test::Xception do
-      @client.testException('foo')
+      @client.testException('Xception')
     end
+#    assert_raise Thrift::TException do
+#      @client.testException('TException')
+#    end
+    assert_equal( @client.testException('test'), "test")
   end
+
+  def test_multi_exception
+    assert_raise Thrift::Test::Xception do
+      @client.testMultiException("Xception", "test 1")
+    end
+    assert_raise Thrift::Test::Xception2 do
+      @client.testMultiException("Xception2", "test 2")
+    end
+    assert_equal( @client.testMultiException("Success", "test 3").string_thing, "test 3")
+  end
+
+  def test_oneway
+    time1 = Time.now.to_f
+    @client.testOneway(3)
+    time2 = Time.now.to_f
+    assert_equal((time2-time1)*1000000<400, true)
+  end
+
 end
 
diff --git a/test/rb/integration/TestServer.rb b/test/rb/integration/TestServer.rb
new file mode 100755
index 0000000..8ae2e20
--- /dev/null
+++ b/test/rb/integration/TestServer.rb
@@ -0,0 +1,129 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+$:.push File.dirname(__FILE__) + '/..'
+
+require 'test_helper'
+require 'thrift'
+require 'thrift_test'
+
+class SimpleHandler
+  [:testVoid, :testString, :testByte, :testI32, :testI64, :testDouble,
+   :testStruct, :testMap, :testSet, :testList, :testNest,
+   :testEnum, :testTypedef, :testMultiException].each do |meth|
+
+    define_method(meth) do |thing|
+      thing
+    end
+
+  end
+
+  def testVoid()
+  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)
+    if thing == "Xception"
+      raise Thrift::Test::Xception, :message => thing
+    elsif thing == "TException"
+      raise Thrift::Test::TException, :message => thing
+    else
+      return arg1
+    end
+  end
+
+  def testMultiException(arg0, arg1)
+    if arg0 == "Xception2"
+      raise Thrift::Test::Xception2, :message => 'This is an Xception2'
+    elsif arg0 == "Xception"
+      raise Thrift::Test::Xception, :message => 'This is an Xception'
+    else
+      return arg1
+    end
+  end
+
+end
+
+protocol = "binary"
+port = 9090
+transport = "buffered"
+@transportFactory = Thrift::BufferedTransportFactory.new
+@protocolFactory = Thrift::BinaryProtocolFactory.new
+ARGV.each do|a|
+  if a == "--help"
+    puts "Allowed options:"
+    puts "\t -h [ --help ] \t produce help message"
+    puts "\t--port arg (=9090) \t Port number to listen"
+    puts "\t--protocol arg (=binary) \t protocol: binary, accel"
+    puts "\t--transport arg (=buffered) transport: buffered, framed, http"
+    exit
+  elsif a.start_with?("--protocol")
+    protocol = a.split("=")[1]
+  elsif a.start_with?("--transport")
+    transport = a.split("=")[1]
+  elsif a.start_with?("--port")
+    port = a.split("=")[1].to_i 
+  end
+end
+
+if protocol == "binary"
+  @protocolFactory = Thrift::BinaryProtocolFactory.new
+elsif protocol == ""
+  @protocolFactory = Thrift::BinaryProtocolFactory.new
+elsif protocol == "compact"
+  @protocolFactory = Thrift::CompactProtocolFactory.new
+elsif protocol == "json"
+  @protocolFactory = Thrift::JsonProtocolFactory.new
+elsif protocol == "accel"
+  @protocolFactory = Thrift::BinaryProtocolAcceleratedFactory.new
+else
+  raise 'Unknown protocol type'
+end
+
+if transport == "buffered"
+  @transportFactory = Thrift::BufferedTransportFactory.new
+elsif transport == ""
+  @transportFactory = Thrift::BufferedTransportFactory.new
+elsif transport == "framed"
+  @transportFactory = Thrift::FramedTransportFactory.new
+else
+  raise 'Unknown transport type'
+end
+
+@handler   = SimpleHandler.new
+@processor = Thrift::Test::ThriftTest::Processor.new(@handler)
+@transport = Thrift::ServerSocket.new(port)
+@server    = Thrift::ThreadedServer.new(@processor, @transport, @transportFactory, @protocolFactory)
+@server.serve
diff --git a/test/rb/integration/accelerated_buffered_client.rb b/test/rb/integration/accelerated_buffered_client.rb
deleted file mode 100755
index f2403c5..0000000
--- a/test/rb/integration/accelerated_buffered_client.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$:.push File.dirname(__FILE__) + '/..'
-
-require 'test_helper'
-require 'thrift'
-require 'thrift_test'
-
-class AcceleratedBufferedClientTest < Test::Unit::TestCase
-  def setup
-    unless @socket
-      @socket   = Thrift::Socket.new('localhost', 9090)
-      @protocol = Thrift::BinaryProtocolAccelerated.new(Thrift::BufferedTransport.new(@socket))
-      @client   = Thrift::Test::ThriftTest::Client.new(@protocol)
-      @socket.open
-    end
-  end
-  
-  def test_string
-    assert_equal(@client.testString('string'), 'string')
-  end
-
-  def test_byte
-    val = 8
-    assert_equal(@client.testByte(val), val)
-    assert_equal(@client.testByte(-val), -val)
-  end
-
-  def test_i32
-    val = 32
-    assert_equal(@client.testI32(val), val)
-    assert_equal(@client.testI32(-val), -val)
-  end
-
-  def test_i64
-    val = 64
-    assert_equal(@client.testI64(val), val)
-    assert_equal(@client.testI64(-val), -val)
-  end
-
-  def test_double
-    val = 3.14
-    assert_equal(@client.testDouble(val), val)
-    assert_equal(@client.testDouble(-val), -val)
-    assert_kind_of(Float, @client.testDouble(val))
-  end
-
-  def test_map
-    val = {1 => 1, 2 => 2, 3 => 3}
-    assert_equal(@client.testMap(val), val)
-    assert_kind_of(Hash, @client.testMap(val))
-  end
-
-  def test_list
-    val = [1,2,3,4,5]
-    assert_equal(@client.testList(val), val)
-    assert_kind_of(Array, @client.testList(val))
-  end
-
-  def test_enum
-    val = Thrift::Test::Numberz::SIX
-    ret = @client.testEnum(val)
-
-    assert_equal(ret, 6)
-    assert_kind_of(Fixnum, ret)
-  end
-
-  def test_typedef
-    #UserId  testTypedef(1: UserId thing),
-    true
-  end
-
-  def test_set
-    val = Set.new([1,2,3])
-    assert_equal(@client.testSet(val), val)
-    assert_kind_of(Set, @client.testSet(val))
-  end
-
-  def get_struct
-    Thrift::Test::Xtruct.new({'string_thing' => 'hi!', 'i32_thing' => 4 })
-  end
-
-  def test_struct
-    ret = @client.testStruct(get_struct)
-
-    assert_nil(ret.byte_thing, nil)
-    assert_nil(ret.i64_thing, nil)
-    assert_equal(ret.string_thing, 'hi!')
-    assert_equal(ret.i32_thing, 4)
-    assert_kind_of(Thrift::Test::Xtruct, ret)
-  end
-
-  def test_nest
-    struct2 = Thrift::Test::Xtruct2.new({'struct_thing' => get_struct, 'i32_thing' => 10})
-
-    ret = @client.testNest(struct2)
-
-    assert_nil(ret.struct_thing.byte_thing, nil)
-    assert_nil(ret.struct_thing.i64_thing, nil)
-    assert_equal(ret.struct_thing.string_thing, 'hi!')
-    assert_equal(ret.struct_thing.i32_thing, 4)
-    assert_equal(ret.i32_thing, 10)
-
-    assert_kind_of(Thrift::Test::Xtruct, ret.struct_thing)
-    assert_kind_of(Thrift::Test::Xtruct2, ret)
-  end
-
-  def test_insane
-    insane = Thrift::Test::Insanity.new({
-      'userMap' => { Thrift::Test::Numberz::ONE => 44 },
-      'xtructs' => [get_struct,
-        Thrift::Test::Xtruct.new({
-          'string_thing' => 'hi again',
-          'i32_thing' => 12
-        })
-      ]
-    })
-
-    ret = @client.testInsanity(insane)
-
-    assert_not_nil(ret[44])
-    assert_not_nil(ret[44][1])
-
-    struct = ret[44][1]
-
-    assert_equal(struct.userMap[Thrift::Test::Numberz::ONE], 44)
-    assert_equal(struct.xtructs[1].string_thing, 'hi again')
-    assert_equal(struct.xtructs[1].i32_thing, 12)
-
-    assert_kind_of(Hash, struct.userMap)
-    assert_kind_of(Array, struct.xtructs)
-    assert_kind_of(Thrift::Test::Insanity, struct)
-  end
-
-  def test_map_map
-    ret = @client.testMapMap(4)
-    assert_kind_of(Hash, ret)
-    assert_equal(ret, { 4 => { 4 => 4}})
-  end
-
-  def test_exception
-    assert_raise Thrift::Test::Xception do
-      @client.testException('foo')
-    end
-  end
-end
-
diff --git a/test/rb/integration/accelerated_buffered_server.rb b/test/rb/integration/accelerated_buffered_server.rb
deleted file mode 100755
index af5e601..0000000
--- a/test/rb/integration/accelerated_buffered_server.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$:.push File.dirname(__FILE__) + '/..'
-
-require 'test_helper'
-require 'thrift'
-require 'thrift_test'
-
-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, Thrift::BufferedTransportFactory.new, Thrift::BinaryProtocolAcceleratedFactory.new)
-
-@server.serve
diff --git a/test/rb/integration/buffered_client.rb b/test/rb/integration/buffered_client.rb
deleted file mode 100755
index 16f6d4e..0000000
--- a/test/rb/integration/buffered_client.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$:.push File.dirname(__FILE__) + '/..'
-
-require 'test_helper'
-require 'thrift'
-require 'thrift_test'
-
-class BufferedClientTest < Test::Unit::TestCase
-  def setup
-    unless @socket
-      @socket   = Thrift::Socket.new('localhost', 9090)
-      @protocol = Thrift::BinaryProtocol.new(Thrift::BufferedTransport.new(@socket))
-      @client   = Thrift::Test::ThriftTest::Client.new(@protocol)
-      @socket.open
-    end
-  end
-  
-  def test_string
-    assert_equal(@client.testString('string'), 'string')
-  end
-
-  def test_byte
-    val = 8
-    assert_equal(@client.testByte(val), val)
-    assert_equal(@client.testByte(-val), -val)
-  end
-
-  def test_i32
-    val = 32
-    assert_equal(@client.testI32(val), val)
-    assert_equal(@client.testI32(-val), -val)
-  end
-
-  def test_i64
-    val = 64
-    assert_equal(@client.testI64(val), val)
-    assert_equal(@client.testI64(-val), -val)
-  end
-
-  def test_double
-    val = 3.14
-    assert_equal(@client.testDouble(val), val)
-    assert_equal(@client.testDouble(-val), -val)
-    assert_kind_of(Float, @client.testDouble(val))
-  end
-
-  def test_map
-    val = {1 => 1, 2 => 2, 3 => 3}
-    assert_equal(@client.testMap(val), val)
-    assert_kind_of(Hash, @client.testMap(val))
-  end
-
-  def test_list
-    val = [1,2,3,4,5]
-    assert_equal(@client.testList(val), val)
-    assert_kind_of(Array, @client.testList(val))
-  end
-
-  def test_enum
-    val = Thrift::Test::Numberz::SIX
-    ret = @client.testEnum(val)
-
-    assert_equal(ret, 6)
-    assert_kind_of(Fixnum, ret)
-  end
-
-  def test_typedef
-    #UserId  testTypedef(1: UserId thing),
-    true
-  end
-
-  def test_set
-    val = Set.new([1,2,3])
-    assert_equal(@client.testSet(val), val)
-    assert_kind_of(Set, @client.testSet(val))
-  end
-
-  def get_struct
-    Thrift::Test::Xtruct.new({'string_thing' => 'hi!', 'i32_thing' => 4 })
-  end
-
-  def test_struct
-    ret = @client.testStruct(get_struct)
-
-    assert_nil(ret.byte_thing, nil)
-    assert_nil(ret.i64_thing, nil)
-    assert_equal(ret.string_thing, 'hi!')
-    assert_equal(ret.i32_thing, 4)
-    assert_kind_of(Thrift::Test::Xtruct, ret)
-  end
-
-  def test_nest
-    struct2 = Thrift::Test::Xtruct2.new({'struct_thing' => get_struct, 'i32_thing' => 10})
-
-    ret = @client.testNest(struct2)
-
-    assert_nil(ret.struct_thing.byte_thing, nil)
-    assert_nil(ret.struct_thing.i64_thing, nil)
-    assert_equal(ret.struct_thing.string_thing, 'hi!')
-    assert_equal(ret.struct_thing.i32_thing, 4)
-    assert_equal(ret.i32_thing, 10)
-
-    assert_kind_of(Thrift::Test::Xtruct, ret.struct_thing)
-    assert_kind_of(Thrift::Test::Xtruct2, ret)
-  end
-
-  def test_insane
-    insane = Thrift::Test::Insanity.new({
-      'userMap' => { Thrift::Test::Numberz::ONE => 44 },
-      'xtructs' => [get_struct,
-        Thrift::Test::Xtruct.new({
-          'string_thing' => 'hi again',
-          'i32_thing' => 12
-        })
-      ]
-    })
-
-    ret = @client.testInsanity(insane)
-
-    assert_not_nil(ret[44])
-    assert_not_nil(ret[44][1])
-
-    struct = ret[44][1]
-
-    assert_equal(struct.userMap[Thrift::Test::Numberz::ONE], 44)
-    assert_equal(struct.xtructs[1].string_thing, 'hi again')
-    assert_equal(struct.xtructs[1].i32_thing, 12)
-
-    assert_kind_of(Hash, struct.userMap)
-    assert_kind_of(Array, struct.xtructs)
-    assert_kind_of(Thrift::Test::Insanity, struct)
-  end
-
-  def test_map_map
-    ret = @client.testMapMap(4)
-    assert_kind_of(Hash, ret)
-    assert_equal(ret, { 4 => { 4 => 4}})
-  end
-
-  def test_exception
-    assert_raise Thrift::Test::Xception do
-      @client.testException('foo')
-    end
-  end
-end
-
diff --git a/test/rb/integration/simple_server.rb b/test/rb/integration/simple_server.rb
deleted file mode 100755
index e543b70..0000000
--- a/test/rb/integration/simple_server.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$:.push File.dirname(__FILE__) + '/..'
-
-require 'test_helper'
-require 'thrift'
-require 'thrift_test'
-
-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
diff --git a/test/rb/integration/test_simple_handler.rb b/test/rb/integration/test_simple_handler.rb
deleted file mode 100755
index c056139..0000000
--- a/test/rb/integration/test_simple_handler.rb
+++ /dev/null
@@ -1,212 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$:.push File.dirname(__FILE__) + '/..'
-
-require 'test_helper'
-require 'thrift'
-require 'thrift_test'
-
-class TestHandler
-  [: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
-class TestThrift < Test::Unit::TestCase
-
-  @@INIT = nil
-
-  def setup
-    if @@INIT.nil?
-      # Initialize the server
-      @handler   = TestHandler.new()
-      @processor = Thrift::Test::ThriftTest::Processor.new(@handler)
-      @transport = Thrift::ServerSocket.new(9090)
-      @server    = Thrift::ThreadedServer.new(@processor, @transport)
-
-      @thread    = Thread.new { @server.serve }
-
-      # And the Client
-      @socket   = Thrift::Socket.new('localhost', 9090)
-      @protocol = Thrift::BinaryProtocol.new(@socket)
-      @client   = Thrift::Test::ThriftTest::Client.new(@protocol)
-      @socket.open
-    end
-  end
-
-  def test_string
-    assert_equal(@client.testString('string'), 'string')
-  end
-
-  def test_byte
-    val = 8
-    assert_equal(@client.testByte(val), val)
-    assert_equal(@client.testByte(-val), -val)
-  end
-
-  def test_i32
-    val = 32
-    assert_equal(@client.testI32(val), val)
-    assert_equal(@client.testI32(-val), -val)
-  end
-
-  def test_i64
-    val = 64
-    assert_equal(@client.testI64(val), val)
-    assert_equal(@client.testI64(-val), -val)
-  end
-
-  def test_double
-    val = 3.14
-    assert_equal(@client.testDouble(val), val)
-    assert_equal(@client.testDouble(-val), -val)
-    assert_kind_of(Float, @client.testDouble(val))
-  end
-
-  def test_map
-    val = {1 => 1, 2 => 2, 3 => 3}
-    assert_equal(@client.testMap(val), val)
-    assert_kind_of(Hash, @client.testMap(val))
-  end
-
-  def test_list
-    val = [1,2,3,4,5]
-    assert_equal(@client.testList(val), val)
-    assert_kind_of(Array, @client.testList(val))
-  end
-
-  def test_enum
-    val = Thrift::Test::Numberz::SIX
-    ret = @client.testEnum(val)
-
-    assert_equal(ret, 6)
-    assert_kind_of(Fixnum, ret)
-  end
-
-  def test_typedef
-    #UserId  testTypedef(1: UserId thing),
-    true
-  end
-
-  def test_set
-    val = Set.new([1, 2, 3])
-    assert_equal(val, @client.testSet(val))
-    assert_kind_of(Set, @client.testSet(val))
-  end
-
-  def get_struct
-    Thrift::Test::Xtruct.new({'string_thing' => 'hi!', 'i32_thing' => 4 })
-  end
-
-  def test_struct
-    ret = @client.testStruct(get_struct)
-
-    assert_nil(ret.byte_thing, nil)
-    assert_nil(ret.i64_thing, nil)
-    assert_equal(ret.string_thing, 'hi!')
-    assert_equal(ret.i32_thing, 4)
-    assert_kind_of(Thrift::Test::Xtruct, ret)
-  end
-
-  def test_nest
-    struct2 = Thrift::Test::Xtruct2.new({'struct_thing' => get_struct, 'i32_thing' => 10})
-
-    ret = @client.testNest(struct2)
-
-    assert_nil(ret.struct_thing.byte_thing, nil)
-    assert_nil(ret.struct_thing.i64_thing, nil)
-    assert_equal(ret.struct_thing.string_thing, 'hi!')
-    assert_equal(ret.struct_thing.i32_thing, 4)
-    assert_equal(ret.i32_thing, 10)
-
-    assert_kind_of(Thrift::Test::Xtruct, ret.struct_thing)
-    assert_kind_of(Thrift::Test::Xtruct2, ret)
-  end
-
-  def test_insane
-    insane = Thrift::Test::Insanity.new({
-      'userMap' => { Thrift::Test::Numberz::ONE => 44 },
-      'xtructs' => [get_struct,
-        Thrift::Test::Xtruct.new({
-          'string_thing' => 'hi again',
-          'i32_thing' => 12
-        })
-      ]
-    })
-
-    ret = @client.testInsanity(insane)
-
-    assert_not_nil(ret[44])
-    assert_not_nil(ret[44][1])
-
-    struct = ret[44][1]
-
-    assert_equal(struct.userMap[Thrift::Test::Numberz::ONE], 44)
-    assert_equal(struct.xtructs[1].string_thing, 'hi again')
-    assert_equal(struct.xtructs[1].i32_thing, 12)
-
-    assert_kind_of(Hash, struct.userMap)
-    assert_kind_of(Array, struct.xtructs)
-    assert_kind_of(Thrift::Test::Insanity, struct)
-  end
-
-  def test_map_map
-    ret = @client.testMapMap(4)
-    assert_kind_of(Hash, ret)
-    assert_equal(ret, { 4 => { 4 => 4}})
-  end
-
-  def test_exception
-    assert_raise Thrift::Test::Xception do
-      @client.testException('foo')
-    end
-  end
-
-  def teardown
-  end
-
-end
