THRIFT-3373: cross test cleanup
Client: build, node, c_glib, cpp, hs, py, rb
Patch: Nobuaki Sukegawa
Github Pull Request:
This closes #641
commit 338f1a502961a4f63b0bd4b3dae4099062d6d17f
Author: Nobuaki Sukegawa <nsukeg@gmail.com>
Date: 2015-10-09T17:25:18Z
THRIFT-3373 Various fixes for cross test servers and clients
diff --git a/test/rb/integration/TestClient.rb b/test/rb/integration/TestClient.rb
index fb339c4..d04f475 100755
--- a/test/rb/integration/TestClient.rb
+++ b/test/rb/integration/TestClient.rb
@@ -45,13 +45,13 @@
elsif a.start_with?("--transport")
$transport = a.split("=")[1]
elsif a.start_with?("--port")
- $port = a.split("=")[1].to_i
+ $port = a.split("=")[1].to_i
end
end
ARGV=[]
class SimpleClientTest < Test::Unit::TestCase
- def setup
+ def setup
unless @socket
@socket = Thrift::Socket.new($host, $port)
if $transport == "buffered"
@@ -77,7 +77,11 @@
@socket.open
end
end
-
+
+ def teardown
+ @socket.close
+ end
+
def test_void
p 'test_void'
@client.testVoid()
@@ -129,7 +133,7 @@
ret = @client.testBinary(val.pack('C*'))
assert_equal(val, ret.bytes.to_a)
end
-
+
def test_map
p 'test_map'
val = {1 => 1, 2 => 2, 3 => 3}