diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-07 07:38:25 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-07 07:38:25 +0000 |
commit | 9ff1e787f915539b1980654e3d3d2013ff5c81d2 (patch) | |
tree | 8d0fc9ca5b4dbfa9885dc56862292d55091bcaac /ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb | |
parent | 441546edcfbb1b346c87b69c5f578d1a0e522e06 (diff) |
wrong commit; sorryv1_8_6_269
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb')
-rw-r--r-- | ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb b/ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb deleted file mode 100644 index 77f642fe1b..0000000000 --- a/ruby_1_8_6/test/wsdl/document/test_nosoapaction.rb +++ /dev/null @@ -1,109 +0,0 @@ -require 'test/unit' -require 'wsdl/parser' -require 'wsdl/soap/wsdl2ruby' -require 'soap/rpc/standaloneServer' -require 'soap/wsdlDriver' -require 'soap/rpc/driver' - - -module WSDL; module Document - - -class TestNoSOAPAction < Test::Unit::TestCase - class Server < ::SOAP::RPC::StandaloneServer - Namespace = 'http://xmlsoap.org/Ping' - - def on_init - add_document_method( - self, - Namespace + '/ping', - 'ping_with_soapaction', - XSD::QName.new(Namespace, 'Ping'), - XSD::QName.new(Namespace, 'PingResponse') - ) - - add_document_method( - self, - nil, - 'ping', - XSD::QName.new(Namespace, 'Ping'), - XSD::QName.new(Namespace, 'PingResponse') - ) - - # When no SOAPAction given, latter method(ping) is called. - end - - def ping(arg) - arg.text = 'ping' - arg - end - - def ping_with_soapaction(arg) - arg.text = 'ping_with_soapaction' - arg - end - end - - DIR = File.dirname(File.expand_path(__FILE__)) - - Port = 17171 - - def setup - setup_server - @client = nil - end - - def teardown - teardown_server - @client.reset_stream if @client - end - - def setup_server - @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) - @server.level = Logger::Severity::ERROR - @server_thread = start_server_thread(@server) - 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 test_with_soapaction - wsdl = File.join(DIR, 'ping_nosoapaction.wsdl') - @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver - @client.endpoint_url = "http://localhost:#{Port}/" - @client.wiredump_dev = STDOUT if $DEBUG - rv = @client.ping(:scenario => 'scenario', :origin => 'origin', - :text => 'text') - assert_equal('scenario', rv.scenario) - assert_equal('origin', rv.origin) - assert_equal('ping', rv.text) - end - - def test_without_soapaction - @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", - Server::Namespace) - @client.add_document_method('ping', Server::Namespace + '/ping', - XSD::QName.new(Server::Namespace, 'Ping'), - XSD::QName.new(Server::Namespace, 'PingResponse')) - @client.wiredump_dev = STDOUT if $DEBUG - rv = @client.ping(:scenario => 'scenario', :origin => 'origin', - :text => 'text') - assert_equal('scenario', rv.scenario) - assert_equal('origin', rv.origin) - assert_equal('ping_with_soapaction', rv.text) - end -end - - -end; end |