1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/soap/rpc/standaloneServer.rb: add 'shutdown' and 'status'

methods as delegates to WEBrick.

        * test/soap/calc/{test_calc.rb,test_calc2.rb},
          test/soap/helloworld/test_helloworld.rb,
          test/wsdl/datetime/test_datetime.rb, test/wsdl/raa/test_raa.rb:
          follow the change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2003-12-08 15:09:49 +00:00
parent e67e930462
commit af2dc00300
8 changed files with 34 additions and 11 deletions

View file

@ -1,3 +1,13 @@
Tue Dec 9 00:07:35 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/soap/rpc/standaloneServer.rb: add 'shutdown' and 'status'
methods as delegates to WEBrick.
* test/soap/calc/{test_calc.rb,test_calc2.rb},
test/soap/helloworld/test_helloworld.rb,
test/wsdl/datetime/test_datetime.rb, test/wsdl/raa/test_raa.rb:
follow the change.
Mon Dec 8 22:48:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> Mon Dec 8 22:48:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/autorunner.rb: remove dependency to a particular * lib/test/unit/autorunner.rb: remove dependency to a particular

View file

@ -79,7 +79,7 @@ class Property
self[generate_new_key] = value self[generate_new_key] = value
end end
# name: a Symbol, String or an Array. nil means hook to the root. # name: a Symbol, String or an Array. nil means hook to the root
# hook: block which will be called with 2 args, name and value # hook: block which will be called with 2 args, name and value
def add_hook(name = nil, &hook) def add_hook(name = nil, &hook)
if name.nil? if name.nil?
@ -142,6 +142,7 @@ protected
end end
end end
# returns: Array of hook
def assign(ary, value) def assign(ary, value)
key, rest = location_pair(ary) key, rest = location_pair(ary)
if rest.empty? if rest.empty?

View file

@ -51,6 +51,18 @@ class StandaloneServer < Logger::Application
def on_init def on_init
# define extra methods in derived class. # define extra methods in derived class.
end end
def status
if @server
@server.status
else
nil
end
end
def shutdown
@server.shutdown
end
def add_rpc_request_servant(klass, namespace = @namespace, mapping_registry = nil) def add_rpc_request_servant(klass, namespace = @namespace, mapping_registry = nil)
@soaplet.add_rpc_request_servant(klass, namespace, mapping_registry) @soaplet.add_rpc_request_servant(klass, namespace, mapping_registry)

View file

@ -20,7 +20,7 @@ class TestCalc < Test::Unit::TestCase
@t = Thread.new { @t = Thread.new {
@server.start @server.start
} }
while @server.server.nil? or @server.server.status != :Running while @server.status != :Running
sleep 0.1 sleep 0.1
unless @t.alive? unless @t.alive?
@t.join @t.join
@ -36,7 +36,7 @@ class TestCalc < Test::Unit::TestCase
end end
def teardown def teardown
@server.server.shutdown @server.shutdown
@t.kill @t.kill
@t.join @t.join
@calc.reset_stream @calc.reset_stream

View file

@ -21,7 +21,7 @@ class TestCalc2 < Test::Unit::TestCase
Thread.current.abort_on_exception = true Thread.current.abort_on_exception = true
@server.start @server.start
} }
while @server.server.nil? or @server.server.status != :Running while @server.status != :Running
sleep 0.1 sleep 0.1
unless @t.alive? unless @t.alive?
@t.join @t.join
@ -39,7 +39,7 @@ class TestCalc2 < Test::Unit::TestCase
end end
def teardown def teardown
@server.server.shutdown @server.shutdown
@t.kill @t.kill
@t.join @t.join
@var.reset_stream @var.reset_stream

View file

@ -21,7 +21,7 @@ class TestHelloWorld < Test::Unit::TestCase
Thread.current.abort_on_exception = true Thread.current.abort_on_exception = true
@server.start @server.start
} }
while @server.server.nil? or @server.server.status != :Running while @server.status != :Running
sleep 0.1 sleep 0.1
unless @t.alive? unless @t.alive?
@t.join @t.join
@ -34,7 +34,7 @@ class TestHelloWorld < Test::Unit::TestCase
end end
def teardown def teardown
@server.server.shutdown @server.shutdown
@t.kill @t.kill
@t.join @t.join
@client.reset_stream @client.reset_stream

View file

@ -26,7 +26,7 @@ class TestDatetime < Test::Unit::TestCase
Thread.current.abort_on_exception = true Thread.current.abort_on_exception = true
@server.start @server.start
} }
while @server.server.nil? or @server.server.status != :Running while @server.status != :Running
sleep 0.1 sleep 0.1
unless @t.alive? unless @t.alive?
@t.join @t.join
@ -48,7 +48,7 @@ class TestDatetime < Test::Unit::TestCase
end end
def teardown_server def teardown_server
@server.server.shutdown @server.shutdown
@t.kill @t.kill
@t.join @t.join
end end

View file

@ -28,7 +28,7 @@ class TestRAA < Test::Unit::TestCase
Thread.current.abort_on_exception = true Thread.current.abort_on_exception = true
@server.start @server.start
} }
while @server.server.nil? or @server.server.status != :Running while @server.status != :Running
sleep 0.1 sleep 0.1
unless @t.alive? unless @t.alive?
@t.join @t.join
@ -49,7 +49,7 @@ class TestRAA < Test::Unit::TestCase
end end
def teardown_server def teardown_server
@server.server.shutdown @server.shutdown
@t.kill @t.kill
@t.join @t.join
end end