mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/soap/calc/*, test/soap/helloworld/*: catch the exception from test
server thread and recover. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bc867112ec
commit
208ff30c07
5 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Oct 21 00:35:02 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
* test/soap/calc/*, test/soap/helloworld/*: catch the exception from
|
||||
test server thread and recover.
|
||||
|
||||
Tue Oct 21 00:22:57 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
|
||||
|
||||
* test/drb/*: import drb/runit.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue