summaryrefslogtreecommitdiff
path: root/test/wsdl/marshal
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/wsdl/marshal
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/wsdl/marshal')
-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
3 files changed, 0 insertions, 123 deletions
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