diff --git a/ChangeLog b/ChangeLog index ee84e66ed1..23574954fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Dec 9 00:07:35 2003 NAKAMURA, Hiroshi + + * 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 * lib/test/unit/autorunner.rb: remove dependency to a particular diff --git a/lib/soap/property.rb b/lib/soap/property.rb index b67ffa8361..d2bae88825 100644 --- a/lib/soap/property.rb +++ b/lib/soap/property.rb @@ -79,7 +79,7 @@ class Property self[generate_new_key] = value 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 def add_hook(name = nil, &hook) if name.nil? @@ -142,6 +142,7 @@ protected end end + # returns: Array of hook def assign(ary, value) key, rest = location_pair(ary) if rest.empty? diff --git a/lib/soap/rpc/standaloneServer.rb b/lib/soap/rpc/standaloneServer.rb index f3f225c7dc..42a566e088 100644 --- a/lib/soap/rpc/standaloneServer.rb +++ b/lib/soap/rpc/standaloneServer.rb @@ -51,6 +51,18 @@ class StandaloneServer < Logger::Application def on_init # define extra methods in derived class. 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) @soaplet.add_rpc_request_servant(klass, namespace, mapping_registry) diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb index d73ade4ac3..c917ddcf9e 100644 --- a/test/soap/calc/test_calc.rb +++ b/test/soap/calc/test_calc.rb @@ -20,7 +20,7 @@ class TestCalc < Test::Unit::TestCase @t = Thread.new { @server.start } - while @server.server.nil? or @server.server.status != :Running + while @server.status != :Running sleep 0.1 unless @t.alive? @t.join @@ -36,7 +36,7 @@ class TestCalc < Test::Unit::TestCase end def teardown - @server.server.shutdown + @server.shutdown @t.kill @t.join @calc.reset_stream diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb index 1f18a5f222..b7fee71526 100644 --- a/test/soap/calc/test_calc2.rb +++ b/test/soap/calc/test_calc2.rb @@ -21,7 +21,7 @@ class TestCalc2 < Test::Unit::TestCase Thread.current.abort_on_exception = true @server.start } - while @server.server.nil? or @server.server.status != :Running + while @server.status != :Running sleep 0.1 unless @t.alive? @t.join @@ -39,7 +39,7 @@ class TestCalc2 < Test::Unit::TestCase end def teardown - @server.server.shutdown + @server.shutdown @t.kill @t.join @var.reset_stream diff --git a/test/soap/helloworld/test_helloworld.rb b/test/soap/helloworld/test_helloworld.rb index 1e9c4a3966..7261e42f19 100644 --- a/test/soap/helloworld/test_helloworld.rb +++ b/test/soap/helloworld/test_helloworld.rb @@ -21,7 +21,7 @@ class TestHelloWorld < Test::Unit::TestCase Thread.current.abort_on_exception = true @server.start } - while @server.server.nil? or @server.server.status != :Running + while @server.status != :Running sleep 0.1 unless @t.alive? @t.join @@ -34,7 +34,7 @@ class TestHelloWorld < Test::Unit::TestCase end def teardown - @server.server.shutdown + @server.shutdown @t.kill @t.join @client.reset_stream diff --git a/test/wsdl/datetime/test_datetime.rb b/test/wsdl/datetime/test_datetime.rb index 5ac3fdc5bc..1a1bc59c65 100644 --- a/test/wsdl/datetime/test_datetime.rb +++ b/test/wsdl/datetime/test_datetime.rb @@ -26,7 +26,7 @@ class TestDatetime < Test::Unit::TestCase Thread.current.abort_on_exception = true @server.start } - while @server.server.nil? or @server.server.status != :Running + while @server.status != :Running sleep 0.1 unless @t.alive? @t.join @@ -48,7 +48,7 @@ class TestDatetime < Test::Unit::TestCase end def teardown_server - @server.server.shutdown + @server.shutdown @t.kill @t.join end diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb index 86452a0b40..5fddb6b22d 100644 --- a/test/wsdl/raa/test_raa.rb +++ b/test/wsdl/raa/test_raa.rb @@ -28,7 +28,7 @@ class TestRAA < Test::Unit::TestCase Thread.current.abort_on_exception = true @server.start } - while @server.server.nil? or @server.server.status != :Running + while @server.status != :Running sleep 0.1 unless @t.alive? @t.join @@ -49,7 +49,7 @@ class TestRAA < Test::Unit::TestCase end def teardown_server - @server.server.shutdown + @server.shutdown @t.kill @t.join end