actionwebservice 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +21 -0
- data/README +50 -6
- data/Rakefile +9 -9
- data/TODO +6 -6
- data/lib/action_web_service.rb +4 -3
- data/lib/action_web_service/api.rb +248 -1
- data/lib/action_web_service/casting.rb +111 -0
- data/lib/action_web_service/client/soap_client.rb +17 -33
- data/lib/action_web_service/client/xmlrpc_client.rb +10 -34
- data/lib/action_web_service/container/delegated_container.rb +1 -1
- data/lib/action_web_service/dispatcher/abstract.rb +52 -72
- data/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +71 -55
- data/lib/action_web_service/protocol/abstract.rb +82 -3
- data/lib/action_web_service/protocol/discovery.rb +2 -2
- data/lib/action_web_service/protocol/soap_protocol.rb +95 -22
- data/lib/action_web_service/protocol/soap_protocol/marshaler.rb +197 -0
- data/lib/action_web_service/protocol/xmlrpc_protocol.rb +56 -24
- data/lib/action_web_service/scaffolding.rb +237 -0
- data/lib/action_web_service/struct.rb +17 -4
- data/lib/action_web_service/support/signature_types.rb +194 -0
- data/lib/action_web_service/templates/scaffolds/layout.rhtml +65 -0
- data/lib/action_web_service/templates/scaffolds/methods.rhtml +6 -0
- data/lib/action_web_service/templates/scaffolds/parameters.rhtml +28 -0
- data/lib/action_web_service/templates/scaffolds/result.rhtml +30 -0
- data/lib/action_web_service/test_invoke.rb +23 -42
- data/test/abstract_dispatcher.rb +102 -48
- data/test/abstract_unit.rb +1 -1
- data/test/api_test.rb +40 -7
- data/test/casting_test.rb +82 -0
- data/test/client_soap_test.rb +3 -0
- data/test/client_xmlrpc_test.rb +5 -1
- data/test/dispatcher_action_controller_soap_test.rb +9 -12
- data/test/dispatcher_action_controller_xmlrpc_test.rb +1 -11
- data/test/run +1 -0
- data/test/scaffolded_controller_test.rb +67 -0
- data/test/struct_test.rb +33 -21
- data/test/test_invoke_test.rb +1 -1
- metadata +18 -31
- data/lib/action_web_service/api/base.rb +0 -135
- data/lib/action_web_service/vendor/ws.rb +0 -4
- data/lib/action_web_service/vendor/ws/common.rb +0 -8
- data/lib/action_web_service/vendor/ws/encoding.rb +0 -3
- data/lib/action_web_service/vendor/ws/encoding/abstract.rb +0 -26
- data/lib/action_web_service/vendor/ws/encoding/soap_rpc_encoding.rb +0 -90
- data/lib/action_web_service/vendor/ws/encoding/xmlrpc_encoding.rb +0 -53
- data/lib/action_web_service/vendor/ws/marshaling.rb +0 -3
- data/lib/action_web_service/vendor/ws/marshaling/abstract.rb +0 -17
- data/lib/action_web_service/vendor/ws/marshaling/soap_marshaling.rb +0 -277
- data/lib/action_web_service/vendor/ws/marshaling/xmlrpc_marshaling.rb +0 -116
- data/lib/action_web_service/vendor/ws/types.rb +0 -165
- data/test/ws/abstract_encoding.rb +0 -68
- data/test/ws/abstract_unit.rb +0 -13
- data/test/ws/gencov +0 -3
- data/test/ws/run +0 -5
- data/test/ws/soap_marshaling_test.rb +0 -91
- data/test/ws/soap_rpc_encoding_test.rb +0 -47
- data/test/ws/types_test.rb +0 -43
- data/test/ws/xmlrpc_encoding_test.rb +0 -34
data/test/abstract_unit.rb
CHANGED
data/test/api_test.rb
CHANGED
@@ -35,13 +35,20 @@ class TC_API < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_signature_canonicalization
|
38
|
-
assert_equal(
|
39
|
-
assert_equal(
|
40
|
-
assert_equal(
|
41
|
-
assert_equal(
|
42
|
-
assert_equal(
|
43
|
-
assert_equal(
|
44
|
-
assert_equal(
|
38
|
+
assert_equal(nil, API.api_methods[:void].expects)
|
39
|
+
assert_equal(nil, API.api_methods[:void].returns)
|
40
|
+
assert_equal([String], API.api_methods[:expects_and_returns].expects.map{|x| x.type_class})
|
41
|
+
assert_equal([String], API.api_methods[:expects_and_returns].returns.map{|x| x.type_class})
|
42
|
+
assert_equal([Integer, TrueClass], API.api_methods[:expects].expects.map{|x| x.type_class})
|
43
|
+
assert_equal(nil, API.api_methods[:expects].returns)
|
44
|
+
assert_equal(nil, API.api_methods[:returns].expects)
|
45
|
+
assert_equal([Integer, [String]], API.api_methods[:returns].returns.map{|x| x.array?? [x.element_type.type_class] : x.type_class})
|
46
|
+
assert_equal([[:appkey, Integer], [:publish, TrueClass]], API.api_methods[:named_signature].expects.map{|x| [x.name, x.type_class]})
|
47
|
+
assert_equal(nil, API.api_methods[:named_signature].returns)
|
48
|
+
assert_equal([Integer, String, TrueClass], API.api_methods[:string_types].expects.map{|x| x.type_class})
|
49
|
+
assert_equal(nil, API.api_methods[:string_types].returns)
|
50
|
+
assert_equal([TrueClass, Integer, String], API.api_methods[:class_types].expects.map{|x| x.type_class})
|
51
|
+
assert_equal(nil, API.api_methods[:class_types].returns)
|
45
52
|
end
|
46
53
|
|
47
54
|
def test_not_instantiable
|
@@ -66,4 +73,30 @@ class TC_API < Test::Unit::TestCase
|
|
66
73
|
end
|
67
74
|
end
|
68
75
|
end
|
76
|
+
|
77
|
+
def test_parameter_names
|
78
|
+
method = API.api_methods[:named_signature]
|
79
|
+
assert_equal 0, method.expects_index_of(:appkey)
|
80
|
+
assert_equal 1, method.expects_index_of(:publish)
|
81
|
+
assert_equal 1, method.expects_index_of('publish')
|
82
|
+
assert_equal 0, method.expects_index_of('appkey')
|
83
|
+
assert_equal -1, method.expects_index_of('blah')
|
84
|
+
assert_equal -1, method.expects_index_of(:missing)
|
85
|
+
assert_equal -1, API.api_methods[:void].expects_index_of('test')
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_parameter_hash
|
89
|
+
method = API.api_methods[:named_signature]
|
90
|
+
hash = method.expects_to_hash([5, false])
|
91
|
+
assert_equal({:appkey => 5, :publish => false}, hash)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_api_methods_compat
|
95
|
+
sig = API.api_methods[:named_signature][:expects]
|
96
|
+
assert_equal [{:appkey=>Integer}, {:publish=>TrueClass}], sig
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_to_s
|
100
|
+
assert_equal 'void Expects(int param0, bool param1)', APITest::API.api_methods[:expects].to_s
|
101
|
+
end
|
69
102
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/abstract_unit'
|
2
|
+
|
3
|
+
module CastingTest
|
4
|
+
class API < ActionWebService::API::Base
|
5
|
+
api_method :int, :expects => [:int]
|
6
|
+
api_method :str, :expects => [:string]
|
7
|
+
api_method :bool, :expects => [:bool]
|
8
|
+
api_method :float, :expects => [:float]
|
9
|
+
api_method :time, :expects => [:time]
|
10
|
+
api_method :datetime, :expects => [:datetime]
|
11
|
+
api_method :date, :expects => [:date]
|
12
|
+
|
13
|
+
api_method :int_array, :expects => [[:int]]
|
14
|
+
api_method :str_array, :expects => [[:string]]
|
15
|
+
api_method :bool_array, :expects => [[:bool]]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class TC_Casting < Test::Unit::TestCase
|
20
|
+
include CastingTest
|
21
|
+
|
22
|
+
def test_base_type_casting_valid
|
23
|
+
assert_equal 10000, cast_expects(:int, '10000')[0]
|
24
|
+
assert_equal '10000', cast_expects(:str, 10000)[0]
|
25
|
+
[1, '1', 'true', 'y', 'yes'].each do |val|
|
26
|
+
assert_equal true, cast_expects(:bool, val)[0]
|
27
|
+
end
|
28
|
+
[0, '0', 'false', 'n', 'no'].each do |val|
|
29
|
+
assert_equal false, cast_expects(:bool, val)[0]
|
30
|
+
end
|
31
|
+
assert_equal 3.14159, cast_expects(:float, '3.14159')[0]
|
32
|
+
now = Time.at(Time.now.tv_sec)
|
33
|
+
casted = cast_expects(:time, now.to_s)[0]
|
34
|
+
assert_equal now, casted
|
35
|
+
now = DateTime.now
|
36
|
+
assert_equal now.to_s, cast_expects(:datetime, now.to_s)[0].to_s
|
37
|
+
today = Date.today
|
38
|
+
assert_equal today, cast_expects(:date, today.to_s)[0]
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_base_type_casting_invalid
|
42
|
+
assert_raises ArgumentError do
|
43
|
+
cast_expects(:int, 'this is not a number')
|
44
|
+
end
|
45
|
+
assert_raises ActionWebService::Casting::CastingError do
|
46
|
+
# neither true or false ;)
|
47
|
+
cast_expects(:bool, 'i always lie')
|
48
|
+
end
|
49
|
+
assert_raises ArgumentError do
|
50
|
+
cast_expects(:float, 'not a float')
|
51
|
+
end
|
52
|
+
assert_raises ArgumentError do
|
53
|
+
cast_expects(:time, '111111111111111111111111111111111')
|
54
|
+
end
|
55
|
+
assert_raises ArgumentError do
|
56
|
+
cast_expects(:datetime, '-1')
|
57
|
+
end
|
58
|
+
assert_raises ArgumentError do
|
59
|
+
cast_expects(:date, '')
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_array_type_casting
|
64
|
+
assert_equal [1, 2, 3213992, 4], cast_expects(:int_array, ['1', '2', '3213992', '4'])[0]
|
65
|
+
assert_equal ['one', 'two', '5.0', '200', '', 'true'], cast_expects(:str_array, [:one, 'two', 5.0, 200, nil, true])[0]
|
66
|
+
assert_equal [true, false, true, true, false], cast_expects(:bool_array, ['1', nil, 'y', true, 'false'])[0]
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_array_type_casting_failure
|
70
|
+
assert_raises ActionWebService::Casting::CastingError do
|
71
|
+
cast_expects(:bool_array, ['false', 'blahblah'])
|
72
|
+
end
|
73
|
+
assert_raises ArgumentError do
|
74
|
+
cast_expects(:int_array, ['1', '2.021', '4'])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
def cast_expects(method_name, *args)
|
80
|
+
API.api_method_instance(method_name.to_sym).cast_expects([*args])
|
81
|
+
end
|
82
|
+
end
|
data/test/client_soap_test.rb
CHANGED
@@ -66,6 +66,9 @@ class TC_ClientSoap < Test::Unit::TestCase
|
|
66
66
|
assert(@container.value_normal.nil?)
|
67
67
|
assert_equal(5, @client.normal(5, 6))
|
68
68
|
assert_equal([5, 6], @container.value_normal)
|
69
|
+
assert_equal(5, @client.normal("7", "8"))
|
70
|
+
assert_equal([7, 8], @container.value_normal)
|
71
|
+
assert_equal(5, @client.normal(true, false))
|
69
72
|
end
|
70
73
|
|
71
74
|
def test_array_return
|
data/test/client_xmlrpc_test.rb
CHANGED
@@ -15,6 +15,7 @@ module ClientXmlRpcTest
|
|
15
15
|
@controller.process(test_request, response)
|
16
16
|
res.header['content-type'] = 'text/xml'
|
17
17
|
res.body = response.body
|
18
|
+
# puts res.body
|
18
19
|
rescue Exception => e
|
19
20
|
$stderr.puts e.message
|
20
21
|
$stderr.puts e.backtrace.join("\n")
|
@@ -60,6 +61,9 @@ class TC_ClientXmlRpc < Test::Unit::TestCase
|
|
60
61
|
assert(@container.value_normal.nil?)
|
61
62
|
assert_equal(5, @client.normal(5, 6))
|
62
63
|
assert_equal([5, 6], @container.value_normal)
|
64
|
+
assert_equal(5, @client.normal("7", "8"))
|
65
|
+
assert_equal([7, 8], @container.value_normal)
|
66
|
+
assert_equal(5, @client.normal(true, false))
|
63
67
|
end
|
64
68
|
|
65
69
|
def test_array_return
|
@@ -97,7 +101,7 @@ class TC_ClientXmlRpc < Test::Unit::TestCase
|
|
97
101
|
end
|
98
102
|
|
99
103
|
def test_invalid_signature
|
100
|
-
assert_raises(
|
104
|
+
assert_raises(ArgumentError) do
|
101
105
|
@client.normal
|
102
106
|
end
|
103
107
|
end
|
@@ -23,11 +23,11 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
|
|
23
23
|
include DispatcherCommonTests
|
24
24
|
|
25
25
|
def setup
|
26
|
-
@encoder = WS::Encoding::SoapRpcEncoding.new 'urn:ActionWebService'
|
27
|
-
@marshaler = WS::Marshaling::SoapMarshaler.new 'urn:ActionWebService'
|
28
26
|
@direct_controller = DirectController.new
|
29
27
|
@delegated_controller = DelegatedController.new
|
30
28
|
@virtual_controller = VirtualController.new
|
29
|
+
@layered_controller = LayeredController.new
|
30
|
+
@protocol = ActionWebService::Protocol::Soap::SoapProtocol.new
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_wsdl_generation
|
@@ -60,6 +60,13 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
|
|
60
60
|
assert(BrokenAutoLoadController.web_service_api.nil?)
|
61
61
|
end
|
62
62
|
|
63
|
+
def test_layered_dispatching
|
64
|
+
mt_cats = do_method_call(@layered_controller, 'mt.getCategories')
|
65
|
+
assert_equal(["mtCat1", "mtCat2"], mt_cats)
|
66
|
+
blogger_cats = do_method_call(@layered_controller, 'blogger.getCategories')
|
67
|
+
assert_equal(["bloggerCat1", "bloggerCat2"], blogger_cats)
|
68
|
+
end
|
69
|
+
|
63
70
|
protected
|
64
71
|
def exception_message(soap_fault_exception)
|
65
72
|
soap_fault_exception.detail.cause.message
|
@@ -70,16 +77,6 @@ class TC_DispatcherActionControllerSoap < Test::Unit::TestCase
|
|
70
77
|
obj.detail.cause.is_a?(Exception)
|
71
78
|
end
|
72
79
|
|
73
|
-
def create_ap_request(container, body, public_method_name, *args)
|
74
|
-
test_request = ActionController::TestRequest.new
|
75
|
-
test_request.request_parameters['action'] = service_name(container)
|
76
|
-
test_request.env['REQUEST_METHOD'] = "POST"
|
77
|
-
test_request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
|
78
|
-
test_request.env['HTTP_SOAPACTION'] = "/soap/#{service_name(container)}/#{public_method_name}"
|
79
|
-
test_request.env['RAW_POST_DATA'] = body
|
80
|
-
test_request
|
81
|
-
end
|
82
|
-
|
83
80
|
def service_name(container)
|
84
81
|
container.is_a?(DelegatedController) ? 'test_service' : 'api'
|
85
82
|
end
|
@@ -5,8 +5,7 @@ class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
|
|
5
5
|
include DispatcherCommonTests
|
6
6
|
|
7
7
|
def setup
|
8
|
-
@
|
9
|
-
@marshaler = WS::Marshaling::XmlRpcMarshaler.new
|
8
|
+
@protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.new
|
10
9
|
@direct_controller = DirectController.new
|
11
10
|
@delegated_controller = DelegatedController.new
|
12
11
|
@layered_controller = LayeredController.new
|
@@ -29,15 +28,6 @@ class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
|
|
29
28
|
obj.is_a?(XMLRPC::FaultException)
|
30
29
|
end
|
31
30
|
|
32
|
-
def create_ap_request(container, body, public_method_name, *args)
|
33
|
-
test_request = ActionController::TestRequest.new
|
34
|
-
test_request.request_parameters['action'] = service_name(container)
|
35
|
-
test_request.env['REQUEST_METHOD'] = "POST"
|
36
|
-
test_request.env['HTTP_CONTENT_TYPE'] = 'text/xml'
|
37
|
-
test_request.env['RAW_POST_DATA'] = body
|
38
|
-
test_request
|
39
|
-
end
|
40
|
-
|
41
31
|
def service_name(container)
|
42
32
|
container.is_a?(DelegatedController) ? 'test_service' : 'api'
|
43
33
|
end
|
data/test/run
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
3
4
|
args = Dir[File.join(File.dirname(__FILE__), '*_test.rb')] + Dir[File.join(File.dirname(__FILE__), 'ws/*_test.rb')]
|
4
5
|
(r = Test::Unit::AutoRunner.new(true)).process_args(args)
|
5
6
|
exit r.run
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/abstract_unit'
|
2
|
+
|
3
|
+
ActionController::Routing::Routes.draw do |map|
|
4
|
+
map.connect '', :controller => 'scaffolded'
|
5
|
+
end
|
6
|
+
|
7
|
+
class ScaffoldPerson < ActionWebService::Struct
|
8
|
+
member :id, :int
|
9
|
+
member :name, :string
|
10
|
+
|
11
|
+
def ==(other)
|
12
|
+
self.id == other.id && self.name == other.name
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class ScaffoldedControllerTestAPI < ActionWebService::API::Base
|
17
|
+
api_method :hello, :expects => [{:integer=>:int}, :string], :returns => [:bool]
|
18
|
+
api_method :bye, :returns => [[ScaffoldPerson]]
|
19
|
+
end
|
20
|
+
|
21
|
+
class ScaffoldedController < ActionController::Base
|
22
|
+
web_service_api ScaffoldedControllerTestAPI
|
23
|
+
web_service_scaffold :scaffold_invoke
|
24
|
+
|
25
|
+
def hello(int, string)
|
26
|
+
0
|
27
|
+
end
|
28
|
+
|
29
|
+
def bye
|
30
|
+
[ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
|
31
|
+
end
|
32
|
+
|
33
|
+
def rescue_action(e)
|
34
|
+
raise e
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class ScaffoldedControllerTest < Test::Unit::TestCase
|
39
|
+
def setup
|
40
|
+
@controller = ScaffoldedController.new
|
41
|
+
@request = ActionController::TestRequest.new
|
42
|
+
@response = ActionController::TestResponse.new
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_scaffold_invoke
|
46
|
+
get :scaffold_invoke
|
47
|
+
assert_rendered_file 'methods.rhtml'
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_scaffold_invoke_method_params
|
51
|
+
get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Hello'
|
52
|
+
assert_rendered_file 'parameters.rhtml'
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_scaffold_invoke_submit_hello
|
56
|
+
post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Hello', :method_params => ['5', 'hello world']
|
57
|
+
assert_rendered_file 'result.rhtml'
|
58
|
+
assert_equal false, @controller.instance_eval{ @method_return_value }
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_scaffold_invoke_submit_bye
|
62
|
+
post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Bye'
|
63
|
+
assert_rendered_file 'result.rhtml'
|
64
|
+
persons = [ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
|
65
|
+
assert_equal persons, @controller.instance_eval{ @method_return_value }
|
66
|
+
end
|
67
|
+
end
|
data/test/struct_test.rb
CHANGED
@@ -11,30 +11,42 @@ module StructTest
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class TC_Struct < Test::Unit::TestCase
|
14
|
+
include StructTest
|
15
|
+
|
16
|
+
def setup
|
17
|
+
@struct = Struct.new(:id => 5,
|
18
|
+
:name => 'hello',
|
19
|
+
:items => ['one', 'two'],
|
20
|
+
:deleted => true,
|
21
|
+
:emails => ['test@test.com'])
|
22
|
+
end
|
23
|
+
|
14
24
|
def test_members
|
15
|
-
assert_equal(5,
|
16
|
-
assert_equal(Integer,
|
17
|
-
assert_equal(String,
|
18
|
-
assert_equal(
|
19
|
-
assert_equal(TrueClass,
|
20
|
-
assert_equal(
|
25
|
+
assert_equal(5, Struct.members.size)
|
26
|
+
assert_equal(Integer, Struct.members[:id].type_class)
|
27
|
+
assert_equal(String, Struct.members[:name].type_class)
|
28
|
+
assert_equal(String, Struct.members[:items].element_type.type_class)
|
29
|
+
assert_equal(TrueClass, Struct.members[:deleted].type_class)
|
30
|
+
assert_equal(String, Struct.members[:emails].element_type.type_class)
|
21
31
|
end
|
22
32
|
|
23
33
|
def test_initializer_and_lookup
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
assert_equal(5,
|
30
|
-
assert_equal('hello',
|
31
|
-
assert_equal(['one', 'two'],
|
32
|
-
assert_equal(true,
|
33
|
-
assert_equal(['test@test.com'],
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
assert_equal(5, @struct.id)
|
35
|
+
assert_equal('hello', @struct.name)
|
36
|
+
assert_equal(['one', 'two'], @struct.items)
|
37
|
+
assert_equal(true, @struct.deleted)
|
38
|
+
assert_equal(['test@test.com'], @struct.emails)
|
39
|
+
assert_equal(5, @struct['id'])
|
40
|
+
assert_equal('hello', @struct['name'])
|
41
|
+
assert_equal(['one', 'two'], @struct['items'])
|
42
|
+
assert_equal(true, @struct['deleted'])
|
43
|
+
assert_equal(['test@test.com'], @struct['emails'])
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_each_pair
|
47
|
+
@struct.each_pair do |name, value|
|
48
|
+
assert_equal @struct.__send__(name), value
|
49
|
+
assert_equal @struct[name], value
|
50
|
+
end
|
39
51
|
end
|
40
52
|
end
|
data/test/test_invoke_test.rb
CHANGED
@@ -65,7 +65,7 @@ class TestInvokeTest < Test::Unit::TestCase
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_layered_add
|
68
|
-
@protocol =
|
68
|
+
@protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.new
|
69
69
|
@controller = TestInvokeLayeredController.new
|
70
70
|
[:one, :two].each do |service|
|
71
71
|
assert_equal nil, @controller.web_service_object(service).invoked
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
|
|
3
3
|
specification_version: 1
|
4
4
|
name: actionwebservice
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.7.0
|
7
|
+
date: 2005-04-19
|
8
8
|
summary: Web service support for Action Pack.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -55,9 +55,9 @@ files:
|
|
55
55
|
- examples/metaWeblog/controllers/xmlrpc_controller.rb
|
56
56
|
- lib/action_web_service
|
57
57
|
- lib/action_web_service.rb
|
58
|
-
- lib/action_web_service/api
|
59
58
|
- lib/action_web_service/api.rb
|
60
59
|
- lib/action_web_service/base.rb
|
60
|
+
- lib/action_web_service/casting.rb
|
61
61
|
- lib/action_web_service/client
|
62
62
|
- lib/action_web_service/client.rb
|
63
63
|
- lib/action_web_service/container
|
@@ -67,11 +67,11 @@ files:
|
|
67
67
|
- lib/action_web_service/invocation.rb
|
68
68
|
- lib/action_web_service/protocol
|
69
69
|
- lib/action_web_service/protocol.rb
|
70
|
+
- lib/action_web_service/scaffolding.rb
|
70
71
|
- lib/action_web_service/struct.rb
|
71
72
|
- lib/action_web_service/support
|
73
|
+
- lib/action_web_service/templates
|
72
74
|
- lib/action_web_service/test_invoke.rb
|
73
|
-
- lib/action_web_service/vendor
|
74
|
-
- lib/action_web_service/api/base.rb
|
75
75
|
- lib/action_web_service/client/base.rb
|
76
76
|
- lib/action_web_service/client/soap_client.rb
|
77
77
|
- lib/action_web_service/client/xmlrpc_client.rb
|
@@ -82,29 +82,24 @@ files:
|
|
82
82
|
- lib/action_web_service/dispatcher/action_controller_dispatcher.rb
|
83
83
|
- lib/action_web_service/protocol/abstract.rb
|
84
84
|
- lib/action_web_service/protocol/discovery.rb
|
85
|
+
- lib/action_web_service/protocol/soap_protocol
|
85
86
|
- lib/action_web_service/protocol/soap_protocol.rb
|
86
87
|
- lib/action_web_service/protocol/xmlrpc_protocol.rb
|
88
|
+
- lib/action_web_service/protocol/soap_protocol/marshaler.rb
|
87
89
|
- lib/action_web_service/support/class_inheritable_options.rb
|
88
|
-
- lib/action_web_service/
|
89
|
-
- lib/action_web_service/
|
90
|
-
- lib/action_web_service/
|
91
|
-
- lib/action_web_service/
|
92
|
-
- lib/action_web_service/
|
93
|
-
- lib/action_web_service/
|
94
|
-
- lib/action_web_service/vendor/ws/marshaling.rb
|
95
|
-
- lib/action_web_service/vendor/ws/types.rb
|
96
|
-
- lib/action_web_service/vendor/ws/encoding/abstract.rb
|
97
|
-
- lib/action_web_service/vendor/ws/encoding/soap_rpc_encoding.rb
|
98
|
-
- lib/action_web_service/vendor/ws/encoding/xmlrpc_encoding.rb
|
99
|
-
- lib/action_web_service/vendor/ws/marshaling/abstract.rb
|
100
|
-
- lib/action_web_service/vendor/ws/marshaling/soap_marshaling.rb
|
101
|
-
- lib/action_web_service/vendor/ws/marshaling/xmlrpc_marshaling.rb
|
90
|
+
- lib/action_web_service/support/signature_types.rb
|
91
|
+
- lib/action_web_service/templates/scaffolds
|
92
|
+
- lib/action_web_service/templates/scaffolds/layout.rhtml
|
93
|
+
- lib/action_web_service/templates/scaffolds/methods.rhtml
|
94
|
+
- lib/action_web_service/templates/scaffolds/parameters.rhtml
|
95
|
+
- lib/action_web_service/templates/scaffolds/result.rhtml
|
102
96
|
- test/abstract_client.rb
|
103
97
|
- test/abstract_dispatcher.rb
|
104
98
|
- test/abstract_unit.rb
|
105
99
|
- test/api_test.rb
|
106
100
|
- test/apis
|
107
101
|
- test/base_test.rb
|
102
|
+
- test/casting_test.rb
|
108
103
|
- test/client_soap_test.rb
|
109
104
|
- test/client_xmlrpc_test.rb
|
110
105
|
- test/container_test.rb
|
@@ -113,19 +108,11 @@ files:
|
|
113
108
|
- test/gencov
|
114
109
|
- test/invocation_test.rb
|
115
110
|
- test/run
|
111
|
+
- test/scaffolded_controller_test.rb
|
116
112
|
- test/struct_test.rb
|
117
113
|
- test/test_invoke_test.rb
|
118
|
-
- test/ws
|
119
114
|
- test/apis/auto_load_api.rb
|
120
115
|
- test/apis/broken_auto_load_api.rb
|
121
|
-
- test/ws/abstract_encoding.rb
|
122
|
-
- test/ws/abstract_unit.rb
|
123
|
-
- test/ws/gencov
|
124
|
-
- test/ws/run
|
125
|
-
- test/ws/soap_marshaling_test.rb
|
126
|
-
- test/ws/soap_rpc_encoding_test.rb
|
127
|
-
- test/ws/types_test.rb
|
128
|
-
- test/ws/xmlrpc_encoding_test.rb
|
129
116
|
test_files: []
|
130
117
|
rdoc_options: []
|
131
118
|
extra_rdoc_files: []
|
@@ -142,7 +129,7 @@ dependencies:
|
|
142
129
|
-
|
143
130
|
- "="
|
144
131
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
132
|
+
version: 1.8.0
|
146
133
|
version:
|
147
134
|
- !ruby/object:Gem::Dependency
|
148
135
|
name: activerecord
|
@@ -152,7 +139,7 @@ dependencies:
|
|
152
139
|
-
|
153
140
|
- "="
|
154
141
|
- !ruby/object:Gem::Version
|
155
|
-
version: 1.
|
142
|
+
version: 1.10.0
|
156
143
|
version:
|
157
144
|
- !ruby/object:Gem::Dependency
|
158
145
|
name: activesupport
|
@@ -162,5 +149,5 @@ dependencies:
|
|
162
149
|
-
|
163
150
|
- "="
|
164
151
|
- !ruby/object:Gem::Version
|
165
|
-
version: 1.0.
|
152
|
+
version: 1.0.4
|
166
153
|
version:
|