* 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
@ -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>
|
Tue Oct 21 00:22:57 2003 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
|
||||||
|
|
||||||
* test/drb/*: import drb/runit.
|
* test/drb/*: import drb/runit.
|
||||||
|
@ -22,6 +22,10 @@ class TestCalc < Test::Unit::TestCase
|
|||||||
}
|
}
|
||||||
while @server.server.nil? or @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
unless @t.alive?
|
||||||
|
@t.join
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService')
|
@calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService')
|
||||||
@calc.add_method('add', 'lhs', 'rhs')
|
@calc.add_method('add', 'lhs', 'rhs')
|
||||||
@ -33,6 +37,7 @@ class TestCalc < Test::Unit::TestCase
|
|||||||
def teardown
|
def teardown
|
||||||
@server.server.shutdown
|
@server.server.shutdown
|
||||||
@t.kill
|
@t.kill
|
||||||
|
@t.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_calc
|
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 = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port)
|
||||||
@server.level = Logger::Severity::FATAL
|
@server.level = Logger::Severity::FATAL
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
|
Thread.current.abort_on_exception = true
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.server.nil? or @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
unless @t.alive?
|
||||||
|
@t.join
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@var = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService')
|
@var = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'http://tempuri.org/calcService')
|
||||||
@var.add_method('set', 'newValue')
|
@var.add_method('set', 'newValue')
|
||||||
@ -35,6 +40,7 @@ class TestCalc2 < Test::Unit::TestCase
|
|||||||
def teardown
|
def teardown
|
||||||
@server.server.shutdown
|
@server.server.shutdown
|
||||||
@t.kill
|
@t.kill
|
||||||
|
@t.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_calc2
|
def test_calc2
|
||||||
|
@ -21,6 +21,7 @@ class TestCalcCGI < Test::Unit::TestCase
|
|||||||
def setup
|
def setup
|
||||||
logger = Logger.new(STDERR)
|
logger = Logger.new(STDERR)
|
||||||
logger.level = Logger::Severity::FATAL
|
logger.level = Logger::Severity::FATAL
|
||||||
|
logger.level = Logger::Severity::DEBUG if $DEBUG
|
||||||
@server = WEBrick::HTTPServer.new(
|
@server = WEBrick::HTTPServer.new(
|
||||||
:BindAddress => "0.0.0.0",
|
:BindAddress => "0.0.0.0",
|
||||||
:Logger => logger,
|
:Logger => logger,
|
||||||
@ -31,10 +32,15 @@ class TestCalcCGI < Test::Unit::TestCase
|
|||||||
:CGIInterpreter => RUBYBIN
|
:CGIInterpreter => RUBYBIN
|
||||||
)
|
)
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
|
Thread.current.abort_on_exception = true
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.status != :Running
|
while @server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
unless @t.alive?
|
||||||
|
@t.join
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/server.cgi", 'http://tempuri.org/calcService')
|
@calc = SOAP::RPC::Driver.new("http://localhost:#{Port}/server.cgi", 'http://tempuri.org/calcService')
|
||||||
@calc.add_method('add', 'lhs', 'rhs')
|
@calc.add_method('add', 'lhs', 'rhs')
|
||||||
@ -46,6 +52,7 @@ class TestCalcCGI < Test::Unit::TestCase
|
|||||||
def teardown
|
def teardown
|
||||||
@server.shutdown
|
@server.shutdown
|
||||||
@t.kill
|
@t.kill
|
||||||
|
@t.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_calc
|
def test_calc
|
||||||
|
@ -18,10 +18,15 @@ class TestHelloWorld < Test::Unit::TestCase
|
|||||||
@server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port)
|
@server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port)
|
||||||
@server.level = Logger::Severity::UNKNOWN
|
@server.level = Logger::Severity::UNKNOWN
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
|
Thread.current.abort_on_exception = true
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.server.nil? or @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
unless @t.alive?
|
||||||
|
@t.join
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@client = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'urn:hws')
|
@client = SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'urn:hws')
|
||||||
@client.add_method("hello_world", "from")
|
@client.add_method("hello_world", "from")
|
||||||
@ -30,6 +35,7 @@ class TestHelloWorld < Test::Unit::TestCase
|
|||||||
def teardown
|
def teardown
|
||||||
@server.server.shutdown
|
@server.server.shutdown
|
||||||
@t.kill
|
@t.kill
|
||||||
|
@t.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_hello_world
|
def test_hello_world
|
||||||
|
Loading…
x
Reference in New Issue
Block a user