mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/soap/rpc/cgistub.rb: make logging severity threshold higher.
* lib/soap/rpc/standaloneServer.rb: defer WEBrick server start to give a change to reset logging severity threshold. * test/soap/calc/test_*, test/soap/helloworld/test_helloworld.rb: run silent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eb4ace3c49
commit
6671baa96b
9 changed files with 33 additions and 14 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Mon Sep 27 15:58:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/soap/rpc/cgistub.rb: make logging severity threshold higher.
|
||||||
|
|
||||||
|
* lib/soap/rpc/standaloneServer.rb: defer WEBrick server start to give
|
||||||
|
a change to reset logging severity threshold.
|
||||||
|
|
||||||
|
* test/soap/calc/test_*, test/soap/helloworld/test_helloworld.rb: run
|
||||||
|
silent.
|
||||||
|
|
||||||
Sat Sep 27 09:44:18 2003 Minero Aoki <aamine@loveruby.net>
|
Sat Sep 27 09:44:18 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* test/fileutils/test_fileutils.rb: clear all errors on Windows.
|
* test/fileutils/test_fileutils.rb: clear all errors on Windows.
|
||||||
|
|
1
MANIFEST
1
MANIFEST
|
@ -626,6 +626,7 @@ test/ruby/test_defined.rb
|
||||||
test/ruby/test_eval.rb
|
test/ruby/test_eval.rb
|
||||||
test/ruby/test_exception.rb
|
test/ruby/test_exception.rb
|
||||||
test/ruby/test_float.rb
|
test/ruby/test_float.rb
|
||||||
|
test/ruby/test_file.rb
|
||||||
test/ruby/test_gc.rb
|
test/ruby/test_gc.rb
|
||||||
test/ruby/test_hash.rb
|
test/ruby/test_hash.rb
|
||||||
test/ruby/test_ifunless.rb
|
test/ruby/test_ifunless.rb
|
||||||
|
|
|
@ -96,7 +96,7 @@ class CGIStub < Logger::Application
|
||||||
def initialize(appname, default_namespace)
|
def initialize(appname, default_namespace)
|
||||||
super(appname)
|
super(appname)
|
||||||
set_log(STDERR)
|
set_log(STDERR)
|
||||||
self.level = INFO
|
self.level = ERROR
|
||||||
@default_namespace = default_namespace
|
@default_namespace = default_namespace
|
||||||
@router = SOAP::RPC::Router.new(appname)
|
@router = SOAP::RPC::Router.new(appname)
|
||||||
@remote_user = ENV['REMOTE_USER'] || 'anonymous'
|
@remote_user = ENV['REMOTE_USER'] || 'anonymous'
|
||||||
|
|
|
@ -50,18 +50,12 @@ class StandaloneServer < Logger::Application
|
||||||
|
|
||||||
def initialize(app_name, namespace, host = "0.0.0.0", port = 8080)
|
def initialize(app_name, namespace, host = "0.0.0.0", port = 8080)
|
||||||
super(app_name)
|
super(app_name)
|
||||||
@logdev = Logger.new(STDERR)
|
|
||||||
@logdev.level = INFO
|
|
||||||
@namespace = namespace
|
@namespace = namespace
|
||||||
@server = WEBrick::HTTPServer.new(
|
@host = host
|
||||||
:BindAddress => host,
|
@port = port
|
||||||
:Logger => logdev,
|
@server = nil
|
||||||
:AccessLog => [[logdev, WEBrick::AccessLog::COMBINED_LOG_FORMAT]],
|
|
||||||
:Port => port
|
|
||||||
)
|
|
||||||
@soaplet = ::SOAP::RPC::SOAPlet.new
|
@soaplet = ::SOAP::RPC::SOAPlet.new
|
||||||
on_init
|
on_init
|
||||||
@server.mount('/', @soaplet)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_init
|
def on_init
|
||||||
|
@ -107,6 +101,13 @@ class StandaloneServer < Logger::Application
|
||||||
private
|
private
|
||||||
|
|
||||||
def run
|
def run
|
||||||
|
@server = WEBrick::HTTPServer.new(
|
||||||
|
:BindAddress => @host,
|
||||||
|
:Logger => @log,
|
||||||
|
:AccessLog => [],
|
||||||
|
:Port => @port
|
||||||
|
)
|
||||||
|
@server.mount('/', @soaplet)
|
||||||
@server.start
|
@server.start
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,10 +14,11 @@ module Calc
|
||||||
class TestCalc < Test::Unit::TestCase
|
class TestCalc < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@server = CalcServer.new(self.class.name, nil, '0.0.0.0', 7000)
|
@server = CalcServer.new(self.class.name, nil, '0.0.0.0', 7000)
|
||||||
|
@server.level = Logger::Severity::FATAL
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
end
|
||||||
@calc = SOAP::RPC::Driver.new('http://localhost:7000/', 'http://tempuri.org/calcService')
|
@calc = SOAP::RPC::Driver.new('http://localhost:7000/', 'http://tempuri.org/calcService')
|
||||||
|
|
|
@ -14,10 +14,11 @@ module Calc
|
||||||
class TestCalc2 < Test::Unit::TestCase
|
class TestCalc2 < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000)
|
@server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000)
|
||||||
|
@server.level = Logger::Severity::FATAL
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
end
|
||||||
@var = SOAP::RPC::Driver.new('http://localhost:7000/', 'http://tempuri.org/calcService')
|
@var = SOAP::RPC::Driver.new('http://localhost:7000/', 'http://tempuri.org/calcService')
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'soap/rpc/driver'
|
require 'soap/rpc/driver'
|
||||||
|
require 'logger'
|
||||||
require 'webrick'
|
require 'webrick'
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,9 +10,13 @@ module Calc
|
||||||
|
|
||||||
class TestCalcCGI < Test::Unit::TestCase
|
class TestCalcCGI < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
|
logger = Logger.new(STDERR)
|
||||||
|
logger.level = Logger::Severity::FATAL
|
||||||
@server = WEBrick::HTTPServer.new(
|
@server = WEBrick::HTTPServer.new(
|
||||||
:BindAddress => "0.0.0.0",
|
:BindAddress => "0.0.0.0",
|
||||||
|
:Logger => logger,
|
||||||
:Port => 8808,
|
:Port => 8808,
|
||||||
|
:AccessLog => [],
|
||||||
:DocumentRoot => File.dirname(File.expand_path(__FILE__)),
|
:DocumentRoot => File.dirname(File.expand_path(__FILE__)),
|
||||||
:CGIPathEnv => ENV['PATH']
|
:CGIPathEnv => ENV['PATH']
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'soap/rpc/standaloneServer'
|
||||||
|
|
||||||
class HelloWorldServer < SOAP::RPC::StandaloneServer
|
class HelloWorldServer < SOAP::RPC::StandaloneServer
|
||||||
def on_init
|
def on_init
|
||||||
@log.level = Logger::Severity::DEBUG
|
|
||||||
add_method(self, 'hello_world', 'from')
|
add_method(self, 'hello_world', 'from')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,11 @@ module HelloWorld
|
||||||
class TestHelloWorld < Test::Unit::TestCase
|
class TestHelloWorld < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000)
|
@server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000)
|
||||||
|
@server.level = Logger::Severity::UNKNOWN
|
||||||
@t = Thread.new {
|
@t = Thread.new {
|
||||||
@server.start
|
@server.start
|
||||||
}
|
}
|
||||||
while @server.server.status != :Running
|
while @server.server.nil? or @server.server.status != :Running
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
end
|
end
|
||||||
@client = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws')
|
@client = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue