summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 08:14:57 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 08:14:57 +0000
commit889c7de09d40ebdd3620cf9c0ad74d750b512221 (patch)
tree6c16302232c2b655cfd5ea406a9ac202814a8b35 /test
parentefed292c4311c8c182a32ac2afe70c6969815b2d (diff)
Mon Dec 24 17:06:37 2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* {lib,test}/{soap,wsdl,xsd}: removed soap4r along to the discussion at ruby-core and ruby-dev. see [ruby-core:12535], [ruby-dev:31969]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/soap/asp.net/hello.wsdl96
-rw-r--r--test/soap/asp.net/test_aspdotnet.rb111
-rw-r--r--test/soap/calc/calc.rb17
-rw-r--r--test/soap/calc/calc2.rb29
-rw-r--r--test/soap/calc/server.cgi13
-rw-r--r--test/soap/calc/server.rb17
-rw-r--r--test/soap/calc/server2.rb20
-rw-r--r--test/soap/calc/test_calc.rb49
-rw-r--r--test/soap/calc/test_calc2.rb53
-rw-r--r--test/soap/calc/test_calc_cgi.rb69
-rw-r--r--test/soap/fault/test_customfault.rb58
-rw-r--r--test/soap/header/server.cgi119
-rw-r--r--test/soap/header/test_authheader.rb240
-rw-r--r--test/soap/header/test_authheader_cgi.rb121
-rw-r--r--test/soap/header/test_simplehandler.rb116
-rw-r--r--test/soap/helloworld/hw_s.rb16
-rw-r--r--test/soap/helloworld/test_helloworld.rb40
-rw-r--r--test/soap/marshal/test_digraph.rb56
-rw-r--r--test/soap/marshal/test_marshal.rb26
-rw-r--r--test/soap/marshal/test_struct.rb47
-rw-r--r--test/soap/ssl/README1
-rw-r--r--test/soap/ssl/ca.cert23
-rw-r--r--test/soap/ssl/client.cert19
-rw-r--r--test/soap/ssl/client.key15
-rw-r--r--test/soap/ssl/server.cert19
-rw-r--r--test/soap/ssl/server.key15
-rw-r--r--test/soap/ssl/sslsvr.rb57
-rw-r--r--test/soap/ssl/subca.cert21
-rw-r--r--test/soap/ssl/test_ssl.rb204
-rw-r--r--test/soap/struct/test_struct.rb77
-rw-r--r--test/soap/swa/test_file.rb73
-rw-r--r--test/soap/test_basetype.rb970
-rw-r--r--test/soap/test_envelopenamespace.rb92
-rw-r--r--test/soap/test_httpconfigloader.rb39
-rw-r--r--test/soap/test_mapping.rb59
-rw-r--r--test/soap/test_no_indent.rb86
-rw-r--r--test/soap/test_property.rb424
-rw-r--r--test/soap/test_soapelement.rb122
-rw-r--r--test/soap/test_streamhandler.rb209
-rw-r--r--test/soap/test_styleuse.rb333
-rw-r--r--test/soap/wsdlDriver/README.txt2
-rw-r--r--test/soap/wsdlDriver/calc.wsdl126
-rw-r--r--test/soap/wsdlDriver/document.wsdl54
-rw-r--r--test/soap/wsdlDriver/echo_version.rb20
-rw-r--r--test/soap/wsdlDriver/simpletype.wsdl63
-rw-r--r--test/soap/wsdlDriver/test_calc.rb88
-rw-r--r--test/soap/wsdlDriver/test_document.rb78
-rw-r--r--test/soap/wsdlDriver/test_simpletype.rb87
-rw-r--r--test/wsdl/any/any.wsdl50
-rw-r--r--test/wsdl/any/expectedDriver.rb54
-rw-r--r--test/wsdl/any/expectedEcho.rb14
-rw-r--r--test/wsdl/any/expectedService.rb52
-rw-r--r--test/wsdl/any/test_any.rb46
-rw-r--r--test/wsdl/axisArray/axisArray.wsdl60
-rw-r--r--test/wsdl/axisArray/itemList.rb27
-rw-r--r--test/wsdl/axisArray/test_axisarray.rb69
-rw-r--r--test/wsdl/datetime/DatetimeService.rb44
-rw-r--r--test/wsdl/datetime/datetime.rb0
-rw-r--r--test/wsdl/datetime/datetime.wsdl45
-rw-r--r--test/wsdl/datetime/datetimeServant.rb21
-rw-r--r--test/wsdl/datetime/test_datetime.rb82
-rw-r--r--test/wsdl/document/document.wsdl74
-rw-r--r--test/wsdl/document/number.wsdl54
-rw-r--r--test/wsdl/document/ping_nosoapaction.wsdl66
-rw-r--r--test/wsdl/document/test_nosoapaction.rb109
-rw-r--r--test/wsdl/document/test_number.rb99
-rw-r--r--test/wsdl/document/test_rpc.rb177
-rw-r--r--test/wsdl/emptycomplextype.wsdl31
-rw-r--r--test/wsdl/map/map.wsdl92
-rw-r--r--test/wsdl/map/map.xml43
-rw-r--r--test/wsdl/map/test_map.rb99
-rw-r--r--test/wsdl/marshal/person.wsdl21
-rw-r--r--test/wsdl/marshal/person_org.rb22
-rw-r--r--test/wsdl/marshal/test_wsdlmarshal.rb80
-rw-r--r--test/wsdl/multiplefault.wsdl68
-rw-r--r--test/wsdl/qualified/lp.wsdl47
-rw-r--r--test/wsdl/qualified/lp.xsd26
-rw-r--r--test/wsdl/qualified/np.wsdl50
-rw-r--r--test/wsdl/qualified/test_qualified.rb154
-rw-r--r--test/wsdl/qualified/test_unqualified.rb143
-rw-r--r--test/wsdl/raa/RAA.rb243
-rw-r--r--test/wsdl/raa/RAAServant.rb99
-rw-r--r--test/wsdl/raa/RAAService.rb100
-rw-r--r--test/wsdl/raa/README.txt8
-rw-r--r--test/wsdl/raa/raa.wsdl264
-rw-r--r--test/wsdl/raa/server.rb103
-rw-r--r--test/wsdl/raa/test_raa.rb71
-rw-r--r--test/wsdl/ref/expectedProduct.rb90
-rw-r--r--test/wsdl/ref/product.wsdl86
-rw-r--r--test/wsdl/ref/test_ref.rb42
-rw-r--r--test/wsdl/rpc/rpc.wsdl75
-rw-r--r--test/wsdl/rpc/test-rpc-lit.wsdl364
-rw-r--r--test/wsdl/rpc/test-rpc-lit12.wsdl455
-rw-r--r--test/wsdl/rpc/test_rpc.rb118
-rw-r--r--test/wsdl/rpc/test_rpc_lit.rb399
-rw-r--r--test/wsdl/simpletype/rpc/expectedClient.rb34
-rw-r--r--test/wsdl/simpletype/rpc/expectedDriver.rb62
-rw-r--r--test/wsdl/simpletype/rpc/expectedEchoVersion.rb23
-rw-r--r--test/wsdl/simpletype/rpc/expectedServant.rb32
-rw-r--r--test/wsdl/simpletype/rpc/expectedService.rb60
-rw-r--r--test/wsdl/simpletype/rpc/rpc.wsdl80
-rw-r--r--test/wsdl/simpletype/rpc/test_rpc.rb50
-rw-r--r--test/wsdl/simpletype/simpletype.wsdl95
-rw-r--r--test/wsdl/simpletype/test_simpletype.rb99
-rw-r--r--test/wsdl/soap/soapbodyparts.wsdl103
-rw-r--r--test/wsdl/soap/test_soapbodyparts.rb79
-rw-r--r--test/wsdl/test_emptycomplextype.rb21
-rw-r--r--test/wsdl/test_fault.rb51
-rw-r--r--test/wsdl/test_multiplefault.rb39
-rw-r--r--test/xsd/codegen/test_classdef.rb214
-rw-r--r--test/xsd/noencoding.xml4
-rw-r--r--test/xsd/test_noencoding.rb32
-rw-r--r--test/xsd/test_xmlschemaparser.rb22
-rw-r--r--test/xsd/test_xsd.rb1511
-rw-r--r--test/xsd/xmlschema.xml12
115 files changed, 0 insertions, 11848 deletions
diff --git a/test/soap/asp.net/hello.wsdl b/test/soap/asp.net/hello.wsdl
deleted file mode 100644
index b94129c152..0000000000
--- a/test/soap/asp.net/hello.wsdl
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
-xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-xmlns:s="http://www.w3.org/2001/XMLSchema"
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-xmlns:tns="http://localhost/WebService/"
-xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
-xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
-targetNamespace="http://localhost/WebService/"
-xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
-targetNamespace="http://localhost/WebService/">
- <s:element name="HelloWorld">
- <s:complexType />
- </s:element>
- <s:element name="HelloWorldResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1"
-name="HelloWorldResult" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="SayHello">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="name"
-type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="SayHelloResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1"
-name="SayHelloResult" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- </s:schema>
- </wsdl:types>
- <wsdl:message name="HelloWorldSoapIn">
- <wsdl:part name="parameters" element="tns:HelloWorld" />
- </wsdl:message>
- <wsdl:message name="HelloWorldSoapOut">
- <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
- </wsdl:message>
- <wsdl:message name="SayHelloSoapIn">
- <wsdl:part name="parameters" element="tns:SayHello" />
- </wsdl:message>
- <wsdl:message name="SayHelloSoapOut">
- <wsdl:part name="parameters" element="tns:SayHelloResponse" />
- </wsdl:message>
- <wsdl:portType name="Service1Soap">
- <wsdl:operation name="HelloWorld">
- <wsdl:input message="tns:HelloWorldSoapIn" />
- <wsdl:output message="tns:HelloWorldSoapOut" />
- </wsdl:operation>
- <wsdl:operation name="SayHello">
- <wsdl:input message="tns:SayHelloSoapIn" />
- <wsdl:output message="tns:SayHelloSoapOut" />
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
-style="document" />
- <wsdl:operation name="HelloWorld">
- <soap:operation
-soapAction="http://localhost/WebService/HelloWorld" style="document" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name="SayHello">
- <soap:operation soapAction="http://localhost/WebService/SayHello"
-style="document" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="Service1">
- <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
- <soap:address
-location="http://localhost/WebService/Service1.asmx" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/test/soap/asp.net/test_aspdotnet.rb b/test/soap/asp.net/test_aspdotnet.rb
deleted file mode 100644
index 7d5f3fd288..0000000000
--- a/test/soap/asp.net/test_aspdotnet.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/rpc/driver'
-
-
-module SOAP; module ASPDotNet
-
-
-class TestASPDotNet < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = "http://localhost/WebService/"
-
- def on_init
- add_document_method(
- self,
- Namespace + 'SayHello',
- 'sayHello',
- XSD::QName.new(Namespace, 'SayHello'),
- XSD::QName.new(Namespace, 'SayHelloResponse')
- )
- end
-
- def sayHello(arg)
- name = arg['name']
- "Hello #{name}"
- end
- end
-
- Port = 17171
- Endpoint = "http://localhost:#{Port}/"
-
- 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_document_method
- @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
- @client.wiredump_dev = STDOUT if $DEBUG
- @client.add_document_method('sayHello', Server::Namespace + 'SayHello',
- XSD::QName.new(Server::Namespace, 'SayHello'),
- XSD::QName.new(Server::Namespace, 'SayHelloResponse'))
- assert_equal("Hello Mike", @client.sayHello(:name => "Mike"))
- end
-
- def test_aspdotnethandler
- @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
- @client.wiredump_dev = STDOUT if $DEBUG
- @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name')
- @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
- assert_equal("Hello Mike", @client.sayHello("Mike"))
- end
-
- if defined?(HTTPAccess2)
-
- # qualified!
- REQUEST_ASPDOTNETHANDLER =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:sayHello xmlns:n1="http://localhost/WebService/">
- <n1:name>Mike</n1:name>
- </n1:sayHello>
- </env:Body>
-</env:Envelope>]
-
- def test_aspdotnethandler_envelope
- @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace)
- @client.wiredump_dev = str = ''
- @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name')
- @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
- assert_equal("Hello Mike", @client.sayHello("Mike"))
- assert_equal(REQUEST_ASPDOTNETHANDLER, parse_requestxml(str))
- end
-
- def parse_requestxml(str)
- str.split(/\r?\n\r?\n/)[3]
- end
-
- end
-end
-
-
-end; end
diff --git a/test/soap/calc/calc.rb b/test/soap/calc/calc.rb
deleted file mode 100644
index 6bc78803b3..0000000000
--- a/test/soap/calc/calc.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module CalcService
- def self.add(lhs, rhs)
- lhs + rhs
- end
-
- def self.sub(lhs, rhs)
- lhs - rhs
- end
-
- def self.multi(lhs, rhs)
- lhs * rhs
- end
-
- def self.div(lhs, rhs)
- lhs / rhs
- end
-end
diff --git a/test/soap/calc/calc2.rb b/test/soap/calc/calc2.rb
deleted file mode 100644
index 69495730e7..0000000000
--- a/test/soap/calc/calc2.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class CalcService2
- def initialize(value = 0)
- @value = value
- end
-
- def set_value(value)
- @value = value
- end
-
- def get_value
- @value
- end
-
- def +(rhs)
- @value + rhs
- end
-
- def -(rhs)
- @value - rhs
- end
-
- def *(rhs)
- @value * rhs
- end
-
- def /(rhs)
- @value / rhs
- end
-end
diff --git a/test/soap/calc/server.cgi b/test/soap/calc/server.cgi
deleted file mode 100644
index 1eb0d1d864..0000000000
--- a/test/soap/calc/server.cgi
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'soap/rpc/cgistub'
-
-class CalcServer < SOAP::RPC::CGIStub
- def initialize(*arg)
- super
-
- require 'calc'
- servant = CalcService
- add_servant(servant, 'http://tempuri.org/calcService')
- end
-end
-
-status = CalcServer.new('CalcServer', nil).start
diff --git a/test/soap/calc/server.rb b/test/soap/calc/server.rb
deleted file mode 100644
index a93774d909..0000000000
--- a/test/soap/calc/server.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'soap/rpc/standaloneServer'
-require 'calc'
-
-class CalcServer < SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super
-
- servant = CalcService
- add_servant(servant, 'http://tempuri.org/calcService')
- end
-end
-
-if $0 == __FILE__
- status = CalcServer.new('CalcServer', nil, '0.0.0.0', 17171).start
-end
diff --git a/test/soap/calc/server2.rb b/test/soap/calc/server2.rb
deleted file mode 100644
index 01c6d75289..0000000000
--- a/test/soap/calc/server2.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'soap/rpc/standaloneServer'
-require 'calc2'
-
-class CalcServer2 < SOAP::RPC::StandaloneServer
- def on_init
- servant = CalcService2.new
- add_method(servant, 'set_value', 'newValue')
- add_method(servant, 'get_value')
- add_method_as(servant, '+', 'add', 'lhs')
- add_method_as(servant, '-', 'sub', 'lhs')
- add_method_as(servant, '*', 'multi', 'lhs')
- add_method_as(servant, '/', 'div', 'lhs')
- end
-end
-
-if $0 == __FILE__
- status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 17171).start
-end
diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb
deleted file mode 100644
index 88738716a6..0000000000
--- a/test/soap/calc/test_calc.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'server.rb'
-
-
-module SOAP
-module Calc
-
-
-class TestCalc < Test::Unit::TestCase
- Port = 17171
-
- def setup
- @server = CalcServer.new(self.class.name, nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
- @calc.add_method('add', 'lhs', 'rhs')
- @calc.add_method('sub', 'lhs', 'rhs')
- @calc.add_method('multi', 'lhs', 'rhs')
- @calc.add_method('div', 'lhs', 'rhs')
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @calc.reset_stream
- end
-
- def test_calc
- assert_equal(3, @calc.add(1, 2))
- assert_equal(-1.1, @calc.sub(1.1, 2.2))
- assert_equal(2.42, @calc.multi(1.1, 2.2))
- assert_equal(2, @calc.div(5, 2))
- assert_equal(2.5, @calc.div(5.0, 2))
- assert_equal(1.0/0.0, @calc.div(1.1, 0))
- assert_raises(ZeroDivisionError) do
- @calc.div(1, 0)
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb
deleted file mode 100644
index f334b29bdb..0000000000
--- a/test/soap/calc/test_calc2.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'server2.rb'
-
-
-module SOAP
-module Calc
-
-
-class TestCalc2 < Test::Unit::TestCase
- Port = 17171
-
- def setup
- @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @var = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
- @var.wiredump_dev = STDERR if $DEBUG
- @var.add_method('set_value', 'newValue')
- @var.add_method('get_value')
- @var.add_method_as('+', 'add', 'rhs')
- @var.add_method_as('-', 'sub', 'rhs')
- @var.add_method_as('*', 'multi', 'rhs')
- @var.add_method_as('/', 'div', 'rhs')
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @var.reset_stream
- end
-
- def test_calc2
- assert_equal(1, @var.set_value(1))
- assert_equal(3, @var + 2)
- assert_equal(-1.2, @var - 2.2)
- assert_equal(2.2, @var * 2.2)
- assert_equal(0, @var / 2)
- assert_equal(0.5, @var / 2.0)
- assert_raises(ZeroDivisionError) do
- @var / 0
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb
deleted file mode 100644
index dc701978c4..0000000000
--- a/test/soap/calc/test_calc_cgi.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'logger'
-require 'webrick'
-require 'rbconfig'
-
-
-module SOAP
-module Calc
-
-
-class TestCalcCGI < Test::Unit::TestCase
- # This test shuld be run after installing ruby.
- RUBYBIN = File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
- RUBYBIN << " -d" if $DEBUG
-
- Port = 17171
-
- def setup
- logger = Logger.new(STDERR)
- logger.level = Logger::Severity::ERROR
- @server = WEBrick::HTTPServer.new(
- :BindAddress => "0.0.0.0",
- :Logger => logger,
- :Port => Port,
- :AccessLog => [],
- :DocumentRoot => File.dirname(File.expand_path(__FILE__)),
- :CGIPathEnv => ENV['PATH'],
- :CGIInterpreter => RUBYBIN
- )
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/server.cgi"
- @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService')
- @calc.wiredump_dev = STDERR if $DEBUG
- @calc.add_method('add', 'lhs', 'rhs')
- @calc.add_method('sub', 'lhs', 'rhs')
- @calc.add_method('multi', 'lhs', 'rhs')
- @calc.add_method('div', 'lhs', 'rhs')
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @calc.reset_stream
- end
-
- def test_calc_cgi
- assert_equal(3, @calc.add(1, 2))
- assert_equal(-1.1, @calc.sub(1.1, 2.2))
- assert_equal(2.42, @calc.multi(1.1, 2.2))
- assert_equal(2, @calc.div(5, 2))
- assert_equal(2.5, @calc.div(5.0, 2))
- assert_equal(1.0/0.0, @calc.div(1.1, 0))
- assert_raises(ZeroDivisionError) do
- @calc.div(1, 0)
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/fault/test_customfault.rb b/test/soap/fault/test_customfault.rb
deleted file mode 100644
index 2f7bc2be6e..0000000000
--- a/test/soap/fault/test_customfault.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'soap/rpc/standaloneServer'
-
-
-module SOAP
-module Fault
-
-
-class TestCustomFault < Test::Unit::TestCase
- Port = 17171
-
- class CustomFaultServer < SOAP::RPC::StandaloneServer
- def on_init
- add_method(self, 'fault', 'msg')
- end
-
- def fault(msg)
- SOAPFault.new(SOAPString.new("mycustom"),
- SOAPString.new("error: #{msg}"),
- SOAPString.new(self.class.name))
- end
- end
-
- def setup
- @server = CustomFaultServer.new('customfault', 'urn:customfault', '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @client = SOAP::RPC::Driver.new(@endpoint, 'urn:customfault')
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_method("fault", "msg")
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @client.reset_stream
- end
-
- def test_custom_fault
- begin
- @client.fault("message")
- assert(false, 'exception not raised')
- rescue SOAP::FaultError => e
- assert(true, 'exception raised')
- assert_equal('error: message', e.message)
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/header/server.cgi b/test/soap/header/server.cgi
deleted file mode 100644
index 2a188538d9..0000000000
--- a/test/soap/header/server.cgi
+++ /dev/null
@@ -1,119 +0,0 @@
-require 'pstore'
-require 'soap/rpc/cgistub'
-require 'soap/header/simplehandler'
-
-
-class AuthHeaderPortServer < SOAP::RPC::CGIStub
- PortName = 'http://tempuri.org/authHeaderPort'
- SupportPortName = 'http://tempuri.org/authHeaderSupportPort'
- MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
- SessionDB = File.join(File.expand_path(File.dirname(__FILE__)), 'session.pstoredb')
-
- class AuthHeaderService
- def self.create
- new
- end
-
- def deposit(amt)
- "deposit #{amt} OK"
- end
-
- def withdrawal(amt)
- "withdrawal #{amt} OK"
- end
- end
-
- class AuthHeaderSupportService
- def delete_sessiondb
- File.unlink(SessionDB) if File.file?(SessionDB)
- backup = SessionDB + "~"
- File.unlink(backup) if File.file?(backup)
- end
- end
-
- def initialize(*arg)
- super
- add_rpc_servant(AuthHeaderService.new, PortName)
- add_rpc_servant(AuthHeaderSupportService.new, SupportPortName)
- add_rpc_headerhandler(ServerAuthHeaderHandler.new)
- end
-
- class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler
- Users = {
- 'NaHi' => 'passwd',
- 'HiNa' => 'wspass'
- }
-
- def initialize
- super(MyHeaderName)
- @db = PStore.new(SessionDB)
- @db.transaction do
- @db["root"] = {} unless @db.root?("root")
- end
- @userid = @sessionid = nil
- end
-
- def login(userid, passwd)
- userid and passwd and Users[userid] == passwd
- end
-
- def auth(sessionid)
- in_sessiondb do |root|
- root[sessionid][0]
- end
- end
-
- def create_session(userid)
- in_sessiondb do |root|
- while true
- key = create_sessionkey
- break unless root[key]
- end
- root[key] = [userid]
- key
- end
- end
-
- def destroy_session(sessionkey)
- in_sessiondb do |root|
- root.delete(sessionkey)
- end
- end
-
- def on_simple_outbound
- { "sessionid" => @sessionid }
- end
-
- def on_simple_inbound(my_header, mu)
- succeeded = false
- userid = my_header["userid"]
- passwd = my_header["passwd"]
- if login(userid, passwd)
- succeeded = true
- elsif sessionid = my_header["sessionid"]
- if userid = auth(sessionid)
- destroy_session(sessionid)
- succeeded = true
- end
- end
- raise RuntimeError.new("authentication failed") unless succeeded
- @userid = userid
- @sessionid = create_session(userid)
- end
-
- private
-
- def create_sessionkey
- Time.now.usec.to_s
- end
-
- def in_sessiondb
- @db.transaction do
- yield(@db["root"])
- end
- end
- end
-end
-
-
-status = AuthHeaderPortServer.new('AuthHeaderPortServer', nil).start
diff --git a/test/soap/header/test_authheader.rb b/test/soap/header/test_authheader.rb
deleted file mode 100644
index 47e1e76b82..0000000000
--- a/test/soap/header/test_authheader.rb
+++ /dev/null
@@ -1,240 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'soap/rpc/standaloneServer'
-require 'soap/header/simplehandler'
-
-
-module SOAP
-module Header
-
-
-class TestAuthHeader < Test::Unit::TestCase
- Port = 17171
- PortName = 'http://tempuri.org/authHeaderPort'
- MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
- DummyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "dummy")
-
- class AuthHeaderPortServer < SOAP::RPC::StandaloneServer
- class AuthHeaderService
- def self.create
- new
- end
-
- def deposit(amt)
- "deposit #{amt} OK"
- end
-
- def withdrawal(amt)
- "withdrawal #{amt} OK"
- end
- end
-
- def initialize(*arg)
- super
- add_rpc_servant(AuthHeaderService.new, PortName)
- ServerAuthHeaderHandler.init
- add_request_headerhandler(ServerAuthHeaderHandler)
- end
-
- class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler
- class << self
- def create
- new
- end
-
- def init
- @users = {
- 'NaHi' => 'passwd',
- 'HiNa' => 'wspass'
- }
- @sessions = {}
- end
-
- def login(userid, passwd)
- userid and passwd and @users[userid] == passwd
- end
-
- def auth(sessionid)
- @sessions[sessionid][0]
- end
-
- def create_session(userid)
- while true
- key = create_sessionkey
- break unless @sessions[key]
- end
- @sessions[key] = [userid]
- key
- end
-
- def destroy_session(sessionkey)
- @sessions.delete(sessionkey)
- end
-
- def sessions
- @sessions
- end
-
- private
-
- def create_sessionkey
- Time.now.usec.to_s
- end
- end
-
- def initialize
- super(MyHeaderName)
- @userid = @sessionid = nil
- end
-
- def on_simple_outbound
- { "sessionid" => @sessionid }
- end
-
- def on_simple_inbound(my_header, mu)
- auth = false
- userid = my_header["userid"]
- passwd = my_header["passwd"]
- if self.class.login(userid, passwd)
- auth = true
- elsif sessionid = my_header["sessionid"]
- if userid = self.class.auth(sessionid)
- self.class.destroy_session(sessionid)
- auth = true
- end
- end
- raise RuntimeError.new("authentication failed") unless auth
- @userid = userid
- @sessionid = self.class.create_session(userid)
- end
- end
- end
-
- class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler
- def initialize(userid, passwd, mustunderstand)
- super(MyHeaderName)
- @sessionid = nil
- @userid = userid
- @passwd = passwd
- @mustunderstand = mustunderstand
- end
-
- def on_simple_outbound
- if @sessionid
- { "sessionid" => @sessionid }
- else
- { "userid" => @userid, "passwd" => @passwd }
- end
- end
-
- def on_simple_inbound(my_header, mustunderstand)
- @sessionid = my_header["sessionid"]
- end
-
- def sessionid
- @sessionid
- end
- end
-
- class DummyHeaderHandler < SOAP::Header::SimpleHandler
- def initialize(mustunderstand)
- super(DummyHeaderName)
- @mustunderstand = mustunderstand
- end
-
- def on_simple_outbound
- { XSD::QName.new("foo", "bar") => nil }
- end
-
- def on_simple_inbound(my_header, mustunderstand)
- end
- end
-
- def setup
- @endpoint = "http://localhost:#{Port}/"
- setup_server
- setup_client
- end
-
- def setup_server
- @server = AuthHeaderPortServer.new(self.class.name, nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- @server.start
- }
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@endpoint, PortName)
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_method('deposit', 'amt')
- @client.add_method('withdrawal', 'amt')
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def test_success_no_mu
- h = ClientAuthHeaderHandler.new('NaHi', 'passwd', false)
- @client.headerhandler << h
- do_transaction_check(h)
- end
-
- def test_success_mu
- h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
- @client.headerhandler << h
- do_transaction_check(h)
- end
-
- def test_no_mu
- h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
- @client.headerhandler << h
- @client.headerhandler << DummyHeaderHandler.new(false)
- do_transaction_check(h)
- end
-
- def test_mu
- h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true)
- @client.headerhandler << h
- @client.headerhandler << (h2 = DummyHeaderHandler.new(true))
- assert_raise(SOAP::UnhandledMustUnderstandHeaderError) do
- assert_equal("deposit 150 OK", @client.deposit(150))
- end
- @client.headerhandler.delete(h2)
- @client.headerhandler << (h2 = DummyHeaderHandler.new(false))
- do_transaction_check(h)
- end
-
- def do_transaction_check(h)
- assert_equal("deposit 150 OK", @client.deposit(150))
- serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid]
- assert_equal("NaHi", serversess[0])
- assert_equal("withdrawal 120 OK", @client.withdrawal(120))
- serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid]
- assert_equal("NaHi", serversess[0])
- end
-
- def test_authfailure
- h = ClientAuthHeaderHandler.new('NaHi', 'pa', false)
- @client.headerhandler << h
- assert_raises(RuntimeError) do
- @client.deposit(150)
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/header/test_authheader_cgi.rb b/test/soap/header/test_authheader_cgi.rb
deleted file mode 100644
index 8d41837f58..0000000000
--- a/test/soap/header/test_authheader_cgi.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'soap/rpc/standaloneServer'
-require 'soap/header/simplehandler'
-require 'logger'
-require 'webrick'
-require 'rbconfig'
-
-
-module SOAP
-module Header
-
-
-class TestAuthHeaderCGI < Test::Unit::TestCase
- # This test shuld be run after installing ruby.
- RUBYBIN = File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
- RUBYBIN << " -d" if $DEBUG
-
- Port = 17171
- PortName = 'http://tempuri.org/authHeaderPort'
- SupportPortName = 'http://tempuri.org/authHeaderSupportPort'
- MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth")
-
- class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler
- def initialize(userid, passwd)
- super(MyHeaderName)
- @sessionid = nil
- @userid = userid
- @passwd = passwd
- end
-
- def on_simple_outbound
- if @sessionid
- { "sessionid" => @sessionid }
- else
- { "userid" => @userid, "passwd" => @passwd }
- end
- end
-
- def on_simple_inbound(my_header, mustunderstand)
- @sessionid = my_header["sessionid"]
- end
-
- def sessionid
- @sessionid
- end
- end
-
- def setup
- @endpoint = "http://localhost:#{Port}/"
- setup_server
- setup_client
- end
-
- def setup_server
- @endpoint = "http://localhost:#{Port}/server.cgi"
- logger = Logger.new(STDERR)
- logger.level = Logger::Severity::ERROR
- @server = WEBrick::HTTPServer.new(
- :BindAddress => "0.0.0.0",
- :Logger => logger,
- :Port => Port,
- :AccessLog => [],
- :DocumentRoot => File.dirname(File.expand_path(__FILE__)),
- :CGIPathEnv => ENV['PATH'],
- :CGIInterpreter => RUBYBIN
- )
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@endpoint, PortName)
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_method('deposit', 'amt')
- @client.add_method('withdrawal', 'amt')
- @supportclient = SOAP::RPC::Driver.new(@endpoint, SupportPortName)
- @supportclient.add_method('delete_sessiondb')
- end
-
- def teardown
- @supportclient.delete_sessiondb
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- @supportclient.reset_stream
- end
-
- def test_success
- h = ClientAuthHeaderHandler.new('NaHi', 'passwd')
- @client.headerhandler << h
- assert_equal("deposit 150 OK", @client.deposit(150))
- assert_equal("withdrawal 120 OK", @client.withdrawal(120))
- end
-
- def test_authfailure
- h = ClientAuthHeaderHandler.new('NaHi', 'pa')
- @client.headerhandler << h
- assert_raises(RuntimeError) do
- @client.deposit(150)
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/header/test_simplehandler.rb b/test/soap/header/test_simplehandler.rb
deleted file mode 100644
index 75dbd4a550..0000000000
--- a/test/soap/header/test_simplehandler.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'soap/rpc/standaloneServer'
-require 'soap/header/simplehandler'
-
-
-module SOAP
-module Header
-
-
-class TestSimpleHandler < Test::Unit::TestCase
- Port = 17171
- PortName = 'http://tempuri.org/authHeaderPort'
-
- class PingPortServer < SOAP::RPC::StandaloneServer
- class PingService
- def self.create
- new
- end
-
- def ping
- Thread.current[:pingheader]
- end
- end
-
- def initialize(*arg)
- super
- add_rpc_servant(PingService.new, PortName)
- add_request_headerhandler(PingServerHeaderHandler)
- end
-
- class PingServerHeaderHandler < SOAP::Header::SimpleHandler
- MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader")
-
- def self.create
- new
- end
-
- def initialize()
- super(MyHeaderName)
- end
-
- def on_simple_outbound
- "dummy"
- end
-
- def on_simple_inbound(my_header, mu)
- Thread.current[:pingheader] = my_header
- end
- end
- end
-
- class PingClientHeaderHandler < SOAP::Header::SimpleHandler
- MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader")
-
- def initialize(pingHeader)
- super(MyHeaderName)
- @pingHeader = pingHeader
- @mustunderstand = false
- end
-
- def on_simple_outbound
- @pingHeader # --- note, not a Hash
- end
-
- def on_simple_inbound(my_header, mustunderstand)
- Thread.current[:pingheader] = my_header
- end
- end
-
- def setup
- @endpoint = "http://localhost:#{Port}/"
- setup_server
- setup_client
- end
-
- def setup_server
- @server = PingPortServer.new(self.class.name, nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- @server.start
- }
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@endpoint, PortName)
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_method('ping')
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def test_string
- h = PingClientHeaderHandler.new('pingheader')
- @client.headerhandler << h
- assert_equal("pingheader", @client.ping)
- assert_equal("dummy", Thread.current[:pingheader])
- end
-end
-
-
-end
-end
diff --git a/test/soap/helloworld/hw_s.rb b/test/soap/helloworld/hw_s.rb
deleted file mode 100644
index 1a54adb924..0000000000
--- a/test/soap/helloworld/hw_s.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'soap/rpc/standaloneServer'
-
-class HelloWorldServer < SOAP::RPC::StandaloneServer
- def on_init
- add_method(self, 'hello_world', 'from')
- end
-
- def hello_world(from)
- "Hello World, from #{ from }"
- end
-end
-
-if $0 == __FILE__
- server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 17171)
- server.start
-end
diff --git a/test/soap/helloworld/test_helloworld.rb b/test/soap/helloworld/test_helloworld.rb
deleted file mode 100644
index 40c35b57fb..0000000000
--- a/test/soap/helloworld/test_helloworld.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'hw_s.rb'
-
-
-module SOAP
-module HelloWorld
-
-
-class TestHelloWorld < Test::Unit::TestCase
- Port = 17171
-
- def setup
- @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @client = SOAP::RPC::Driver.new(@endpoint, 'urn:hws')
- @client.add_method("hello_world", "from")
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @client.reset_stream
- end
-
- def test_hello_world
- assert_equal("Hello World, from NaHi", @client.hello_world("NaHi"))
- assert_equal("Hello World, from <&>", @client.hello_world("<&>"))
- end
-end
-
-
-end
-end
diff --git a/test/soap/marshal/test_digraph.rb b/test/soap/marshal/test_digraph.rb
deleted file mode 100644
index d7f30654f8..0000000000
--- a/test/soap/marshal/test_digraph.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'test/unit'
-require 'soap/marshal'
-
-
-module SOAP
-module Marshal
-
-
-class Node; include SOAP::Marshallable
- attr_reader :first, :second, :str
-
- def initialize(*init_next)
- @first = init_next[0]
- @second = init_next[1]
- end
-end
-
-class TestDigraph < Test::Unit::TestCase
- def setup
- @n9 = Node.new
- @n81 = Node.new(@n9)
- @n82 = Node.new(@n9)
- @n7 = Node.new(@n81, @n82)
- @n61 = Node.new(@n7)
- @n62 = Node.new(@n7)
- @n5 = Node.new(@n61, @n62)
- @n41 = Node.new(@n5)
- @n42 = Node.new(@n5)
- @n3 = Node.new(@n41, @n42)
- @n21 = Node.new(@n3)
- @n22 = Node.new(@n3)
- @n1 = Node.new(@n21, @n22)
- end
-
- def test_marshal
- f = File.open("digraph_marshalled_string.soap", "wb")
- SOAP::Marshal.dump(@n1, f)
- f.close
- f = File.open("digraph_marshalled_string.soap")
- str = f.read
- f.close
- newnode = SOAP::Marshal.unmarshal(str)
- assert_equal(newnode.first.first.__id__, newnode.second.first.__id__)
- assert_equal(newnode.first.first.first.first.__id__, newnode.second.first.second.first.__id__)
- end
-
- def teardown
- if File.exist?("digraph_marshalled_string.soap")
- File.unlink("digraph_marshalled_string.soap")
- end
- end
-end
-
-
-end
-end
diff --git a/test/soap/marshal/test_marshal.rb b/test/soap/marshal/test_marshal.rb
deleted file mode 100644
index 5cc30a2b5d..0000000000
--- a/test/soap/marshal/test_marshal.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'test/unit'
-require 'soap/marshal'
-dir = File.join(File.dirname(File.expand_path(__FILE__)), '../../ruby')
-orgpath = $:.dup
-begin
- $:.push(dir)
- require 'marshaltestlib'
-ensure
- $:.replace(orgpath)
-end
-
-module SOAP
-module Marshal
-class TestMarshal < Test::Unit::TestCase
- include MarshalTestLib
-
- def encode(o)
- SOAPMarshal.dump(o)
- end
-
- def decode(s)
- SOAPMarshal.load(s)
- end
-end
-end
-end
diff --git a/test/soap/marshal/test_struct.rb b/test/soap/marshal/test_struct.rb
deleted file mode 100644
index 33975c31b0..0000000000
--- a/test/soap/marshal/test_struct.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'test/unit'
-require 'soap/marshal'
-
-
-module SOAP
-module Marshal
-
-
-Foo1 = ::Struct.new("Foo1", :m)
-Foo2 = ::Struct.new(:m)
-class Foo3
- attr_accessor :m
-end
-
-class TestStruct < Test::Unit::TestCase
- def test_foo1
- org = Foo1.new
- org.m = org
- obj = convert(org)
- assert_equal(Foo1, obj.class)
- assert_equal(obj.m, obj)
- end
-
- def test_foo2
- org = Foo2.new
- org.m = org
- obj = convert(org)
- assert_equal(Foo2, obj.class)
- assert_equal(obj.m, obj)
- end
-
- def test_foo3
- org = Foo3.new
- org.m = org
- obj = convert(org)
- assert_equal(Foo3, obj.class)
- assert_equal(obj.m, obj)
- end
-
- def convert(obj)
- SOAP::Marshal.unmarshal(SOAP::Marshal.marshal(obj))
- end
-end
-
-
-end
-end
diff --git a/test/soap/ssl/README b/test/soap/ssl/README
deleted file mode 100644
index 98ebcf7c23..0000000000
--- a/test/soap/ssl/README
+++ /dev/null
@@ -1 +0,0 @@
-* certificates and keys in this directory is copied from http-access2 test.
diff --git a/test/soap/ssl/ca.cert b/test/soap/ssl/ca.cert
deleted file mode 100644
index bcabbee4ad..0000000000
--- a/test/soap/ssl/ca.cert
+++ /dev/null
@@ -1,23 +0,0 @@
------BEGIN CERTIFICATE-----
-MIID0DCCArigAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
-MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
-DTA0MDEzMDAwNDIzMloXDTM2MDEyMjAwNDIzMlowPDELMAkGA1UEBgwCSlAxEjAQ
-BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQswCQYDVQQDDAJDQTCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbv0x42BTKFEQOE+KJ2XmiSdZpR
-wjzQLAkPLRnLB98tlzs4xo+y4RyY/rd5TT9UzBJTIhP8CJi5GbS1oXEerQXB3P0d
-L5oSSMwGGyuIzgZe5+vZ1kgzQxMEKMMKlzA73rbMd4Jx3u5+jdbP0EDrPYfXSvLY
-bS04n2aX7zrN3x5KdDrNBfwBio2/qeaaj4+9OxnwRvYP3WOvqdW0h329eMfHw0pi
-JI0drIVdsEqClUV4pebT/F+CPUPkEh/weySgo9wANockkYu5ujw2GbLFcO5LXxxm
-dEfcVr3r6t6zOA4bJwL0W/e6LBcrwiG/qPDFErhwtgTLYf6Er67SzLyA66UCAwEA
-AaOB3DCB2TAPBgNVHRMBAf8EBTADAQH/MDEGCWCGSAGG+EIBDQQkFiJSdWJ5L09w
-ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRJ7Xd380KzBV7f
-USKIQ+O/vKbhDzAOBgNVHQ8BAf8EBAMCAQYwZAYDVR0jBF0wW4AUSe13d/NCswVe
-31EiiEPjv7ym4Q+hQKQ+MDwxCzAJBgNVBAYMAkpQMRIwEAYDVQQKDAlKSU4uR1Iu
-SlAxDDAKBgNVBAsMA1JSUjELMAkGA1UEAwwCQ0GCAQAwDQYJKoZIhvcNAQEFBQAD
-ggEBAIu/mfiez5XN5tn2jScgShPgHEFJBR0BTJBZF6xCk0jyqNx/g9HMj2ELCuK+
-r/Y7KFW5c5M3AQ+xWW0ZSc4kvzyTcV7yTVIwj2jZ9ddYMN3nupZFgBK1GB4Y05GY
-MJJFRkSu6d/Ph5ypzBVw2YMT/nsOo5VwMUGLgS7YVjU+u/HNWz80J3oO17mNZllj
-PvORJcnjwlroDnS58KoJ7GDgejv3ESWADvX1OHLE4cRkiQGeLoEU4pxdCxXRqX0U
-PbwIkZN9mXVcrmPHq8MWi4eC/V7hnbZETMHuWhUoiNdOEfsAXr3iP4KjyyRdwc7a
-d/xgcK06UVQRL/HbEYGiQL056mc=
------END CERTIFICATE-----
diff --git a/test/soap/ssl/client.cert b/test/soap/ssl/client.cert
deleted file mode 100644
index ad13c4b735..0000000000
--- a/test/soap/ssl/client.cert
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDKDCCAhCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
-MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
-DTA0MDEzMTAzMTQ1OFoXDTM1MDEyMzAzMTQ1OFowZTELMAkGA1UEBgwCSlAxEjAQ
-BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRAwDgYDVQQDDAdleGFtcGxl
-MSIwIAYJKoZIhvcNAQkBDBNleGFtcGxlQGV4YW1wbGUub3JnMIGfMA0GCSqGSIb3
-DQEBAQUAA4GNADCBiQKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLW
-jTkvsgOwbYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQ
-gNS6ew7/Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2Xf
-ewIDAQABo4GPMIGMMAwGA1UdEwEB/wQCMAAwMQYJYIZIAYb4QgENBCQWIlJ1Ynkv
-T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOFvay0H7lr2
-xUx6waYEV2bVDYQhMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYI
-KwYBBQUHAwQwDQYJKoZIhvcNAQEFBQADggEBABd2dYWqbDIWf5sWFvslezxJv8gI
-w64KCJBuyJAiDuf+oazr3016kMzAlt97KecLZDusGNagPrq02UX7YMoQFsWJBans
-cDtHrkM0al5r6/WGexNMgtYbNTYzt/IwodISGBgZ6dsOuhznwms+IBsTNDAvWeLP
-lt2tOqD8kEmjwMgn0GDRuKjs4EoboA3kMULb1p9akDV9ZESU3eOtpS5/G5J5msLI
-9WXbYBjcjvkLuJH9VsJhb+R58Vl0ViemvAHhPilSl1SPWVunGhv6FcIkdBEi1k9F
-e8BNMmsEjFiANiIRvpdLRbiGBt0KrKTndVfsmoKCvY48oCOvnzxtahFxfs8=
------END CERTIFICATE-----
diff --git a/test/soap/ssl/client.key b/test/soap/ssl/client.key
deleted file mode 100644
index 37bc62f259..0000000000
--- a/test/soap/ssl/client.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICWwIBAAKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLWjTkvsgOw
-bYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQgNS6ew7/
-Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2XfewIDAQAB
-AoGAZcz8llWErtsV3QB9gNb3S/PNADGjqBFjReva8n3jG2k4sZSibpwWTwUaTNtT
-ZQgjSRKRvH1hk9XwffNAvXAQZNNkuj/16gO2oO45nyLj4dO365ujLptWnVIWDHOE
-uN0GeiZO+VzcCisT0WCq4tvtLeH8svrxzA8cbXIEyOK7NiECQQDwo2zPFyKAZ/Cu
-lDJ6zKT+RjfWwW7DgWzirAlTrt4ViMaW+IaDH29TmQpb4V4NuR3Xi+2Xl4oicu6S
-36TW9+/FAkEA3rgfOQJuLlWSnw1RTGwvnC816a/W7iYYY7B+0U4cDbfWl7IoXT4y
-M8nV/HESooviZLqBwzAYSoj3fFKYBKpGPwJAUO8GN5iWWA2dW3ooiDiv/X1sZmRk
-dojfMFWgRW747tEzya8Ivq0h6kH8w+5GjeMG8Gn1nRiwsulo6Ckj7dEx6QJACyui
-7UIQ8qP6GZ4aYMHgVW4Mvy7Bkeo5OO7GPYs0Xv/EdJFL8vlGnVBXOjUVoS9w6Gpu
-TbLg1QQvnX2rADjmEwJANxZO2GUkaWGsEif8aGW0x5g/IdaMGG27pTWk5zqix7P3
-1UDrdo/JOXhptovhRi06EppIxAxYmbh9vd9VN8Itlw==
------END RSA PRIVATE KEY-----
diff --git a/test/soap/ssl/server.cert b/test/soap/ssl/server.cert
deleted file mode 100644
index 998ccc5892..0000000000
--- a/test/soap/ssl/server.cert
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC/zCCAeegAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQGDAJKUDES
-MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxDjAMBgNVBAMMBVN1YkNB
-MB4XDTA0MDEzMTAzMTMxNloXDTMzMDEyMzAzMTMxNlowQzELMAkGA1UEBgwCSlAx
-EjAQBgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRIwEAYDVQQDDAlsb2Nh
-bGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANFJTxWqup3nV9dsJAku
-p+WaXnPNIzcpAA3qMGZDJTJsfa8Du7ZxTP0XJK5mETttBrn711cJxAuP3KjqnW9S
-vtZ9lY2sXJ6Zj62sN5LwG3VVe25dI28yR1EsbHjJ5Zjf9tmggMC6am52dxuHbt5/
-vHo4ngJuKE/U+eeGRivMn6gFAgMBAAGjgYUwgYIwDAYDVR0TAQH/BAIwADAxBglg
-hkgBhvhCAQ0EJBYiUnVieS9PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAd
-BgNVHQ4EFgQUpZIyygD9JxFYHHOTEuWOLbCKfckwCwYDVR0PBAQDAgWgMBMGA1Ud
-JQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBBQUAA4IBAQBwAIj5SaBHaA5X31IP
-CFCJiep96awfp7RANO0cuUj+ZpGoFn9d6FXY0g+Eg5wAkCNIzZU5NHN9xsdOpnUo
-zIBbyTfQEPrge1CMWMvL6uGaoEXytq84VTitF/xBTky4KtTn6+es4/e7jrrzeUXQ
-RC46gkHObmDT91RkOEGjHLyld2328jo3DIN/VTHIryDeVHDWjY5dENwpwdkhhm60
-DR9IrNBbXWEe9emtguNXeN0iu1ux0lG1Hc6pWGQxMlRKNvGh0yZB9u5EVe38tOV0
-jQaoNyL7qzcQoXD3Dmbi1p0iRmg/+HngISsz8K7k7MBNVsSclztwgCzTZOBiVtkM
-rRlQ
------END CERTIFICATE-----
diff --git a/test/soap/ssl/server.key b/test/soap/ssl/server.key
deleted file mode 100644
index 9ba2218a03..0000000000
--- a/test/soap/ssl/server.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDRSU8Vqrqd51fXbCQJLqflml5zzSM3KQAN6jBmQyUybH2vA7u2
-cUz9FySuZhE7bQa5+9dXCcQLj9yo6p1vUr7WfZWNrFyemY+trDeS8Bt1VXtuXSNv
-MkdRLGx4yeWY3/bZoIDAumpudncbh27ef7x6OJ4CbihP1PnnhkYrzJ+oBQIDAQAB
-AoGBAIf4CstW2ltQO7+XYGoex7Hh8s9lTSW/G2vu5Hbr1LTHy3fzAvdq8MvVR12O
-rk9fa+lU9vhzPc0NMB0GIDZ9GcHuhW5hD1Wg9OSCbTOkZDoH3CAFqonjh4Qfwv5W
-IPAFn9KHukdqGXkwEMdErsUaPTy9A1V/aROVEaAY+HJgq/eZAkEA/BP1QMV04WEZ
-Oynzz7/lLizJGGxp2AOvEVtqMoycA/Qk+zdKP8ufE0wbmCE3Qd6GoynavsHb6aGK
-gQobb8zDZwJBANSK6MrXlrZTtEaeZuyOB4mAmRzGzOUVkUyULUjEx2GDT93ujAma
-qm/2d3E+wXAkNSeRpjUmlQXy/2oSqnGvYbMCQQDRM+cYyEcGPUVpWpnj0shrF/QU
-9vSot/X1G775EMTyaw6+BtbyNxVgOIu2J+rqGbn3c+b85XqTXOPL0A2RLYkFAkAm
-syhSDtE9X55aoWsCNZY/vi+i4rvaFoQ/WleogVQAeGVpdo7/DK9t9YWoFBIqth0L
-mGSYFu9ZhvZkvQNV8eYrAkBJ+rOIaLDsmbrgkeDruH+B/9yrm4McDtQ/rgnOGYnH
-LjLpLLOrgUxqpzLWe++EwSLwK2//dHO+SPsQJ4xsyQJy
------END RSA PRIVATE KEY-----
diff --git a/test/soap/ssl/sslsvr.rb b/test/soap/ssl/sslsvr.rb
deleted file mode 100644
index 4f67eb9485..0000000000
--- a/test/soap/ssl/sslsvr.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require 'webrick/https'
-require 'logger'
-require 'rbconfig'
-
-require 'soap/rpc/httpserver'
-
-class HelloWorldServer < SOAP::RPC::HTTPServer
-private
-
- def on_init
- self.level = Logger::Severity::FATAL
- @default_namespace = 'urn:ssltst'
- add_method(self, 'hello_world', 'from')
- end
-
- def hello_world(from)
- "Hello World, from #{ from }"
- end
-end
-
-
-if $0 == __FILE__
- PORT = 17171
- DIR = File.dirname(File.expand_path(__FILE__))
-
- def cert(filename)
- OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f|
- f.read
- })
- end
-
- def key(filename)
- OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f|
- f.read
- })
- end
-
- $server = HelloWorldServer.new(
- :BindAddress => "0.0.0.0",
- :Port => PORT,
- :AccessLog => [],
- :SSLEnable => true,
- :SSLCACertificateFile => File.join(DIR, 'ca.cert'),
- :SSLCertificate => cert('server.cert'),
- :SSLPrivateKey => key('server.key'),
- :SSLVerifyClient => nil, #OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT|OpenSSL::SSL::VERIFY_PEER,
- :SSLClientCA => cert('ca.cert'),
- :SSLCertName => nil
- )
- t = Thread.new {
- Thread.current.abort_on_exception = true
- $server.start
- }
- STDOUT.sync = true
- puts $$
- t.join
-end
diff --git a/test/soap/ssl/subca.cert b/test/soap/ssl/subca.cert
deleted file mode 100644
index 1e471851b8..0000000000
--- a/test/soap/ssl/subca.cert
+++ /dev/null
@@ -1,21 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES
-MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X
-DTA0MDEzMDAwNDMyN1oXDTM1MDEyMjAwNDMyN1owPzELMAkGA1UEBgwCSlAxEjAQ
-BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQ4wDAYDVQQDDAVTdWJDQTCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0Ou7AyRcRXnB/kVHv/6kwe
-ANzgg/DyJfsAUqW90m7Lu1nqyug8gK0RBd77yU0w5HOAMHTVSdpjZK0g2sgx4Mb1
-d/213eL9TTl5MRVEChTvQr8q5DVG/8fxPPE7fMI8eOAzd98/NOAChk+80r4Sx7fC
-kGVEE1bKwY1MrUsUNjOY2d6t3M4HHV3HX1V8ShuKfsHxgCmLzdI8U+5CnQedFgkm
-3e+8tr8IX5RR1wA1Ifw9VadF7OdI/bGMzog/Q8XCLf+WPFjnK7Gcx6JFtzF6Gi4x
-4dp1Xl45JYiVvi9zQ132wu8A1pDHhiNgQviyzbP+UjcB/tsOpzBQF8abYzgEkWEC
-AwEAAaNyMHAwDwYDVR0TAQH/BAUwAwEB/zAxBglghkgBhvhCAQ0EJBYiUnVieS9P
-cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUlCjXWLsReYzH
-LzsxwVnCXmKoB/owCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCJ/OyN
-rT8Cq2Y+G2yA/L1EMRvvxwFBqxavqaqHl/6rwsIBFlB3zbqGA/0oec6MAVnYynq4
-c4AcHTjx3bQ/S4r2sNTZq0DH4SYbQzIobx/YW8PjQUJt8KQdKMcwwi7arHP7A/Ha
-LKu8eIC2nsUBnP4NhkYSGhbmpJK+PFD0FVtD0ZIRlY/wsnaZNjWWcnWF1/FNuQ4H
-ySjIblqVQkPuzebv3Ror6ZnVDukn96Mg7kP4u6zgxOeqlJGRe1M949SS9Vudjl8X
-SF4aZUUB9pQGhsqQJVqaz2OlhGOp9D0q54xko/rekjAIcuDjl1mdX4F2WRrzpUmZ
-uY/bPeOBYiVsOYVe
------END CERTIFICATE-----
diff --git a/test/soap/ssl/test_ssl.rb b/test/soap/ssl/test_ssl.rb
deleted file mode 100644
index 772b77c940..0000000000
--- a/test/soap/ssl/test_ssl.rb
+++ /dev/null
@@ -1,204 +0,0 @@
-require 'test/unit'
-begin
- require 'http-access2'
-rescue LoadError
-end
-require 'soap/rpc/driver'
-
-if defined?(HTTPAccess2) and defined?(OpenSSL)
-
-module SOAP; module SSL
-
-
-class TestSSL < Test::Unit::TestCase
- PORT = 17171
-
- DIR = File.dirname(File.expand_path(__FILE__))
- require 'rbconfig'
- RUBY = File.join(
- RbConfig::CONFIG["bindir"],
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
- )
-
- def setup
- @url = "https://localhost:#{PORT}/hello"
- @serverpid = @client = nil
- @verify_callback_called = false
- setup_server
- setup_client
- end
-
- def teardown
- teardown_client
- teardown_server
- end
-
- def test_options
- cfg = @client.streamhandler.client.ssl_config
- assert_nil(cfg.client_cert)
- assert_nil(cfg.client_key)
- assert_nil(cfg.client_ca)
- assert_equal(OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT, cfg.verify_mode)
- assert_nil(cfg.verify_callback)
- assert_nil(cfg.timeout)
- assert_equal(OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_SSLv2, cfg.options)
- assert_equal("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH", cfg.ciphers)
- assert_instance_of(OpenSSL::X509::Store, cfg.cert_store)
- # dummy call to ensure sslsvr initialization finished.
- assert_raise(OpenSSL::SSL::SSLError) do
- @client.hello_world("ssl client")
- end
- end
-
- def test_verification
- cfg = @client.options
- cfg["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc
- @verify_callback_called = false
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- #
- cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, "client.cert")
- cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, "client.key")
- @verify_callback_called = false
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- #
- cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert")
- @verify_callback_called = false
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- #
- cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert")
- @verify_callback_called = false
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- assert(@verify_callback_called)
- #
- cfg["protocol.http.ssl_config.verify_depth"] = "1"
- @verify_callback_called = false
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- #
- cfg["protocol.http.ssl_config.verify_depth"] = ""
- cfg["protocol.http.ssl_config.cert_store"] = OpenSSL::X509::Store.new
- cfg["protocol.http.ssl_config.verify_mode"] = OpenSSL::SSL::VERIFY_PEER.to_s
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- #
- cfg["protocol.http.ssl_config.verify_mode"] = ""
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- end
-
- def test_property
- testpropertyname = File.join(DIR, 'soapclient.properties')
- File.open(testpropertyname, "w") do |f|
- f <<<<__EOP__
-protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER
-# depth: 1 causes an error (intentional)
-protocol.http.ssl_config.verify_depth = 1
-protocol.http.ssl_config.client_cert = #{File.join(DIR, 'client.cert')}
-protocol.http.ssl_config.client_key = #{File.join(DIR, 'client.key')}
-protocol.http.ssl_config.ca_file = #{File.join(DIR, 'ca.cert')}
-protocol.http.ssl_config.ca_file = #{File.join(DIR, 'subca.cert')}
-protocol.http.ssl_config.ciphers = ALL
-__EOP__
- end
- begin
- @client.loadproperty(testpropertyname)
- @client.options["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc
- @verify_callback_called = false
- # NG with String
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- # NG with Integer
- @client.options["protocol.http.ssl_config.verify_depth"] = 0
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- assert_equal("certificate verify failed", ssle.message)
- assert(@verify_callback_called)
- # OK with empty
- @client.options["protocol.http.ssl_config.verify_depth"] = ""
- @verify_callback_called = false
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- assert(@verify_callback_called)
- # OK with nil
- @client.options["protocol.http.ssl_config.verify_depth"] = nil
- @verify_callback_called = false
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- assert(@verify_callback_called)
- # OK with String
- @client.options["protocol.http.ssl_config.verify_depth"] = "3"
- @verify_callback_called = false
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- assert(@verify_callback_called)
- # OK with Integer
- @client.options["protocol.http.ssl_config.verify_depth"] = 3
- @verify_callback_called = false
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- assert(@verify_callback_called)
- ensure
- File.unlink(testpropertyname)
- end
- end
-
- def test_ciphers
- cfg = @client.options
- cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, 'client.cert')
- cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, 'client.key')
- cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert")
- cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert")
- #cfg.timeout = 123
- cfg["protocol.http.ssl_config.ciphers"] = "!ALL"
- #
- ssle = assert_raise(OpenSSL::SSL::SSLError) {@client.hello_world("ssl client")}
- # depends on OpenSSL version. (?:0.9.8|0.9.7)
- assert_match(/\A(?:SSL_CTX_set_cipher_list:: no cipher match|no ciphers available)\z/, ssle.message)
- #
- cfg["protocol.http.ssl_config.ciphers"] = "ALL"
- assert_equal("Hello World, from ssl client", @client.hello_world("ssl client"))
- end
-
-private
-
- def q(str)
- %Q["#{str}"]
- end
-
- def setup_server
- svrcmd = "#{q(RUBY)} "
- #svrcmd << "-d " if $DEBUG
- svrcmd << File.join(DIR, "sslsvr.rb")
- svrout = IO.popen(svrcmd)
- @serverpid = Integer(svrout.gets.chomp)
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@url, 'urn:ssltst')
- @client.add_method("hello_world", "from")
- end
-
- def teardown_server
- if @serverpid
- Process.kill('KILL', @serverpid)
- Process.waitpid(@serverpid)
- end
- end
-
- def teardown_client
- @client.reset_stream if @client
- end
-
- def verify_callback(ok, cert)
- @verify_callback_called = true
- p ["client", ok, cert] if $DEBUG
- ok
- end
-end
-
-
-end; end
-
-end
diff --git a/test/soap/struct/test_struct.rb b/test/soap/struct/test_struct.rb
deleted file mode 100644
index d92f4bc18a..0000000000
--- a/test/soap/struct/test_struct.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/httpserver'
-require 'soap/rpc/driver'
-
-
-module SOAP; module Struct
-
-
-class TestStruct < Test::Unit::TestCase
- Namespace = "urn:example.com:simpletype-rpc"
- class Server < ::SOAP::RPC::HTTPServer
- @@test_struct = ::Struct.new(:one, :two)
-
- def on_init
- add_method(self, 'a_method')
- end
-
- def a_method
- @@test_struct.new("string", 1)
- end
- end
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new(
- :Port => Port,
- :BindAddress => "0.0.0.0",
- :AccessLog => [],
- :SOAPDefaultNamespace => Namespace
- )
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace)
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_method('a_method')
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_struct
- assert_equal("string", @client.a_method.one)
- assert_equal(1, @client.a_method.two)
- end
-end
-
-
-end; end
diff --git a/test/soap/swa/test_file.rb b/test/soap/swa/test_file.rb
deleted file mode 100644
index 1ec7aa92a7..0000000000
--- a/test/soap/swa/test_file.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'soap/rpc/standaloneServer'
-require 'soap/attachment'
-
-
-module SOAP
-module SWA
-
-
-class TestFile < Test::Unit::TestCase
- Port = 17171
- THIS_FILE = File.expand_path(__FILE__)
-
- class SwAService
- def get_file
- return {
- 'name' => $0,
- 'file' => SOAP::Attachment.new(File.open(THIS_FILE)) # closed when GCed.
- }
- end
-
- def put_file(name, file)
- "File '#{name}' was received ok."
- end
- end
-
- def setup
- @server = SOAP::RPC::StandaloneServer.new('SwAServer',
- 'http://www.acmetron.com/soap', '0.0.0.0', Port)
- @server.add_servant(SwAService.new)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @client = SOAP::RPC::Driver.new(@endpoint, 'http://www.acmetron.com/soap')
- @client.add_method('get_file')
- @client.add_method('put_file', 'name', 'file')
- @client.wiredump_dev = STDERR if $DEBUG
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @client.reset_stream
- end
-
- def test_get_file
- assert_equal(
- File.open(THIS_FILE) { |f| f.read },
- @client.get_file['file'].content
- )
- end
-
- def test_put_file
- assert_equal(
- "File 'foo' was received ok.",
- @client.put_file('foo',
- SOAP::Attachment.new(File.open(THIS_FILE)))
- )
- assert_equal(
- "File 'bar' was received ok.",
- @client.put_file('bar',
- SOAP::Attachment.new(File.open(THIS_FILE) { |f| f.read }))
- )
- end
-end
-
-
-end
-end
diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb
deleted file mode 100644
index 3785873560..0000000000
--- a/test/soap/test_basetype.rb
+++ /dev/null
@@ -1,970 +0,0 @@
-require 'test/unit'
-require 'soap/baseData'
-
-
-module SOAP
-
-
-class TestSOAP < Test::Unit::TestCase
- NegativeZero = (-1.0 / (1.0 / 0.0))
-
- def setup
- # Nothing to do.
- end
-
- def teardown
- # Nothing to do.
- end
-
- def assert_parsed_result(klass, str)
- o = klass.new(str)
- assert_equal(str, o.to_s)
- end
-
- def test_SOAPNil
- o = SOAP::SOAPNil.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::NilLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- o = SOAP::SOAPNil.new(nil)
- assert_equal(true, o.is_nil)
- assert_equal(nil, o.data)
- assert_equal("", o.to_s)
- o = SOAP::SOAPNil.new('var')
- assert_equal(false, o.is_nil)
- assert_equal('var', o.data)
- assert_equal('var', o.to_s)
- end
-
- def test_SOAPString
- o = SOAP::SOAPString.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::StringLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- str = "abc"
- assert_equal(str, SOAP::SOAPString.new(str).data)
- assert_equal(str, SOAP::SOAPString.new(str).to_s)
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPString.new("\0")
- end
- assert_raises(XSD::ValueSpaceError) do
- p SOAP::SOAPString.new("\xC0\xC0").to_s
- end
- end
-
- def test_SOAPBoolean
- o = SOAP::SOAPBoolean.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::BooleanLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- ["true", true],
- ["1", true],
- ["false", false],
- ["0", false],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPBoolean.new(data).data)
- assert_equal(expected.to_s, SOAP::SOAPBoolean.new(data).to_s)
- end
-
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPBoolean.new("nil").to_s
- end
- end
-
- def test_SOAPDecimal
- o = SOAP::SOAPDecimal.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DecimalLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- -9999999999,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |dec|
- assert_equal(dec.to_s, SOAP::SOAPDecimal.new(dec).data)
- end
-
- targets = [
- "0",
- "0.00000001",
- "1000000000",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPDecimal.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["0.0", "0"],
- ["-0.0", "0"],
- ["+0.0", "0"],
- ["0.", "0"],
- [".0", "0"],
- [
- "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
- ],
- [
- ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
- ],
- [
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPDecimal.new(data).to_s)
- end
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPDecimal.new(d)
- end
- end
- end
-
- def test_SOAPFloat
- o = SOAP::SOAPFloat.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::FloatLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 3.14159265358979,
- 12.34e36,
- 1.402e-45,
- -1.402e-45,
- ]
- targets.each do |f|
- assert_equal(f, SOAP::SOAPFloat.new(f).data)
- end
-
- targets = [
- "+3.141592654",
- "+1.234e+37",
- "+1.402e-45",
- "-1.402e-45",
- ]
- targets.each do |f|
- assert_equal(f, SOAP::SOAPFloat.new(f).to_s)
- end
-
- targets = [
- [3, "+3"], # should be 3.0?
- [-2, "-2"], # ditto
- [3.14159265358979, "+3.141592654"],
- [12.34e36, "+1.234e+37"],
- [1.402e-45, "+1.402e-45"],
- [-1.402e-45, "-1.402e-45"],
- ["1.402e", "+1.402"],
- ["12.34E36", "+1.234e+37"],
- ["1.402E-45", "+1.402e-45"],
- ["-1.402E-45", "-1.402e-45"],
- ["1.402E", "+1.402"],
- ]
- targets.each do |f, str|
- assert_equal(str, SOAP::SOAPFloat.new(f).to_s)
- end
-
- assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
- assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
- assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?)
- assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s)
- assert_equal(1, SOAP::SOAPFloat.new(1.0/0.0).data.infinite?)
- assert_equal("-INF", SOAP::SOAPFloat.new(-1.0/0.0).to_s)
- assert_equal(-1, SOAP::SOAPFloat.new(-1.0/0.0).data.infinite?)
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- "5_0",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPFloat.new(d)
- end
- end
- end
-
- def test_SOAPDouble
- o = SOAP::SOAPDouble.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DoubleLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 3.14159265358979,
- 12.34e36,
- 1.402e-45,
- -1.402e-45,
- ]
- targets.each do |f|
- assert_equal(f, SOAP::SOAPDouble.new(f).data)
- end
-
- targets = [
- "+3.14159265358979",
- "+1.234e+37",
- "+1.402e-45",
- "-1.402e-45",
- ]
- targets.each do |f|
- assert_equal(f, SOAP::SOAPDouble.new(f).to_s)
- end
-
- targets = [
- [3, "+3"], # should be 3.0?
- [-2, "-2"], # ditto.
- [3.14159265358979, "+3.14159265358979"],
- [12.34e36, "+1.234e+37"],
- [1.402e-45, "+1.402e-45"],
- [-1.402e-45, "-1.402e-45"],
- ["1.402e", "+1.402"],
- ["12.34E36", "+1.234e+37"],
- ["1.402E-45", "+1.402e-45"],
- ["-1.402E-45", "-1.402e-45"],
- ["1.402E", "+1.402"],
- ]
- targets.each do |f, str|
- assert_equal(str, SOAP::SOAPDouble.new(f).to_s)
- end
-
- assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s)
- assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s)
- assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s)
- assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?)
- assert_equal("INF", SOAP::SOAPDouble.new(1.0/0.0).to_s)
- assert_equal(1, SOAP::SOAPDouble.new(1.0/0.0).data.infinite?)
- assert_equal("-INF", SOAP::SOAPDouble.new(-1.0/0.0).to_s)
- assert_equal(-1, SOAP::SOAPDouble.new(-1.0/0.0).data.infinite?)
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPDouble.new(d)
- end
- end
- end
-
- def test_SOAPDuration
- o = SOAP::SOAPDuration.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DurationLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "P1Y2M3DT4H5M6S",
- "P1234Y5678M9012DT3456H7890M1234.5678S",
- "P0DT3456H7890M1234.5678S",
- "P1234Y5678M9012D",
- "-P1234Y5678M9012DT3456H7890M1234.5678S",
- "P5678M9012DT3456H7890M1234.5678S",
- "-P1234Y9012DT3456H7890M1234.5678S",
- "+P1234Y5678MT3456H7890M1234.5678S",
- "P1234Y5678M9012DT7890M1234.5678S",
- "-P1234Y5678M9012DT3456H1234.5678S",
- "+P1234Y5678M9012DT3456H7890M",
- "P123400000000000Y",
- "-P567800000000000M",
- "+P901200000000000D",
- "P0DT345600000000000H",
- "-P0DT789000000000000M",
- "+P0DT123400000000000.000000000005678S",
- "P1234YT1234.5678S",
- "-P5678MT7890M",
- "+P9012DT3456H",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPDuration, str)
- end
-
- targets = [
- ["P0Y0M0DT0H0M0S",
- "P0D"],
- ["-P0DT0S",
- "-P0D"],
- ["P01234Y5678M9012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y005678M9012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M0009012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT00003456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT3456H000007890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT3456H7890M0000001234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPDuration.new(data).to_s)
- end
- end
-
- def test_SOAPDateTime
- o = SOAP::SOAPDateTime.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DateTimeLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05-18T16:52:20Z",
- "0001-01-01T00:00:00Z",
- "9999-12-31T23:59:59Z",
- "19999-12-31T23:59:59Z",
- "2002-12-31T23:59:59.999Z",
- "2002-12-31T23:59:59.001Z",
- "2002-12-31T23:59:59.99999999999999999999Z",
- "2002-12-31T23:59:59.00000000000000000001Z",
- "2002-12-31T23:59:59+09:00",
- "2002-12-31T23:59:59+00:01",
- "2002-12-31T23:59:59-00:01",
- "2002-12-31T23:59:59-23:59",
- "2002-12-31T23:59:59.00000000000000000001+13:30",
- "2002-12-31T23:59:59.51375Z",
- "2002-12-31T23:59:59.51345+12:34",
- "-2002-05-18T16:52:20Z",
- "-4711-12-31T23:59:59Z",
- "-4713-01-01T12:00:00Z",
- "-19999-12-31T23:59:59Z",
- "-2002-12-31T23:59:59+00:01",
- "-0001-12-31T23:59:59.00000000000000000001+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPDateTime, str)
- end
-
- targets = [
- ["2002-12-31T23:59:59.00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59+00:00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59-00:00",
- "2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59.00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59+00:00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59-00:00",
- "-2002-12-31T23:59:59Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPDateTime.new(data).to_s)
- d = DateTime.parse(data)
- d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
- assert_equal(expected, SOAP::SOAPDateTime.new(d).to_s)
- end
-
- targets = [
- "1-05-18T16:52:20Z",
- "05-18T16:52:20Z",
- "2002-05T16:52:20Z",
- "2002-05-18T16:52Z",
- "",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- SOAP::SOAPDateTime.new(d)
- end
- end
- end
-
- def test_SOAPTime
- o = SOAP::SOAPTime.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::TimeLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "16:52:20Z",
- "00:00:00Z",
- "23:59:59Z",
- "23:59:59.999Z",
- "23:59:59.001Z",
- "23:59:59.99999999999999999999Z",
- "23:59:59.00000000000000000001Z",
- "23:59:59+09:00",
- "23:59:59+00:01",
- "23:59:59-00:01",
- "23:59:59-23:59",
- "23:59:59.00000000000000000001+13:30",
- "23:59:59.51375Z",
- "23:59:59.51375+12:34",
- "23:59:59+00:01",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPTime, str)
- end
-
- targets = [
- ["23:59:59.00",
- "23:59:59Z"],
- ["23:59:59+00:00",
- "23:59:59Z"],
- ["23:59:59-00:00",
- "23:59:59Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPTime.new(data).to_s)
- end
- end
-
- def test_SOAPDate
- o = SOAP::SOAPDate.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DateLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05-18Z",
- "0001-01-01Z",
- "9999-12-31Z",
- "19999-12-31Z",
- "2002-12-31+09:00",
- "2002-12-31+00:01",
- "2002-12-31-00:01",
- "2002-12-31-23:59",
- "2002-12-31+13:30",
- "-2002-05-18Z",
- "-19999-12-31Z",
- "-2002-12-31+00:01",
- "-0001-12-31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPDate, str)
- end
-
- targets = [
- ["2002-12-31",
- "2002-12-31Z"],
- ["2002-12-31+00:00",
- "2002-12-31Z"],
- ["2002-12-31-00:00",
- "2002-12-31Z"],
- ["-2002-12-31",
- "-2002-12-31Z"],
- ["-2002-12-31+00:00",
- "-2002-12-31Z"],
- ["-2002-12-31-00:00",
- "-2002-12-31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPDate.new(data).to_s)
- d = Date.parse(data)
- d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
- assert_equal(expected, SOAP::SOAPDate.new(d).to_s)
- end
- end
-
- def test_SOAPGYearMonth
- o = SOAP::SOAPGYearMonth.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GYearMonthLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05Z",
- "0001-01Z",
- "9999-12Z",
- "19999-12Z",
- "2002-12+09:00",
- "2002-12+00:01",
- "2002-12-00:01",
- "2002-12-23:59",
- "2002-12+13:30",
- "-2002-05Z",
- "-19999-12Z",
- "-2002-12+00:01",
- "-0001-12+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPGYearMonth, str)
- end
-
- targets = [
- ["2002-12",
- "2002-12Z"],
- ["2002-12+00:00",
- "2002-12Z"],
- ["2002-12-00:00",
- "2002-12Z"],
- ["-2002-12",
- "-2002-12Z"],
- ["-2002-12+00:00",
- "-2002-12Z"],
- ["-2002-12-00:00",
- "-2002-12Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPGYearMonth.new(data).to_s)
- end
- end
-
- def test_SOAPGYear
- o = SOAP::SOAPGYear.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GYearLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002Z",
- "0001Z",
- "9999Z",
- "19999Z",
- "2002+09:00",
- "2002+00:01",
- "2002-00:01",
- "2002-23:59",
- "2002+13:30",
- "-2002Z",
- "-19999Z",
- "-2002+00:01",
- "-0001+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPGYear, str)
- end
-
- targets = [
- ["2002",
- "2002Z"],
- ["2002+00:00",
- "2002Z"],
- ["2002-00:00",
- "2002Z"],
- ["-2002",
- "-2002Z"],
- ["-2002+00:00",
- "-2002Z"],
- ["-2002-00:00",
- "-2002Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPGYear.new(data).to_s)
- end
- end
-
- def test_SOAPGMonthDay
- o = SOAP::SOAPGMonthDay.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GMonthDayLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "05-18Z",
- "01-01Z",
- "12-31Z",
- "12-31+09:00",
- "12-31+00:01",
- "12-31-00:01",
- "12-31-23:59",
- "12-31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPGMonthDay, str)
- end
-
- targets = [
- ["12-31",
- "12-31Z"],
- ["12-31+00:00",
- "12-31Z"],
- ["12-31-00:00",
- "12-31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPGMonthDay.new(data).to_s)
- end
- end
-
- def test_SOAPGDay
- o = SOAP::SOAPGDay.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GDayLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "18Z",
- "01Z",
- "31Z",
- "31+09:00",
- "31+00:01",
- "31-00:01",
- "31-23:59",
- "31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPGDay, str)
- end
-
- targets = [
- ["31",
- "31Z"],
- ["31+00:00",
- "31Z"],
- ["31-00:00",
- "31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPGDay.new(data).to_s)
- end
- end
-
- def test_SOAPGMonth
- o = SOAP::SOAPGMonth.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GMonthLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "05Z",
- "01Z",
- "12Z",
- "12+09:00",
- "12+00:01",
- "12-00:01",
- "12-23:59",
- "12+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPGMonth, str)
- end
-
- targets = [
- ["12",
- "12Z"],
- ["12+00:00",
- "12Z"],
- ["12-00:00",
- "12Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPGMonth.new(data).to_s)
- end
- end
-
- def test_SOAPHexBinary
- o = SOAP::SOAPHexBinary.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::HexBinaryLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "abcdef",
- "\xe3\x81\xaa\xe3\x81\xb2",
- "\0",
- "",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPHexBinary.new(str).string)
- assert_equal(str.unpack("H*")[0].tr('a-f', 'A-F'),
- SOAP::SOAPHexBinary.new(str).data)
- o = SOAP::SOAPHexBinary.new
- o.set_encoded(str.unpack("H*")[0].tr('a-f', 'A-F'))
- assert_equal(str, o.string)
- o.set_encoded(str.unpack("H*")[0].tr('A-F', 'a-f'))
- assert_equal(str, o.string)
- end
-
- targets = [
- "0FG7",
- "0fg7",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- o = SOAP::SOAPHexBinary.new
- o.set_encoded(d)
- p o.string
- end
- end
- end
-
- def test_SOAPBase64Binary
- o = SOAP::SOAPBase64.new
- assert_equal(SOAP::EncodingNamespace, o.type.namespace)
- assert_equal(SOAP::Base64Literal, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "abcdef",
- "\xe3\x81\xaa\xe3\x81\xb2",
- "\0",
- "",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPBase64.new(str).string)
- assert_equal([str].pack("m").chomp, SOAP::SOAPBase64.new(str).data)
- o = SOAP::SOAPBase64.new
- o.set_encoded([str].pack("m").chomp)
- assert_equal(str, o.string)
- end
-
- targets = [
- "-",
- "*",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- o = SOAP::SOAPBase64.new
- o.set_encoded(d)
- p o.string
- end
- end
- end
-
- def test_SOAPAnyURI
- o = SOAP::SOAPAnyURI.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::AnyURILiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- # Too few tests here I know. Believe uri module. :)
- targets = [
- "foo",
- "http://foo",
- "http://foo/bar/baz",
- "http://foo/bar#baz",
- "http://foo/bar%20%20?a+b",
- "HTTP://FOO/BAR%20%20?A+B",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPAnyURI, str)
- end
- end
-
- def test_SOAPQName
- o = SOAP::SOAPQName.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::QNameLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- # More strict test is needed but current implementation allows all non-':'
- # chars like ' ', C0 or C1...
- targets = [
- "foo",
- "foo:bar",
- "a:b",
- ]
- targets.each do |str|
- assert_parsed_result(SOAP::SOAPQName, str)
- end
- end
-
-
- ###
- ## Derived types
- #
-
- def test_SOAPInteger
- o = SOAP::SOAPInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::IntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- -9999999999,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |int|
- assert_equal(int, SOAP::SOAPInteger.new(int).data)
- end
-
- targets = [
- "0",
- "1000000000",
- "-9999999999",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPInteger.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- [
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPInteger.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPInteger.new(d)
- end
- end
- end
-
- def test_SOAPLong
- o = SOAP::SOAPLong.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::LongLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 9223372036854775807,
- -9223372036854775808,
- ]
- targets.each do |lng|
- assert_equal(lng, SOAP::SOAPLong.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "9223372036854775807",
- "-9223372036854775808",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPLong.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPLong.new(data).to_s)
- end
-
- targets = [
- 9223372036854775808,
- -9223372036854775809,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPLong.new(d)
- end
- end
- end
-
- def test_SOAPInt
- o = SOAP::SOAPInt.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::IntLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 2147483647,
- -2147483648,
- ]
- targets.each do |lng|
- assert_equal(lng, SOAP::SOAPInt.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "2147483647",
- "-2147483648",
- ]
- targets.each do |str|
- assert_equal(str, SOAP::SOAPInt.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, SOAP::SOAPInt.new(data).to_s)
- end
-
- targets = [
- 2147483648,
- -2147483649,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- SOAP::SOAPInt.new(d)
- end
- end
- end
-end
-
-
-end
diff --git a/test/soap/test_envelopenamespace.rb b/test/soap/test_envelopenamespace.rb
deleted file mode 100644
index 5b7d281341..0000000000
--- a/test/soap/test_envelopenamespace.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'webrick'
-require 'logger'
-
-
-module SOAP
-
-
-class TestEnvelopeNamespace < Test::Unit::TestCase
- Port = 17171
- TemporaryNamespace = 'urn:foo'
-
- def setup
- @logger = Logger.new(STDERR)
- @logger.level = Logger::Severity::ERROR
- @url = "http://localhost:#{Port}/"
- @server = @client = nil
- @server_thread = nil
- setup_server
- setup_client
- end
-
- def teardown
- teardown_client
- teardown_server
- end
-
- def setup_server
- @server = WEBrick::HTTPServer.new(
- :BindAddress => "0.0.0.0",
- :Logger => @logger,
- :Port => Port,
- :AccessLog => [],
- :DocumentRoot => File.dirname(File.expand_path(__FILE__))
- )
- @server.mount(
- '/',
- WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc)
- )
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@url, '')
- @client.add_method("do_server_proc")
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def do_server_proc(req, res)
- res['content-type'] = 'text/xml'
- res.body = <<__EOX__
-<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:env="#{TemporaryNamespace}">
- <env:Body>
- <n1:do_server_proc xmlns:n1="urn:foo" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <return>hello world</return>
- </n1:do_server_proc>
- </env:Body>
-</env:Envelope>
-__EOX__
- end
-
- def test_normal
- assert_raise(SOAP::ResponseFormatError) do
- @client.do_server_proc
- end
- @client.options["soap.envelope.requestnamespace"] = TemporaryNamespace
- @client.options["soap.envelope.responsenamespace"] = TemporaryNamespace
- assert_equal('hello world', @client.do_server_proc)
- end
-end
-
-
-end
diff --git a/test/soap/test_httpconfigloader.rb b/test/soap/test_httpconfigloader.rb
deleted file mode 100644
index b06243f661..0000000000
--- a/test/soap/test_httpconfigloader.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'test/unit'
-require 'soap/httpconfigloader'
-require 'soap/rpc/driver'
-
-if defined?(HTTPAccess2)
-
-module SOAP
-
-
-class TestHTTPConfigLoader < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
-
- def setup
- @client = SOAP::RPC::Driver.new(nil, nil)
- end
-
- def test_property
- testpropertyname = File.join(DIR, 'soapclient.properties')
- File.open(testpropertyname, "w") do |f|
- f <<<<__EOP__
-protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER
-# depth: 1 causes an error (intentional)
-protocol.http.ssl_config.verify_depth = 1
-protocol.http.ssl_config.ciphers = ALL
-__EOP__
- end
- begin
- @client.loadproperty(testpropertyname)
- assert_equal('ALL', @client.options['protocol.http.ssl_config.ciphers'])
- ensure
- File.unlink(testpropertyname)
- end
- end
-end
-
-
-end
-
-end
diff --git a/test/soap/test_mapping.rb b/test/soap/test_mapping.rb
deleted file mode 100644
index 26222e6719..0000000000
--- a/test/soap/test_mapping.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'test/unit'
-require 'soap/mapping'
-
-
-module SOAP
-
-
-class TestMapping < Test::Unit::TestCase
- def test_date
- targets = [
- ["2002-12-31",
- "2002-12-31Z"],
- ["2002-12-31+00:00",
- "2002-12-31Z"],
- ["2002-12-31-00:00",
- "2002-12-31Z"],
- ["-2002-12-31",
- "-2002-12-31Z"],
- ["-2002-12-31+00:00",
- "-2002-12-31Z"],
- ["-2002-12-31-00:00",
- "-2002-12-31Z"],
- ]
- targets.each do |str, expectec|
- d = Date.parse(str)
- assert_equal(d.class, convert(d).class)
- assert_equal(d, convert(d))
- end
- end
-
- def test_datetime
- targets = [
- ["2002-12-31T23:59:59.00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59+00:00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59-00:00",
- "2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59.00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59+00:00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59-00:00",
- "-2002-12-31T23:59:59Z"],
- ]
- targets.each do |str, expectec|
- d = DateTime.parse(str)
- assert_equal(d.class, convert(d).class)
- assert_equal(d, convert(d))
- end
- end
-
- def convert(obj)
- SOAP::Mapping.soap2obj(SOAP::Mapping.obj2soap(obj))
- end
-end
-
-
-end
diff --git a/test/soap/test_no_indent.rb b/test/soap/test_no_indent.rb
deleted file mode 100644
index f49fb7389f..0000000000
--- a/test/soap/test_no_indent.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/rpc/driver'
-
-if defined?(HTTPAccess2)
-
-module SOAP
-
-
-class TestNoIndent < Test::Unit::TestCase
- Port = 17171
-
- class NopServer < SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super
- add_rpc_method(self, 'nop')
- end
-
- def nop
- SOAP::RPC::SOAPVoid.new
- end
- end
-
- def setup
- @server = NopServer.new(self.class.name, nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- @server.start
- }
- @endpoint = "http://localhost:#{Port}/"
- @client = SOAP::RPC::Driver.new(@endpoint)
- @client.add_rpc_method('nop')
- end
-
- def teardown
- @server.shutdown
- @t.kill
- @t.join
- @client.reset_stream
- end
-
- INDENT_XML =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- </nop>
- </env:Body>
-</env:Envelope>]
-
- NO_INDENT_XML =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<env:Body>
-<nop env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
-</nop>
-</env:Body>
-</env:Envelope>]
-
- def test_indent
- @client.wiredump_dev = str = ''
- @client.options["soap.envelope.no_indent"] = false
- @client.nop
- assert_equal(INDENT_XML, parse_requestxml(str))
- end
-
- def test_no_indent
- @client.wiredump_dev = str = ''
- @client.options["soap.envelope.no_indent"] = true
- @client.nop
- assert_equal(NO_INDENT_XML, parse_requestxml(str))
- end
-
- def parse_requestxml(str)
- str.split(/\r?\n\r?\n/)[3]
- end
-end
-
-
-end
-
-end
diff --git a/test/soap/test_property.rb b/test/soap/test_property.rb
deleted file mode 100644
index 7acd2c8437..0000000000
--- a/test/soap/test_property.rb
+++ /dev/null
@@ -1,424 +0,0 @@
-require 'test/unit'
-require 'soap/property'
-
-
-module SOAP
-
-
-class TestProperty < Test::Unit::TestCase
- FrozenError = (RUBY_VERSION >= "1.9.0") ? RuntimeError : TypeError
-
- def setup
- @prop = ::SOAP::Property.new
- end
-
- def teardown
- # Nothing to do.
- end
-
- def test_s_load
- propstr = <<__EOP__
-
-# comment1
-
-# comment2\r
-# comment2
-
-\r
-a.b.0 = 1
-a.b.1 = 2
-a.b.2 = 3
-client.protocol.http.proxy=http://myproxy:8080 \r
-client.protocol.http.no_proxy: intranet.example.com,local.example.com\r
-client.protocol.http.protocol_version = 1.0
-foo\\:bar\\=baz = qux
-foo\\\\.bar.baz=\tq\\\\ux\ttab
- a\\ b = 1
-[ppp.qqq.rrr]
-sss = 3
-ttt.uuu = 4
-
-[ sss.ttt.uuu ]
-vvv.www = 5
-[ ]
-xxx.yyy.zzz = 6
-__EOP__
- prop = Property.load(propstr)
- assert_equal(["1", "2", "3"], prop["a.b"].values.sort)
- assert_equal("intranet.example.com,local.example.com",
- prop["client.protocol.http.no_proxy"])
- assert_equal("http://myproxy:8080", prop["client.protocol.http.proxy"])
- assert_equal("1.0", prop["client.protocol.http.protocol_version"])
- assert_equal("q\\ux\ttab", prop['foo\.bar.baz'])
- assert_equal("1", prop['a b'])
- assert_equal("3", prop['ppp.qqq.rrr.sss'])
- assert_equal("4", prop['ppp.qqq.rrr.ttt.uuu'])
- assert_equal("5", prop['sss.ttt.uuu.vvv.www'])
- assert_equal("6", prop['xxx.yyy.zzz'])
- end
-
- def test_load
- prop = Property.new
- hooked = false
- prop.add_hook("foo.bar.baz") do |name, value|
- assert_equal(["foo", "bar", "baz"], name)
- assert_equal("123", value)
- hooked = true
- end
- prop.lock
- prop["foo.bar"].lock
- prop.load("foo.bar.baz = 123")
- assert(hooked)
- assert_raises(FrozenError) do
- prop.load("foo.bar.qux = 123")
- end
- prop.load("foo.baz = 456")
- assert_equal("456", prop["foo.baz"])
- end
-
- def test_initialize
- prop = ::SOAP::Property.new
- # store is empty
- assert_nil(prop["a"])
- # does hook work?
- assert_equal(1, prop["a"] = 1)
- end
-
- def test_aref
- # name_to_a
- assert_nil(@prop[:foo])
- assert_nil(@prop["foo"])
- assert_nil(@prop[[:foo]])
- assert_nil(@prop[["foo"]])
- assert_raises(ArgumentError) do
- @prop[1]
- end
- @prop[:foo] = :foo
- assert_equal(:foo, @prop[:foo])
- assert_equal(:foo, @prop["foo"])
- assert_equal(:foo, @prop[[:foo]])
- assert_equal(:foo, @prop[["foo"]])
- end
-
- def test_referent
- # referent(1)
- assert_nil(@prop["foo.foo"])
- assert_nil(@prop[["foo", "foo"]])
- assert_nil(@prop[["foo", :foo]])
- @prop["foo.foo"] = :foo
- assert_equal(:foo, @prop["foo.foo"])
- assert_equal(:foo, @prop[["foo", "foo"]])
- assert_equal(:foo, @prop[[:foo, "foo"]])
- # referent(2)
- @prop["bar.bar.bar"] = :bar
- assert_equal(:bar, @prop["bar.bar.bar"])
- assert_equal(:bar, @prop[["bar", "bar", "bar"]])
- assert_equal(:bar, @prop[[:bar, "bar", :bar]])
- end
-
- def test_to_key_and_deref
- @prop["foo.foo"] = :foo
- assert_equal(:foo, @prop["fOo.FoO"])
- assert_equal(:foo, @prop[[:fOO, :FOO]])
- assert_equal(:foo, @prop[["FoO", :Foo]])
- # deref_key negative test
- assert_raises(ArgumentError) do
- @prop["baz"] = 1
- @prop["baz.qux"] = 2
- end
- end
-
- def test_hook_name
- tag = Object.new
- tested = false
- @prop.add_hook("foo.bar") do |key, value|
- assert_raise(FrozenError) do
- key << "baz"
- end
- tested = true
- end
- @prop["foo.bar"] = tag
- assert(tested)
- end
-
- def test_value_hook
- tag = Object.new
- tested = false
- @prop.add_hook("FOO.BAR.BAZ") do |key, value|
- assert_equal(["Foo", "baR", "baZ"], key)
- assert_equal(tag, value)
- tested = true
- end
- @prop["Foo.baR.baZ"] = tag
- assert_equal(tag, @prop["foo.bar.baz"])
- assert(tested)
- @prop["foo.bar"] = 1 # unhook the above block
- assert_equal(1, @prop["foo.bar"])
- end
-
- def test_key_hook_no_cascade
- tag = Object.new
- tested = 0
- @prop.add_hook do |key, value|
- assert(false)
- end
- @prop.add_hook(false) do |key, value|
- assert(false)
- end
- @prop.add_hook("foo") do |key, value|
- assert(false)
- end
- @prop.add_hook("foo.bar", false) do |key, value|
- assert(false)
- end
- @prop.add_hook("foo.bar.baz") do |key, value|
- assert(false)
- end
- @prop.add_hook("foo.bar.baz.qux", false) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop["foo.bar.baz.qux"] = tag
- assert_equal(tag, @prop["foo.bar.baz.qux"])
- assert_equal(1, tested)
- end
-
- def test_key_hook_cascade
- tag = Object.new
- tested = 0
- @prop.add_hook(true) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop.add_hook("foo", true) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop.add_hook("foo.bar", true) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop.add_hook("foo.bar.baz", true) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop.add_hook("foo.bar.baz.qux", true) do |key, value|
- assert_equal(["foo", "bar", "baz", "qux"], key)
- assert_equal(tag, value)
- tested += 1
- end
- @prop["foo.bar.baz.qux"] = tag
- assert_equal(tag, @prop["foo.bar.baz.qux"])
- assert_equal(5, tested)
- end
-
- def test_keys
- assert(@prop.keys.empty?)
- @prop["foo"] = 1
- @prop["bar"]
- @prop["BAz"] = 2
- assert_equal(2, @prop.keys.size)
- assert(@prop.keys.member?("foo"))
- assert(@prop.keys.member?("baz"))
- #
- assert_nil(@prop["a"])
- @prop["a.a"] = 1
- assert_instance_of(::SOAP::Property, @prop["a"])
- @prop["a.b"] = 1
- @prop["a.c"] = 1
- assert_equal(3, @prop["a"].keys.size)
- assert(@prop["a"].keys.member?("a"))
- assert(@prop["a"].keys.member?("b"))
- assert(@prop["a"].keys.member?("c"))
- end
-
- def test_lshift
- assert(@prop.empty?)
- @prop << 1
- assert_equal([1], @prop.values)
- assert_equal(1, @prop["0"])
- @prop << 1
- assert_equal([1, 1], @prop.values)
- assert_equal(1, @prop["1"])
- @prop << 1
- assert_equal([1, 1, 1], @prop.values)
- assert_equal(1, @prop["2"])
- #
- @prop["abc.def"] = o = SOAP::Property.new
- tested = 0
- o.add_hook do |k, v|
- tested += 1
- end
- @prop["abc.def"] << 1
- @prop["abc.def"] << 2
- @prop["abc.def"] << 3
- @prop["abc.def"] << 4
- assert_equal(4, tested)
- end
-
- def test_lock_each
- @prop["a.b.c.d.e"] = 1
- @prop["a.b.d"] = branch = ::SOAP::Property.new
- @prop["a.b.d.e.f"] = 2
- @prop.lock
- assert(@prop.locked?)
- assert_instance_of(::SOAP::Property, @prop["a"])
- assert_raises(FrozenError) do
- @prop["b"]
- end
- #
- @prop["a"].lock
- assert_raises(FrozenError) do
- @prop["a"]
- end
- assert_instance_of(::SOAP::Property, @prop["a.b"])
- #
- @prop["a.b"].lock
- assert_raises(FrozenError) do
- @prop["a.b"]
- end
- assert_raises(FrozenError) do
- @prop["a"]
- end
- #
- @prop["a.b.c.d"].lock
- assert_instance_of(::SOAP::Property, @prop["a.b.c"])
- assert_raises(FrozenError) do
- @prop["a.b.c.d"]
- end
- assert_instance_of(::SOAP::Property, @prop["a.b.d"])
- #
- branch["e"].lock
- assert_instance_of(::SOAP::Property, @prop["a.b.d"])
- assert_raises(FrozenError) do
- @prop["a.b.d.e"]
- end
- assert_raises(FrozenError) do
- branch["e"]
- end
- end
-
- def test_lock_cascade
- @prop["a.a"] = nil
- @prop["a.b.c"] = 1
- @prop["b"] = false
- @prop.lock(true)
- assert(@prop.locked?)
- assert_equal(nil, @prop["a.a"])
- assert_equal(1, @prop["a.b.c"])
- assert_equal(false, @prop["b"])
- assert_raises(FrozenError) do
- @prop["c"]
- end
- assert_raises(FrozenError) do
- @prop["c"] = 2
- end
- assert_raises(FrozenError) do
- @prop["a.b.R"]
- end
- assert_raises(FrozenError) do
- @prop.add_hook do
- assert(false)
- end
- end
- assert_raises(FrozenError) do
- @prop.add_hook("c") do
- assert(false)
- end
- end
- assert_raises(FrozenError) do
- @prop.add_hook("a.c") do
- assert(false)
- end
- end
- assert_nil(@prop["a.a"])
- @prop["a.a"] = 2
- assert_equal(2, @prop["a.a"])
- #
- @prop.unlock(true)
- assert_nil(@prop["c"])
- @prop["c"] = 2
- assert_equal(2, @prop["c"])
- @prop["a.d.a.a"] = :foo
- assert_equal(:foo, @prop["a.d.a.a"])
- tested = false
- @prop.add_hook("a.c") do |name, value|
- assert(true)
- tested = true
- end
- @prop["a.c"] = 3
- assert(tested)
- end
-
- def test_hook_then_lock
- tested = false
- @prop.add_hook("a.b.c") do |name, value|
- assert_equal(["a", "b", "c"], name)
- tested = true
- end
- @prop["a.b"].lock
- assert(!tested)
- @prop["a.b.c"] = 5
- assert(tested)
- assert_equal(5, @prop["a.b.c"])
- assert_raises(FrozenError) do
- @prop["a.b.d"] = 5
- end
- end
-
- def test_lock_unlock_return
- assert_equal(@prop, @prop.lock)
- assert_equal(@prop, @prop.unlock)
- end
-
- def test_lock_split
- @prop["a.b.c"] = 1
- assert_instance_of(::SOAP::Property, @prop["a.b"])
- @prop["a.b.d"] = branch = ::SOAP::Property.new
- @prop["a.b.d.e"] = 2
- assert_equal(branch, @prop["a.b.d"])
- assert_equal(branch, @prop[:a][:b][:d])
- @prop.lock(true)
- # split error 1
- assert_raises(FrozenError) do
- @prop["a.b"]
- end
- # split error 2
- assert_raises(FrozenError) do
- @prop["a"]
- end
- @prop["a.b.c"] = 2
- assert_equal(2, @prop["a.b.c"])
- # replace error
- assert_raises(FrozenError) do
- @prop["a.b.c"] = ::SOAP::Property.new
- end
- # override error
- assert_raises(FrozenError) do
- @prop["a.b"] = 1
- end
- #
- assert_raises(FrozenError) do
- @prop["a.b.d"] << 1
- end
- assert_raises(FrozenError) do
- branch << 1
- end
- branch.unlock(true)
- branch << 1
- branch << 2
- branch << 3
- assert_equal(2, @prop["a.b.d.e"])
- assert_equal(1, @prop["a.b.d.1"])
- assert_equal(2, @prop["a.b.d.2"])
- assert_equal(3, @prop["a.b.d.3"])
- end
-end
-
-
-end
diff --git a/test/soap/test_soapelement.rb b/test/soap/test_soapelement.rb
deleted file mode 100644
index 66e2a836a4..0000000000
--- a/test/soap/test_soapelement.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-require 'test/unit'
-require 'soap/baseData'
-require 'soap/mapping'
-
-
-module SOAP
-
-
-class TestSOAPElement < Test::Unit::TestCase
- include SOAP
-
- def setup
- # Nothing to do.
- end
-
- def teardown
- # Nothing to do.
- end
-
- def d(elename = nil, text = nil)
- elename ||= n(nil, nil)
- if text
- SOAPElement.new(elename, text)
- else
- SOAPElement.new(elename) # do not merge.
- end
- end
-
- def n(namespace, name)
- XSD::QName.new(namespace, name)
- end
-
- def test_initialize
- elename = n(nil, nil)
- obj = d(elename)
- assert_equal(elename, obj.elename)
- assert_equal(LiteralNamespace, obj.encodingstyle)
- assert_equal({}, obj.extraattr)
- assert_equal([], obj.precedents)
- assert_equal(nil, obj.qualified)
- assert_equal(nil, obj.text)
- assert(obj.members.empty?)
-
- obj = d("foo", "text")
- assert_equal(n(nil, "foo"), obj.elename)
- assert_equal("text", obj.text)
- end
-
- def test_add
- obj = d()
- child = d("abc")
- obj.add(child)
- assert(obj.key?("abc"))
- assert_same(child, obj["abc"])
- assert_same(child, obj.abc)
- def obj.foo; 1; end
- child = d("foo")
- obj.add(child)
- assert_equal(1, obj.foo)
- assert_equal(child, obj.var_foo)
- child = d("_?a?b_")
- obj.add(child)
- assert_equal(child, obj.__send__('_?a?b_'))
- end
-
- def test_member
- obj = d()
- c1 = d("c1")
- obj.add(c1)
- c2 = d("c2")
- obj.add(c2)
- assert(obj.key?("c1"))
- assert(obj.key?("c2"))
- assert_equal(c1, obj["c1"])
- assert_equal(c2, obj["c2"])
- c22 = d("c22")
- obj["c2"] = c22
- assert(obj.key?("c2"))
- assert_equal(c22, obj["c2"])
- assert_equal(["c1", "c2"], obj.members.sort)
- #
- k_expect = ["c1", "c2"]
- v_expect = [c1, c22]
- obj.each do |k, v|
- assert(k_expect.include?(k))
- assert(v_expect.include?(v))
- k_expect.delete(k)
- v_expect.delete(v)
- end
- assert(k_expect.empty?)
- assert(v_expect.empty?)
- end
-
- def test_to_obj
- obj = d("root")
- ct1 = d("ct1", "t1")
- obj.add(ct1)
- c2 = d("c2")
- ct2 = d("ct2", "t2")
- c2.add(ct2)
- obj.add(c2)
- assert_equal({ "ct1" => "t1", "c2" => { "ct2" => "t2" }}, obj.to_obj)
- #
- assert_equal(nil, d().to_obj)
- assert_equal("abc", d(nil, "abc").to_obj)
- assert_equal(nil, d("abc", nil).to_obj)
- end
-
- def test_from_obj
- source = { "ct1" => "t1", "c2" => { "ct2" => "t2" }}
- assert_equal(source, SOAPElement.from_obj(source).to_obj)
- source = { "1" => nil }
- assert_equal(source, SOAPElement.from_obj(source).to_obj)
- source = {}
- assert_equal(nil, SOAPElement.from_obj(source).to_obj) # not {}
- source = nil
- assert_equal(nil, SOAPElement.from_obj(source).to_obj)
- end
-end
-
-
-end
diff --git a/test/soap/test_streamhandler.rb b/test/soap/test_streamhandler.rb
deleted file mode 100644
index c31254513f..0000000000
--- a/test/soap/test_streamhandler.rb
+++ /dev/null
@@ -1,209 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/driver'
-require 'webrick'
-require 'webrick/httpproxy'
-require 'logger'
-
-
-module SOAP
-
-
-class TestStreamHandler < Test::Unit::TestCase
- Port = 17171
- ProxyPort = 17172
-
- def setup
- @logger = Logger.new(STDERR)
- @logger.level = Logger::Severity::ERROR
- @url = "http://localhost:#{Port}/"
- @proxyurl = "http://localhost:#{ProxyPort}/"
- @server = @proxyserver = @client = nil
- @server_thread = @proxyserver_thread = nil
- setup_server
- setup_client
- end
-
- def teardown
- teardown_client
- teardown_proxyserver if @proxyserver
- teardown_server
- end
-
- def setup_server
- @server = WEBrick::HTTPServer.new(
- :BindAddress => "0.0.0.0",
- :Logger => @logger,
- :Port => Port,
- :AccessLog => [],
- :DocumentRoot => File.dirname(File.expand_path(__FILE__))
- )
- @server.mount(
- '/',
- WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc)
- )
- @server_thread = start_server_thread(@server)
- end
-
- def setup_proxyserver
- @proxyserver = WEBrick::HTTPProxyServer.new(
- :BindAddress => "0.0.0.0",
- :Logger => @logger,
- :Port => ProxyPort,
- :AccessLog => []
- )
- @proxyserver_thread = start_server_thread(@proxyserver)
- end
-
- def setup_client
- @client = SOAP::RPC::Driver.new(@url, '')
- @client.add_method("do_server_proc")
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_proxyserver
- @proxyserver.shutdown
- @proxyserver_thread.kill
- @proxyserver_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def do_server_proc(req, res)
- res['content-type'] = 'text/xml'
- res.body = <<__EOX__
-<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:do_server_proc xmlns:n1="urn:foo" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <return xsi:nil="true"/>
- </n1:do_server_proc>
- </env:Body>
-</env:Envelope>
-__EOX__
- end
-
- def parse_req_header(str)
- if ::SOAP::HTTPStreamHandler::Client.to_s == 'SOAP::NetHttpClient'
- str = eval(str.split(/\r?\n/)[4][3..-1])
- end
- parse_req_header_http_access2(str)
- end
-
- def parse_req_header_http_access2(str)
- headerp = false
- headers = {}
- req = nil
- str.split(/(?:\r?\n)/).each do |line|
- if headerp and /^$/ =~line
- headerp = false
- break
- end
- if headerp
- k, v = line.scan(/^([^:]+):\s*(.*)$/)[0]
- headers[k.downcase] = v
- end
- if /^POST/ =~ line
- req = line
- headerp = true
- end
- end
- return req, headers
- end
-
- def test_normal
- str = ""
- @client.wiredump_dev = str
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_match(%r"POST / HTTP/1.", r)
- assert(/^text\/xml;/ =~ h["content-type"])
- end
-
- def test_uri
- # initialize client with URI object
- @client = SOAP::RPC::Driver.new(URI.parse(@url), '')
- @client.add_method("do_server_proc")
- # same as test_normal
- str = ""
- @client.wiredump_dev = str
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_match(%r"POST / HTTP/1.", r)
- assert(/^text\/xml;/ =~ h["content-type"])
- end
-
- def test_basic_auth
- unless Object.const_defined?('HTTPAccess2')
- # soap4r + net/http + basic_auth is not supported.
- # use http-access2 instead.
- assert(true)
- return
- end
- str = ""
- @client.wiredump_dev = str
- @client.options["protocol.http.basic_auth"] << [@url, "foo", "bar"]
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_equal("Basic Zm9vOmJhcg==", h["authorization"])
- end
-
- def test_proxy
- if Object.const_defined?('HTTPAccess2')
- backup = HTTPAccess2::Client::NO_PROXY_HOSTS.dup
- HTTPAccess2::Client::NO_PROXY_HOSTS.clear
- else
- backup = SOAP::NetHttpClient::NO_PROXY_HOSTS.dup
- SOAP::NetHttpClient::NO_PROXY_HOSTS.clear
- end
- setup_proxyserver
- str = ""
- @client.wiredump_dev = str
- @client.options["protocol.http.proxy"] = @proxyurl
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_match(%r"POST http://localhost:17171/ HTTP/1.", r)
- # illegal proxy uri
- assert_raise(ArgumentError) do
- @client.options["protocol.http.proxy"] = 'ftp://foo:8080'
- end
- ensure
- if Object.const_defined?('HTTPAccess2')
- HTTPAccess2::Client::NO_PROXY_HOSTS.replace(backup)
- else
- SOAP::NetHttpClient::NO_PROXY_HOSTS.replace(backup)
- end
- end
-
- def test_charset
- str = ""
- @client.wiredump_dev = str
- @client.options["protocol.http.charset"] = "iso-8859-8"
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_equal("text/xml; charset=iso-8859-8", h["content-type"])
- #
- str.replace("")
- @client.options["protocol.http.charset"] = "iso-8859-3"
- assert_nil(@client.do_server_proc)
- r, h = parse_req_header(str)
- assert_equal("text/xml; charset=iso-8859-3", h["content-type"])
- end
-end
-
-
-end
diff --git a/test/soap/test_styleuse.rb b/test/soap/test_styleuse.rb
deleted file mode 100644
index 4ea321848d..0000000000
--- a/test/soap/test_styleuse.rb
+++ /dev/null
@@ -1,333 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/httpserver'
-require 'soap/rpc/driver'
-
-
-module SOAP
-
-
-class TestStyleUse < Test::Unit::TestCase
- # rpc driver: obj in(Hash allowed for literal), obj out
- #
- # style: not visible from user
- # rpc: wrapped element
- # document: unwrappted element
- #
- # use:
- # encoding: a graph (SOAP Data Model)
- # literal: not a graph (SOAPElement)
- #
- # rpc stub: obj in, obj out(Hash is allowed for literal)
- #
- # style: not visible from user
- # rpc: wrapped element
- # document: unwrappted element
- #
- # use:
- # encoding: a graph (SOAP Data Model)
- # literal: not a graph (SOAPElement)
- #
- # document driver: SOAPElement in, SOAPElement out? [not implemented]
- #
- # style: ditto
- # use: ditto
- #
- #
- # document stub: SOAPElement in, SOAPElement out? [not implemented]
- #
- # style: ditto
- # use: ditto
- #
- class GenericServant
- # method name style: requeststyle_requestuse_responsestyle_responseuse
-
- # 2 params -> array
- def rpc_enc_rpc_enc(obj1, obj2)
- [obj1, [obj1, obj2]]
- end
-
- # 2 objs -> array
- def rpc_lit_rpc_enc(obj1, obj2)
- [obj2, obj1]
- end
-
- # 2 params -> 2 params
- def rpc_enc_rpc_lit(obj1, obj2)
- klass = [obj1.class.name, obj2.class.name]
- [obj2, obj1]
- end
-
- # 2 objs -> 2 objs
- def rpc_lit_rpc_lit(obj1, obj2)
- [obj1, obj2]
- end
-
- # 2 params -> array
- def doc_enc_doc_enc(obj1, obj2)
- [obj1, [obj1, obj2]]
- end
-
- # 2 objs -> array
- def doc_lit_doc_enc(obj1, obj2)
- [obj2, obj1]
- end
-
- # 2 params -> 2 hashes
- def doc_enc_doc_lit(obj1, obj2)
- klass = [obj1.class.name, obj2.class.name]
- return {'obj1' => {'klass' => klass}, 'misc' => 'hash does not have an order'},
- {'obj2' => {'klass' => klass}}
- end
-
- # 2 objs -> 2 objs
- def doc_lit_doc_lit(obj1, obj2)
- return obj1, obj2
- end
- end
-
- Namespace = "urn:styleuse"
-
- module Op
- def self.opt(request_style, request_use, response_style, response_use)
- {
- :request_style => request_style,
- :request_use => request_use,
- :response_style => response_style,
- :response_use => response_use
- }
- end
-
- Op_rpc_enc_rpc_enc = [
- XSD::QName.new(Namespace, 'rpc_enc_rpc_enc'),
- nil,
- 'rpc_enc_rpc_enc', [
- ['in', 'obj1', nil],
- ['in', 'obj2', nil],
- ['retval', 'return', nil]],
- opt(:rpc, :encoded, :rpc, :encoded)
- ]
-
- Op_rpc_lit_rpc_enc = [
- XSD::QName.new(Namespace, 'rpc_lit_rpc_enc'),
- nil,
- 'rpc_lit_rpc_enc', [
- ['in', 'obj1', nil],
- ['in', 'obj2', nil],
- ['retval', 'return', nil]],
- opt(:rpc, :literal, :rpc, :encoded)
- ]
-
- Op_rpc_enc_rpc_lit = [
- XSD::QName.new(Namespace, 'rpc_enc_rpc_lit'),
- nil,
- 'rpc_enc_rpc_lit', [
- ['in', 'obj1', nil],
- ['in', 'obj2', nil],
- ['retval', 'ret1', nil],
- ['out', 'ret2', nil]],
- opt(:rpc, :encoded, :rpc, :literal)
- ]
-
- Op_rpc_lit_rpc_lit = [
- XSD::QName.new(Namespace, 'rpc_lit_rpc_lit'),
- nil,
- 'rpc_lit_rpc_lit', [
- ['in', 'obj1', nil],
- ['in', 'obj2', nil],
- ['retval', 'ret1', nil],
- ['out', 'ret2', nil]],
- opt(:rpc, :literal, :rpc, :literal)
- ]
-
- Op_doc_enc_doc_enc = [
- Namespace + 'doc_enc_doc_enc',
- 'doc_enc_doc_enc', [
- ['in', 'obj1', [nil, Namespace, 'obj1']],
- ['in', 'obj2', [nil, Namespace, 'obj2']],
- ['out', 'ret1', [nil, Namespace, 'ret1']],
- ['out', 'ret2', [nil, Namespace, 'ret2']]],
- opt(:document, :encoded, :document, :encoded)
- ]
-
- Op_doc_lit_doc_enc = [
- Namespace + 'doc_lit_doc_enc',
- 'doc_lit_doc_enc', [
- ['in', 'obj1', [nil, Namespace, 'obj1']],
- ['in', 'obj2', [nil, Namespace, 'obj2']],
- ['out', 'ret1', [nil, Namespace, 'ret1']],
- ['out', 'ret2', [nil, Namespace, 'ret2']]],
- opt(:document, :literal, :document, :encoded)
- ]
-
- Op_doc_enc_doc_lit = [
- Namespace + 'doc_enc_doc_lit',
- 'doc_enc_doc_lit', [
- ['in', 'obj1', [nil, Namespace, 'obj1']],
- ['in', 'obj2', [nil, Namespace, 'obj2']],
- ['out', 'ret1', [nil, Namespace, 'ret1']],
- ['out', 'ret2', [nil, Namespace, 'ret2']]],
- opt(:document, :encoded, :document, :literal)
- ]
-
- Op_doc_lit_doc_lit = [
- Namespace + 'doc_lit_doc_lit',
- 'doc_lit_doc_lit', [
- ['in', 'obj1', [nil, Namespace, 'obj1']],
- ['in', 'obj2', [nil, Namespace, 'obj2']],
- ['out', 'ret1', [nil, Namespace, 'ret1']],
- ['out', 'ret2', [nil, Namespace, 'ret2']]],
- opt(:document, :literal, :document, :literal)
- ]
- end
-
- include Op
-
- class Server < ::SOAP::RPC::HTTPServer
- include Op
-
- def on_init
- @servant = GenericServant.new
- add_rpc_operation(@servant, *Op_rpc_enc_rpc_enc)
- add_rpc_operation(@servant, *Op_rpc_lit_rpc_enc)
- add_rpc_operation(@servant, *Op_rpc_enc_rpc_lit)
- add_rpc_operation(@servant, *Op_rpc_lit_rpc_lit)
- add_document_operation(@servant, *Op_doc_enc_doc_enc)
- add_document_operation(@servant, *Op_doc_lit_doc_enc)
- add_document_operation(@servant, *Op_doc_enc_doc_lit)
- add_document_operation(@servant, *Op_doc_lit_doc_lit)
- end
- end
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new(
- :BindAddress => "0.0.0.0",
- :Port => Port,
- :AccessLog => [],
- :SOAPDefaultNamespace => Namespace
- )
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace)
- @client.wiredump_dev = STDERR if $DEBUG
- @client.add_rpc_operation(*Op_rpc_enc_rpc_enc)
- @client.add_rpc_operation(*Op_rpc_lit_rpc_enc)
- @client.add_rpc_operation(*Op_rpc_enc_rpc_lit)
- @client.add_rpc_operation(*Op_rpc_lit_rpc_lit)
- @client.add_document_operation(*Op_doc_enc_doc_enc)
- @client.add_document_operation(*Op_doc_lit_doc_enc)
- @client.add_document_operation(*Op_doc_enc_doc_lit)
- @client.add_document_operation(*Op_doc_lit_doc_lit)
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_rpc_enc_rpc_enc
- o = "hello"
- obj1 = o
- obj2 = [1]
- ret = @client.rpc_enc_rpc_enc(obj1, obj2)
- # server returns [obj1, [obj1, obj2]]
- assert_equal([obj1, [obj1, obj2]], ret)
- assert_same(ret[0], ret[1][0])
- end
-
- S1 = ::Struct.new(:a)
- S2 = ::Struct.new(:c)
- def test_rpc_lit_rpc_enc
- ret1, ret2 = @client.rpc_lit_rpc_enc(S1.new('b'), S2.new('d'))
- assert_equal('d', ret1.c)
- assert_equal('b', ret2.a)
- # Hash is allowed for literal
- ret1, ret2 = @client.rpc_lit_rpc_enc({'a' => 'b'}, {'c' => 'd'})
- assert_equal('d', ret1.c)
- assert_equal('b', ret2.a)
- # simple value
- assert_equal(
- ['1', 'a'],
- @client.rpc_lit_rpc_enc('a', 1)
- )
- end
-
- def test_rpc_enc_rpc_lit
- assert_equal(
- ['1', 'a'],
- @client.rpc_enc_rpc_lit('a', '1')
- )
- end
-
- def test_rpc_lit_rpc_lit
- ret1, ret2 = @client.rpc_lit_rpc_lit({'a' => 'b'}, {'c' => 'd'})
- assert_equal('b', ret1["a"])
- assert_equal('d', ret2["c"])
- end
-
- def test_doc_enc_doc_enc
- o = "hello"
- obj1 = o
- obj2 = [1]
- ret = @client.rpc_enc_rpc_enc(obj1, obj2)
- # server returns [obj1, [obj1, obj2]]
- assert_equal([obj1, [obj1, obj2]], ret)
- assert_same(ret[0], ret[1][0])
- end
-
- def test_doc_lit_doc_enc
- ret1, ret2 = @client.doc_lit_doc_enc({'a' => 'b'}, {'c' => 'd'})
- assert_equal('d', ret1.c)
- assert_equal('b', ret2.a)
- assert_equal(
- ['a', '1'],
- @client.doc_lit_doc_enc(1, 'a')
- )
- end
-
- def test_doc_enc_doc_lit
- ret1, ret2 = @client.doc_enc_doc_lit('a', 1)
- # literal Array
- assert_equal(['String', 'Fixnum'], ret1['obj1']['klass'])
- # same value
- assert_equal(ret1['obj1']['klass'], ret2['obj2']['klass'])
- # not the same object (not encoded)
- assert_not_same(ret1['obj1']['klass'], ret2['obj2']['klass'])
- end
-
- def test_doc_lit_doc_lit
- ret1, ret2 = @client.doc_lit_doc_lit({'a' => 'b'}, {'c' => 'd'})
- assert_equal('b', ret1["a"])
- assert_equal('d', ret2["c"])
- end
-end
-
-
-end
diff --git a/test/soap/wsdlDriver/README.txt b/test/soap/wsdlDriver/README.txt
deleted file mode 100644
index b4d45a0486..0000000000
--- a/test/soap/wsdlDriver/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-echo_version.rb is generated by wsdl2ruby.rb;
-% wsdl2ruby.rb --wsdl simpletype.wsdl --classdef --force
diff --git a/test/soap/wsdlDriver/calc.wsdl b/test/soap/wsdlDriver/calc.wsdl
deleted file mode 100644
index 694a01e87e..0000000000
--- a/test/soap/wsdlDriver/calc.wsdl
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--generated by GLUE Standard 4.0.1 on Wed Mar 09 10:20:07 GMT-08:00
-2005-->
-<wsdl:definitions name='Calculator'
-targetNamespace='http://www.themindelectric.com/wsdl/Calculator/'
- xmlns:tns='http://www.themindelectric.com/wsdl/Calculator/'
- xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
- xmlns:http='http://schemas.xmlsoap.org/wsdl/http/'
- xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'
- xmlns:xsd='http://www.w3.org/2001/XMLSchema'
- xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
- xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
- xmlns:tme='http://www.themindelectric.com/'>
- <wsdl:message name='add0In'>
- <wsdl:part name='x' type='xsd:float'/>
- <wsdl:part name='y' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='add0Out'>
- <wsdl:part name='Result' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='divide1In'>
- <wsdl:part name='numerator' type='xsd:float'/>
- <wsdl:part name='denominator' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='divide1Out'>
- <wsdl:part name='Result' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='multiply2In'>
- <wsdl:part name='x' type='xsd:float'/>
- <wsdl:part name='y' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='multiply2Out'>
- <wsdl:part name='Result' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='subtract3In'>
- <wsdl:part name='x' type='xsd:float'/>
- <wsdl:part name='y' type='xsd:float'/>
- </wsdl:message>
- <wsdl:message name='subtract3Out'>
- <wsdl:part name='Result' type='xsd:float'/>
- </wsdl:message>
- <wsdl:portType name='ICalculator'>
- <wsdl:operation name='add' parameterOrder='x y'>
- <wsdl:input name='add0In' message='tns:add0In'/>
- <wsdl:output name='add0Out' message='tns:add0Out'/>
- </wsdl:operation>
- <wsdl:operation name='divide' parameterOrder='numerator
-denominator'>
- <wsdl:input name='divide1In' message='tns:divide1In'/>
- <wsdl:output name='divide1Out' message='tns:divide1Out'/>
- </wsdl:operation>
- <wsdl:operation name='multiply' parameterOrder='x y'>
- <wsdl:input name='multiply2In' message='tns:multiply2In'/>
- <wsdl:output name='multiply2Out'
-message='tns:multiply2Out'/>
- </wsdl:operation>
- <wsdl:operation name='subtract' parameterOrder='x y'>
- <wsdl:input name='subtract3In' message='tns:subtract3In'/>
- <wsdl:output name='subtract3Out'
-message='tns:subtract3Out'/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name='ICalculator' type='tns:ICalculator'>
- <soap:binding style='rpc'
-transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsdl:operation name='add'>
- <soap:operation soapAction='add' style='rpc'/>
- <wsdl:input name='add0In'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:input>
- <wsdl:output name='add0Out'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name='divide'>
- <soap:operation soapAction='divide' style='rpc'/>
- <wsdl:input name='divide1In'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:input>
- <wsdl:output name='divide1Out'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name='multiply'>
- <soap:operation soapAction='multiply' style='rpc'/>
- <wsdl:input name='multiply2In'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:input>
- <wsdl:output name='multiply2Out'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:output>
- </wsdl:operation>
- <wsdl:operation name='subtract'>
- <soap:operation soapAction='subtract' style='rpc'/>
- <wsdl:input name='subtract3In'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:input>
- <wsdl:output name='subtract3Out'>
- <soap:body use='encoded'
-namespace='http://www.fred.com'
-encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name='Calculator'>
- <wsdl:documentation>calculator service</wsdl:documentation>
- <wsdl:port name='ICalculator' binding='tns:ICalculator'>
- <soap:address
-location='http://ukulele:8080/calcapp/services/calculator'/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/test/soap/wsdlDriver/document.wsdl b/test/soap/wsdlDriver/document.wsdl
deleted file mode 100644
index 5e9e74b9df..0000000000
--- a/test/soap/wsdlDriver/document.wsdl
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="submit_service"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:example.com:document"
- targetNamespace="urn:example.com:document"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:example.com:document">
- <xsd:element name="ruby">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="1" maxOccurs="1" name="myversion" type="tns:myversion"/>
- <xsd:element minOccurs="0" maxOccurs="1" name="date" type="xsd:dateTime"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:simpleType name="myversion">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="1.6"/>
- <xsd:enumeration value="1.8"/>
- <xsd:enumeration value="1.9"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:schema>
- </types>
-
- <message name="submit_msg">
- <part name="parameters" element="tns:ruby"/>
- </message>
-
- <portType name="submit_port_type">
- <operation name="submit">
- <input message="tns:submit_msg"/>
- <output message="tns:submit_msg"/>
- </operation>
- </portType>
-
- <binding name="submit_binding" type="tns:submit_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="submit">
- <soap:operation soapAction="urn:example.com:document#submit" style="document"/>
- <input><soap:body use="literal"/></input>
- <output><soap:body use="literal"/></output>
- </operation>
- </binding>
-
- <service name="submit_service">
- <port name="submit_port" binding="tns:submit_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/soap/wsdlDriver/echo_version.rb b/test/soap/wsdlDriver/echo_version.rb
deleted file mode 100644
index 7d76fb7587..0000000000
--- a/test/soap/wsdlDriver/echo_version.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# urn:example.com:simpletype-rpc-type
-class Version_struct
- @@schema_type = "version_struct"
- @@schema_ns = "urn:example.com:simpletype-rpc-type"
-
- attr_accessor :version
- attr_accessor :msg
-
- def initialize(version = nil, msg = nil)
- @version = version
- @msg = msg
- end
-end
-
-# urn:example.com:simpletype-rpc-type
-module Versions
- C_16 = "1.6"
- C_18 = "1.8"
- C_19 = "1.9"
-end
diff --git a/test/soap/wsdlDriver/simpletype.wsdl b/test/soap/wsdlDriver/simpletype.wsdl
deleted file mode 100644
index 6781dda552..0000000000
--- a/test/soap/wsdlDriver/simpletype.wsdl
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="echo_version"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:example.com:simpletype-rpc"
- xmlns:txd="urn:example.com:simpletype-rpc-type"
- targetNamespace="urn:example.com:simpletype-rpc"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:example.com:simpletype-rpc-type">
- <xsd:complexType name="version_struct">
- <xsd:all>
- <xsd:element name="myversion" type="txd:myversions" />
- <xsd:element name="msg" type="xsd:string" />
- </xsd:all>
- </xsd:complexType>
-
- <xsd:simpleType name="myversions">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="1.6"/>
- <xsd:enumeration value="1.8"/>
- <xsd:enumeration value="1.9"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:schema>
- </types>
-
- <message name="msg_version">
- <part name="myversion" type="txd:myversions"/>
- </message>
-
- <message name="msg_version_struct">
- <part name="return" type="txd:version_struct"/>
- </message>
-
- <portType name="echo_version_port_type">
- <operation name="echo_version">
- <input message="tns:msg_version"/>
- <output message="tns:msg_version_struct"/>
- </operation>
- </portType>
-
- <binding name="echo_version_binding" type="tns:echo_version_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
- <operation name="echo_version">
- <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
- <input>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="echo_version_service">
- <port name="echo_version_port" binding="tns:echo_version_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/soap/wsdlDriver/test_calc.rb b/test/soap/wsdlDriver/test_calc.rb
deleted file mode 100644
index f1cc116a59..0000000000
--- a/test/soap/wsdlDriver/test_calc.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/httpserver'
-require 'soap/wsdlDriver'
-
-
-module SOAP
-
-
-class TestCalc < Test::Unit::TestCase
- class Server < ::SOAP::RPC::HTTPServer
- def on_init
- add_method(self, 'add', 'x', 'y')
- end
-
- def add(x, y)
- x.to_f + y.to_f
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new(
- :BindAddress => "0.0.0.0",
- :Port => Port,
- :AccessLog => [],
- :SOAPDefaultNamespace => 'http://www.fred.com'
- )
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- @wsdl = File.join(DIR, 'calc.wsdl')
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream if @client
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_rpc_driver
- @client = ::SOAP::WSDLDriverFactory.new(@wsdl).create_rpc_driver
- @client.wiredump_dev = STDOUT if $DEBUG
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = true
- assert_equal(0.3, @client.add(0.1, 0.2))
- @client.generate_explicit_type = false
- assert_equal(0.3, @client.add(0.1, 0.2))
- end
-
- def test_old_driver
- @client = ::SOAP::WSDLDriverFactory.new(@wsdl).create_driver
- @client.wiredump_dev = STDOUT if $DEBUG
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = true
- assert_equal(0.3, @client.add(0.1, 0.2))
- @client.generate_explicit_type = false
- assert_equal(0.3, @client.add(0.1, 0.2))
- end
-end
-
-
-end
diff --git a/test/soap/wsdlDriver/test_document.rb b/test/soap/wsdlDriver/test_document.rb
deleted file mode 100644
index 634b827aae..0000000000
--- a/test/soap/wsdlDriver/test_document.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module SOAP
-
-
-class TestDocument < Test::Unit::TestCase
- Namespace = 'urn:example.com:document'
-
- class Server < ::SOAP::RPC::StandaloneServer
- def on_init
- add_document_method(self, 'urn:example.com:document#submit', 'submit', XSD::QName.new(Namespace, 'ruby'), XSD::QName.new(Namespace, 'ruby'))
- end
-
- def submit(ruby)
- ruby
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new('Test', Namespace, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- wsdl = File.join(DIR, 'document.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDOUT if $DEBUG
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_document
- msg = {'myversion' => "1.9", 'date' => "2004-01-01T00:00:00Z"}
- reply_msg = @client.submit(msg)
- assert_equal('1.9', reply_msg.myversion)
- assert_equal('1.9', reply_msg['myversion'])
- assert_equal('2004-01-01T00:00:00Z', reply_msg.date)
- assert_equal('2004-01-01T00:00:00Z', reply_msg['date'])
- end
-end
-
-
-end
diff --git a/test/soap/wsdlDriver/test_simpletype.rb b/test/soap/wsdlDriver/test_simpletype.rb
deleted file mode 100644
index 76b3a32df7..0000000000
--- a/test/soap/wsdlDriver/test_simpletype.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/httpserver'
-require 'soap/wsdlDriver'
-
-
-module SOAP
-
-
-class TestSimpleType < Test::Unit::TestCase
- class Server < ::SOAP::RPC::HTTPServer
- def on_init
- add_method(self, 'echo_version', 'version')
- end
-
- def echo_version(version)
- # "2.0" is out of range.
- Version_struct.new(version || "2.0", 'checked')
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
- require File.join(DIR, 'echo_version')
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new(
- :BindAddress => "0.0.0.0",
- :Port => Port,
- :AccessLog => [],
- :SOAPDefaultNamespace => "urn:example.com:simpletype-rpc"
- )
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- wsdl = File.join(DIR, 'simpletype.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.wiredump_dev = STDOUT if $DEBUG
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = false
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_ping
- result = @client.echo_version("1.9")
- assert_equal("1.9", result.version)
- assert_equal("checked", result.msg)
- assert_raise(XSD::ValueSpaceError) do
- @client.echo_version("2.0")
- end
- assert_raise(XSD::ValueSpaceError) do
- @client.echo_version(nil) # nil => "2.0" => out of range
- end
- end
-end
-
-
-end
diff --git a/test/wsdl/any/any.wsdl b/test/wsdl/any/any.wsdl
deleted file mode 100644
index 4d1f73a8cd..0000000000
--- a/test/wsdl/any/any.wsdl
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="echo"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:example.com:echo"
- xmlns:txd="urn:example.com:echo-type"
- targetNamespace="urn:example.com:echo"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:example.com:echo-type">
- <xsd:complexType name="foo.bar">
- <xsd:sequence>
- <xsd:any />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:schema>
- </types>
-
- <message name="msg_echoitem">
- <part name="echoitem" type="txd:foo.bar"/>
- </message>
-
- <portType name="echo_port_type">
- <operation name="echo">
- <input message="tns:msg_echoitem"/>
- <output message="tns:msg_echoitem"/>
- </operation>
- </portType>
-
- <binding name="echo_binding" type="tns:echo_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
- <operation name="echo">
- <soap:operation soapAction="urn:example.com:echo"/>
- <input>
- <soap:body use="encoded" namespace="urn:example.com:echo"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:example.com:echo"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="echo_service">
- <port name="echo_port" binding="tns:echo_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/any/expectedDriver.rb b/test/wsdl/any/expectedDriver.rb
deleted file mode 100644
index 6d1827fb94..0000000000
--- a/test/wsdl/any/expectedDriver.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'echo.rb'
-
-require 'soap/rpc/driver'
-
-class Echo_port_type < ::SOAP::RPC::Driver
- DefaultEndpointUrl = "http://localhost:10080"
- MappingRegistry = ::SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- FooBar,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") }
- )
-
- Methods = [
- [ XSD::QName.new("urn:example.com:echo", "echo"),
- "urn:example.com:echo",
- "echo",
- [ ["in", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]],
- ["retval", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ]
- ]
-
- def initialize(endpoint_url = nil)
- endpoint_url ||= DefaultEndpointUrl
- super(endpoint_url, nil)
- self.mapping_registry = MappingRegistry
- init_methods
- end
-
-private
-
- def init_methods
- Methods.each do |definitions|
- opt = definitions.last
- if opt[:request_style] == :document
- add_document_operation(*definitions)
- else
- add_rpc_operation(*definitions)
- qname = definitions[0]
- name = definitions[2]
- if qname.name != name and qname.name.capitalize == name.capitalize
- ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
- __send__(name, *arg)
- end
- end
- end
- end
- end
-end
-
diff --git a/test/wsdl/any/expectedEcho.rb b/test/wsdl/any/expectedEcho.rb
deleted file mode 100644
index 456950dfef..0000000000
--- a/test/wsdl/any/expectedEcho.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'xsd/qname'
-
-# {urn:example.com:echo-type}foo.bar
-class FooBar
- @@schema_type = "foo.bar"
- @@schema_ns = "urn:example.com:echo-type"
- @@schema_element = [["any", [nil, XSD::QName.new(nil, "any")]]]
-
- attr_accessor :any
-
- def initialize(any = nil)
- @any = any
- end
-end
diff --git a/test/wsdl/any/expectedService.rb b/test/wsdl/any/expectedService.rb
deleted file mode 100644
index e3885e7c6c..0000000000
--- a/test/wsdl/any/expectedService.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-require 'echoServant.rb'
-
-require 'soap/rpc/standaloneServer'
-require 'soap/mapping/registry'
-
-class Echo_port_type
- MappingRegistry = ::SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- FooBar,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("urn:example.com:echo-type", "foo.bar") }
- )
-
- Methods = [
- [ XSD::QName.new("urn:example.com:echo", "echo"),
- "urn:example.com:echo",
- "echo",
- [ ["in", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]],
- ["retval", "echoitem", ["FooBar", "urn:example.com:echo-type", "foo.bar"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ]
- ]
-end
-
-class Echo_port_typeApp < ::SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super(*arg)
- servant = Echo_port_type.new
- Echo_port_type::Methods.each do |definitions|
- opt = definitions.last
- if opt[:request_style] == :document
- @router.add_document_operation(servant, *definitions)
- else
- @router.add_rpc_operation(servant, *definitions)
- end
- end
- self.mapping_registry = Echo_port_type::MappingRegistry
- end
-end
-
-if $0 == __FILE__
- # Change listen port.
- server = Echo_port_typeApp.new('app', nil, '0.0.0.0', 10080)
- trap(:INT) do
- server.shutdown
- end
- server.start
-end
diff --git a/test/wsdl/any/test_any.rb b/test/wsdl/any/test_any.rb
deleted file mode 100644
index 7b0e480be9..0000000000
--- a/test/wsdl/any/test_any.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/wsdl2ruby'
-module WSDL; module Any
-
-
-class TestAny < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
- def pathname(filename)
- File.join(DIR, filename)
- end
-
- def test_any
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("any.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['driver'] = nil
- gen.opt['client_skelton'] = nil
- gen.opt['servant_skelton'] = nil
- gen.opt['standalone_server_stub'] = nil
- gen.opt['force'] = true
- gen.run
- compare("expectedDriver.rb", "echoDriver.rb")
- compare("expectedEcho.rb", "echo.rb")
- compare("expectedService.rb", "echo_service.rb")
-
- File.unlink(pathname("echo_service.rb"))
- File.unlink(pathname("echo.rb"))
- File.unlink(pathname("echo_serviceClient.rb"))
- File.unlink(pathname("echoDriver.rb"))
- File.unlink(pathname("echoServant.rb"))
- end
-
- def compare(expected, actual)
- assert_equal(loadfile(expected), loadfile(actual), actual)
- end
-
- def loadfile(file)
- File.open(pathname(file)) { |f| f.read }
- end
-end
-
-
-end; end
diff --git a/test/wsdl/axisArray/axisArray.wsdl b/test/wsdl/axisArray/axisArray.wsdl
deleted file mode 100644
index 3602edb748..0000000000
--- a/test/wsdl/axisArray/axisArray.wsdl
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions name = "itemList"
- targetNamespace="urn:jp.gr.jin.rrr.example.itemList"
- xmlns:tns="urn:jp.gr.jin.rrr.example.itemList"
- xmlns:typens="urn:jp.gr.jin.rrr.example.itemListType"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="urn:jp.gr.jin.rrr.example.itemListType"
- xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
- <complexType name="Item">
- <sequence>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
- <complexType name="ItemList">
- <sequence>
- <element maxOccurs="unbounded" minOccurs="0" name="Item" type="typens:Item"/>
- </sequence>
- </complexType>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="listItemRequest"/>
-
- <wsdl:message name="listItemResponse">
- <wsdl:part name="list" type="typens:ItemList"/>
- </wsdl:message>
-
- <wsdl:portType name="ItemListPortType">
- <wsdl:operation name="listItem">
- <wsdl:input message="tns:listItemRequest" name="listItemRequest"/>
- <wsdl:output message="tns:listItemResponse" name="listItemResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="ItemListBinding" type="tns:ItemListPortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="listItem">
- <soap:operation soapAction=""/>
- <wsdl:input name="listItemRequest">
- <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
- </wsdl:input>
- <wsdl:output name="listItemResponse">
- <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="ItemListService">
- <wsdl:port binding="tns:ItemListBinding" name="ItemListPort">
- <soap:address location="http://localhost:10080/"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/test/wsdl/axisArray/itemList.rb b/test/wsdl/axisArray/itemList.rb
deleted file mode 100644
index b81297ed37..0000000000
--- a/test/wsdl/axisArray/itemList.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by wsdl2ruby.rb with axisArray.wsdl.
-
-# urn:jp.gr.jin.rrr.example.itemListType
-class Item
- @@schema_type = "Item"
- @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
-
- def name
- @name
- end
-
- def name=(value)
- @name = value
- end
-
- def initialize(name = nil)
- @name = name
- end
-end
-
-# urn:jp.gr.jin.rrr.example.itemListType
-class ItemList < Array
- # Contents type should be dumped here...
- @@schema_type = "ItemList"
- @@schema_ns = "urn:jp.gr.jin.rrr.example.itemListType"
-end
-
diff --git a/test/wsdl/axisArray/test_axisarray.rb b/test/wsdl/axisArray/test_axisarray.rb
deleted file mode 100644
index 9f220bb48a..0000000000
--- a/test/wsdl/axisArray/test_axisarray.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'test/unit'
-require 'soap/processor'
-require 'soap/mapping'
-require 'soap/rpc/element'
-require 'wsdl/importer'
-require 'itemList.rb'
-
-
-module WSDL
-
-
-class TestAxisArray < Test::Unit::TestCase
- def setup
- @xml =<<__EOX__
-<?xml version="1.0" encoding="UTF-8"?>
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <ns1:listItemResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:jp.gr.jin.rrr.example.itemList">
- <list href="#id0"/>
- </ns1:listItemResponse>
- <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ItemList" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:jp.gr.jin.rrr.example.itemListType">
- <Item href="#id1"/>
- <Item href="#id2"/>
- <Item href="#id3"/>
- </multiRef>
- <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Item" xmlns:ns3="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
- <name xsi:type="xsd:string">name3</name>
- </multiRef>
- <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Item" xmlns:ns4="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
- <name xsi:type="xsd:string">name1</name>
- </multiRef>
- <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Item" xmlns:ns5="urn:jp.gr.jin.rrr.example.itemListType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
- <name xsi:type="xsd:string">name2</name>
- </multiRef>
- </soapenv:Body>
-</soapenv:Envelope>
-__EOX__
- end
-
- def test_by_stub
- header, body = ::SOAP::Processor.unmarshal(@xml)
- ary = ::SOAP::Mapping.soap2obj(body.response)
- assert_equal(3, ary.size)
- assert_equal("name1", ary[0].name)
- assert_equal("name2", ary[1].name)
- assert_equal("name3", ary[2].name)
- end
-
- def test_by_wsdl
- wsdlfile = File.join(File.dirname(File.expand_path(__FILE__)), 'axisArray.wsdl')
- wsdl = WSDL::Importer.import(wsdlfile)
- service = wsdl.services[0]
- port = service.ports[0]
- wsdl_types = wsdl.collect_complextypes
- rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding)
- opt = {}
- opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
- opt[:decode_typemap] = rpc_decode_typemap
- header, body = ::SOAP::Processor.unmarshal(@xml, opt)
- ary = ::SOAP::Mapping.soap2obj(body.response)
- assert_equal(3, ary.size)
- assert_equal("name1", ary[0].name)
- assert_equal("name2", ary[1].name)
- assert_equal("name3", ary[2].name)
- end
-end
-
-
-end
diff --git a/test/wsdl/datetime/DatetimeService.rb b/test/wsdl/datetime/DatetimeService.rb
deleted file mode 100644
index 800e06d66f..0000000000
--- a/test/wsdl/datetime/DatetimeService.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env ruby
-require 'datetimeServant.rb'
-
-require 'soap/rpc/standaloneServer'
-require 'soap/mapping/registry'
-
-class DatetimePortType
- MappingRegistry = ::SOAP::Mapping::Registry.new
-
- Methods = [
- ["now", "now",
- [
- ["in", "now", [::SOAP::SOAPDateTime]],
- ["retval", "now", [::SOAP::SOAPDateTime]]
- ],
- "", "urn:jp.gr.jin.rrr.example.datetime", :rpc
- ]
- ]
-end
-
-class DatetimePortTypeApp < ::SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super(*arg)
- servant = DatetimePortType.new
- DatetimePortType::Methods.each do |name_as, name, param_def, soapaction, namespace, style|
- if style == :document
- @router.add_document_operation(servant, soapaction, name, param_def)
- else
- qname = XSD::QName.new(namespace, name_as)
- @router.add_rpc_operation(servant, qname, soapaction, name, param_def)
- end
- end
- self.mapping_registry = DatetimePortType::MappingRegistry
- end
-end
-
-if $0 == __FILE__
- # Change listen port.
- server = DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080)
- trap(:INT) do
- server.shutdown
- end
- server.start
-end
diff --git a/test/wsdl/datetime/datetime.rb b/test/wsdl/datetime/datetime.rb
deleted file mode 100644
index e69de29bb2..0000000000
--- a/test/wsdl/datetime/datetime.rb
+++ /dev/null
diff --git a/test/wsdl/datetime/datetime.wsdl b/test/wsdl/datetime/datetime.wsdl
deleted file mode 100644
index 4998dc48d6..0000000000
--- a/test/wsdl/datetime/datetime.wsdl
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions name = "datetime"
- targetNamespace="urn:jp.gr.jin.rrr.example.datetime"
- xmlns:tns="urn:jp.gr.jin.rrr.example.datetime"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <wsdl:message name="nowRequest">
- <wsdl:part name="now" type="xsd:dateTime"/>
- </wsdl:message>
-
- <wsdl:message name="nowResponse">
- <wsdl:part name="now" type="xsd:dateTime"/>
- </wsdl:message>
-
- <wsdl:portType name="DatetimePortType">
- <wsdl:operation name="now">
- <wsdl:input message="tns:nowRequest" name="nowRequest"/>
- <wsdl:output message="tns:nowResponse" name="nowResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="DatetimeBinding" type="tns:DatetimePortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="now">
- <soap:operation soapAction=""/>
- <wsdl:input name="nowRequest">
- <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:jp.gr.jin.rrr.example.datetime" use="encoded"/>
- </wsdl:input>
- <wsdl:output name="nowResponse">
- <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:jp.gr.jin.rrr.example.datetime" use="encoded"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="DatetimeService">
- <wsdl:port binding="tns:DatetimeBinding" name="DatetimePort">
- <soap:address location="http://localhost:10080/"/>
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
diff --git a/test/wsdl/datetime/datetimeServant.rb b/test/wsdl/datetime/datetimeServant.rb
deleted file mode 100644
index 14145c42e5..0000000000
--- a/test/wsdl/datetime/datetimeServant.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'datetime.rb'
-
-class DatetimePortType
- # SYNOPSIS
- # now(now)
- #
- # ARGS
- # now - {http://www.w3.org/2001/XMLSchema}dateTime
- #
- # RETURNS
- # now - {http://www.w3.org/2001/XMLSchema}dateTime
- #
- # RAISES
- # (undefined)
- #
- def now(now)
- #raise NotImplementedError.new
- now + 1
- end
-end
-
diff --git a/test/wsdl/datetime/test_datetime.rb b/test/wsdl/datetime/test_datetime.rb
deleted file mode 100644
index 7652318205..0000000000
--- a/test/wsdl/datetime/test_datetime.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require 'test/unit'
-require 'soap/wsdlDriver'
-require 'DatetimeService.rb'
-
-
-module WSDL
-module Datetime
-
-
-class TestDatetime < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = DatetimePortTypeApp.new('Datetime server', nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- end
-
- def setup_client
- wsdl = File.join(DIR, 'datetime.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = true
- @client.wiredump_dev = STDOUT if $DEBUG
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def test_datetime
- d = DateTime.now
- d1 = d + 1
- d2 = @client.now(d)
- assert_equal(d1.year, d2.year)
- assert_equal(d1.month, d2.month)
- assert_equal(d1.day, d2.day)
- assert_equal(d1.hour, d2.hour)
- assert_equal(d1.min, d2.min)
- assert_equal(d1.sec, d2.sec)
- assert_equal(d1.sec, d2.sec)
- end
-
- def test_time
- d = DateTime.now
- t = Time.gm(d.year, d.month, d.day, d.hour, d.min, d.sec)
- d1 = d + 1
- d2 = @client.now(t)
- assert_equal(d1.year, d2.year)
- assert_equal(d1.month, d2.month)
- assert_equal(d1.day, d2.day)
- assert_equal(d1.hour, d2.hour)
- assert_equal(d1.min, d2.min)
- assert_equal(d1.sec, d2.sec)
- assert_equal(d1.sec, d2.sec)
- end
-end
-
-
-end
-end
diff --git a/test/wsdl/document/document.wsdl b/test/wsdl/document/document.wsdl
deleted file mode 100644
index fbf03fae8b..0000000000
--- a/test/wsdl/document/document.wsdl
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions
- name="echo"
- targetNamespace="urn:docrpc"
- xmlns:tns="urn:docrpc"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema elementFormDefault="unqualified" targetNamespace="urn:docrpc">
- <xsd:complexType name="echo_struct">
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="m_string" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="1" name="m_datetime" type="xsd:dateTime" />
- </xsd:sequence>
- <xsd:attribute name="m_attr" type="xsd:string" />
- </xsd:complexType>
-
- <xsd:element name="echoele">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="struct1" type="tns:echo_struct" />
- <xsd:element minOccurs="0" maxOccurs="1" name="struct-2" type="tns:echo_struct" />
- </xsd:sequence>
- <xsd:attribute name="attr_string" type="xsd:string" />
- <xsd:attribute name="attr-int" type="xsd:int" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="echo_response">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="struct1" type="tns:echo_struct" />
- <xsd:element minOccurs="0" maxOccurs="1" name="struct-2" type="tns:echo_struct" />
- </xsd:sequence>
- <xsd:attribute name="attr_string" type="xsd:string" />
- <xsd:attribute name="attr-int" type="xsd:int" />
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </types>
-
- <message name="echo_in">
- <part name="parameters" element="tns:echoele" />
- </message>
- <message name="echo_out">
- <part name="parameters" element="tns:echo_response" />
- </message>
-
- <portType name="docrpc_porttype">
- <operation name="echo">
- <input message="tns:echo_in" />
- <output message="tns:echo_out" />
- </operation>
- </portType>
-
- <binding name="docrpc_binding" type="tns:docrpc_porttype">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="echo">
- <soap:operation soapAction="urn:docrpc:echo" style="document" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="docrpc_service">
- <port name="docprc_service_port" binding="tns:docrpc_binding">
- <soap:address location="http://localhost:17171/" />
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/document/number.wsdl b/test/wsdl/document/number.wsdl
deleted file mode 100644
index cc3dd8e9f0..0000000000
--- a/test/wsdl/document/number.wsdl
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions
- name="foo"
- targetNamespace="urn:foo"
- xmlns:tns="urn:foo"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema elementFormDefault="unqualified" targetNamespace="urn:foo">
- <xsd:element name="get_foo">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="number" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </types>
-
- <message name="get_foo_in">
- <part name="parameters" element="tns:get_foo" />
- </message>
- <message name="get_foo_out">
- <part name="parameters" type="xsd:string" />
- </message>
-
- <portType name="foo_porttype">
- <operation name="get_foo">
- <input message="tns:get_foo_in" />
- <output message="tns:get_foo_out" />
- </operation>
- </portType>
-
- <binding name="foo_binding" type="tns:foo_porttype">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
- style="document" />
- <operation name="get_foo">
- <soap:operation soapAction="urn:foo:get_foo" style="document" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="foo_service">
- <port name="foo_service_port" binding="tns:foo_binding">
- <soap:address location="http://localhost:17171/" />
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/document/ping_nosoapaction.wsdl b/test/wsdl/document/ping_nosoapaction.wsdl
deleted file mode 100644
index ab9529e456..0000000000
--- a/test/wsdl/document/ping_nosoapaction.wsdl
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions xmlns:tns="http://xmlsoap.org/Ping"
-xmlns="http://schemas.xmlsoap.org/wsdl/"
-xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-targetNamespace="http://xmlsoap.org/Ping" name="Ping">
- <types>
- <schema targetNamespace="http://xmlsoap.org/Ping"
- xmlns="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
- <complexType name="ping">
- <sequence>
- <element name="scenario" type="xsd:string"
- nillable="true"/>
- <element name="origin" type="xsd:string"
- nillable="true"/>
- <element name="text" type="xsd:string"
- nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="pingResponse">
- <sequence>
- <element name="scenario" type="xsd:string"
- nillable="true"/>
- <element name="origin" type="xsd:string"
- nillable="true"/>
- <element name="text" type="xsd:string"
- nillable="true"/>
- </sequence>
- </complexType>
- <element name="Ping" type="tns:ping"/>
- <element name="PingResponse" type="tns:pingResponse"/>
- </schema>
- </types>
- <message name="PingRequest">
- <part name="ping" element="tns:Ping"/>
- </message>
- <message name="PingResponse">
- <part name="pingResponse" element="tns:PingResponse"/>
- </message>
- <portType name="PingPort">
- <operation name="Ping">
- <input message="tns:PingRequest"/>
- <output message="tns:PingResponse"/>
- </operation>
- </portType>
- <binding name="PingBinding" type="tns:PingPort">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="Ping">
- <soap:operation/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="PingService">
- <port name="PingPort" binding="tns:PingBinding">
- <soap:address
- location="http://127.0.0.1:8080/axis/services/PingPort"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/document/test_nosoapaction.rb b/test/wsdl/document/test_nosoapaction.rb
deleted file mode 100644
index 77f642fe1b..0000000000
--- a/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
diff --git a/test/wsdl/document/test_number.rb b/test/wsdl/document/test_number.rb
deleted file mode 100644
index a640ef2a25..0000000000
--- a/test/wsdl/document/test_number.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module WSDL; module Document
-
-
-class TestNumber < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = 'urn:foo'
-
- def on_init
- add_document_method(
- self,
- Namespace + ':get_foo',
- 'get_foo',
- XSD::QName.new(Namespace, 'get_foo'),
- XSD::QName.new(Namespace, 'get_foo_response')
- )
- end
-
- def get_foo(arg)
- arg.number
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
- Port = 17171
-
- def setup
- setup_server
- setup_classdef
- @client = nil
- end
-
- def teardown
- teardown_server
- File.unlink(pathname('foo.rb'))
- @client.reset_stream if @client
- end
-
- def setup_server
- @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("number.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['force'] = true
- gen.run
- require pathname('foo')
- 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
-
- def test_wsdl
- wsdl = File.join(DIR, 'number.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDOUT if $DEBUG
-
- # with the Struct defined in foo.rb, which is generated from WSDL
- assert_equal("12345", @client.get_foo(Get_foo.new("12345")))
-
- # with Hash
- assert_equal("12345", @client.get_foo({:number => "12345"}))
-
- # with Original struct
- get_foo_struct = Struct.new(:number)
- assert_equal("12345", @client.get_foo(get_foo_struct.new("12345")))
- end
-end
-
-
-end; end
diff --git a/test/wsdl/document/test_rpc.rb b/test/wsdl/document/test_rpc.rb
deleted file mode 100644
index 6c07a18ac2..0000000000
--- a/test/wsdl/document/test_rpc.rb
+++ /dev/null
@@ -1,177 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module WSDL; module Document
-
-
-class TestRPC < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = 'urn:docrpc'
-
- def on_init
- add_document_method(
- self,
- Namespace + ':echo',
- 'echo',
- XSD::QName.new(Namespace, 'echo'),
- XSD::QName.new(Namespace, 'echo_response')
- )
- end
-
- def echo(arg)
- if arg.is_a?(Echoele)
- # swap args
- tmp = arg.struct1
- arg.struct1 = arg.struct_2
- arg.struct_2 = tmp
- arg
- else
- # swap args
- tmp = arg["struct1"]
- arg["struct1"] = arg["struct-2"]
- arg["struct-2"] = tmp
- arg
- end
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_classdef
- @client = nil
- end
-
- def teardown
- teardown_server
- File.unlink(pathname('echo.rb'))
- @client.reset_stream if @client
- end
-
- def setup_server
- @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("document.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['force'] = true
- gen.run
- require pathname('echo')
- 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
-
- def test_wsdl
- wsdl = File.join(DIR, 'document.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDOUT if $DEBUG
-
- struct1 = Echo_struct.new("mystring1", now1 = Time.now)
- struct1.xmlattr_m_attr = 'myattr1'
- struct2 = Echo_struct.new("mystring2", now2 = Time.now)
- struct2.xmlattr_m_attr = 'myattr2'
- echo = Echoele.new(struct1, struct2)
- echo.xmlattr_attr_string = 'attr_string'
- echo.xmlattr_attr_int = 5
- ret = @client.echo(echo)
-
- # struct#m_datetime in a response is a DateTime even though
- # struct#m_datetime in a request is a Time.
- timeformat = "%Y-%m-%dT%H:%M:%S"
- assert_equal("mystring2", ret.struct1.m_string)
- assert_equal(now2.strftime(timeformat),
- date2time(ret.struct1.m_datetime).strftime(timeformat))
- assert_equal("mystring1", ret.struct_2.m_string)
- assert_equal(now1.strftime(timeformat),
- date2time(ret.struct_2.m_datetime).strftime(timeformat))
- assert_equal("attr_string", ret.xmlattr_attr_string)
- assert_equal(5, ret.xmlattr_attr_int)
- end
-
- def date2time(date)
- if date.respond_to?(:to_time)
- date.to_time
- else
- d = date.new_offset(0)
- d.instance_eval {
- Time.utc(year, mon, mday, hour, min, sec,
- (sec_fraction * 86400000000).to_i)
- }.getlocal
- end
- end
-
- include ::SOAP
- def test_naive
- @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/")
- @client.add_document_method('echo', 'urn:docrpc:echo',
- XSD::QName.new('urn:docrpc', 'echoele'),
- XSD::QName.new('urn:docrpc', 'echo_response'))
- @client.wiredump_dev = STDOUT if $DEBUG
-
- echo = SOAPElement.new('foo')
- echo.extraattr['attr_string'] = 'attr_string'
- echo.extraattr['attr-int'] = 5
- echo.add(struct1 = SOAPElement.new('struct1'))
- struct1.add(SOAPElement.new('m_string', 'mystring1'))
- struct1.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:31+01:00'))
- struct1.extraattr['m_attr'] = 'myattr1'
- echo.add(struct2 = SOAPElement.new('struct-2'))
- struct2.add(SOAPElement.new('m_string', 'mystring2'))
- struct2.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:32+02:00'))
- struct2.extraattr['m_attr'] = 'myattr2'
- ret = @client.echo(echo)
- timeformat = "%Y-%m-%dT%H:%M:%S"
- assert_equal('mystring2', ret.struct1.m_string)
- assert_equal('2005-03-17T19:47:32',
- ret.struct1.m_datetime.strftime(timeformat))
- assert_equal("mystring1", ret.struct_2.m_string)
- assert_equal('2005-03-17T19:47:31',
- ret.struct_2.m_datetime.strftime(timeformat))
- assert_equal('attr_string', ret.xmlattr_attr_string)
- assert_equal(5, ret.xmlattr_attr_int)
-
- echo = {'struct1' => {'m_string' => 'mystring1', 'm_datetime' => '2005-03-17T19:47:31+01:00'},
- 'struct-2' => {'m_string' => 'mystring2', 'm_datetime' => '2005-03-17T19:47:32+02:00'}}
- ret = @client.echo(echo)
- timeformat = "%Y-%m-%dT%H:%M:%S"
- assert_equal('mystring2', ret.struct1.m_string)
- assert_equal('2005-03-17T19:47:32',
- ret.struct1.m_datetime.strftime(timeformat))
- assert_equal("mystring1", ret.struct_2.m_string)
- assert_equal('2005-03-17T19:47:31',
- ret.struct_2.m_datetime.strftime(timeformat))
- end
-end
-
-
-end; end
diff --git a/test/wsdl/emptycomplextype.wsdl b/test/wsdl/emptycomplextype.wsdl
deleted file mode 100644
index 4f8dc4849c..0000000000
--- a/test/wsdl/emptycomplextype.wsdl
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name = "emptycomplextype"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <xsd:schema elementFormDefault="qualified"
- targetNamespace="urn:jp.gr.jin.rrr.example.emptycomplextype">
- <xsd:element name="typeIn">
- <xsd:complexType />
- </xsd:element>
-
- <xsd:element name="typeOut">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="0" maxOccurs="1" name="str1" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="1" name="str2" type="xsd:string" />
- <xsd:element minOccurs="0" maxOccurs="1" name="seq">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:any />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- </types>
-</definitions>
diff --git a/test/wsdl/map/map.wsdl b/test/wsdl/map/map.wsdl
deleted file mode 100644
index e418a4cbbd..0000000000
--- a/test/wsdl/map/map.wsdl
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0"?>
-<definitions
- name="map"
- targetNamespace="urn:map"
- xmlns:tns="urn:map"
- xmlns:txd="urn:map"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:apachesoap="http://xml.apache.org/xml-soap">
-
- <types>
- <schema
- xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://xml.apache.org/xml-soap">
- <complexType name="Map">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="key" type="xsd:anyType" />
- <element name="value" type="xsd:anyType" />
- </sequence>
- </complexType>
- </element>
- </sequence>
- </complexType>
- </schema>
- </types>
-
- <message name="mapRequest"/>
- <message name="mapResponse">
- <part name="return" type="apachesoap:Map"/>
- </message>
-
- <message name="map2Request">
- <part name="arg" type="apachesoap:Map"/>
- </message>
- <message name="map2Response">
- <part name="return" type="apachesoap:Map"/>
- </message>
-
- <portType name="MapServicePortType">
- <operation name="map" parameterOrder="">
- <input message="tns:mapRequest"/>
- <output message="tns:mapResponse"/>
- </operation>
-
- <operation name="map2" parameterOrder="">
- <input message="tns:map2Request"/>
- <output message="tns:map2Response"/>
- </operation>
- </portType>
-
- <binding name="MapServicePortBinding" type="tns:MapServicePortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="map">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:map"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:map"/>
- </output>
- </operation>
-
- <operation name="map2">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:map"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:map"/>
- </output>
- </operation>
- </binding>
-
- <service name="MapService">
- <port name="MapServicePort" binding="tns:MapServicePortBinding">
- <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/map/map.xml b/test/wsdl/map/map.xml
deleted file mode 100644
index 7106735ffc..0000000000
--- a/test/wsdl/map/map.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n2:mapResponse xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/" xmlns:n2="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <return xmlns:n3="http://xml.apache.org/xml-soap" xsi:type="n3:Map">
- <item>
- <key xsi:type="xsd:string">a</key>
- <value xsi:type="n3:Map">
- <item>
- <key xsi:type="xsd:string">a1</key>
- <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
- <item xsi:type="xsd:string">a1</item>
- </value>
- </item>
- <item>
- <key xsi:type="xsd:string">a2</key>
- <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
- <item xsi:type="xsd:string">a2</item>
- </value>
- </item>
- </value>
- </item>
- <item>
- <key xsi:type="xsd:string">b</key>
- <value xsi:type="n3:Map">
- <item>
- <key xsi:type="xsd:string">b1</key>
- <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
- <item xsi:type="xsd:string">b1</item>
- </value>
- </item>
- <item>
- <key xsi:type="xsd:string">b2</key>
- <value xsi:type="n1:Array" n1:arrayType="xsd:anyType[1]">
- <item xsi:type="xsd:string">b2</item>
- </value>
- </item>
- </value>
- </item>
- </return>
- </n2:mapResponse>
- </env:Body>
-</env:Envelope>
diff --git a/test/wsdl/map/test_map.rb b/test/wsdl/map/test_map.rb
deleted file mode 100644
index 68f7d76e05..0000000000
--- a/test/wsdl/map/test_map.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/httpserver'
-require 'soap/wsdlDriver'
-
-
-module WSDL
-
-
-class TestMap < Test::Unit::TestCase
- Port = 17171
- DIR = File.dirname(File.expand_path(__FILE__))
-
- class Server < ::SOAP::RPC::HTTPServer
- def on_init
- add_method(self, 'map')
- add_method(self, 'map2', 'arg')
- end
-
- def map
- {1 => "a", 2 => "b"}
- end
-
- def map2(arg)
- arg
- end
- end
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new(
- :BindAddress => "0.0.0.0",
- :Port => Port,
- :AccessLog => [],
- :SOAPDefaultNamespace => "urn:map"
- )
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- end
-
- def setup_client
- wsdl = File.join(DIR, 'map.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = true
- @client.wiredump_dev = STDOUT if $DEBUG
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def test_by_wsdl
- dir = File.dirname(File.expand_path(__FILE__))
- wsdlfile = File.join(dir, 'map.wsdl')
- xml = File.open(File.join(dir, 'map.xml')) { |f| f.read }
- wsdl = WSDL::Importer.import(wsdlfile)
- service = wsdl.services[0]
- port = service.ports[0]
- wsdl_types = wsdl.collect_complextypes
- rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding)
- opt = {}
- opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
- opt[:decode_typemap] = rpc_decode_typemap
- header, body = ::SOAP::Processor.unmarshal(xml, opt)
- map = ::SOAP::Mapping.soap2obj(body.response)
- assert_equal(["a1"], map["a"]["a1"])
- assert_equal(["a2"], map["a"]["a2"])
- assert_equal(["b1"], map["b"]["b1"])
- assert_equal(["b2"], map["b"]["b2"])
- end
-
- def test_wsdldriver
- assert_equal({1 => "a", 2 => "b"}, @client.map)
- assert_equal({1 => 2}, @client.map2({1 => 2}))
- assert_equal({1 => {2 => 3}}, @client.map2({1 => {2 => 3}}))
- assert_equal({["a", 2] => {2 => 3}}, @client.map2({["a", 2] => {2 => 3}}))
- end
-end
-
-
-end
diff --git a/test/wsdl/marshal/person.wsdl b/test/wsdl/marshal/person.wsdl
deleted file mode 100644
index 6ea8a04825..0000000000
--- a/test/wsdl/marshal/person.wsdl
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<definitions name="Person"
- targetNamespace="http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
- xmlns:tns="http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.jin.gr.jp/~nahi/xmlns/sample/Person">
- <complexType name="Person">
- <all>
- <element name="familyname" type="xsd:string"/>
- <element name="givenname" type="xsd:string"/>
- <element name="var1" type="xsd:int"/>
- <element name="var2" type="xsd:double"/>
- <element name="var3" type="xsd:string"/>
- </all>
- </complexType>
- </xsd:schema>
- </types>
-</definitions>
diff --git a/test/wsdl/marshal/person_org.rb b/test/wsdl/marshal/person_org.rb
deleted file mode 100644
index f8c0e0db76..0000000000
--- a/test/wsdl/marshal/person_org.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'xsd/qname'
-
-# {http://www.jin.gr.jp/~nahi/xmlns/sample/Person}Person
-class Person
- @@schema_type = "Person"
- @@schema_ns = "http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
- @@schema_element = [["familyname", ["SOAP::SOAPString", XSD::QName.new(nil, "familyname")]], ["givenname", ["SOAP::SOAPString", XSD::QName.new(nil, "givenname")]], ["var1", ["SOAP::SOAPInt", XSD::QName.new(nil, "var1")]], ["var2", ["SOAP::SOAPDouble", XSD::QName.new(nil, "var2")]], ["var3", ["SOAP::SOAPString", XSD::QName.new(nil, "var3")]]]
-
- attr_accessor :familyname
- attr_accessor :givenname
- attr_accessor :var1
- attr_accessor :var2
- attr_accessor :var3
-
- def initialize(familyname = nil, givenname = nil, var1 = nil, var2 = nil, var3 = nil)
- @familyname = familyname
- @givenname = givenname
- @var1 = var1
- @var2 = var2
- @var3 = var3
- end
-end
diff --git a/test/wsdl/marshal/test_wsdlmarshal.rb b/test/wsdl/marshal/test_wsdlmarshal.rb
deleted file mode 100644
index cd2bdb198a..0000000000
--- a/test/wsdl/marshal/test_wsdlmarshal.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'soap/mapping/wsdlencodedregistry'
-require 'soap/marshal'
-require 'wsdl/soap/wsdl2ruby'
-
-class WSDLMarshaller
- include SOAP
-
- def initialize(wsdlfile)
- wsdl = WSDL::Parser.new.parse(File.open(wsdlfile) { |f| f.read })
- types = wsdl.collect_complextypes
- @opt = {
- :decode_typemap => types,
- :generate_explicit_type => false,
- :pretty => true
- }
- @mapping_registry = Mapping::WSDLEncodedRegistry.new(types)
- end
-
- def dump(obj, io = nil)
- type = Mapping.class2element(obj.class)
- ele = Mapping.obj2soap(obj, @mapping_registry, type)
- ele.elename = ele.type
- Processor.marshal(SOAPEnvelope.new(nil, SOAPBody.new(ele)), @opt, io)
- end
-
- def load(io)
- header, body = Processor.unmarshal(io, @opt)
- Mapping.soap2obj(body.root_node)
- end
-end
-
-
-require File.join(File.dirname(__FILE__), 'person_org')
-
-class Person
- def ==(rhs)
- @familyname == rhs.familyname and @givenname == rhs.givenname and
- @var1 == rhs.var1 and @var2 == rhs.var2 and @var3 == rhs.var3
- end
-end
-
-
-class TestWSDLMarshal < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
-
- def test_marshal
- marshaller = WSDLMarshaller.new(pathname('person.wsdl'))
- obj = Person.new("NAKAMURA", "Hiroshi", 1, 1.0, "1")
- str = marshaller.dump(obj)
- obj2 = marshaller.load(str)
- assert_equal(obj, obj2)
- assert_equal(str, marshaller.dump(obj2))
- end
-
- def test_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("person.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['force'] = true
- gen.run
- compare("person_org.rb", "Person.rb")
- File.unlink(pathname('Person.rb'))
- end
-
- def compare(expected, actual)
- assert_equal(loadfile(expected), loadfile(actual), actual)
- end
-
- def loadfile(file)
- File.open(pathname(file)) { |f| f.read }
- end
-
- def pathname(filename)
- File.join(DIR, filename)
- end
-end
diff --git a/test/wsdl/multiplefault.wsdl b/test/wsdl/multiplefault.wsdl
deleted file mode 100644
index 2d928b60b0..0000000000
--- a/test/wsdl/multiplefault.wsdl
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0"?>
-<definitions name="MultipleFaultTest"
- targetNamespace="urn:jp.gr.jin.rrr.example.ele"
- xmlns:tns="urn:jp.gr.jin.rrr.example.ele"
- xmlns:typens="urn:jp.gr.jin.rrr.example.datatypes"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jp.gr.jin.rrr.example.datatypes">
- <xsd:complexType name="AuthenticationError">
- <all>
- <element name="message" type="xsd:string" />
- <element name="backtrace" type="xoapenc:Array" />
- </all>
- </xsd:complexType>
- <xsd:complexType name="AuthorizationError">
- <all>
- <element name="message" type="xsd:string" />
- <element name="backtrace" type="xoapenc:Array" />
- </all>
- </xsd:complexType>
- </xsd:schema>
- </types>
-
- <message name="inputmsg"/>
- <message name="outputmsg"/>
- <message name="faultmsg1" >
- <part name="exception" type="typens:AuthenticationError" />
- </message>
- <message name="faultmsg2" >
- <part name="exception" type="typens:AuthorizationError" />
- </message>
-
- <portType name="MultipleFaultPortType">
- <operation name="myoperation">
- <input message="tns:inputmsg"/>
- <output message="tns:outputmsg"/>
- <fault message="tns:faultmsg1"/>
- <fault message="tns:faultmsg2"/>
- </operation>
- </portType>
-
- <binding name="MultipleFaultBinding" type="tns:MultipleFaultPortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="myoperation">
- <soap:operation soapAction="urn:jp.gr.jin.rrr.example.ele"/>
- <input>
- <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:jp.gr.jin.rrr.example.ele"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="MultipleFaultService">
- <port name="MultipleFaultPortType" binding="tns:MultipleFaultBinding">
- <soap:address location="http://localhost:17171/"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/qualified/lp.wsdl b/test/wsdl/qualified/lp.wsdl
deleted file mode 100644
index b107b7b392..0000000000
--- a/test/wsdl/qualified/lp.wsdl
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions
- name="lp"
- targetNamespace="urn:lp"
- xmlns:tns="urn:lp"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="urn:lp" schemaLocation="lp.xsd"/>
- </schema>
- </types>
-
- <message name="login_in">
- <part name="parameters" element="tns:login" />
- </message>
- <message name="login_out">
- <part name="parameters" element="tns:loginResponse" />
- </message>
-
- <portType name="lp_porttype">
- <operation name="login">
- <input message="tns:login_in" />
- <output message="tns:login_out" />
- </operation>
- </portType>
-
- <binding name="lp_binding" type="tns:lp_porttype">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="login">
- <soap:operation soapAction="urn:lp:login" style="document" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="lp_service">
- <port name="lp_service_port" binding="tns:lp_binding">
- <soap:address location="http://localhost:17171/" />
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/qualified/lp.xsd b/test/wsdl/qualified/lp.xsd
deleted file mode 100644
index 12bcbd8cef..0000000000
--- a/test/wsdl/qualified/lp.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:lp="urn:lp" targetNamespace="urn:lp" elementFormDefault="unqualified">
-
- <xs:complexType name="login">
- <xs:sequence>
- <xs:element name="username" type="xs:string"/>
- <xs:element name="password" type="xs:string"/>
- <xs:element name="timezone" type="xs:string" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="login" type="lp:login"/>
-
- <xs:complexType name="loginResponse">
- <xs:sequence>
- <xs:element name="loginResult">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="sessionID" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="loginResponse" type="lp:loginResponse"/>
-</xs:schema>
diff --git a/test/wsdl/qualified/np.wsdl b/test/wsdl/qualified/np.wsdl
deleted file mode 100644
index e2b7253d0e..0000000000
--- a/test/wsdl/qualified/np.wsdl
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www50.brinkster.com/vbfacileinpt/np" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www50.brinkster.com/vbfacileinpt/np" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://www50.brinkster.com/vbfacileinpt/np">
- <s:element name="GetPrimeNumbers">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="Max" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="GetPrimeNumbersResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="GetPrimeNumbersResult" type="s:string" />
- </s:sequence>
- </s:complexType>
- </s:element>
- </s:schema>
- </wsdl:types>
- <wsdl:message name="GetPrimeNumbersSoapIn">
- <wsdl:part name="parameters" element="tns:GetPrimeNumbers" />
- </wsdl:message>
- <wsdl:message name="GetPrimeNumbersSoapOut">
- <wsdl:part name="parameters" element="tns:GetPrimeNumbersResponse" />
- </wsdl:message>
- <wsdl:portType name="pnumSoap">
- <wsdl:operation name="GetPrimeNumbers">
- <wsdl:input message="tns:GetPrimeNumbersSoapIn" />
- <wsdl:output message="tns:GetPrimeNumbersSoapOut" />
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="pnumSoap" type="tns:pnumSoap">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="GetPrimeNumbers">
- <soap:operation soapAction="http://www50.brinkster.com/vbfacileinpt/np/GetPrimeNumbers" style="document" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="pnum">
- <wsdl:port name="pnumSoap" binding="tns:pnumSoap">
- <soap:address location="http://www50.brinkster.com/vbfacileinpt/np.asmx" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions> \ No newline at end of file
diff --git a/test/wsdl/qualified/test_qualified.rb b/test/wsdl/qualified/test_qualified.rb
deleted file mode 100644
index d6c1159a87..0000000000
--- a/test/wsdl/qualified/test_qualified.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-require 'test/unit'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-if defined?(HTTPAccess2)
-
-module WSDL
-
-
-class TestQualified < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = 'http://www50.brinkster.com/vbfacileinpt/np'
-
- def on_init
- add_document_method(
- self,
- Namespace + '/GetPrimeNumbers',
- 'GetPrimeNumbers',
- XSD::QName.new(Namespace, 'GetPrimeNumbers'),
- XSD::QName.new(Namespace, 'GetPrimeNumbersResponse')
- )
- end
-
- def GetPrimeNumbers(arg)
- nil
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
- Port = 17171
-
- def setup
- setup_server
- setup_clientdef
- @client = nil
- end
-
- def teardown
- teardown_server
- unless $DEBUG
- File.unlink(pathname('default.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)
- 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['classdef'] = nil
- gen.opt['driver'] = nil
- gen.opt['force'] = true
- gen.run
- require pathname('default.rb')
- ensure
- 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_NS =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:GetPrimeNumbers xmlns:n1="http://www50.brinkster.com/vbfacileinpt/np">
- <n1:Max>10</n1:Max>
- </n1:GetPrimeNumbers>
- </env:Body>
-</env:Envelope>]
-
- LOGIN_REQUEST_QUALIFIED =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <GetPrimeNumbers xmlns="http://www50.brinkster.com/vbfacileinpt/np">
- <Max>10</Max>
- </GetPrimeNumbers>
- </env:Body>
-</env:Envelope>]
-
- def test_wsdl
- wsdl = File.join(DIR, 'np.wsdl')
- @client = nil
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- ensure
- Dir.chdir(backupdir)
- end
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = str = ''
- @client.GetPrimeNumbers(:Max => 10)
- assert_equal(LOGIN_REQUEST_QUALIFIED_NS, parse_requestxml(str))
- end
-
- include ::SOAP
- def test_naive
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- require pathname('defaultDriver')
- ensure
- Dir.chdir(backupdir)
- end
- @client = PnumSoap.new("http://localhost:#{Port}/")
-
- @client.wiredump_dev = str = ''
- @client.getPrimeNumbers(GetPrimeNumbers.new(10))
- assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
- end
-
- def parse_requestxml(str)
- str.split(/\r?\n\r?\n/)[3]
- end
-end
-
-
-end
-
-end
diff --git a/test/wsdl/qualified/test_unqualified.rb b/test/wsdl/qualified/test_unqualified.rb
deleted file mode 100644
index bcfed73e58..0000000000
--- a/test/wsdl/qualified/test_unqualified.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-require 'test/unit'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-if defined?(HTTPAccess2)
-
-module WSDL
-
-
-class TestUnqualified < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = 'urn:lp'
-
- def on_init
- add_document_method(
- self,
- Namespace + ':login',
- 'login',
- XSD::QName.new(Namespace, 'login'),
- XSD::QName.new(Namespace, 'loginResponse')
- )
- end
-
- def login(arg)
- nil
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
- Port = 17171
-
- def setup
- setup_server
- setup_clientdef
- @client = nil
- end
-
- def teardown
- teardown_server
- File.unlink(pathname('lp.rb'))
- File.unlink(pathname('lpDriver.rb'))
- @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)
- end
-
- def setup_clientdef
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("lp.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['driver'] = nil
- gen.opt['force'] = true
- gen.run
- require pathname('lp')
- ensure
- 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 =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:login xmlns:n1="urn:lp">
- <username>NaHi</username>
- <password>passwd</password>
- <timezone>JST</timezone>
- </n1:login>
- </env:Body>
-</env:Envelope>]
-
- def test_wsdl
- wsdl = File.join(DIR, 'lp.wsdl')
- @client = nil
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- ensure
- Dir.chdir(backupdir)
- end
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = str = ''
- @client.login(:timezone => 'JST', :password => 'passwd',
- :username => 'NaHi')
- assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
- end
-
- include ::SOAP
- def test_naive
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- require pathname('lpDriver')
- ensure
- Dir.chdir(backupdir)
- end
- @client = Lp_porttype.new("http://localhost:#{Port}/")
-
- @client.wiredump_dev = str = ''
- @client.login(Login.new('NaHi', 'passwd', 'JST'))
- assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str))
- end
-
- def parse_requestxml(str)
- str.split(/\r?\n\r?\n/)[3]
- end
-end
-
-
-end
-
-end
diff --git a/test/wsdl/raa/RAA.rb b/test/wsdl/raa/RAA.rb
deleted file mode 100644
index aff0525480..0000000000
--- a/test/wsdl/raa/RAA.rb
+++ /dev/null
@@ -1,243 +0,0 @@
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class Category
- @@schema_type = "Category"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-
- def major
- @major
- end
-
- def major=(value)
- @major = value
- end
-
- def minor
- @minor
- end
-
- def minor=(value)
- @minor = value
- end
-
- def initialize(major = nil,
- minor = nil)
- @major = major
- @minor = minor
- end
-end
-
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class Product
- @@schema_type = "Product"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-
- def id
- @id
- end
-
- def id=(value)
- @id = value
- end
-
- def name
- @name
- end
-
- def name=(value)
- @name = value
- end
-
- def short_description
- @short_description
- end
-
- def short_description=(value)
- @short_description = value
- end
-
- def version
- @version
- end
-
- def version=(value)
- @version = value
- end
-
- def status
- @status
- end
-
- def status=(value)
- @status = value
- end
-
- def homepage
- @homepage
- end
-
- def homepage=(value)
- @homepage = value
- end
-
- def download
- @download
- end
-
- def download=(value)
- @download = value
- end
-
- def license
- @license
- end
-
- def license=(value)
- @license = value
- end
-
- def description
- @description
- end
-
- def description=(value)
- @description = value
- end
-
- def initialize(id = nil,
- name = nil,
- short_description = nil,
- version = nil,
- status = nil,
- homepage = nil,
- download = nil,
- license = nil,
- description = nil)
- @id = id
- @name = name
- @short_description = short_description
- @version = version
- @status = status
- @homepage = homepage
- @download = download
- @license = license
- @description = description
- end
-end
-
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class Owner
- @@schema_type = "Owner"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-
- def id
- @id
- end
-
- def id=(value)
- @id = value
- end
-
- def email
- @email
- end
-
- def email=(value)
- @email = value
- end
-
- def name
- @name
- end
-
- def name=(value)
- @name = value
- end
-
- def initialize(id = nil,
- email = nil,
- name = nil)
- @id = id
- @email = email
- @name = name
- end
-end
-
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class Info
- @@schema_type = "Info"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-
- def category
- @category
- end
-
- def category=(value)
- @category = value
- end
-
- def product
- @product
- end
-
- def product=(value)
- @product = value
- end
-
- def owner
- @owner
- end
-
- def owner=(value)
- @owner = value
- end
-
- def created
- @created
- end
-
- def created=(value)
- @created = value
- end
-
- def updated
- @updated
- end
-
- def updated=(value)
- @updated = value
- end
-
- def initialize(category = nil,
- product = nil,
- owner = nil,
- created = nil,
- updated = nil)
- @category = category
- @product = product
- @owner = owner
- @created = created
- @updated = updated
- end
-end
-
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class InfoArray < Array
- # Contents type should be dumped here...
- @@schema_type = "InfoArray"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-end
-
-# http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/
-class StringArray < Array
- # Contents type should be dumped here...
- @@schema_type = "StringArray"
- @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
-end
-
-# http://xml.apache.org/xml-soap
-class Map < Array
- # Contents type should be dumped here...
- @@schema_type = "Map"
- @@schema_ns = "http://xml.apache.org/xml-soap"
-end
-
diff --git a/test/wsdl/raa/RAAServant.rb b/test/wsdl/raa/RAAServant.rb
deleted file mode 100644
index 68380f8e48..0000000000
--- a/test/wsdl/raa/RAAServant.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-class RAABaseServicePortType
- # SYNOPSIS
- # getAllListings
- #
- # ARGS
- # N/A
- #
- # RETURNS
- # return StringArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}StringArray
- #
- # RAISES
- # (undefined)
- #
- def getAllListings
- #raise NotImplementedError.new
- ["ruby", "soap4r"]
- end
-
- # SYNOPSIS
- # getProductTree
- #
- # ARGS
- # N/A
- #
- # RETURNS
- # return Map - {http://xml.apache.org/xml-soap}Map
- #
- # RAISES
- # (undefined)
- #
- def getProductTree
- raise NotImplementedError.new
- end
-
- # SYNOPSIS
- # getInfoFromCategory(category)
- #
- # ARGS
- # category Category - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Category
- #
- # RETURNS
- # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
- #
- # RAISES
- # (undefined)
- #
- def getInfoFromCategory(category)
- raise NotImplementedError.new
- end
-
- # SYNOPSIS
- # getModifiedInfoSince(timeInstant)
- #
- # ARGS
- # timeInstant - {http://www.w3.org/2001/XMLSchema}dateTime
- #
- # RETURNS
- # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
- #
- # RAISES
- # (undefined)
- #
- def getModifiedInfoSince(timeInstant)
- raise NotImplementedError.new
- end
-
- # SYNOPSIS
- # getInfoFromName(productName)
- #
- # ARGS
- # productName - {http://www.w3.org/2001/XMLSchema}string
- #
- # RETURNS
- # return Info - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Info
- #
- # RAISES
- # (undefined)
- #
- def getInfoFromName(productName)
- raise NotImplementedError.new
- end
-
- # SYNOPSIS
- # getInfoFromOwnerId(ownerId)
- #
- # ARGS
- # ownerId - {http://www.w3.org/2001/XMLSchema}int
- #
- # RETURNS
- # return InfoArray - {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray
- #
- # RAISES
- # (undefined)
- #
- def getInfoFromOwnerId(ownerId)
- raise NotImplementedError.new
- end
-end
-
diff --git a/test/wsdl/raa/RAAService.rb b/test/wsdl/raa/RAAService.rb
deleted file mode 100644
index 9d0813304c..0000000000
--- a/test/wsdl/raa/RAAService.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env ruby
-require 'RAAServant.rb'
-
-require 'soap/rpc/standaloneServer'
-
-class RAABaseServicePortType
- MappingRegistry = SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- StringArray,
- ::SOAP::SOAPArray,
- ::SOAP::Mapping::Registry::TypedArrayFactory,
- { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
- )
- MappingRegistry.set(
- Map,
- ::SOAP::SOAPArray,
- ::SOAP::Mapping::Registry::TypedArrayFactory,
- { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
- )
- MappingRegistry.set(
- Category,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
- )
- MappingRegistry.set(
- InfoArray,
- ::SOAP::SOAPArray,
- ::SOAP::Mapping::Registry::TypedArrayFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
- )
- MappingRegistry.set(
- Info,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
- )
- MappingRegistry.set(
- Product,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
- )
- MappingRegistry.set(
- Owner,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
- )
-
-
- Methods = [
- ["getAllListings", "getAllListings", [
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getProductTree", "getProductTree", [
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromCategory", "getInfoFromCategory", [
- ["in", "category",
- [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getModifiedInfoSince", "getModifiedInfoSince", [
- ["in", "timeInstant",
- [SOAP::SOAPDateTime]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromName", "getInfoFromName", [
- ["in", "productName",
- [SOAP::SOAPString]],
- ["retval", "return",
- [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromOwnerId", "getInfoFromOwnerId", [
- ["in", "ownerId",
- [SOAP::SOAPInt]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]], "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
- ]
-end
-
-class App < SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super
-
- servant = RAABaseServicePortType.new
- RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
- qname = XSD::QName.new(namespace, name_as)
- @router.add_method(servant, qname, soapaction, name, params)
- end
-
- self.mapping_registry = RAABaseServicePortType::MappingRegistry
- end
-end
-
-# Change listen port.
-if $0 == __FILE__
- App.new('app', nil, '0.0.0.0', 10080).start
-end
diff --git a/test/wsdl/raa/README.txt b/test/wsdl/raa/README.txt
deleted file mode 100644
index efbaf9d87c..0000000000
--- a/test/wsdl/raa/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-RAAServant.rb: based on the file which is generated with the following command;
- bin/wsdl2ruby.rb --wsdl raa.wsdl --servant_skelton --force
-
-RAAService.rb: generated with the following command;
- bin/wsdl2ruby.rb --wsdl raa.wsdl --standalone_server_stub --force
-
-RAA.rb: generated with the following command;
- bin/wsdl2ruby.rb --wsdl raa.wsdl --classdef --force
diff --git a/test/wsdl/raa/raa.wsdl b/test/wsdl/raa/raa.wsdl
deleted file mode 100644
index 78376893dd..0000000000
--- a/test/wsdl/raa/raa.wsdl
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version="1.0"?>
-<definitions
- name="RAA"
- targetNamespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
- xmlns:tns="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
- xmlns:txd="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:apachesoap="http://xml.apache.org/xml-soap">
-
- <types>
- <schema
- xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/">
-
- <complexType name="Category">
- <all>
- <element name="major" type="string"/>
- <element name="minor" type="string"/>
- </all>
- </complexType>
-
- <complexType name="Product">
- <all>
- <element name="id" type="int"/>
- <element name="name" type="string"/>
- <element name="short_description" type="string"/>
- <element name="version" type="string"/>
- <element name="status" type="string"/>
- <element name="homepage" type="anyURI"/>
- <element name="download" type="anyURI"/>
- <element name="license" type="string"/>
- <element name="description" type="string"/>
- </all>
- </complexType>
-
- <complexType name="Owner">
- <all>
- <element name="id" type="int"/>
- <element name="email" type="anyURI"/>
- <element name="name" type="string"/>
- </all>
- </complexType>
-
- <complexType name="Info">
- <all>
- <element name="category" type="txd:Category"/>
- <element name="product" type="txd:Product"/>
- <element name="owner" type="txd:Owner"/>
- <element name="created" type="xsd:dateTime"/>
- <element name="updated" type="xsd:dateTime"/>
- </all>
- </complexType>
-
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
- <complexType name="InfoArray">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="txd:Info[]"/>
- </restriction>
- </complexContent>
- </complexType>
-
- <complexType name="StringArray">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
- </restriction>
- </complexContent>
- </complexType>
- </schema>
-
- <!-- type definition for ApacheSOAP's Map -->
- <schema
- xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://xml.apache.org/xml-soap">
- <complexType name="Map">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="key" type="anyType" />
- <element name="value" type="anyType" />
- </sequence>
- </complexType>
- </element>
- </sequence>
- </complexType>
- </schema>
- </types>
-
- <message name="getAllListingsRequest"/>
- <message name="getAllListingsResponse">
- <part name="return" type="txd:StringArray"/>
- </message>
-
- <message name="getProductTreeRequest"/>
- <message name="getProductTreeResponse">
- <part name="return" type="apachesoap:Map"/>
- </message>
-
- <message name="getInfoFromCategoryRequest">
- <part name="category" type="txd:Category"/>
- </message>
- <message name="getInfoFromCategoryResponse">
- <part name="return" type="txd:InfoArray"/>
- </message>
-
- <message name="getModifiedInfoSinceRequest">
- <part name="timeInstant" type="xsd:dateTime"/>
- </message>
- <message name="getModifiedInfoSinceResponse">
- <part name="return" type="txd:InfoArray"/>
- </message>
-
- <message name="getInfoFromNameRequest">
- <part name="productName" type="xsd:string"/>
- </message>
- <message name="getInfoFromNameResponse">
- <part name="return" type="txd:Info"/>
- </message>
-
- <message name="getInfoFromOwnerIdRequest">
- <part name="ownerId" type="xsd:int"/>
- </message>
- <message name="getInfoFromOwnerIdResponse">
- <part name="return" type="txd:InfoArray"/>
- </message>
-
- <portType name="RAABaseServicePortType">
- <operation name="getAllListings"
- parameterOrder="">
- <input message="tns:getAllListingsRequest"/>
- <output message="tns:getAllListingsResponse"/>
- </operation>
-
- <operation name="getProductTree"
- parameterOrder="">
- <input message="tns:getProductTreeRequest"/>
- <output message="tns:getProductTreeResponse"/>
- </operation>
-
- <operation name="getInfoFromCategory"
- parameterOrder="category">
- <input message="tns:getInfoFromCategoryRequest"/>
- <output message="tns:getInfoFromCategoryResponse"/>
- </operation>
-
- <operation name="getModifiedInfoSince"
- parameterOrder="timeInstant">
- <input message="tns:getModifiedInfoSinceRequest"/>
- <output message="tns:getModifiedInfoSinceResponse"/>
- </operation>
-
- <operation name="getInfoFromName"
- parameterOrder="productName">
- <input message="tns:getInfoFromNameRequest"/>
- <output message="tns:getInfoFromNameResponse"/>
- </operation>
-
- <operation name="getInfoFromOwnerId"
- parameterOrder="ownerId">
- <input message="tns:getInfoFromOwnerIdRequest"/>
- <output message="tns:getInfoFromOwnerIdResponse"/>
- </operation>
- </portType>
-
- <binding name="RAABaseServicePortBinding" type="tns:RAABaseServicePortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <operation name="getAllListings">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
-
- <operation name="getProductTree">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
-
- <operation name="getInfoFromCategory">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
-
- <operation name="getModifiedInfoSince">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
-
- <operation name="getInfoFromName">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
-
- <operation name="getInfoFromOwnerId">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"/>
- </output>
- </operation>
- </binding>
-
- <service name="RAAService">
- <port name="RAABaseServicePort" binding="tns:RAABaseServicePortBinding">
- <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/raa/server.rb b/test/wsdl/raa/server.rb
deleted file mode 100644
index 87bbc6f569..0000000000
--- a/test/wsdl/raa/server.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-require 'soap/rpc/standaloneServer'
-require 'RAA.rb'
-
-class RAABaseServicePortType
- MappingRegistry = SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- StringArray,
- ::SOAP::SOAPArray,
- ::SOAP::Mapping::Registry::TypedArrayFactory,
- { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") }
- )
- MappingRegistry.set(
- Map,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://xml.apache.org/xml-soap", "Map") }
- )
- MappingRegistry.set(
- Category,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category") }
- )
- MappingRegistry.set(
- InfoArray,
- ::SOAP::SOAPArray,
- ::SOAP::Mapping::Registry::TypedArrayFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
- )
- MappingRegistry.set(
- Info,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info") }
- )
- MappingRegistry.set(
- Product,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Product") }
- )
- MappingRegistry.set(
- Owner,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Owner") }
- )
-
- Methods = [
- ["getAllListings", "getAllListings", [
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getProductTree", "getProductTree", [
- ["retval", "return",
- [::SOAP::SOAPStruct, "http://xml.apache.org/xml-soap", "Map"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromCategory", "getInfoFromCategory", [
- ["in", "category",
- [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getModifiedInfoSince", "getModifiedInfoSince", [
- ["in", "timeInstant",
- [SOAP::SOAPDateTime]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromName", "getInfoFromName", [
- ["in", "productName",
- [SOAP::SOAPString]],
- ["retval", "return",
- [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"],
- ["getInfoFromOwnerId", "getInfoFromOwnerId", [
- ["in", "ownerId",
- [SOAP::SOAPInt]],
- ["retval", "return",
- [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]]],
- "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/"]
- ]
-
- def getAllListings
- ["ruby", "soap4r"]
- end
-end
-
-class RAABaseServiceServer < SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super
-
- servant = RAABaseServicePortType.new
- RAABaseServicePortType::Methods.each do |name_as, name, params, soapaction, namespace|
- qname = XSD::QName.new(namespace, name_as)
- @router.add_method(servant, qname, soapaction, name, params)
- end
-
- self.mapping_registry = RAABaseServicePortType::MappingRegistry
- end
-end
diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb
deleted file mode 100644
index 0b00042ffb..0000000000
--- a/test/wsdl/raa/test_raa.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-require 'test/unit'
-require 'soap/wsdlDriver'
-require 'RAA.rb'
-require 'RAAServant.rb'
-require 'RAAService.rb'
-
-
-module WSDL
-module RAA
-
-
-class TestRAA < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = App.new('RAA server', nil, '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- end
-
- def setup_client
- wsdl = File.join(DIR, 'raa.wsdl')
- @raa = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @raa.endpoint_url = "http://localhost:#{Port}/"
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @raa.reset_stream
- end
-
- def test_raa
- assert_equal(["ruby", "soap4r"], @raa.getAllListings)
- end
-
- def foo
- p @raa.getProductTree()
- p @raa.getInfoFromCategory(Category.new("Library", "XML"))
- t = Time.at(Time.now.to_i - 24 * 3600)
- p @raa.getModifiedInfoSince(t)
- p @raa.getModifiedInfoSince(DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec))
- o = @raa.getInfoFromName("SOAP4R")
- p o.type
- p o.owner.name
- p o
- end
-end
-
-
-end
-end
diff --git a/test/wsdl/ref/expectedProduct.rb b/test/wsdl/ref/expectedProduct.rb
deleted file mode 100644
index 91c6e4c566..0000000000
--- a/test/wsdl/ref/expectedProduct.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'xsd/qname'
-
-# {urn:product}Rating
-module Rating
- C_0 = "0"
- C_1 = "+1"
- C_1_2 = "-1"
-end
-
-# {urn:product}Product-Bag
-class ProductBag
- @@schema_type = "Product-Bag"
- @@schema_ns = "urn:product"
- @@schema_attribute = {XSD::QName.new("urn:product", "version") => "SOAP::SOAPString", XSD::QName.new("urn:product", "yesno") => "SOAP::SOAPString"}
- @@schema_element = [["bag", ["Product[]", XSD::QName.new(nil, "bag")]], ["rating", ["SOAP::SOAPString[]", XSD::QName.new("urn:product", "Rating")]], ["product_Bag", [nil, XSD::QName.new("urn:product", "Product-Bag")]], ["comment_1", [nil, XSD::QName.new(nil, "comment_1")]], ["comment_2", ["Comment[]", XSD::QName.new(nil, "comment-2")]]]
-
- attr_accessor :bag
- attr_accessor :product_Bag
- attr_accessor :comment_1
- attr_accessor :comment_2
-
- def Rating
- @rating
- end
-
- def Rating=(value)
- @rating = value
- end
-
- def xmlattr_version
- (@__xmlattr ||= {})[XSD::QName.new("urn:product", "version")]
- end
-
- def xmlattr_version=(value)
- (@__xmlattr ||= {})[XSD::QName.new("urn:product", "version")] = value
- end
-
- def xmlattr_yesno
- (@__xmlattr ||= {})[XSD::QName.new("urn:product", "yesno")]
- end
-
- def xmlattr_yesno=(value)
- (@__xmlattr ||= {})[XSD::QName.new("urn:product", "yesno")] = value
- end
-
- def initialize(bag = [], rating = [], product_Bag = nil, comment_1 = [], comment_2 = [])
- @bag = bag
- @rating = rating
- @product_Bag = product_Bag
- @comment_1 = comment_1
- @comment_2 = comment_2
- @__xmlattr = {}
- end
-end
-
-# {urn:product}Creator
-class Creator
- @@schema_type = "Creator"
- @@schema_ns = "urn:product"
- @@schema_element = []
-
- def initialize
- end
-end
-
-# {urn:product}Product
-class Product
- @@schema_type = "Product"
- @@schema_ns = "urn:product"
- @@schema_element = [["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], ["rating", ["SOAP::SOAPString", XSD::QName.new("urn:product", "Rating")]]]
-
- attr_accessor :name
-
- def Rating
- @rating
- end
-
- def Rating=(value)
- @rating = value
- end
-
- def initialize(name = nil, rating = nil)
- @name = name
- @rating = rating
- end
-end
-
-# {urn:product}Comment
-class Comment < String
-end
diff --git a/test/wsdl/ref/product.wsdl b/test/wsdl/ref/product.wsdl
deleted file mode 100644
index 993fe217aa..0000000000
--- a/test/wsdl/ref/product.wsdl
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>
-<definitions name="product"
- targetNamespace="urn:product"
- xmlns:tns="urn:product"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:product">
- <simpleType name="non-empty-string">
- <restriction base="xsd:string">
- <minLength value="1"/>
- </restriction>
- </simpleType>
-
- <complexType name="Product">
- <all>
- <element name="name" type="xsd:string"/>
- <element ref="tns:Rating"/>
- </all>
- </complexType>
-
- <complexType name="Comment">
- <simpleContent>
- <extension base="xsd:string">
- <attribute name="msgid" type="xsd:string" use="required"/>
- </extension>
- </simpleContent>
- </complexType>
-
- <attribute name="version" type="tns:non-empty-string"/>
-
- <attribute default="Y" name="yesno">
- <simpleType>
- <restriction base="xsd:string">
- <enumeration value="Y"/>
- <enumeration value="N"/>
- </restriction>
- </simpleType>
- </attribute>
-
- <element name="Rating">
- <simpleType>
- <restriction base="xsd:string">
- <enumeration value="+1"/>
- <enumeration value="0"/>
- <enumeration value="-1"/>
- </restriction>
- </simpleType>
- </element>
-
- <element name="Product-Bag">
- <complexType>
- <sequence>
- <element name="bag" type="tns:Product" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:Rating" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:Product-Bag"/>
- <element name="comment_1" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <simpleContent>
- <extension base="xsd:string">
- <attribute name="msgid" type="xsd:string" use="required"/>
- </extension>
- </simpleContent>
- </complexType>
- </element>
- <element name="comment-2" type="tns:Comment" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute ref="tns:version"/>
- <attribute ref="tns:yesno"/>
- </complexType>
- </element>
-
- <element name="Creator" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <simpleContent>
- <extension base="xsd:string">
- <attribute name="Role" type="xs:string" use="required"/>
- </extension>
- </simpleContent>
- </complexType>
- </element>
- </xsd:schema>
- </types>
-</definitions>
diff --git a/test/wsdl/ref/test_ref.rb b/test/wsdl/ref/test_ref.rb
deleted file mode 100644
index 165a8643e9..0000000000
--- a/test/wsdl/ref/test_ref.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-require 'wsdl/soap/wsdl2ruby'
-
-
-module WSDL
-module Ref
-
-
-class TestRef < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
- Port = 17171
-
- def test_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("product.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['force'] = true
- gen.run
- compare("expectedProduct.rb", "product.rb")
- File.unlink(pathname('product.rb'))
- end
-
- def compare(expected, actual)
- assert_equal(loadfile(expected), loadfile(actual), actual)
- end
-
- def loadfile(file)
- File.open(pathname(file)) { |f| f.read }
- end
-
- def pathname(filename)
- File.join(DIR, filename)
- end
-end
-
-
-end
-end
diff --git a/test/wsdl/rpc/rpc.wsdl b/test/wsdl/rpc/rpc.wsdl
deleted file mode 100644
index b0ee5c5e56..0000000000
--- a/test/wsdl/rpc/rpc.wsdl
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="echo"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:rpc"
- xmlns:txd="urn:rpc-type"
- targetNamespace="urn:rpc"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:rpc-type">
- <xsd:complexType name="person">
- <xsd:all>
- <xsd:element name="family-name" type="xsd:string" />
- <xsd:element name="given_name" type="xsd:string" />
- <xsd:element name="age" type="xsd:int" />
- <xsd:element name="link" type="txd:person" />
- </xsd:all>
- </xsd:complexType>
- </xsd:schema>
- </types>
-
- <message name="echo_in">
- <part name="arg1" type="txd:person"/>
- <part name="arg2" type="txd:person"/>
- </message>
-
- <message name="echo_out">
- <part name="return" type="txd:person"/>
- </message>
-
- <portType name="echo_port_type">
- <operation name="echo">
- <input message="tns:echo_in"/>
- <output message="tns:echo_out"/>
- </operation>
-
- <operation name="echo_err">
- <input message="tns:echo_in"/>
- <output message="tns:echo_out"/>
- </operation>
- </portType>
-
- <binding name="echo_binding" type="tns:echo_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
- <operation name="echo">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded" namespace="urn:rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
-
- <operation name="echo_err">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded" namespace="urn:rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="echo_service">
- <port name="echo_port" binding="tns:echo_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/rpc/test-rpc-lit.wsdl b/test/wsdl/rpc/test-rpc-lit.wsdl
deleted file mode 100644
index 72de747e36..0000000000
--- a/test/wsdl/rpc/test-rpc-lit.wsdl
+++ /dev/null
@@ -1,364 +0,0 @@
-<?xml version="1.0"?>
-
-<definitions name="RPC-Literal-TestDefinitions"
- targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test"
- xmlns:types="http://soapbuilders.org/rpc-lit-test/types"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types">
-
- <element name="stringItem" type="xsd:string" />
- <complexType name="ArrayOfstring">
- <sequence>
- <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="ArrayOfstringInline">
- <sequence>
- <element name="stringItem" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="ArrayOfint">
- <sequence>
- <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <element name="structItem" type="types:SOAPStruct" />
- <complexType name="SOAPStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- </all>
- </complexType>
-
- <complexType name="ArrayOfSOAPStruct">
- <sequence>
- <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="SOAPStructStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- <element ref="types:structItem" />
- </all>
- </complexType>
-
- <complexType name="SOAPArrayStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- <element name="varArray" type="types:ArrayOfstring"/>
- </all>
- </complexType>
-
- </schema>
-
- </types>
-
- <!-- echoStruct rpc operation -->
- <message name="echoStructRequest">
- <part name="inputStruct" type="types:SOAPStruct"/>
- </message>
- <message name="echoStructResponse">
- <part name="return" type="types:SOAPStruct"/>
- </message>
-
- <!-- echoStructArray rpc operation -->
- <message name="echoStructArrayRequest">
- <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/>
- </message>
- <message name="echoStructArrayResponse">
- <part name="return" type="types:ArrayOfSOAPStruct"/>
- </message>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <message name="echoStructAsSimpleTypesRequest">
- <part name="inputStruct" type="types:SOAPStruct"/>
- </message>
- <message name="echoStructAsSimpleTypesResponse">
- <part name="outputString" type="xsd:string"/>
- <part name="outputInteger" type="xsd:int"/>
- <part name="outputFloat" type="xsd:float"/>
- </message>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <message name="echoSimpleTypesAsStructRequest">
- <part name="inputString" type="xsd:string"/>
- <part name="inputInteger" type="xsd:int"/>
- <part name="inputFloat" type="xsd:float"/>
- </message>
- <message name="echoSimpleTypesAsStructResponse">
- <part name="return" type="types:SOAPStruct"/>
- </message>
-
- <!-- echoNestedStruct rpc operation -->
- <message name="echoNestedStructRequest">
- <part name="inputStruct" type="types:SOAPStructStruct"/>
- </message>
- <message name="echoNestedStructResponse">
- <part name="return" type="types:SOAPStructStruct"/>
- </message>
-
- <!-- echoNestedArray rpc operation -->
- <message name="echoNestedArrayRequest">
- <part name="inputStruct" type="types:SOAPArrayStruct"/>
- </message>
- <message name="echoNestedArrayResponse">
- <part name="return" type="types:SOAPArrayStruct"/>
- </message>
-
- <!-- echoStringArray rpc operation -->
- <message name="echoStringArrayRequest">
- <part name="inputStringArray" type="types:ArrayOfstring"/>
- </message>
- <message name="echoStringArrayResponse">
- <part name="return" type="types:ArrayOfstring"/>
- </message>
-
- <message name="echoStringArrayInlineRequest">
- <part name="inputStringArray" type="types:ArrayOfstringInline"/>
- </message>
- <message name="echoStringArrayInlineResponse">
- <part name="return" type="types:ArrayOfstringInline"/>
- </message>
-
- <!-- echoIntegerArray rpc operation -->
- <message name="echoIntegerArrayRequest">
- <part name="inputIntegerArray" type="types:ArrayOfint"/>
- </message>
- <message name="echoIntegerArrayResponse">
- <part name="return" type="types:ArrayOfint"/>
- </message>
-
- <!-- echoBoolean rpc operation -->
- <message name="echoBooleanRequest">
- <part name="inputBoolean" type="xsd:boolean"/>
- </message>
- <message name="echoBooleanResponse">
- <part name="return" type="xsd:boolean"/>
- </message>
-
- <!-- echoString rpc operation -->
- <message name="echoStringRequest">
- <part name="inputString" type="xsd:string"/>
- </message>
- <message name="echoStringResponse">
- <part name="return" type="xsd:string"/>
- </message>
-
-
- <portType name="SoapTestPortTypeRpc">
-
- <!-- echoStruct rpc operation -->
- <operation name="echoStruct" parameterOrder="inputStruct">
- <input message="tns:echoStructRequest"/>
- <output message="tns:echoStructResponse"/>
- </operation>
-
- <!-- echoStructArray rpc operation -->
- <operation name="echoStructArray" parameterOrder="inputStructArray">
- <input message="tns:echoStructArrayRequest"/>
- <output message="tns:echoStructArrayResponse"/>
- </operation>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
- <input message="tns:echoStructAsSimpleTypesRequest"/>
- <output message="tns:echoStructAsSimpleTypesResponse"/>
- </operation>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
- <input message="tns:echoSimpleTypesAsStructRequest"/>
- <output message="tns:echoSimpleTypesAsStructResponse"/>
- </operation>
-
- <!-- echoNestedStruct rpc operation -->
- <operation name="echoNestedStruct" parameterOrder="inputStruct">
- <input message="tns:echoNestedStructRequest"/>
- <output message="tns:echoNestedStructResponse"/>
- </operation>
-
- <!-- echoNestedArray rpc operation -->
- <operation name="echoNestedArray" parameterOrder="inputStruct">
- <input message="tns:echoNestedArrayRequest"/>
- <output message="tns:echoNestedArrayResponse"/>
- </operation>
-
- <!-- echoStringArray rpc operation -->
- <operation name="echoStringArray" parameterOrder="inputStringArray">
- <input message="tns:echoStringArrayRequest"/>
- <output message="tns:echoStringArrayResponse"/>
- </operation>
-
- <operation name="echoStringArrayInline" parameterOrder="inputStringArray">
- <input message="tns:echoStringArrayInlineRequest"/>
- <output message="tns:echoStringArrayInlineResponse"/>
- </operation>
-
- <!-- echoIntegerArray rpc operation -->
- <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
- <input message="tns:echoIntegerArrayRequest"/>
- <output message="tns:echoIntegerArrayResponse"/>
- </operation>
-
- <!-- echoBoolean rpc operation -->
- <operation name="echoBoolean" parameterOrder="inputBoolean">
- <input message="tns:echoBooleanRequest"/>
- <output message="tns:echoBooleanResponse"/>
- </operation>
-
- <!-- echoString rpc operation -->
- <operation name="echoString" parameterOrder="inputString">
- <input message="tns:echoStringRequest"/>
- <output message="tns:echoStringResponse"/>
- </operation>
-
- </portType>
-
- <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
- <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <!-- echoStruct rpc operation -->
- <operation name="echoStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructArray rpc operation -->
- <operation name="echoStructArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <operation name="echoStructAsSimpleTypes">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <operation name="echoSimpleTypesAsStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedStruct rpc operation -->
- <operation name="echoNestedStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedArray rpc operation -->
- <operation name="echoNestedArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStringArray rpc operation -->
- <operation name="echoStringArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <operation name="echoStringArrayInline">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoIntegerArray rpc operation -->
- <operation name="echoIntegerArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoBoolean rpc operation -->
- <operation name="echoBoolean">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoString rpc operation -->
- <operation name="echoString">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- </binding>
-
- <service name="WhiteMesaSoapRpcLitTestSvc">
-
- <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding">
- <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/>
- </port>
-
- </service>
-
-</definitions>
diff --git a/test/wsdl/rpc/test-rpc-lit12.wsdl b/test/wsdl/rpc/test-rpc-lit12.wsdl
deleted file mode 100644
index 901cde6f9c..0000000000
--- a/test/wsdl/rpc/test-rpc-lit12.wsdl
+++ /dev/null
@@ -1,455 +0,0 @@
-<?xml version="1.0"?>
-
-<definitions name="RPC-Literal-TestDefinitions"
- targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
- xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test"
- xmlns:types="http://soapbuilders.org/rpc-lit-test/types"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types">
-
- <element name="stringItem" type="xsd:string" />
- <complexType name="ArrayOfstring">
- <sequence>
- <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="ArrayOfint">
- <sequence>
- <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <element name="structItem" type="types:SOAPStruct" />
- <complexType name="SOAPStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- </all>
- </complexType>
-
- <complexType name="ArrayOfSOAPStruct">
- <sequence>
- <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="SOAPStructStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- <element ref="types:structItem" />
- </all>
- </complexType>
-
- <complexType name="SOAPArrayStruct">
- <all>
- <element name="varString" type="xsd:string"/>
- <element name="varInt" type="xsd:int"/>
- <element name="varFloat" type="xsd:float"/>
- <element name="varArray" type="types:ArrayOfstring"/>
- </all>
- </complexType>
-
- </schema>
-
- </types>
-
- <!-- echoStruct rpc operation -->
- <message name="echoStructRequest">
- <part name="inputStruct" type="types:SOAPStruct"/>
- </message>
- <message name="echoStructResponse">
- <part name="return" type="types:SOAPStruct"/>
- </message>
-
- <!-- echoStructArray rpc operation -->
- <message name="echoStructArrayRequest">
- <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/>
- </message>
- <message name="echoStructArrayResponse">
- <part name="return" type="types:ArrayOfSOAPStruct"/>
- </message>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <message name="echoStructAsSimpleTypesRequest">
- <part name="inputStruct" type="types:SOAPStruct"/>
- </message>
- <message name="echoStructAsSimpleTypesResponse">
- <part name="outputString" type="xsd:string"/>
- <part name="outputInteger" type="xsd:int"/>
- <part name="outputFloat" type="xsd:float"/>
- </message>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <message name="echoSimpleTypesAsStructRequest">
- <part name="inputString" type="xsd:string"/>
- <part name="inputInteger" type="xsd:int"/>
- <part name="inputFloat" type="xsd:float"/>
- </message>
- <message name="echoSimpleTypesAsStructResponse">
- <part name="return" type="types:SOAPStruct"/>
- </message>
-
- <!-- echoNestedStruct rpc operation -->
- <message name="echoNestedStructRequest">
- <part name="inputStruct" type="types:SOAPStructStruct"/>
- </message>
- <message name="echoNestedStructResponse">
- <part name="return" type="types:SOAPStructStruct"/>
- </message>
-
- <!-- echoNestedArray rpc operation -->
- <message name="echoNestedArrayRequest">
- <part name="inputStruct" type="types:SOAPArrayStruct"/>
- </message>
- <message name="echoNestedArrayResponse">
- <part name="return" type="types:SOAPArrayStruct"/>
- </message>
-
- <!-- echoStringArray rpc operation -->
- <message name="echoStringArrayRequest">
- <part name="inputStringArray" type="types:ArrayOfstring"/>
- </message>
- <message name="echoStringArrayResponse">
- <part name="return" type="types:ArrayOfstring"/>
- </message>
-
- <!-- echoIntegerArray rpc operation -->
- <message name="echoIntegerArrayRequest">
- <part name="inputIntegerArray" type="types:ArrayOfint"/>
- </message>
- <message name="echoIntegerArrayResponse">
- <part name="return" type="types:ArrayOfint"/>
- </message>
-
- <!-- echoBoolean rpc operation -->
- <message name="echoBooleanRequest">
- <part name="inputBoolean" type="xsd:boolean"/>
- </message>
- <message name="echoBooleanResponse">
- <part name="return" type="xsd:boolean"/>
- </message>
-
- <!-- echoString rpc operation -->
- <message name="echoStringRequest">
- <part name="inputString" type="xsd:string"/>
- </message>
- <message name="echoStringResponse">
- <part name="return" type="xsd:string"/>
- </message>
-
-
- <portType name="SoapTestPortTypeRpc">
-
- <!-- echoStruct rpc operation -->
- <operation name="echoStruct" parameterOrder="inputStruct">
- <input message="tns:echoStructRequest"/>
- <output message="tns:echoStructResponse"/>
- </operation>
-
- <!-- echoStructArray rpc operation -->
- <operation name="echoStructArray" parameterOrder="inputStructArray">
- <input message="tns:echoStructArrayRequest"/>
- <output message="tns:echoStructArrayResponse"/>
- </operation>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
- <input message="tns:echoStructAsSimpleTypesRequest"/>
- <output message="tns:echoStructAsSimpleTypesResponse"/>
- </operation>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
- <input message="tns:echoSimpleTypesAsStructRequest"/>
- <output message="tns:echoSimpleTypesAsStructResponse"/>
- </operation>
-
- <!-- echoNestedStruct rpc operation -->
- <operation name="echoNestedStruct" parameterOrder="inputStruct">
- <input message="tns:echoNestedStructRequest"/>
- <output message="tns:echoNestedStructResponse"/>
- </operation>
-
- <!-- echoNestedArray rpc operation -->
- <operation name="echoNestedArray" parameterOrder="inputStruct">
- <input message="tns:echoNestedArrayRequest"/>
- <output message="tns:echoNestedArrayResponse"/>
- </operation>
-
- <!-- echoStringArray rpc operation -->
- <operation name="echoStringArray" parameterOrder="inputStringArray">
- <input message="tns:echoStringArrayRequest"/>
- <output message="tns:echoStringArrayResponse"/>
- </operation>
-
- <!-- echoIntegerArray rpc operation -->
- <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
- <input message="tns:echoIntegerArrayRequest"/>
- <output message="tns:echoIntegerArrayResponse"/>
- </operation>
-
- <!-- echoBoolean rpc operation -->
- <operation name="echoBoolean" parameterOrder="inputBoolean">
- <input message="tns:echoBooleanRequest"/>
- <output message="tns:echoBooleanResponse"/>
- </operation>
-
- <!-- echoString rpc operation -->
- <operation name="echoString" parameterOrder="inputString">
- <input message="tns:echoStringRequest"/>
- <output message="tns:echoStringResponse"/>
- </operation>
-
- </portType>
-
- <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
- <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <!-- echoStruct rpc operation -->
- <operation name="echoStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructArray rpc operation -->
- <operation name="echoStructArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <operation name="echoStructAsSimpleTypes">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <operation name="echoSimpleTypesAsStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedStruct rpc operation -->
- <operation name="echoNestedStruct">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedArray rpc operation -->
- <operation name="echoNestedArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStringArray rpc operation -->
- <operation name="echoStringArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoIntegerArray rpc operation -->
- <operation name="echoIntegerArray">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoBoolean rpc operation -->
- <operation name="echoBoolean">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoString rpc operation -->
- <operation name="echoString">
- <soap11:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- </binding>
-
- <binding name="Soap12TestRpcLitBinding" type="tns:SoapTestPortTypeRpc">
- <soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <!-- echoStruct rpc operation -->
- <operation name="echoStruct">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructArray rpc operation -->
- <operation name="echoStructArray">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStructAsSimpleTypes rpc operation -->
- <operation name="echoStructAsSimpleTypes">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoSimpleTypesAsStruct rpc operation -->
- <operation name="echoSimpleTypesAsStruct">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedStruct rpc operation -->
- <operation name="echoNestedStruct">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoNestedArray rpc operation -->
- <operation name="echoNestedArray">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoStringArray rpc operation -->
- <operation name="echoStringArray">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoIntegerArray rpc operation -->
- <operation name="echoIntegerArray">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoBoolean rpc operation -->
- <operation name="echoBoolean">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- <!-- echoString rpc operation -->
- <operation name="echoString">
- <soap12:operation/>
- <input>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </input>
- <output>
- <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" />
- </output>
- </operation>
-
- </binding>
-
- <service name="WhiteMesaSoapRpcLitTestSvc">
-
- <port name="Soap12TestRpcLitPort" binding="tns:Soap12TestRpcLitBinding">
- <soap12:address location="http://www.whitemesa.net/soap12/test-rpc-lit"/>
- </port>
- <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding">
- <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/>
- </port>
-
- </service>
-
-</definitions>
diff --git a/test/wsdl/rpc/test_rpc.rb b/test/wsdl/rpc/test_rpc.rb
deleted file mode 100644
index 7c4c3a7ad6..0000000000
--- a/test/wsdl/rpc/test_rpc.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module WSDL; module RPC
-
-
-class TestRPC < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- def on_init
- self.generate_explicit_type = false
- add_rpc_method(self, 'echo', 'arg1', 'arg2')
- add_rpc_method(self, 'echo_err', 'arg1', 'arg2')
- end
-
- DummyPerson = Struct.new("family-name".intern, :given_name)
- def echo(arg1, arg2)
- case arg1.family_name
- when 'normal'
- arg1.family_name = arg2.family_name
- arg1.given_name = arg2.given_name
- arg1.age = arg2.age
- arg1
- when 'dummy'
- DummyPerson.new("family-name", "given_name")
- else
- raise
- end
- end
-
- ErrPerson = Struct.new(:given_name, :no_such_element)
- def echo_err(arg1, arg2)
- ErrPerson.new(58, Time.now)
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_classdef
- @client = nil
- end
-
- def teardown
- teardown_server
- File.unlink(pathname('echo.rb'))
- @client.reset_stream if @client
- end
-
- def setup_server
- @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("rpc.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['force'] = true
- gen.run
- require pathname('echo')
- 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
-
- def test_wsdl
- wsdl = File.join(DIR, 'rpc.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDOUT if $DEBUG
-
- ret = @client.echo(Person.new("normal", "", 12), Person.new("Hi", "Na", 21))
- assert_equal(Person, ret.class)
- assert_equal("Hi", ret.family_name)
- assert_equal("Na", ret.given_name)
- assert_equal(21, ret.age)
-
- ret = @client.echo(Person.new("dummy", "", 12), Person.new("Hi", "Na", 21))
- assert_equal(Person, ret.class)
- assert_equal("family-name", ret.family_name)
- assert_equal("given_name", ret.given_name)
- assert_equal(nil, ret.age)
-
- ret = @client.echo_err(Person.new("Na", "Hi"), Person.new("Hi", "Na"))
- assert_equal(Person, ret.class)
- assert_equal("58", ret.given_name)
- assert_equal(nil, ret.family_name)
- assert_equal(nil, ret.age)
- end
-end
-
-
-end; end
diff --git a/test/wsdl/rpc/test_rpc_lit.rb b/test/wsdl/rpc/test_rpc_lit.rb
deleted file mode 100644
index 080dbb82cf..0000000000
--- a/test/wsdl/rpc/test_rpc_lit.rb
+++ /dev/null
@@ -1,399 +0,0 @@
-require 'test/unit'
-require 'wsdl/soap/wsdl2ruby'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-if defined?(HTTPAccess2) and defined?(OpenSSL)
-
-module WSDL; module RPC
-
-
-class TestRPCLIT < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- Namespace = "http://soapbuilders.org/rpc-lit-test"
-
- def on_init
- self.generate_explicit_type = false
- add_rpc_operation(self,
- XSD::QName.new(Namespace, 'echoStringArray'),
- nil,
- 'echoStringArray', [
- ['in', 'inputStringArray', nil],
- ['retval', 'return', nil]
- ],
- {
- :request_style => :rpc,
- :request_use => :literal,
- :response_style => :rpc,
- :response_use => :literal
- }
- )
- add_rpc_operation(self,
- XSD::QName.new(Namespace, 'echoStringArrayInline'),
- nil,
- 'echoStringArrayInline', [
- ['in', 'inputStringArray', nil],
- ['retval', 'return', nil]
- ],
- {
- :request_style => :rpc,
- :request_use => :literal,
- :response_style => :rpc,
- :response_use => :literal
- }
- )
- add_rpc_operation(self,
- XSD::QName.new(Namespace, 'echoNestedStruct'),
- nil,
- 'echoNestedStruct', [
- ['in', 'inputNestedStruct', nil],
- ['retval', 'return', nil]
- ],
- {
- :request_style => :rpc,
- :request_use => :literal,
- :response_style => :rpc,
- :response_use => :literal
- }
- )
- add_rpc_operation(self,
- XSD::QName.new(Namespace, 'echoStructArray'),
- nil,
- 'echoStructArray', [
- ['in', 'inputStructArray', nil],
- ['retval', 'return', nil]
- ],
- {
- :request_style => :rpc,
- :request_use => :literal,
- :response_style => :rpc,
- :response_use => :literal
- }
- )
- end
-
- def echoStringArray(strings)
- # strings.stringItem => Array
- ArrayOfstring[*strings.stringItem]
- end
-
- def echoStringArrayInline(strings)
- ArrayOfstringInline[*strings.stringItem]
- end
-
- def echoNestedStruct(struct)
- struct
- end
-
- def echoStructArray(ary)
- ary
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_classdef
- @client = nil
- end
-
- def teardown
- teardown_server
- unless $DEBUG
- File.unlink(pathname('RPC-Literal-TestDefinitions.rb'))
- File.unlink(pathname('RPC-Literal-TestDefinitionsDriver.rb'))
- end
- @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 setup_classdef
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("test-rpc-lit.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['driver'] = nil
- gen.opt['force'] = true
- gen.run
- backupdir = Dir.pwd
- begin
- Dir.chdir(DIR)
- require pathname('RPC-Literal-TestDefinitions.rb')
- require pathname('RPC-Literal-TestDefinitionsDriver.rb')
- ensure
- 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
-
- def test_wsdl_echoStringArray
- wsdl = pathname('test-rpc-lit.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDOUT if $DEBUG
- # response contains only 1 part.
- result = @client.echoStringArray(ArrayOfstring["a", "b", "c"])[0]
- assert_equal(["a", "b", "c"], result.stringItem)
- end
-
- ECHO_STRING_ARRAY_REQUEST =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStringArray xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <inputStringArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <n2:stringItem>a</n2:stringItem>
- <n2:stringItem>b</n2:stringItem>
- <n2:stringItem>c</n2:stringItem>
- </inputStringArray>
- </n1:echoStringArray>
- </env:Body>
-</env:Envelope>]
-
- ECHO_STRING_ARRAY_RESPONSE =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStringArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <n2:stringItem>a</n2:stringItem>
- <n2:stringItem>b</n2:stringItem>
- <n2:stringItem>c</n2:stringItem>
- </return>
- </n1:echoStringArrayResponse>
- </env:Body>
-</env:Envelope>]
-
- def test_stub_echoStringArray
- drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
- drv.wiredump_dev = str = ''
- # response contains only 1 part.
- result = drv.echoStringArray(ArrayOfstring["a", "b", "c"])[0]
- assert_equal(["a", "b", "c"], result.stringItem)
- assert_equal(ECHO_STRING_ARRAY_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_STRING_ARRAY_RESPONSE, parse_responsexml(str))
- end
-
- ECHO_STRING_ARRAY_INLINE_REQUEST =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStringArrayInline xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <inputStringArray>
- <stringItem>a</stringItem>
- <stringItem>b</stringItem>
- <stringItem>c</stringItem>
- </inputStringArray>
- </n1:echoStringArrayInline>
- </env:Body>
-</env:Envelope>]
-
- ECHO_STRING_ARRAY_INLINE_RESPONSE =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStringArrayInlineResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <return>
- <stringItem>a</stringItem>
- <stringItem>b</stringItem>
- <stringItem>c</stringItem>
- </return>
- </n1:echoStringArrayInlineResponse>
- </env:Body>
-</env:Envelope>]
-
- def test_stub_echoStringArrayInline
- drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
- drv.wiredump_dev = str = ''
- # response contains only 1 part.
- result = drv.echoStringArrayInline(ArrayOfstringInline["a", "b", "c"])[0]
- assert_equal(["a", "b", "c"], result.stringItem)
- assert_equal(ECHO_STRING_ARRAY_INLINE_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_STRING_ARRAY_INLINE_RESPONSE, parse_responsexml(str))
- end
-
- ECHO_NESTED_STRUCT_REQUEST =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoNestedStruct xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <inputStruct xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <varString>str</varString>
- <varInt>1</varInt>
- <varFloat>+1</varFloat>
- <n2:structItem>
- <varString>str</varString>
- <varInt>1</varInt>
- <varFloat>+1</varFloat>
- </n2:structItem>
- </inputStruct>
- </n1:echoNestedStruct>
- </env:Body>
-</env:Envelope>]
-
- ECHO_NESTED_STRUCT_RESPONSE =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoNestedStructResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <varString>str</varString>
- <varInt>1</varInt>
- <varFloat>+1</varFloat>
- <n2:structItem>
- <varString>str</varString>
- <varInt>1</varInt>
- <varFloat>+1</varFloat>
- </n2:structItem>
- </return>
- </n1:echoNestedStructResponse>
- </env:Body>
-</env:Envelope>]
-
- def test_wsdl_echoNestedStruct
- wsdl = pathname('test-rpc-lit.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = str = ''
- # response contains only 1 part.
- result = @client.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0]
- assert_equal('str', result.varString)
- assert_equal('1', result.varInt)
- assert_equal('+1', result.varFloat)
- assert_equal('str', result.structItem.varString)
- assert_equal('1', result.structItem.varInt)
- assert_equal('+1', result.structItem.varFloat)
- assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str))
- end
-
- def test_stub_echoNestedStruct
- drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
- drv.wiredump_dev = str = ''
- # response contains only 1 part.
- result = drv.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0]
- assert_equal('str', result.varString)
- assert_equal('1', result.varInt)
- assert_equal('+1', result.varFloat)
- assert_equal('str', result.structItem.varString)
- assert_equal('1', result.structItem.varInt)
- assert_equal('+1', result.structItem.varFloat)
- assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str))
- end
-
- ECHO_STRUCT_ARRAY_REQUEST =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStructArray xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <inputStructArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <n2:structItem>
- <varString>str</varString>
- <varInt>2</varInt>
- <varFloat>+2.1</varFloat>
- </n2:structItem>
- <n2:structItem>
- <varString>str</varString>
- <varInt>2</varInt>
- <varFloat>+2.1</varFloat>
- </n2:structItem>
- </inputStructArray>
- </n1:echoStructArray>
- </env:Body>
-</env:Envelope>]
-
- ECHO_STRUCT_ARRAY_RESPONSE =
-%q[<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <n1:echoStructArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test">
- <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types">
- <n2:structItem>
- <varString>str</varString>
- <varInt>2</varInt>
- <varFloat>+2.1</varFloat>
- </n2:structItem>
- <n2:structItem>
- <varString>str</varString>
- <varInt>2</varInt>
- <varFloat>+2.1</varFloat>
- </n2:structItem>
- </return>
- </n1:echoStructArrayResponse>
- </env:Body>
-</env:Envelope>]
-
- def test_wsdl_echoStructArray
- wsdl = pathname('test-rpc-lit.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = str = ''
- # response contains only 1 part.
- e = SOAPStruct.new("str", 2, 2.1)
- result = @client.echoStructArray(ArrayOfSOAPStruct[e, e])
- assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str))
- end
-
- def test_stub_echoStructArray
- drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/")
- drv.wiredump_dev = str = ''
- # response contains only 1 part.
- e = SOAPStruct.new("str", 2, 2.1)
- result = drv.echoStructArray(ArrayOfSOAPStruct[e, e])
- assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str))
- assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str))
- end
-
- def parse_requestxml(str)
- str.split(/\r?\n\r?\n/)[3]
- end
-
- def parse_responsexml(str)
- str.split(/\r?\n\r?\n/)[6]
- end
-end
-
-
-end; end
-
-end
diff --git a/test/wsdl/simpletype/rpc/expectedClient.rb b/test/wsdl/simpletype/rpc/expectedClient.rb
deleted file mode 100644
index 55eb58c3dd..0000000000
--- a/test/wsdl/simpletype/rpc/expectedClient.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env ruby
-require 'echo_versionDriver.rb'
-
-endpoint_url = ARGV.shift
-obj = Echo_version_port_type.new(endpoint_url)
-
-# run ruby with -d to see SOAP wiredumps.
-obj.wiredump_dev = STDERR if $DEBUG
-
-# SYNOPSIS
-# echo_version(version)
-#
-# ARGS
-# version Version - {urn:example.com:simpletype-rpc-type}version
-#
-# RETURNS
-# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
-#
-version = nil
-puts obj.echo_version(version)
-
-# SYNOPSIS
-# echo_version_r(version_struct)
-#
-# ARGS
-# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
-#
-# RETURNS
-# version Version - {urn:example.com:simpletype-rpc-type}version
-#
-version_struct = nil
-puts obj.echo_version_r(version_struct)
-
-
diff --git a/test/wsdl/simpletype/rpc/expectedDriver.rb b/test/wsdl/simpletype/rpc/expectedDriver.rb
deleted file mode 100644
index 81c72d1acf..0000000000
--- a/test/wsdl/simpletype/rpc/expectedDriver.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'echo_version.rb'
-
-require 'soap/rpc/driver'
-
-class Echo_version_port_type < ::SOAP::RPC::Driver
- DefaultEndpointUrl = "http://localhost:10080"
- MappingRegistry = ::SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- Version_struct,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }
- )
-
- Methods = [
- [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version"),
- "urn:example.com:simpletype-rpc",
- "echo_version",
- [ ["in", "version", ["::SOAP::SOAPString"]],
- ["retval", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ],
- [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version_r"),
- "urn:example.com:simpletype-rpc",
- "echo_version_r",
- [ ["in", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]],
- ["retval", "version", ["::SOAP::SOAPString"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ]
- ]
-
- def initialize(endpoint_url = nil)
- endpoint_url ||= DefaultEndpointUrl
- super(endpoint_url, nil)
- self.mapping_registry = MappingRegistry
- init_methods
- end
-
-private
-
- def init_methods
- Methods.each do |definitions|
- opt = definitions.last
- if opt[:request_style] == :document
- add_document_operation(*definitions)
- else
- add_rpc_operation(*definitions)
- qname = definitions[0]
- name = definitions[2]
- if qname.name != name and qname.name.capitalize == name.capitalize
- ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
- __send__(name, *arg)
- end
- end
- end
- end
- end
-end
-
diff --git a/test/wsdl/simpletype/rpc/expectedEchoVersion.rb b/test/wsdl/simpletype/rpc/expectedEchoVersion.rb
deleted file mode 100644
index 806ece1626..0000000000
--- a/test/wsdl/simpletype/rpc/expectedEchoVersion.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'xsd/qname'
-
-# {urn:example.com:simpletype-rpc-type}version_struct
-class Version_struct
- @@schema_type = "version_struct"
- @@schema_ns = "urn:example.com:simpletype-rpc-type"
- @@schema_element = [["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]], ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]]]
-
- attr_accessor :version
- attr_accessor :msg
-
- def initialize(version = nil, msg = nil)
- @version = version
- @msg = msg
- end
-end
-
-# {urn:example.com:simpletype-rpc-type}version
-module Version
- C_16 = "1.6"
- C_18 = "1.8"
- C_19 = "1.9"
-end
diff --git a/test/wsdl/simpletype/rpc/expectedServant.rb b/test/wsdl/simpletype/rpc/expectedServant.rb
deleted file mode 100644
index 81cf50218e..0000000000
--- a/test/wsdl/simpletype/rpc/expectedServant.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'echo_version.rb'
-
-class Echo_version_port_type
- # SYNOPSIS
- # echo_version(version)
- #
- # ARGS
- # version Version - {urn:example.com:simpletype-rpc-type}version
- #
- # RETURNS
- # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
- #
- def echo_version(version)
- p [version]
- raise NotImplementedError.new
- end
-
- # SYNOPSIS
- # echo_version_r(version_struct)
- #
- # ARGS
- # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct
- #
- # RETURNS
- # version Version - {urn:example.com:simpletype-rpc-type}version
- #
- def echo_version_r(version_struct)
- p [version_struct]
- raise NotImplementedError.new
- end
-end
-
diff --git a/test/wsdl/simpletype/rpc/expectedService.rb b/test/wsdl/simpletype/rpc/expectedService.rb
deleted file mode 100644
index be6f996562..0000000000
--- a/test/wsdl/simpletype/rpc/expectedService.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env ruby
-require 'echo_versionServant.rb'
-
-require 'soap/rpc/standaloneServer'
-require 'soap/mapping/registry'
-
-class Echo_version_port_type
- MappingRegistry = ::SOAP::Mapping::Registry.new
-
- MappingRegistry.set(
- Version_struct,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("urn:example.com:simpletype-rpc-type", "version_struct") }
- )
-
- Methods = [
- [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version"),
- "urn:example.com:simpletype-rpc",
- "echo_version",
- [ ["in", "version", ["::SOAP::SOAPString"]],
- ["retval", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ],
- [ XSD::QName.new("urn:example.com:simpletype-rpc", "echo_version_r"),
- "urn:example.com:simpletype-rpc",
- "echo_version_r",
- [ ["in", "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]],
- ["retval", "version", ["::SOAP::SOAPString"]] ],
- { :request_style => :rpc, :request_use => :encoded,
- :response_style => :rpc, :response_use => :encoded }
- ]
- ]
-end
-
-class Echo_version_port_typeApp < ::SOAP::RPC::StandaloneServer
- def initialize(*arg)
- super(*arg)
- servant = Echo_version_port_type.new
- Echo_version_port_type::Methods.each do |definitions|
- opt = definitions.last
- if opt[:request_style] == :document
- @router.add_document_operation(servant, *definitions)
- else
- @router.add_rpc_operation(servant, *definitions)
- end
- end
- self.mapping_registry = Echo_version_port_type::MappingRegistry
- end
-end
-
-if $0 == __FILE__
- # Change listen port.
- server = Echo_version_port_typeApp.new('app', nil, '0.0.0.0', 10080)
- trap(:INT) do
- server.shutdown
- end
- server.start
-end
diff --git a/test/wsdl/simpletype/rpc/rpc.wsdl b/test/wsdl/simpletype/rpc/rpc.wsdl
deleted file mode 100644
index 91f71a8831..0000000000
--- a/test/wsdl/simpletype/rpc/rpc.wsdl
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="echo_version"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:example.com:simpletype-rpc"
- xmlns:txd="urn:example.com:simpletype-rpc-type"
- targetNamespace="urn:example.com:simpletype-rpc"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:example.com:simpletype-rpc-type">
- <xsd:complexType name="version_struct">
- <xsd:all>
- <xsd:element name="version" type="txd:version" />
- <xsd:element name="msg" type="xsd:string" />
- </xsd:all>
- </xsd:complexType>
-
- <xsd:simpleType name="version">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="1.6"/>
- <xsd:enumeration value="1.8"/>
- <xsd:enumeration value="1.9"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:schema>
- </types>
-
- <message name="msg_version">
- <part name="version" type="txd:version"/>
- </message>
-
- <message name="msg_version_struct">
- <part name="version_struct" type="txd:version_struct"/>
- </message>
-
- <portType name="echo_version_port_type">
- <operation name="echo_version">
- <input message="tns:msg_version"/>
- <output message="tns:msg_version_struct"/>
- </operation>
-
- <operation name="echo_version_r">
- <input message="tns:msg_version_struct"/>
- <output message="tns:msg_version"/>
- </operation>
- </portType>
-
- <binding name="echo_version_binding" type="tns:echo_version_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
- <operation name="echo_version">
- <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
- <input>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
-
- <operation name="echo_version_r">
- <soap:operation soapAction="urn:example.com:simpletype-rpc"/>
- <input>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:example.com:simpletype-rpc"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="echo_version_service">
- <port name="echo_version_port" binding="tns:echo_version_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/simpletype/rpc/test_rpc.rb b/test/wsdl/simpletype/rpc/test_rpc.rb
deleted file mode 100644
index 1d6a3eb4bc..0000000000
--- a/test/wsdl/simpletype/rpc/test_rpc.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/wsdl2ruby'
-
-
-module WSDL; module SimpleType
-
-
-class TestRPC < Test::Unit::TestCase
- DIR = File.dirname(File.expand_path(__FILE__))
- def pathname(filename)
- File.join(DIR, filename)
- end
-
- def test_rpc
- gen = WSDL::SOAP::WSDL2Ruby.new
- gen.location = pathname("rpc.wsdl")
- gen.basedir = DIR
- gen.logger.level = Logger::FATAL
- gen.opt['classdef'] = nil
- gen.opt['driver'] = nil
- gen.opt['client_skelton'] = nil
- gen.opt['servant_skelton'] = nil
- gen.opt['standalone_server_stub'] = nil
- gen.opt['force'] = true
- gen.run
- compare("expectedEchoVersion.rb", "echo_version.rb")
- compare("expectedDriver.rb", "echo_versionDriver.rb")
- compare("expectedService.rb", "echo_version_service.rb")
- compare("expectedClient.rb", "echo_version_serviceClient.rb")
- compare("expectedServant.rb", "echo_versionServant.rb")
-
- File.unlink(pathname("echo_version.rb"))
- File.unlink(pathname("echo_versionDriver.rb"))
- File.unlink(pathname("echo_version_service.rb"))
- File.unlink(pathname("echo_version_serviceClient.rb"))
- File.unlink(pathname("echo_versionServant.rb"))
- end
-
- def compare(expected, actual)
- assert_equal(loadfile(expected), loadfile(actual), actual)
- end
-
- def loadfile(file)
- File.open(pathname(file)) { |f| f.read }
- end
-end
-
-
-end; end
diff --git a/test/wsdl/simpletype/simpletype.wsdl b/test/wsdl/simpletype/simpletype.wsdl
deleted file mode 100644
index 623969c794..0000000000
--- a/test/wsdl/simpletype/simpletype.wsdl
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions name="ping_service"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="urn:example.com:simpletype"
- targetNamespace="urn:example.com:simpletype"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <xsd:schema targetNamespace="urn:example.com:simpletype">
- <xsd:element name="ruby">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element minOccurs="1" maxOccurs="1" name="myversion" type="tns:myversion"/>
- <xsd:element minOccurs="0" maxOccurs="1" name="date" type="xsd:dateTime"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:simpleType name="myversion">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="1.6"/>
- <xsd:enumeration value="1.8"/>
- <xsd:enumeration value="1.9"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:element name="myid" type="tns:ID"/>
-
- <xsd:simpleType name="ID">
- <xsd:restriction base="xsd:string">
- <xsd:length value="18"/>
- <xsd:pattern value='[a-zA-Z0-9]{18}'/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:schema>
- </types>
-
- <message name="ping_in">
- <part name="parameters" element="tns:ruby"/>
- </message>
-
- <message name="ping_out">
- <part name="parameters" type="xsd:string"/>
- </message>
-
- <message name="ping_id_in">
- <part name="parameters" element="tns:myid"/>
- </message>
-
- <message name="ping_id_out">
- <part name="parameters" element="tns:myid"/>
- </message>
-
- <message name="versionmsg">
- <part name="myversion" element="tns:myversion"/>
- </message>
-
- <portType name="ping_port_type">
- <operation name="ping">
- <input message="tns:ping_in"/>
- <output message="tns:ping_out"/>
- </operation>
-
- <operation name="ping_id">
- <input message="tns:ping_id_in"/>
- <output message="tns:ping_id_out"/>
- </operation>
-
- <operation name="echo_version">
- <input message="tns:versionmsg"/>
- <output message="tns:versionmsg"/>
- </operation>
- </portType>
-
- <binding name="ping_binding" type="tns:ping_port_type">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="ping">
- <soap:operation soapAction="urn:example.com:simpletype:ping" style="document"/>
- <input><soap:body use="literal"/></input>
- <output><soap:body use="literal"/></output>
- </operation>
-
- <operation name="ping_id">
- <soap:operation soapAction="urn:example.com:simpletype:ping_id" style="document"/>
- <input><soap:body use="literal"/></input>
- <output><soap:body use="literal"/></output>
- </operation>
- </binding>
-
- <service name="ping_service">
- <port name="ping_port" binding="tns:ping_binding">
- <soap:address location="http://localhost:10080"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/simpletype/test_simpletype.rb b/test/wsdl/simpletype/test_simpletype.rb
deleted file mode 100644
index 7e644c3042..0000000000
--- a/test/wsdl/simpletype/test_simpletype.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module WSDL
-module SimpleType
-
-
-class TestSimpleType < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- def on_init
- add_document_method(self, 'urn:example.com:simpletype:ping', 'ping',
- XSD::QName.new('urn:example.com:simpletype', 'ruby'),
- XSD::QName.new('http://www.w3.org/2001/XMLSchema', 'string'))
- add_document_method(self, 'urn:example.com:simpletype:ping_id', 'ping_id',
- XSD::QName.new('urn:example.com:simpletype', 'myid'),
- XSD::QName.new('urn:example.com:simpletype', 'myid'))
- end
-
- def ping(ruby)
- version = ruby["myversion"]
- date = ruby["date"]
- "#{version} (#{date})"
- end
-
- def ping_id(id)
- id
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new('Test', "urn:example.com:simpletype", '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @server_thread = start_server_thread(@server)
- end
-
- def setup_client
- wsdl = File.join(DIR, 'simpletype.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.generate_explicit_type = false
- @client.wiredump_dev = STDOUT if $DEBUG
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @server_thread.kill
- @server_thread.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def start_server_thread(server)
- t = Thread.new {
- Thread.current.abort_on_exception = true
- server.start
- }
- t
- end
-
- def test_ping
- ret = @client.ping({:myversion => "1.9", :date => "2004-01-01T00:00:00Z"})
- assert_equal("1.9 (2004-01-01T00:00:00Z)", ret)
- end
-
- def test_ping_id
- ret = @client.ping_id("012345678901234567")
- assert_equal("012345678901234567", ret)
- # length
- assert_raise(XSD::ValueSpaceError) do
- @client.ping_id("0123456789012345678")
- end
- # pattern
- assert_raise(XSD::ValueSpaceError) do
- @client.ping_id("01234567890123456;")
- end
- end
-end
-
-
-end
-end
diff --git a/test/wsdl/soap/soapbodyparts.wsdl b/test/wsdl/soap/soapbodyparts.wsdl
deleted file mode 100644
index 0e6da0ebee..0000000000
--- a/test/wsdl/soap/soapbodyparts.wsdl
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0"?>
-<definitions
- name="soapbodyparts"
- targetNamespace="urn:www.example.com:soapbodyparts:v1"
- xmlns:tns="urn:www.example.com:soapbodyparts:v1"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
-
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:www.example.com:soapbodyparts:v1">
- <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
- <complexType name="StringArray">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
- </restriction>
- </complexContent>
- </complexType>
- </schema>
- </types>
-
- <message name="fooRequest">
- <part name="param1" type="xsd:string"/>
- <part name="param2" type="xsd:string"/>
- <part name="param3" type="xsd:string"/>
- </message>
-
- <message name="fooResponse">
- <part name="return" type="tns:StringArray"/>
- </message>
-
- <portType name="FooServicePortType">
- <operation name="foo"
- parameterOrder="param3 param2 param1">
- <input message="tns:fooRequest"/>
- <output message="tns:fooResponse"/>
- </operation>
- <operation name="bar"
- parameterOrder="param1 param2 param3">
- <input message="tns:fooRequest"/>
- <output message="tns:fooResponse"/>
- </operation>
- <operation name="baz">
- <input message="tns:fooRequest"/>
- <output message="tns:fooResponse"/>
- </operation>
- </portType>
-
- <binding name="FooServicePortBinding" type="tns:FooServicePortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="foo">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- parts="param1 param3"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </output>
- </operation>
- <operation name="bar">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- parts="param3 param2"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </output>
- </operation>
- <operation name="baz">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </input>
- <output>
- <soap:body use="encoded"
- encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
- namespace="urn:www.example.com:soapbodyparts:v1"/>
- </output>
- </operation>
- </binding>
-
- <service name="FooService">
- <port name="FooServicePort" binding="tns:FooServicePortBinding">
- <soap:address location="http://raa.ruby-lang.org/soap/1.0.2/"/>
- </port>
- </service>
-</definitions>
diff --git a/test/wsdl/soap/test_soapbodyparts.rb b/test/wsdl/soap/test_soapbodyparts.rb
deleted file mode 100644
index 291319aedf..0000000000
--- a/test/wsdl/soap/test_soapbodyparts.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-require 'test/unit'
-require 'soap/rpc/standaloneServer'
-require 'soap/wsdlDriver'
-
-
-module WSDL
-module SOAP
-
-
-class TestSOAPBodyParts < Test::Unit::TestCase
- class Server < ::SOAP::RPC::StandaloneServer
- def on_init
- add_method(self, 'foo', 'p1', 'p2', 'p3')
- add_method(self, 'bar', 'p1', 'p2', 'p3')
- add_method(self, 'baz', 'p1', 'p2', 'p3')
- end
-
- def foo(p1, p2, p3)
- [p1, p2, p3]
- end
-
- alias bar foo
-
- def baz(p1, p2, p3)
- [p3, p2, p1]
- end
- end
-
- DIR = File.dirname(File.expand_path(__FILE__))
-
- Port = 17171
-
- def setup
- setup_server
- setup_client
- end
-
- def setup_server
- @server = Server.new('Test', "urn:www.example.com:soapbodyparts:v1", '0.0.0.0', Port)
- @server.level = Logger::Severity::ERROR
- @t = Thread.new {
- Thread.current.abort_on_exception = true
- @server.start
- }
- end
-
- def setup_client
- wsdl = File.join(DIR, 'soapbodyparts.wsdl')
- @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
- @client.endpoint_url = "http://localhost:#{Port}/"
- @client.wiredump_dev = STDERR if $DEBUG
- end
-
- def teardown
- teardown_server
- teardown_client
- end
-
- def teardown_server
- @server.shutdown
- @t.kill
- @t.join
- end
-
- def teardown_client
- @client.reset_stream
- end
-
- def test_soapbodyparts
- assert_equal(["1", "2", "3"], @client.foo("1", "2", "3"))
- assert_equal(["3", "2", "1"], @client.foo("3", "2", "1"))
- assert_equal(["1", "2", "3"], @client.bar("1", "2", "3"))
- assert_equal(["3", "2", "1"], @client.baz("1", "2", "3"))
- end
-end
-
-
-end
-end
diff --git a/test/wsdl/test_emptycomplextype.rb b/test/wsdl/test_emptycomplextype.rb
deleted file mode 100644
index 71d1b8641d..0000000000
--- a/test/wsdl/test_emptycomplextype.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-
-
-module WSDL
-
-
-class TestWSDL < Test::Unit::TestCase
- def setup
- @file = File.join(File.dirname(File.expand_path(__FILE__)), 'emptycomplextype.wsdl')
- end
-
- def test_wsdl
- @wsdl = WSDL::Parser.new.parse(File.open(@file) { |f| f.read })
- assert(/\{urn:jp.gr.jin.rrr.example.emptycomplextype\}emptycomplextype/ =~ @wsdl.inspect)
- end
-end
-
-
-
-end
diff --git a/test/wsdl/test_fault.rb b/test/wsdl/test_fault.rb
deleted file mode 100644
index ec414528ee..0000000000
--- a/test/wsdl/test_fault.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'test/unit'
-require 'soap/processor'
-require 'soap/mapping'
-require 'soap/rpc/element'
-require 'wsdl/parser'
-
-
-module WSDL
-
-
-class TestFault < Test::Unit::TestCase
- def setup
- @xml =<<__EOX__
-<?xml version="1.0" encoding="utf-8" ?>
-<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <env:Body>
- <env:Fault xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/"
- env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <faultcode xsi:type="xsd:string">Server</faultcode>
- <faultstring xsi:type="xsd:string">faultstring</faultstring>
- <faultactor xsi:type="xsd:string">faultactor</faultactor>
- <detail xmlns:n2="http://www.ruby-lang.org/xmlns/ruby/type/custom"
- xsi:type="n2:SOAPException">
- <excn_type_name xsi:type="xsd:string">type</excn_type_name>
- <cause href="#id123"/>
- </detail>
- </env:Fault>
- <cause id="id123" xsi:type="xsd:int">5</cause>
- </env:Body>
-</env:Envelope>
-__EOX__
- end
-
- def test_by_wsdl
- rpc_decode_typemap = WSDL::Definitions.soap_rpc_complextypes
- opt = {}
- opt[:default_encodingstyle] = ::SOAP::EncodingNamespace
- opt[:decode_typemap] = rpc_decode_typemap
- header, body = ::SOAP::Processor.unmarshal(@xml, opt)
- fault = ::SOAP::Mapping.soap2obj(body.response)
- assert_equal("Server", fault.faultcode)
- assert_equal("faultstring", fault.faultstring)
- assert_equal(URI.parse("faultactor"), fault.faultactor)
- assert_equal(5, fault.detail.cause)
- end
-end
-
-
-end
diff --git a/test/wsdl/test_multiplefault.rb b/test/wsdl/test_multiplefault.rb
deleted file mode 100644
index 7004297dc9..0000000000
--- a/test/wsdl/test_multiplefault.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'test/unit'
-require 'wsdl/parser'
-require 'wsdl/soap/classDefCreator'
-
-
-module WSDL
-
-
-class TestMultipleFault < Test::Unit::TestCase
- def self.setup(filename)
- @@filename = filename
- end
-
- def test_multiplefault
- @wsdl = WSDL::Parser.new.parse(File.open(@@filename) { |f| f.read })
- classdefstr = WSDL::SOAP::ClassDefCreator.new(@wsdl).dump
- yield_eval_binding(classdefstr) do |b|
- assert_equal(
- WSDL::TestMultipleFault::AuthenticationError,
- eval("AuthenticationError", b)
- )
- assert_equal(
- WSDL::TestMultipleFault::AuthorizationError,
- eval("AuthorizationError", b)
- )
- end
- end
-
- def yield_eval_binding(evaled)
- b = binding
- eval(evaled, b)
- yield(b)
- end
-end
-
-TestMultipleFault.setup(File.join(File.dirname(__FILE__), 'multiplefault.wsdl'))
-
-
-end
diff --git a/test/xsd/codegen/test_classdef.rb b/test/xsd/codegen/test_classdef.rb
deleted file mode 100644
index 64c4771918..0000000000
--- a/test/xsd/codegen/test_classdef.rb
+++ /dev/null
@@ -1,214 +0,0 @@
-require 'test/unit'
-require 'xsd/codegen/classdef'
-
-
-module XSD; module CodeGen
-
-
-class TestClassDefCreator < Test::Unit::TestCase
- include XSD::CodeGen
- include GenSupport
-
- def test_classdef_simple
- c = ClassDef.new("Foo")
- assert_equal(format(<<-EOD), c.dump)
- class Foo
- end
- EOD
- end
-
- def test_classdef_complex
- c = ClassDef.new("Foo::Bar::Baz", String)
- assert_equal(format(<<-EOD), c.dump)
- module Foo; module Bar
-
- class Baz < String
- end
-
- end; end
- EOD
- end
-
- def test_require
- c = ClassDef.new("Foo")
- c.def_require("foo/bar")
- assert_equal(format(<<-EOD), c.dump)
- require 'foo/bar'
-
- class Foo
- end
- EOD
- end
-
- def test_comment
- c = ClassDef.new("Foo")
- c.def_require("foo/bar")
- c.comment = <<-EOD
- foo
- EOD
- assert_equal(format(<<-EOD), c.dump)
- require 'foo/bar'
-
- # foo
- class Foo
- end
- EOD
- c.comment = <<-EOD
- foo
-
- bar
- baz
-
- EOD
- assert_equal(format(<<-EOD), c.dump)
- require 'foo/bar'
-
- # foo
- #
- # bar
- # baz
- #
- class Foo
- end
- EOD
- end
-
- def test_emptymethod
- c = ClassDef.new("Foo")
- c.def_method('foo') do
- end
- c.def_method('bar') do
- ''
- end
- assert_equal(format(<<-EOD), c.dump)
- class Foo
- def foo
- end
-
- def bar
- end
- end
- EOD
- end
-
- def test_full
- c = ClassDef.new("Foo::Bar::HobbitName", String)
- c.def_require("foo/bar")
- c.comment = <<-EOD
- foo
- bar
- baz
- EOD
- c.def_const("FOO", 1)
- c.def_classvar("@@foo", "var".dump)
- c.def_classvar("baz", "1".dump)
- c.def_attr("Foo", true, "foo")
- c.def_attr("bar")
- c.def_attr("baz", true)
- c.def_attr("Foo2", true, "foo2")
- c.def_attr("foo3", false, "foo3")
- c.def_method("foo") do
- <<-EOD
- foo.bar = 1
-\tbaz.each do |ele|
-\t ele
- end
- EOD
- end
- c.def_method("baz", "qux") do
- <<-EOD
- [1, 2, 3].each do |i|
- p i
- end
- EOD
- end
-
- m = MethodDef.new("qux", "quxx", "quxxx") do
- <<-EOD
- p quxx + quxxx
- EOD
- end
- m.comment = "hello world\n123"
- c.add_method(m)
- c.def_code <<-EOD
- Foo.new
- Bar.z
- EOD
- c.def_code <<-EOD
- Foo.new
- Bar.z
- EOD
- c.def_privatemethod("foo", "baz", "*arg", "&block")
-
- assert_equal(format(<<-EOD), c.dump)
- require 'foo/bar'
-
- module Foo; module Bar
-
- # foo
- # bar
- # baz
- class HobbitName < String
- @@foo = "var"
- @@baz = "1"
-
- FOO = 1
-
- Foo.new
- Bar.z
-
- Foo.new
- Bar.z
-
- attr_accessor :bar
- attr_accessor :baz
- attr_reader :foo3
-
- def Foo
- @foo
- end
-
- def Foo=(value)
- @foo = value
- end
-
- def Foo2
- @foo2
- end
-
- def Foo2=(value)
- @foo2 = value
- end
-
- def foo
- foo.bar = 1
- baz.each do |ele|
- ele
- end
- end
-
- def baz(qux)
- [1, 2, 3].each do |i|
- p i
- end
- end
-
- # hello world
- # 123
- def qux(quxx, quxxx)
- p quxx + quxxx
- end
-
- private
-
- def foo(baz, *arg, &block)
- end
- end
-
- end; end
- EOD
- end
-end
-
-
-end; end
diff --git a/test/xsd/noencoding.xml b/test/xsd/noencoding.xml
deleted file mode 100644
index 614ffa34ad..0000000000
--- a/test/xsd/noencoding.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="euc-jp"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema">
- <!-- ¤¢¤¤¤¦ -->
-</schema>
diff --git a/test/xsd/test_noencoding.rb b/test/xsd/test_noencoding.rb
deleted file mode 100644
index 48119ec1f7..0000000000
--- a/test/xsd/test_noencoding.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'test/unit'
-require 'wsdl/xmlSchema/parser'
-
-
-module XSD
-
-
-class TestEmptyCharset < Test::Unit::TestCase
- def setup
- @file = File.join(File.dirname(File.expand_path(__FILE__)), 'noencoding.xml')
- end
-
- def test_wsdl
- begin
- xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
- rescue RuntimeError
- if XSD::XMLParser.const_defined?("REXMLParser")
- STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.")
- return
- end
- raise
- rescue Errno::EINVAL
- # unsupported encoding
- return
- end
- assert_equal(WSDL::XMLSchema::Schema, xml.class)
- assert_equal(0, xml.collect_elements.size)
- end
-end
-
-
-end
diff --git a/test/xsd/test_xmlschemaparser.rb b/test/xsd/test_xmlschemaparser.rb
deleted file mode 100644
index 10dff43e61..0000000000
--- a/test/xsd/test_xmlschemaparser.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'test/unit'
-require 'wsdl/xmlSchema/parser'
-
-
-module XSD
-
-
-class TestXMLSchemaParser < Test::Unit::TestCase
- def setup
- @file = File.join(File.dirname(File.expand_path(__FILE__)), 'xmlschema.xml')
- end
-
- def test_wsdl
- @wsdl = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read })
- assert_equal(WSDL::XMLSchema::Schema, @wsdl.class)
- assert_equal(1, @wsdl.collect_elements.size)
- end
-end
-
-
-
-end
diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb
deleted file mode 100644
index 6302f3128b..0000000000
--- a/test/xsd/test_xsd.rb
+++ /dev/null
@@ -1,1511 +0,0 @@
-require 'test/unit'
-require 'xsd/datatypes'
-
-
-module XSD
-
-
-class TestXSD < Test::Unit::TestCase
- NegativeZero = (-1.0 / (1.0 / 0.0))
-
- def setup
- end
-
- def teardown
- end
-
- def assert_parsed_result(klass, str)
- o = klass.new(str)
- assert_equal(str, o.to_s)
- end
-
- def test_NSDBase
- o = XSD::NSDBase.new
- assert_equal(nil, o.type)
- end
-
- def test_XSDBase
- o = XSD::XSDAnySimpleType.new
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
- assert_equal('', o.to_s)
- end
-
- def test_XSDNil
- o = XSD::XSDNil.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::NilLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- o = XSD::XSDNil.new(nil)
- assert_equal(true, o.is_nil)
- assert_equal(nil, o.data)
- assert_equal("", o.to_s)
- o = XSD::XSDNil.new('var')
- assert_equal(false, o.is_nil)
- assert_equal('var', o.data)
- assert_equal('var', o.to_s)
- end
-
- def test_XSDString_UTF8
- o = XSD::XSDString.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::StringLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- str = "abc"
- assert_equal(str, XSD::XSDString.new(str).data)
- assert_equal(str, XSD::XSDString.new(str).to_s)
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDString.new("\0")
- end
- assert_raises(XSD::ValueSpaceError) do
- p XSD::XSDString.new("\xC0\xC0").to_s
- end
- end
-
- def test_XSDString_NONE
- XSD::Charset.module_eval { @encoding_backup = @encoding; @encoding = "NONE" }
- begin
- o = XSD::XSDString.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::StringLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- str = "abc"
- assert_equal(str, XSD::XSDString.new(str).data)
- assert_equal(str, XSD::XSDString.new(str).to_s)
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDString.new("\0")
- end
- assert_raises(XSD::ValueSpaceError) do
- p XSD::XSDString.new("\xC0\xC0").to_s
- end
- ensure
- XSD::Charset.module_eval { @encoding = @encoding_backup }
- end
- end
-
- def test_XSDBoolean
- o = XSD::XSDBoolean.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::BooleanLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- ["true", true],
- ["1", true],
- ["false", false],
- ["0", false],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDBoolean.new(data).data)
- assert_equal(expected.to_s, XSD::XSDBoolean.new(data).to_s)
- end
-
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDBoolean.new("nil").to_s
- end
- end
-
- def test_XSDDecimal
- o = XSD::XSDDecimal.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DecimalLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- -9999999999,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |dec|
- assert_equal(dec.to_s, XSD::XSDDecimal.new(dec).data)
- end
-
- targets = [
- "0",
- "0.00000001",
- "1000000000",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDDecimal.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["0.0", "0"],
- ["-0.0", "0"],
- ["+0.0", "0"],
- ["0.", "0"],
- [".0", "0"],
- [
- "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
- ],
- [
- ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
- ],
- [
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDDecimal.new(data).to_s)
- end
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDDecimal.new(d)
- end
- end
- end
-
- def test_XSDFloat
- o = XSD::XSDFloat.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::FloatLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 3.14159265358979,
- 12.34e36,
- 1.402e-45,
- -1.402e-45,
- ]
- targets.each do |f|
- assert_equal(f, XSD::XSDFloat.new(f).data)
- end
-
- targets = [
- "+3.141592654",
- "+1.234e+37",
- "+1.402e-45",
- "-1.402e-45",
- ]
- targets.each do |f|
- assert_equal(f, XSD::XSDFloat.new(f).to_s)
- end
-
- targets = [
- [3, "+3"], # should be 3.0?
- [-2, "-2"], # ditto
- [3.14159265358979, "+3.141592654"],
- [12.34e36, "+1.234e+37"],
- [1.402e-45, "+1.402e-45"],
- [-1.402e-45, "-1.402e-45"],
- ["1.402e", "+1.402"],
- ["12.34E36", "+1.234e+37"],
- ["1.402E-45", "+1.402e-45"],
- ["-1.402E-45", "-1.402e-45"],
- ["1.402E", "+1.402"],
- ]
- targets.each do |f, str|
- assert_equal(str, XSD::XSDFloat.new(f).to_s)
- end
-
- assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
- assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
- assert(XSD::XSDFloat.new(0.0/0.0).data.nan?)
- assert_equal("INF", XSD::XSDFloat.new(1.0/0.0).to_s)
- assert_equal(1, XSD::XSDFloat.new(1.0/0.0).data.infinite?)
- assert_equal("-INF", XSD::XSDFloat.new(-1.0/0.0).to_s)
- assert_equal(-1, XSD::XSDFloat.new(-1.0/0.0).data.infinite?)
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- "5_0",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDFloat.new(d)
- end
- end
- end
-
- def test_XSDDouble
- o = XSD::XSDDouble.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DoubleLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 3.14159265358979,
- 12.34e36,
- 1.402e-45,
- -1.402e-45,
- ]
- targets.each do |f|
- assert_equal(f, XSD::XSDDouble.new(f).data)
- end
-
- targets = [
- "+3.14159265358979",
- "+1.234e+37",
- "+1.402e-45",
- "-1.402e-45",
- ]
- targets.each do |f|
- assert_equal(f, XSD::XSDDouble.new(f).to_s)
- end
-
- targets = [
- [3, "+3"], # should be 3.0?
- [-2, "-2"], # ditto.
- [3.14159265358979, "+3.14159265358979"],
- [12.34e36, "+1.234e+37"],
- [1.402e-45, "+1.402e-45"],
- [-1.402e-45, "-1.402e-45"],
- ["1.402e", "+1.402"],
- ["12.34E36", "+1.234e+37"],
- ["1.402E-45", "+1.402e-45"],
- ["-1.402E-45", "-1.402e-45"],
- ["1.402E", "+1.402"],
- ]
- targets.each do |f, str|
- assert_equal(str, XSD::XSDDouble.new(f).to_s)
- end
-
- assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
- assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
- assert_equal("NaN", XSD::XSDDouble.new(0.0/0.0).to_s)
- assert(XSD::XSDDouble.new(0.0/0.0).data.nan?)
- assert_equal("INF", XSD::XSDDouble.new(1.0/0.0).to_s)
- assert_equal(1, XSD::XSDDouble.new(1.0/0.0).data.infinite?)
- assert_equal("-INF", XSD::XSDDouble.new(-1.0/0.0).to_s)
- assert_equal(-1, XSD::XSDDouble.new(-1.0/0.0).data.infinite?)
-
- targets = [
- "0.000000000000a",
- "00a.0000000000001",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDDouble.new(d)
- end
- end
- end
-
- def test_XSDDuration
- o = XSD::XSDDuration.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DurationLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "P1Y2M3DT4H5M6S",
- "P1234Y5678M9012DT3456H7890M1234.5678S",
- "P0DT3456H7890M1234.5678S",
- "P1234Y5678M9012D",
- "-P1234Y5678M9012DT3456H7890M1234.5678S",
- "P5678M9012DT3456H7890M1234.5678S",
- "-P1234Y9012DT3456H7890M1234.5678S",
- "+P1234Y5678MT3456H7890M1234.5678S",
- "P1234Y5678M9012DT7890M1234.5678S",
- "-P1234Y5678M9012DT3456H1234.5678S",
- "+P1234Y5678M9012DT3456H7890M",
- "P123400000000000Y",
- "-P567800000000000M",
- "+P901200000000000D",
- "P0DT345600000000000H",
- "-P0DT789000000000000M",
- "+P0DT123400000000000.000000000005678S",
- "P1234YT1234.5678S",
- "-P5678MT7890M",
- "+P9012DT3456H",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDDuration, str)
- end
-
- targets = [
- ["P0Y0M0DT0H0M0S",
- "P0D"],
- ["-P0DT0S",
- "-P0D"],
- ["P01234Y5678M9012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y005678M9012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M0009012DT3456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT00003456H7890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT3456H000007890M1234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ["P1234Y5678M9012DT3456H7890M0000001234.5678S",
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDDuration.new(data).to_s)
- end
- end
-
- def test_XSDDateTime
- o = XSD::XSDDateTime.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DateTimeLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05-18T16:52:20Z",
- "0001-01-01T00:00:00Z",
- "9999-12-31T23:59:59Z",
- "19999-12-31T23:59:59Z",
- "2002-12-31T23:59:59.999Z",
- "2002-12-31T23:59:59.001Z",
- "2002-12-31T23:59:59.99999999999999999999Z",
- "2002-12-31T23:59:59.00000000000000000001Z",
- "2002-12-31T23:59:59+09:00",
- "2002-12-31T23:59:59+00:01",
- "2002-12-31T23:59:59-00:01",
- "2002-12-31T23:59:59-23:59",
- "2002-12-31T23:59:59.00000000000000000001+13:30",
- "2002-12-31T23:59:59.5137Z",
- "2002-12-31T23:59:59.51375Z", # 411/800
- "2002-12-31T23:59:59.51375+12:34",
- "-2002-05-18T16:52:20Z",
- "-4713-01-01T12:00:00Z",
- "-2002-12-31T23:59:59+00:01",
- "-0001-12-31T23:59:59.00000000000000000001+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDDateTime, str)
- end
-
- targets = [
- ["2002-12-31T23:59:59.00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59+00:00",
- "2002-12-31T23:59:59Z"],
- ["2002-12-31T23:59:59-00:00",
- "2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59.00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59+00:00",
- "-2002-12-31T23:59:59Z"],
- ["-2002-12-31T23:59:59-00:00",
- "-2002-12-31T23:59:59Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDDateTime.new(data).to_s)
- d = DateTime.parse(data)
- d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
- assert_equal(expected, XSD::XSDDateTime.new(d).to_s)
- end
-
- targets = [
- "0000-05-18T16:52:20Z",
- "05-18T16:52:20Z",
- "2002-05T16:52:20Z",
- "2002-05-18T16:52Z",
- "",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- XSD::XSDDateTime.new(d)
- end
- end
- end
-
- def test_XSDTime
- o = XSD::XSDTime.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::TimeLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "16:52:20Z",
- "00:00:00Z",
- "23:59:59Z",
- "23:59:59.999Z",
- "23:59:59.001Z",
- "23:59:59.99999999999999999999Z",
- "23:59:59.00000000000000000001Z",
- "23:59:59+09:00",
- "23:59:59+00:01",
- "23:59:59-00:01",
- "23:59:59-23:59",
- "23:59:59.00000000000000000001+13:30",
- "23:59:59.51345Z",
- "23:59:59.51345+12:34",
- "23:59:59+00:01",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDTime, str)
- end
-
- targets = [
- ["23:59:59.00",
- "23:59:59Z"],
- ["23:59:59+00:00",
- "23:59:59Z"],
- ["23:59:59-00:00",
- "23:59:59Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDTime.new(data).to_s)
- end
- end
-
- def test_XSDDate
- o = XSD::XSDDate.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::DateLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05-18Z",
- "0001-01-01Z",
- "9999-12-31Z",
- "19999-12-31Z",
- "2002-12-31+09:00",
- "2002-12-31+00:01",
- "2002-12-31-00:01",
- "2002-12-31-23:59",
- "2002-12-31+13:30",
- "-2002-05-18Z",
- "-19999-12-31Z",
- "-2002-12-31+00:01",
- "-0001-12-31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDDate, str)
- end
-
- targets = [
- ["2002-12-31",
- "2002-12-31Z"],
- ["2002-12-31+00:00",
- "2002-12-31Z"],
- ["2002-12-31-00:00",
- "2002-12-31Z"],
- ["-2002-12-31",
- "-2002-12-31Z"],
- ["-2002-12-31+00:00",
- "-2002-12-31Z"],
- ["-2002-12-31-00:00",
- "-2002-12-31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDDate.new(data).to_s)
- d = Date.parse(data)
- d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
- assert_equal(expected, XSD::XSDDate.new(d).to_s)
- end
- end
-end
-
-class TestXSD2 < Test::Unit::TestCase
- def setup
- # Nothing to do.
- end
-
- def teardown
- # Nothing to do.
- end
-
- def assert_parsed_result(klass, str)
- o = klass.new(str)
- assert_equal(str, o.to_s)
- end
-
- def test_XSDGYearMonth
- o = XSD::XSDGYearMonth.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GYearMonthLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002-05Z",
- "0001-01Z",
- "9999-12Z",
- "19999-12Z",
- "2002-12+09:00",
- "2002-12+00:01",
- "2002-12-00:01",
- "2002-12-23:59",
- "2002-12+13:30",
- "-2002-05Z",
- "-19999-12Z",
- "-2002-12+00:01",
- "-0001-12+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDGYearMonth, str)
- end
-
- targets = [
- ["2002-12",
- "2002-12Z"],
- ["2002-12+00:00",
- "2002-12Z"],
- ["2002-12-00:00",
- "2002-12Z"],
- ["-2002-12",
- "-2002-12Z"],
- ["-2002-12+00:00",
- "-2002-12Z"],
- ["-2002-12-00:00",
- "-2002-12Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDGYearMonth.new(data).to_s)
- end
- end
-
- def test_XSDGYear
- o = XSD::XSDGYear.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GYearLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "2002Z",
- "0001Z",
- "9999Z",
- "19999Z",
- "2002+09:00",
- "2002+00:01",
- "2002-00:01",
- "2002-23:59",
- "2002+13:30",
- "-2002Z",
- "-19999Z",
- "-2002+00:01",
- "-0001+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDGYear, str)
- end
-
- targets = [
- ["2002",
- "2002Z"],
- ["2002+00:00",
- "2002Z"],
- ["2002-00:00",
- "2002Z"],
- ["-2002",
- "-2002Z"],
- ["-2002+00:00",
- "-2002Z"],
- ["-2002-00:00",
- "-2002Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDGYear.new(data).to_s)
- end
- end
-
- def test_XSDGMonthDay
- o = XSD::XSDGMonthDay.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GMonthDayLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "05-18Z",
- "01-01Z",
- "12-31Z",
- "12-31+09:00",
- "12-31+00:01",
- "12-31-00:01",
- "12-31-23:59",
- "12-31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDGMonthDay, str)
- end
-
- targets = [
- ["12-31",
- "12-31Z"],
- ["12-31+00:00",
- "12-31Z"],
- ["12-31-00:00",
- "12-31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDGMonthDay.new(data).to_s)
- end
- end
-
- def test_XSDGDay
- o = XSD::XSDGDay.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GDayLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "18Z",
- "01Z",
- "31Z",
- "31+09:00",
- "31+00:01",
- "31-00:01",
- "31-23:59",
- "31+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDGDay, str)
- end
-
- targets = [
- ["31",
- "31Z"],
- ["31+00:00",
- "31Z"],
- ["31-00:00",
- "31Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDGDay.new(data).to_s)
- end
- end
-
- def test_XSDGMonth
- o = XSD::XSDGMonth.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::GMonthLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "05Z",
- "01Z",
- "12Z",
- "12+09:00",
- "12+00:01",
- "12-00:01",
- "12-23:59",
- "12+13:30",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDGMonth, str)
- end
-
- targets = [
- ["12",
- "12Z"],
- ["12+00:00",
- "12Z"],
- ["12-00:00",
- "12Z"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDGMonth.new(data).to_s)
- end
- end
-
- def test_XSDHexBinary
- o = XSD::XSDHexBinary.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::HexBinaryLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "abcdef",
- "\xe3\x81\xaa\xe3\x81\xb2",
- %Q(\0),
- "",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDHexBinary.new(str).string)
- assert_equal(str.unpack("H*")[0 ].tr('a-f', 'A-F'),
- XSD::XSDHexBinary.new(str).data)
- o = XSD::XSDHexBinary.new
- o.set_encoded(str.unpack("H*")[0 ].tr('a-f', 'A-F'))
- assert_equal(str, o.string)
- o.set_encoded(str.unpack("H*")[0 ].tr('A-F', 'a-f'))
- assert_equal(str, o.string)
- end
-
- targets = [
- "0FG7",
- "0fg7",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- o = XSD::XSDHexBinary.new
- o.set_encoded(d)
- p o.string
- end
- end
- end
-
- def test_XSDBase64Binary
- o = XSD::XSDBase64Binary.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::Base64BinaryLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- "abcdef",
- "\xe3\x81\xaa\xe3\x81\xb2",
- %Q(\0),
- "",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDBase64Binary.new(str).string)
- assert_equal([str ].pack("m").chomp, XSD::XSDBase64Binary.new(str).data)
- o = XSD::XSDBase64Binary.new
- o.set_encoded([str ].pack("m").chomp)
- assert_equal(str, o.string)
- end
-
- targets = [
- "-",
- "*",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError, d.to_s) do
- o = XSD::XSDBase64Binary.new
- o.set_encoded(d)
- p o.string
- end
- end
- end
-
- def test_XSDAnyURI
- o = XSD::XSDAnyURI.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::AnyURILiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- # Too few tests here I know. Believe uri module. :)
- targets = [
- "foo",
- "http://foo",
- "http://foo/bar/baz",
- "http://foo/bar#baz",
- "http://foo/bar%20%20?a+b",
- "HTTP://FOO/BAR%20%20?A+B",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDAnyURI, str)
- end
- end
-
- def test_XSDQName
- o = XSD::XSDQName.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::QNameLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- # More strict test is needed but current implementation allows all non-':'
- # chars like ' ', C0 or C1...
- targets = [
- "foo",
- "foo:bar",
- "a:b",
- ]
- targets.each do |str|
- assert_parsed_result(XSD::XSDQName, str)
- end
- end
-
-
- ###
- ## Derived types
- #
-
- def test_XSDInteger
- o = XSD::XSDInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::IntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- -9999999999,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDInteger.new(int).data)
- end
-
- targets = [
- "0",
- "1000000000",
- "-9999999999",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDInteger.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- [
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDInteger.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDInteger.new(d)
- end
- end
- end
-
- def test_XSDNonPositiveInteger
- o = XSD::XSDNonPositiveInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::NonPositiveIntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- -9999999999,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDNonPositiveInteger.new(int).data)
- end
-
- targets = [
- "0",
- "-9999999999",
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDNonPositiveInteger.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDNonPositiveInteger.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDNonPositiveInteger.new(d)
- end
- end
- end
-
- def test_XSDNegativeInteger
- o = XSD::XSDNegativeInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::NegativeIntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- -1,
- -9999999999,
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDNegativeInteger.new(int).data)
- end
-
- targets = [
- "-1",
- "-9999999999",
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDNegativeInteger.new(str).to_s)
- end
-
- targets = [
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDNegativeInteger.new(data).to_s)
- end
-
- targets = [
- "-0.0",
- "-5.2",
- "-0.000000000000a",
- "+-5",
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDNegativeInteger.new(d)
- end
- end
- end
-
- def test_XSDLong
- o = XSD::XSDLong.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::LongLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 9223372036854775807,
- -9223372036854775808,
- ]
- targets.each do |lng|
- assert_equal(lng, XSD::XSDLong.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "9223372036854775807",
- "-9223372036854775808",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDLong.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDLong.new(data).to_s)
- end
-
- targets = [
- 9223372036854775808,
- -9223372036854775809,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDLong.new(d)
- end
- end
- end
-
- def test_XSDInt
- o = XSD::XSDInt.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::IntLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 2147483647,
- -2147483648,
- ]
- targets.each do |lng|
- assert_equal(lng, XSD::XSDInt.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "2147483647",
- "-2147483648",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDInt.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDInt.new(data).to_s)
- end
-
- targets = [
- 2147483648,
- -2147483649,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDInt.new(d)
- end
- end
- end
-
- def test_XSDShort
- o = XSD::XSDShort.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::ShortLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 32767,
- -32768,
- ]
- targets.each do |lng|
- assert_equal(lng, XSD::XSDShort.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "32767",
- "-32768",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDShort.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDShort.new(data).to_s)
- end
-
- targets = [
- 32768,
- -32769,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDShort.new(d)
- end
- end
- end
-
- def test_XSDByte
- o = XSD::XSDByte.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::ByteLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 123,
- -123,
- 127,
- -128,
- ]
- targets.each do |lng|
- assert_equal(lng, XSD::XSDByte.new(lng).data)
- end
-
- targets = [
- "0",
- "123",
- "-123",
- "127",
- "-128",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDByte.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["-000123", "-123"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDByte.new(data).to_s)
- end
-
- targets = [
- 128,
- -129,
- "0.0",
- "-5.2",
- "0.000000000000a",
- "+-5",
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDByte.new(d)
- end
- end
- end
-
- def test_XSDNonNegativeInteger
- o = XSD::XSDNonNegativeInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::NonNegativeIntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDNonNegativeInteger.new(int).data)
- end
-
- targets = [
- "0",
- "1000000000",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDNonNegativeInteger.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- [
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDNonNegativeInteger.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "0.000000000000a",
- "+-5",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDNonNegativeInteger.new(d)
- end
- end
- end
-
- def test_XSDUnsignedLong
- o = XSD::XSDUnsignedLong.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::UnsignedLongLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- 18446744073709551615,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDUnsignedLong.new(int).data)
- end
-
- targets = [
- "0",
- "1000000000",
- "18446744073709551615",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDUnsignedLong.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["+18446744073709551615", "18446744073709551615"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDUnsignedLong.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "0.000000000000a",
- "+-5",
- "18446744073709551615."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDUnsignedLong.new(d)
- end
- end
- end
-
- def test_XSDUnsignedInt
- o = XSD::XSDUnsignedInt.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::UnsignedIntLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 1000000000,
- 4294967295,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDUnsignedInt.new(int).data)
- end
-
- targets = [
- "0",
- "1000000000",
- "4294967295",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDUnsignedInt.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["+4294967295", "4294967295"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDUnsignedInt.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "0.000000000000a",
- "+-5",
- "4294967295."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDUnsignedInt.new(d)
- end
- end
- end
-
- def test_XSDUnsignedShort
- o = XSD::XSDUnsignedShort.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::UnsignedShortLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 10000,
- 65535,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDUnsignedShort.new(int).data)
- end
-
- targets = [
- "0",
- "1000",
- "65535",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDUnsignedShort.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["+65535", "65535"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDUnsignedShort.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "0.000000000000a",
- "+-5",
- "65535."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDUnsignedShort.new(d)
- end
- end
- end
-
- def test_XSDUnsignedByte
- o = XSD::XSDUnsignedByte.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::UnsignedByteLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 0,
- 10,
- 255,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDUnsignedByte.new(int).data)
- end
-
- targets = [
- "0",
- "10",
- "255",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDUnsignedByte.new(str).to_s)
- end
-
- targets = [
- ["-0", "0"],
- ["+0", "0"],
- ["000123", "123"],
- ["+255", "255"],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDUnsignedByte.new(data).to_s)
- end
-
- targets = [
- "0.0",
- "0.000000000000a",
- "+-5",
- "255."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDUnsignedByte.new(d)
- end
- end
- end
-
- def test_XSDPositiveInteger
- o = XSD::XSDPositiveInteger.new
- assert_equal(XSD::Namespace, o.type.namespace)
- assert_equal(XSD::PositiveIntegerLiteral, o.type.name)
- assert_equal(nil, o.data)
- assert_equal(true, o.is_nil)
-
- targets = [
- 1,
- 1000000000,
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
- ]
- targets.each do |int|
- assert_equal(int, XSD::XSDPositiveInteger.new(int).data)
- end
-
- targets = [
- "1",
- "1000000000",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- ]
- targets.each do |str|
- assert_equal(str, XSD::XSDPositiveInteger.new(str).to_s)
- end
-
- targets = [
- ["+1", "1"],
- ["000123", "123"],
- [
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
- ],
- ]
- targets.each do |data, expected|
- assert_equal(expected, XSD::XSDPositiveInteger.new(data).to_s)
- end
-
- targets = [
- "1.0",
- "1.000000000000a",
- "+-5",
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
- ]
- targets.each do |d|
- assert_raises(XSD::ValueSpaceError) do
- XSD::XSDPositiveInteger.new(d)
- end
- end
- end
-end
-
-
-end
diff --git a/test/xsd/xmlschema.xml b/test/xsd/xmlschema.xml
deleted file mode 100644
index 018bd0cc67..0000000000
--- a/test/xsd/xmlschema.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xs:schema
- attributeFormDefault="qualified"
- elementFormDefault="qualified"
- targetNamespace="urn:jp.gr.jin.rrr.example.fakeschema"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="MessageDataSet">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded" />
- </xs:complexType>
- </xs:element>
-</xs:schema>