wasabi 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions
3
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
5
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
6
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
7
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
8
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
10
+ xmlns:actions="http://example.com/actions"
11
+ targetNamespace="http://example.com/topLevelNamespace">
12
+ <types>
13
+ <s:schema elementFormDefault="qualified" targetNamespace="http://example.com/actions">
14
+ <s:element name="SomeRequest">
15
+ <s:complexType>
16
+ <s:sequence>
17
+ <s:element name="status" type="s:string"/>
18
+ </s:sequence>
19
+ </s:complexType>
20
+ </s:element>
21
+ </s:schema>
22
+ </types>
23
+ <message name="SomeInput">
24
+ <part name="parameters" element="actions:SomeRequest"/>
25
+ </message>
26
+ <message name="SomeOutput">
27
+ <part name="parameters" element="actions:SomeResponse"/>
28
+ </message>
29
+ <portType name="ExamplePortType">
30
+ <operation name="SomeOperation">
31
+ <input message="actions:SomeInput"/>
32
+ <output message="actions:SomeOutput"/>
33
+ </operation>
34
+ </portType>
35
+ <binding name="ExampleBinding" type="actions:ExamplePortType">
36
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
37
+ <operation name="SomeOperation">
38
+ <soap:operation soapAction="http://example.com/actions.SomeOperation" style="document"/>
39
+ <input>
40
+ <soap:body use="literal"/>
41
+ </input>
42
+ <output>
43
+ <soap:body use="literal"/>
44
+ </output>
45
+ </operation>
46
+ </binding>
47
+ <service name="ExampleService">
48
+ <port name="ExamplePort" binding="actions:ExampleBinding">
49
+ <soap:address location="http://localhost/soapservice/execute?path=%2Fbase%2Fincludes%2FTest+Soap%2FReturn+Rows"/>
50
+ </port>
51
+ </service>
52
+ </definitions>
@@ -1,9 +1,19 @@
1
1
  require "bundler"
2
2
  Bundler.require :default, :development
3
3
 
4
+ unless RUBY_PLATFORM =~ /java/
5
+ require "simplecov"
6
+ require "coveralls"
7
+
8
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
9
+ SimpleCov.start do
10
+ add_filter "spec"
11
+ end
12
+ end
13
+
4
14
  support_files = File.expand_path("spec/support/**/*.rb")
5
15
  Dir[support_files].each { |file| require file }
6
16
 
7
17
  RSpec.configure do |config|
8
- config.include SpecSupport::Methods
18
+ config.include SpecSupport
9
19
  end
@@ -33,10 +33,8 @@ module SpecSupport
33
33
  end
34
34
  end
35
35
 
36
- module Methods
37
- def fixture(*args)
38
- Fixture.new(*args)
39
- end
36
+ def fixture(*args)
37
+ Fixture.new(*args)
40
38
  end
41
39
 
42
40
  end
@@ -0,0 +1,18 @@
1
+ module SpecSupport
2
+
3
+ def benchmark(&block)
4
+ require 'benchmark'
5
+
6
+ puts "Benchmark:"
7
+ puts Benchmark.measure(&block)
8
+ end
9
+
10
+ def profile_methods
11
+ require 'method_profiler'
12
+
13
+ profiler = MethodProfiler.observe(Wasabi::Parser)
14
+ yield
15
+ puts profiler.report
16
+ end
17
+
18
+ end
@@ -15,7 +15,7 @@ describe Wasabi::Document do
15
15
 
16
16
  its(:operations) do
17
17
  should == {
18
- :authenticate => { :input => "authenticate", :action => "authenticate", :namespace_identifier => "tns" }
18
+ :authenticate => { :input => "authenticate", :output => "authenticateResponse", :action => "authenticate", :namespace_identifier => "tns" }
19
19
  }
20
20
  end
21
21
 
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Wasabi::Document do
4
+ context 'with: economic.wsdl' do
5
+
6
+ subject { Wasabi::Document.new fixture(:economic).read }
7
+
8
+ it 'has an ok parse-time for huge wsdl files' do
9
+ expect(subject.operations.count).to eq(1511)
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ describe Wasabi::Document do
4
+ context "with: encoded_endpoint.wsdl" do
5
+
6
+ subject { Wasabi::Document.new fixture(:encoded_endpoint).read }
7
+
8
+ its(:endpoint) { should == URI("http://localhost/soapservice/execute?path=/base/includes/Test+Soap/Return+Rows") }
9
+
10
+ end
11
+ end
@@ -15,8 +15,8 @@ describe Wasabi::Document do
15
15
 
16
16
  its(:operations) do
17
17
  should include(
18
- { :get_quick_approver_list => { :input => "GetQuickApproverList", :action => "GetQuickApproverList" } },
19
- { :hello => { :input => "hello", :action => "hello" } }
18
+ { :get_quick_approver_list => { :input => "GetQuickApproverList", :action => "GetQuickApproverList", :parameters=>{:Request=>{:name=>"Request", :type=>"GetQuickApproverListInput"}}}},
19
+ { :hello => { :input => "hello", :action => "hello", :parameters=>{:Input=>{:name=>"Input", :type=>"string"}} } }
20
20
  )
21
21
  end
22
22
 
@@ -13,6 +13,26 @@ describe Wasabi::Document do
13
13
  should include([["Account", "fieldsToNull"], "string"])
14
14
  end
15
15
 
16
+ it "should position base class attributes before subclass attributes in :order! array" do
17
+ account = subject.parser.types["Account"]
18
+ account[:order!].should == ["fieldsToNull", "Id", "Description", "ProcessId", "CreatedDate"]
19
+ end
20
+
21
+ it "should have each type's hash remember it's base type in :base_type element" do
22
+ account = subject.parser.types["Account"]
23
+ account[:base_type].should == "baseObject"
24
+
25
+ base_object = subject.parser.types["baseObject"]
26
+ base_object.should_not have_key(:base_type)
27
+ end
28
+
29
+ it "should have element's hash contain all these attributes (:nillable, :minOccurs, :maxOccurs) in addition to :type" do
30
+ base_object = subject.parser.types["baseObject"]
31
+ fields_to_null = base_object["fieldsToNull"]
32
+ fields_to_null[:nillable].should == "true"
33
+ fields_to_null[:minOccurs].should == "0"
34
+ fields_to_null[:maxOccurs].should == "unbounded"
35
+ end
16
36
  end
17
37
  end
18
38
 
@@ -14,7 +14,7 @@ describe Wasabi::Document do
14
14
  it { should have(1).operations }
15
15
 
16
16
  its(:operations) do
17
- should == { :save => { :input => "Save", :action => "http://example.com/actions.Save", :namespace_identifier => "actions" } }
17
+ should == { :save => { :input => "Save", :output=>"SaveResponse", :action => "http://example.com/actions.Save", :namespace_identifier => "actions", :parameters => { :article => { :name => "article", :type => "Article" } } } }
18
18
  end
19
19
 
20
20
  its(:type_namespaces) do
@@ -15,9 +15,9 @@ describe Wasabi::Document do
15
15
 
16
16
  its(:operations) do
17
17
  should include(
18
- { :delete_client => { :input => "Client.Delete", :action => "http://api.example.com/api/Client.Delete", :namespace_identifier => "tns" } },
19
- { :get_clients => { :input => "User.GetClients", :action => "http://api.example.com/api/User.GetClients", :namespace_identifier => "tns" } },
20
- { :get_api_key => { :input => "User.GetApiKey", :action => "http://api.example.com/api/User.GetApiKey", :namespace_identifier => "tns" } }
18
+ { :delete_client => { :input => "Client.Delete", :output => "Client.DeleteResponse", :action => "http://api.example.com/api/Client.Delete", :namespace_identifier => "tns" } },
19
+ { :get_clients => { :input => "User.GetClients", :output => "User.GetClientsResponse", :action => "http://api.example.com/api/User.GetClients", :namespace_identifier => "tns" } },
20
+ { :get_api_key => { :input => "User.GetApiKey", :output => "User.GetApiKeyResponse", :action => "http://api.example.com/api/User.GetApiKey", :namespace_identifier => "tns" } }
21
21
  )
22
22
  end
23
23
 
@@ -15,9 +15,9 @@ describe Wasabi::Document do
15
15
 
16
16
  its(:operations) do
17
17
  should include(
18
- { :get_user_login_by_id => { :input => "GetUserLoginById", :action => "/api/api/GetUserLoginById", :namespace_identifier => "typens" } },
19
- { :get_all_contacts => { :input => "GetAllContacts", :action => "/api/api/GetAllContacts", :namespace_identifier => "typens" } },
20
- { :search_user => { :input => "SearchUser", :action => "/api/api/SearchUser", :namespace_identifier => "typens" } }
18
+ { :get_user_login_by_id => { :input => "GetUserLoginById", :output => "GetUserLoginByIdResponse", :action => "/api/api/GetUserLoginById", :namespace_identifier => "typens" } },
19
+ { :get_all_contacts => { :input => "GetAllContacts", :output =>"GetAllContactsResponse", :action => "/api/api/GetAllContacts", :namespace_identifier => "typens" } },
20
+ { :search_user => { :input => "SearchUser", :output =>"SearchUserResponse", :action => "/api/api/SearchUser", :namespace_identifier => "typens" } }
21
21
  )
22
22
  end
23
23
 
@@ -7,7 +7,7 @@ describe Wasabi::Document do
7
7
 
8
8
  its(:operations) do
9
9
  should include(
10
- { :sendsms => { :input => "sendsms", :action => "sendsms", :namespace_identifier => "tns" } }
10
+ { :sendsms => { :input => "sendsmsRequest", :output => "sendsmsResponse", :action => "sendsms", :namespace_identifier => "tns" } }
11
11
  )
12
12
  end
13
13
 
@@ -20,11 +20,11 @@ describe Wasabi::Parser do
20
20
  end
21
21
 
22
22
  it "records the fields under a type" do
23
- subject.types["Save"].keys.should =~ ["article", :namespace]
23
+ subject.types["Save"].keys.should =~ ["article", :namespace, :order!]
24
24
  end
25
25
 
26
26
  it "records multiple fields when there are more than one" do
27
- subject.types["Article"].keys.should =~ ["Title", "Author", :namespace]
27
+ subject.types["Article"].keys.should =~ ["Title", "Author", :namespace, :order!]
28
28
  end
29
29
 
30
30
  it "records the type of a field" do
@@ -32,5 +32,9 @@ describe Wasabi::Parser do
32
32
  subject.namespaces["article"].should == "http://example.com/article"
33
33
  end
34
34
 
35
+ it "lists the order of the type elements" do
36
+ subject.types["Article"][:order!].should == ["Author", "Title"]
37
+ end
38
+
35
39
  end
36
40
  end
@@ -12,7 +12,11 @@ describe Wasabi::Parser do
12
12
  let(:xml) { fixture(:no_message_parts).read }
13
13
 
14
14
  it "falls back to using the message type in the port element" do
15
- subject.operations[:save][:input].should == "Save"
15
+ # Operation's input has no part element in the message, so using the message type.
16
+ subject.operations[:save][:input].should == "SaveSoapIn"
17
+
18
+ # Operation's output has part element in the message, so using part element's type.
19
+ subject.operations[:save][:output].should == "SaveResponse"
16
20
  end
17
21
 
18
22
  it "falls back to using the namespace ID in the port element" do
@@ -16,8 +16,11 @@ describe Wasabi::Parser do
16
16
  end
17
17
 
18
18
  it "ignores xsd:all" do
19
- subject.types["MpUser"].keys.should == [:namespace]
20
- end
19
+ keys = subject.types["MpUser"].keys
20
+ keys.size.should == 2
21
21
 
22
+ keys.should include(:namespace)
23
+ keys.should include(:order!)
24
+ end
22
25
  end
23
26
  end
@@ -15,5 +15,10 @@ describe Wasabi::Parser do
15
15
  subject.endpoint.should be_nil
16
16
  end
17
17
 
18
+ it "should position base class attributes before subclass attributes in :order! array" do
19
+ type = subject.types["ROPtsLiesListe"]
20
+ type[:order!].should == ["messages", "returncode", "listenteil"]
21
+ end
22
+
18
23
  end
19
24
  end
@@ -7,14 +7,15 @@ Gem::Specification.new do |s|
7
7
  s.version = Wasabi::VERSION
8
8
  s.authors = ["Daniel Harrington"]
9
9
  s.email = ["me@rubiii.com"]
10
- s.homepage = "https://github.com/rubiii/#{s.name}"
10
+ s.homepage = "https://github.com/savonrb/#{s.name}"
11
11
  s.summary = "A simple WSDL parser"
12
12
  s.description = s.summary
13
13
 
14
14
  s.rubyforge_project = s.name
15
+ s.license = 'MIT'
15
16
 
16
17
  s.add_dependency "httpi", "~> 2.0"
17
- s.add_dependency "nokogiri", ">= 1.4.0"
18
+ s.add_dependency "nokogiri", ">= 1.4.0", "< 1.6"
18
19
 
19
20
  s.add_development_dependency "rake", "~> 0.9"
20
21
  s.add_development_dependency "rspec", "~> 2.10"
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wasabi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
5
- prerelease:
4
+ version: 3.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel Harrington
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-21 00:00:00.000000000 Z
11
+ date: 2013-07-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: httpi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,23 +27,26 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: nokogiri
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.4.0
34
+ - - <
35
+ - !ruby/object:Gem::Version
36
+ version: '1.6'
38
37
  type: :runtime
39
38
  prerelease: false
40
39
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ! '>='
41
+ - - '>='
44
42
  - !ruby/object:Gem::Version
45
43
  version: 1.4.0
44
+ - - <
45
+ - !ruby/object:Gem::Version
46
+ version: '1.6'
46
47
  - !ruby/object:Gem::Dependency
47
48
  name: rake
48
49
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
@@ -54,7 +54,6 @@ dependencies:
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
57
  requirements:
59
58
  - - ~>
60
59
  - !ruby/object:Gem::Version
@@ -62,7 +61,6 @@ dependencies:
62
61
  - !ruby/object:Gem::Dependency
63
62
  name: rspec
64
63
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
64
  requirements:
67
65
  - - ~>
68
66
  - !ruby/object:Gem::Version
@@ -70,7 +68,6 @@ dependencies:
70
68
  type: :development
71
69
  prerelease: false
72
70
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
71
  requirements:
75
72
  - - ~>
76
73
  - !ruby/object:Gem::Version
@@ -96,8 +93,9 @@ files:
96
93
  - lib/wasabi/parser.rb
97
94
  - lib/wasabi/resolver.rb
98
95
  - lib/wasabi/version.rb
99
- - lib/wasabi/xpath_helper.rb
100
96
  - spec/fixtures/authentication.wsdl
97
+ - spec/fixtures/economic.wsdl
98
+ - spec/fixtures/encoded_endpoint.wsdl
101
99
  - spec/fixtures/geotrust.wsdl
102
100
  - spec/fixtures/import_port_types.wsdl
103
101
  - spec/fixtures/inherited.wsdl
@@ -114,8 +112,11 @@ files:
114
112
  - spec/fixtures/two_bindings.wsdl
115
113
  - spec/spec_helper.rb
116
114
  - spec/support/fixture.rb
115
+ - spec/support/profiling.rb
117
116
  - spec/wasabi/core_ext/string_spec.rb
118
117
  - spec/wasabi/document/authentication_spec.rb
118
+ - spec/wasabi/document/economic_spec.rb
119
+ - spec/wasabi/document/encoded_endpoint_spec.rb
119
120
  - spec/wasabi/document/geotrust_spec.rb
120
121
  - spec/wasabi/document/inherited_spec.rb
121
122
  - spec/wasabi/document/multiple_namespaces_spec.rb
@@ -136,38 +137,34 @@ files:
136
137
  - spec/wasabi/resolver_spec.rb
137
138
  - spec/wasabi/wasabi_spec.rb
138
139
  - wasabi.gemspec
139
- homepage: https://github.com/rubiii/wasabi
140
- licenses: []
140
+ homepage: https://github.com/savonrb/wasabi
141
+ licenses:
142
+ - MIT
143
+ metadata: {}
141
144
  post_install_message:
142
145
  rdoc_options: []
143
146
  require_paths:
144
147
  - lib
145
148
  required_ruby_version: !ruby/object:Gem::Requirement
146
- none: false
147
149
  requirements:
148
- - - ! '>='
150
+ - - '>='
149
151
  - !ruby/object:Gem::Version
150
152
  version: '0'
151
- segments:
152
- - 0
153
- hash: 1638093846469018042
154
153
  required_rubygems_version: !ruby/object:Gem::Requirement
155
- none: false
156
154
  requirements:
157
- - - ! '>='
155
+ - - '>='
158
156
  - !ruby/object:Gem::Version
159
157
  version: '0'
160
- segments:
161
- - 0
162
- hash: 1638093846469018042
163
158
  requirements: []
164
159
  rubyforge_project: wasabi
165
- rubygems_version: 1.8.24
160
+ rubygems_version: 2.0.6
166
161
  signing_key:
167
- specification_version: 3
162
+ specification_version: 4
168
163
  summary: A simple WSDL parser
169
164
  test_files:
170
165
  - spec/fixtures/authentication.wsdl
166
+ - spec/fixtures/economic.wsdl
167
+ - spec/fixtures/encoded_endpoint.wsdl
171
168
  - spec/fixtures/geotrust.wsdl
172
169
  - spec/fixtures/import_port_types.wsdl
173
170
  - spec/fixtures/inherited.wsdl
@@ -184,8 +181,11 @@ test_files:
184
181
  - spec/fixtures/two_bindings.wsdl
185
182
  - spec/spec_helper.rb
186
183
  - spec/support/fixture.rb
184
+ - spec/support/profiling.rb
187
185
  - spec/wasabi/core_ext/string_spec.rb
188
186
  - spec/wasabi/document/authentication_spec.rb
187
+ - spec/wasabi/document/economic_spec.rb
188
+ - spec/wasabi/document/encoded_endpoint_spec.rb
189
189
  - spec/wasabi/document/geotrust_spec.rb
190
190
  - spec/wasabi/document/inherited_spec.rb
191
191
  - spec/wasabi/document/multiple_namespaces_spec.rb