summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-28 05:53:16 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-28 05:53:16 +0000
commit42bca643c3ec41782d519c7676383f8f71e67a7a (patch)
tree3ddde51774247d839f4e12ae0d9af6ff2e84d35b /test
parenta017b0cc8aea236600d47ff04cd829f84499f414 (diff)
* lib/soap/streamHandler.rb: drop unused http parameters.
* lib/soap/encodingstyle/soapHandler.rb, lib/soap/mapping/factory.rb, lib/soap/mapping/mapping.rb, lib/soap/mapping/registry.rb, lib/wsdl/soap/complexType.rb: ApacheSOAP's map support was broken under WSDL dynanic client environment. fixed. * test/wsdl/raa/*: add tests. * lib/xsd/datatypes.rb: dateTime precision bug fix (at least, I hope.) bug of soap4r. XSDDateTimeImple.to_time passed a Float to Time.local/Time.gm as an usec, and NUM2LONG(rb_num2long for Float) causes rounding error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/soap/marshal/test_marshal.rb2
-rw-r--r--test/soap/test_basetype.rb4
-rw-r--r--test/wsdl/raa/RAA.rb15
-rw-r--r--test/wsdl/raa/RAAServant.rb99
-rw-r--r--test/wsdl/raa/RAAService.rb (renamed from test/wsdl/raa/server.rb)41
-rw-r--r--test/wsdl/raa/README.txt5
-rw-r--r--test/wsdl/raa/test_raa.rb6
-rw-r--r--test/xsd/test_xsd.rb5
8 files changed, 138 insertions, 39 deletions
diff --git a/test/soap/marshal/test_marshal.rb b/test/soap/marshal/test_marshal.rb
index 9ae08c68d8..9d5b706d41 100644
--- a/test/soap/marshal/test_marshal.rb
+++ b/test/soap/marshal/test_marshal.rb
@@ -369,7 +369,7 @@ module MarshalTestLib
class MyTime < Time; def initialize(v, *args) super(*args); @v = v; end end
def test_time
# once there was a bug caused by usec overflow. try a little harder.
- 10.times do
+ 100.times do
t = Time.now
marshal_equal(t, t.usec.to_s)
end
diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb
index 0125f80505..a00f0f549c 100644
--- a/test/soap/test_basetype.rb
+++ b/test/soap/test_basetype.rb
@@ -351,6 +351,8 @@ class TestSOAP < Test::Unit::TestCase
"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",
@@ -414,6 +416,8 @@ class TestSOAP < Test::Unit::TestCase
"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|
diff --git a/test/wsdl/raa/RAA.rb b/test/wsdl/raa/RAA.rb
index 32b88bd26a..aff0525480 100644
--- a/test/wsdl/raa/RAA.rb
+++ b/test/wsdl/raa/RAA.rb
@@ -235,20 +235,9 @@ class StringArray < Array
end
# http://xml.apache.org/xml-soap
-class Map
+class Map < Array
+ # Contents type should be dumped here...
@@schema_type = "Map"
@@schema_ns = "http://xml.apache.org/xml-soap"
-
- def item
- @item
- end
-
- def item=(value)
- @item = value
- end
-
- def initialize(item = nil)
- @item = item
- end
end
diff --git a/test/wsdl/raa/RAAServant.rb b/test/wsdl/raa/RAAServant.rb
new file mode 100644
index 0000000000..68380f8e48
--- /dev/null
+++ b/test/wsdl/raa/RAAServant.rb
@@ -0,0 +1,99 @@
+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/server.rb b/test/wsdl/raa/RAAService.rb
index 95e63dcd31..42cdfaea47 100644
--- a/test/wsdl/raa/server.rb
+++ b/test/wsdl/raa/RAAService.rb
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
+require 'RAAServant.rb'
+
require 'soap/rpc/standaloneServer'
-require 'RAA.rb'
class RAABaseServicePortType
MappingRegistry = SOAP::Mapping::Registry.new
@@ -13,9 +14,9 @@ class RAABaseServicePortType
)
MappingRegistry.set(
Map,
- ::SOAP::SOAPStruct,
- ::SOAP::Mapping::Registry::TypedStructFactory,
- { :type => XSD::QName.new("http://xml.apache.org/xml-soap", "Map") }
+ ::SOAP::SOAPArray,
+ ::SOAP::Mapping::Registry::TypedArrayFactory,
+ { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") }
)
MappingRegistry.set(
Category,
@@ -47,48 +48,39 @@ class RAABaseServicePortType
::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/"],
+ [::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/"],
+ [::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/"],
+ [::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/"],
+ [::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/"],
+ [::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/"]
+ [::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
+class App < SOAP::RPC::StandaloneServer
def initialize(*arg)
super
@@ -102,3 +94,8 @@ class RAABaseServiceServer < SOAP::RPC::StandaloneServer
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
index e884db9bb4..efbaf9d87c 100644
--- a/test/wsdl/raa/README.txt
+++ b/test/wsdl/raa/README.txt
@@ -1,4 +1,7 @@
-server.rb: based on RAAService.rb which is generated with the following command;
+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;
diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb
index f90c6222f4..86452a0b40 100644
--- a/test/wsdl/raa/test_raa.rb
+++ b/test/wsdl/raa/test_raa.rb
@@ -18,9 +18,11 @@ class TestRAA < Test::Unit::TestCase
def setup_server
$:.push(DIR)
- require File.join(DIR, 'server.rb')
+ require File.join(DIR, 'RAA.rb')
+ require File.join(DIR, 'RAAServant.rb')
+ require File.join(DIR, 'RAAService.rb')
$:.delete(DIR)
- @server = RAABaseServiceServer.new('RAA server', nil, '0.0.0.0', Port)
+ @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
diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb
index 88191bb7f1..9b3a7f0f1f 100644
--- a/test/xsd/test_xsd.rb
+++ b/test/xsd/test_xsd.rb
@@ -384,6 +384,9 @@ class TestXSD < Test::Unit::TestCase
"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",
@@ -445,6 +448,8 @@ class TestXSD < Test::Unit::TestCase
"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|