diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-20 15:37:11 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-20 15:37:11 +0000 |
commit | 4c5f9a0133ea2155739d0931c265de3270ee1c69 (patch) | |
tree | 46e1de4572b9522f746270d901f0e3cefeda1bff /test | |
parent | f507a38e284c6cdbd0ad906d9e4bcf1fb5436f45 (diff) | |
download | ruby-4c5f9a0133ea2155739d0931c265de3270ee1c69.tar.gz ruby-4c5f9a0133ea2155739d0931c265de3270ee1c69.tar.xz ruby-4c5f9a0133ea2155739d0931c265de3270ee1c69.zip |
* test/soap/calc/*, test/soap/helloworld/*: catch the exception from test
server thread and recover.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/soap/calc/test_calc.rb | 5 | ||||
-rw-r--r-- | test/soap/calc/test_calc2.rb | 6 | ||||
-rw-r--r-- | test/soap/calc/test_calc_cgi.rb | 7 | ||||
-rw-r--r-- | test/soap/helloworld/test_helloworld.rb | 6 |
4 files changed, 24 insertions, 0 deletions
diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb index e3304a415..4e50617f0 100644 --- a/test/soap/calc/test_calc.rb +++ b/test/soap/calc/test_calc.rb @@ -22,6 +22,10 @@ class TestCalc < Test::Unit::TestCase } while @server.server.nil? or @server.server.status != :Running sleep 0.1 + unless @t.alive? + @t.join + raise + end end @calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService') @calc.add_method('add', 'lhs', 'rhs') @@ -33,6 +37,7 @@ class TestCalc < Test::Unit::TestCase def teardown @server.server.shutdown @t.kill + @t.join end def test_calc diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb index 25e686b24..4675d0316 100644 --- a/test/soap/calc/test_calc2.rb +++ b/test/soap/calc/test_calc2.rb @@ -18,10 +18,15 @@ class TestCalc2 < Test::Unit::TestCase @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port) @server.level = Logger::Severity::FATAL @t = Thread.new { + Thread.current.abort_on_exception = true @server.start } while @server.server.nil? or @server.server.status != :Running sleep 0.1 + unless @t.alive? + @t.join + raise + end end @var = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService') @var.add_method('set', 'newValue') @@ -35,6 +40,7 @@ class TestCalc2 < Test::Unit::TestCase def teardown @server.server.shutdown @t.kill + @t.join end def test_calc2 diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb index 0ed584928..30cafae44 100644 --- a/test/soap/calc/test_calc_cgi.rb +++ b/test/soap/calc/test_calc_cgi.rb @@ -21,6 +21,7 @@ class TestCalcCGI < Test::Unit::TestCase def setup logger = Logger.new(STDERR) logger.level = Logger::Severity::FATAL + logger.level = Logger::Severity::DEBUG if $DEBUG @server = WEBrick::HTTPServer.new( :BindAddress => "0.0.0.0", :Logger => logger, @@ -31,10 +32,15 @@ class TestCalcCGI < Test::Unit::TestCase :CGIInterpreter => RUBYBIN ) @t = Thread.new { + Thread.current.abort_on_exception = true @server.start } while @server.status != :Running sleep 0.1 + unless @t.alive? + @t.join + raise + end end @calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/server.cgi", 'http://tempuri.org/calcService') @calc.add_method('add', 'lhs', 'rhs') @@ -46,6 +52,7 @@ class TestCalcCGI < Test::Unit::TestCase def teardown @server.shutdown @t.kill + @t.join end def test_calc diff --git a/test/soap/helloworld/test_helloworld.rb b/test/soap/helloworld/test_helloworld.rb index 2819f86b4..bc1937bea 100644 --- a/test/soap/helloworld/test_helloworld.rb +++ b/test/soap/helloworld/test_helloworld.rb @@ -18,10 +18,15 @@ class TestHelloWorld < Test::Unit::TestCase @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port) @server.level = Logger::Severity::UNKNOWN @t = Thread.new { + Thread.current.abort_on_exception = true @server.start } while @server.server.nil? or @server.server.status != :Running sleep 0.1 + unless @t.alive? + @t.join + raise + end end @client = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'urn:hws') @client.add_method("hello_world", "from") @@ -30,6 +35,7 @@ class TestHelloWorld < Test::Unit::TestCase def teardown @server.server.shutdown @t.kill + @t.join end def test_hello_world |