Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/trunk/test/wsdl/test_multiplefault.rb

Revision 1939, 0.9 kB (checked in by nahi, 1 year ago)
  • added wsdl/soap/classNameCreator and let it handle whole classname creation. and when the same NCName is used in different namespaces, ClassNameCreator? tries to avoid classname crash by adding '_' at the end of classname. it's a dirty workaround for #408 and will be changed in the future.
  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1 require 'test/unit'
2 require 'wsdl/parser'
3 require 'wsdl/soap/classDefCreator'
4 require 'wsdl/soap/classNameCreator'
5
6
7 module WSDL
8
9
10 class TestMultipleFault < Test::Unit::TestCase
11   def self.setup(filename)
12     @@filename = filename
13   end
14
15   def test_multiplefault
16     @wsdl = WSDL::Parser.new.parse(File.open(@@filename) { |f| f.read })
17     name_creator = WSDL::SOAP::ClassNameCreator.new
18     classdefstr = WSDL::SOAP::ClassDefCreator.new(@wsdl, name_creator).dump
19     yield_eval_binding(classdefstr) do |b|
20       assert_equal(
21         WSDL::TestMultipleFault::AuthenticationError,
22         eval("AuthenticationError", b)
23       )
24       assert_equal(
25         WSDL::TestMultipleFault::AuthorizationError,
26         eval("AuthorizationError", b)
27       )
28     end
29   end
30
31   def yield_eval_binding(evaled)
32     b = binding
33     eval(evaled, b)
34     yield(b)
35   end
36 end
37
38 TestMultipleFault.setup(File.join(File.dirname(__FILE__), 'multiplefault.wsdl'))
39
40
41 end
Note: See TracBrowser for help on using the browser.