test/wsdl/qualified/test_qualified.rb in soap4r-1.5.5.20061022 vs test/wsdl/qualified/test_qualified.rb in soap4r-1.5.6
- old
+ new
@@ -1,10 +1,12 @@
require 'test/unit'
require 'wsdl/soap/wsdl2ruby'
require 'soap/rpc/standaloneServer'
require 'soap/wsdlDriver'
+require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
+
if defined?(HTTPAccess2)
module WSDL
@@ -38,53 +40,49 @@
def teardown
teardown_server
unless $DEBUG
File.unlink(pathname('default.rb'))
+ File.unlink(pathname('defaultMappingRegistry.rb'))
File.unlink(pathname('defaultDriver.rb'))
end
@client.reset_stream if @client
end
def setup_server
@server = Server.new('Test', "urn:lp", '0.0.0.0', Port)
@server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
+ @server_thread = TestUtil.start_server_thread(@server)
end
def setup_clientdef
backupdir = Dir.pwd
begin
Dir.chdir(DIR)
gen = WSDL::SOAP::WSDL2Ruby.new
gen.location = pathname("np.wsdl")
gen.basedir = DIR
gen.logger.level = Logger::FATAL
+ gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '')
gen.opt['classdef'] = nil
+ gen.opt['mapping_registry'] = nil
gen.opt['driver'] = nil
gen.opt['force'] = true
gen.run
- require pathname('default.rb')
+ require 'default.rb'
ensure
+ $".delete('default.rb')
Dir.chdir(backupdir)
end
end
def teardown_server
@server.shutdown
@server_thread.kill
@server_thread.join
end
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
def pathname(filename)
File.join(DIR, filename)
end
LOGIN_REQUEST_QUALIFIED =
@@ -117,16 +115,10 @@
[LOGIN_REQUEST_QUALIFIED, parse_requestxml(str)].join("\n\n"))
end
include ::SOAP
def test_naive
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- require pathname('defaultDriver')
- ensure
- Dir.chdir(backupdir)
- end
+ TestUtil.require(DIR, 'defaultDriver.rb', 'defaultMappingRegistry.rb', 'default.rb')
@client = PnumSoap.new("http://localhost:#{Port}/")
@client.wiredump_dev = str = ''
@client.getPrimeNumbers(GetPrimeNumbers.new(2, 10))
assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str),