diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
commit | b94bd32f3116b469b48400382dbc964bf17994d1 (patch) | |
tree | 91752d7e0f49916e5ed2b9e015815c6dc06b4366 /actionwebservice/test/abstract_dispatcher.rb | |
parent | 715715aed443a027fccbac995cd5404eaeabaf53 (diff) | |
download | rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.gz rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.bz2 rails-b94bd32f3116b469b48400382dbc964bf17994d1.zip |
first pass of web service scaffolding. add ability to quickly generate an
action pack request for a protocol, add missing log_error when we fail to parse
protocol messages. add RDoc for scaffolding and functional testing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1037 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/abstract_dispatcher.rb')
-rw-r--r-- | actionwebservice/test/abstract_dispatcher.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionwebservice/test/abstract_dispatcher.rb b/actionwebservice/test/abstract_dispatcher.rb index 21b9a0f5a9..53be05f9f2 100644 --- a/actionwebservice/test/abstract_dispatcher.rb +++ b/actionwebservice/test/abstract_dispatcher.rb @@ -301,7 +301,8 @@ module DispatcherCommonTests [@direct_controller, @delegated_controller].each do |controller| controller.class.web_service_exception_reporting = true send_garbage_request = lambda do - request = create_ap_request(controller, 'invalid request body', 'xxx') + service_name = service_name(controller) + request = @protocol.create_action_pack_request(service_name, 'broken, method, name!', 'broken request body', :request_class => ActionController::TestRequest) response = ActionController::TestResponse.new controller.process(request, response) # puts response.body @@ -378,22 +379,25 @@ module DispatcherCommonTests mode = container.web_service_dispatching_mode case mode when :direct + service_name = service_name(container) api = container.class.web_service_api when :delegated - api = container.web_service_object(service_name(container)).class.web_service_api + service_name = service_name(container) + api = container.web_service_object(service_name).class.web_service_api when :layered service_name = nil if public_method_name =~ /^([^\.]+)\.(.*)$/ service_name = $1 end api = container.web_service_object(service_name.to_sym).class.web_service_api + service_name = self.service_name(container) end method = api.public_api_method_instance(public_method_name) method ||= api.dummy_public_api_method_instance(public_method_name) # we turn off strict so we can test our own handling of incorrectly typed parameters body = method.encode_rpc_call(@marshaler, @encoder, params.dup, :strict => false) # puts body - ap_request = create_ap_request(container, body, public_method_name, *params) + ap_request = protocol.create_action_pack_request(service_name, public_method_name, body, :request_class => ActionController::TestRequest) ap_response = ActionController::TestResponse.new container.process(ap_request, ap_response) # puts ap_response.body |