rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
Leon Breedt aaea48fe98 * collapse 'ws' back into protocols, it just added complexity and indirection, and was hard to extend.
* extract casting into seperate support file
* ensure casting always does the right thing for return values, should fix interoperability issues with Ecto and possibly other XML-RPC clients
* add functional unit tests for scaffolding
* represent signature items with classes instead of symbols/Class objects, much more flexible
* tweak logging to always show casted versions of parameters and return values, if possible.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1072 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 21:03:36 +00:00

35 lines
1.0 KiB
Ruby

require File.dirname(__FILE__) + '/abstract_dispatcher'
class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
include DispatcherTest
include DispatcherCommonTests
def setup
@protocol = ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.new
@direct_controller = DirectController.new
@delegated_controller = DelegatedController.new
@layered_controller = LayeredController.new
@virtual_controller = VirtualController.new
end
def test_layered_dispatching
mt_cats = do_method_call(@layered_controller, 'mt.getCategories')
assert_equal(["mtCat1", "mtCat2"], mt_cats)
blogger_cats = do_method_call(@layered_controller, 'blogger.getCategories')
assert_equal(["bloggerCat1", "bloggerCat2"], blogger_cats)
end
protected
def exception_message(xmlrpc_fault_exception)
xmlrpc_fault_exception.faultString
end
def is_exception?(obj)
obj.is_a?(XMLRPC::FaultException)
end
def service_name(container)
container.is_a?(DelegatedController) ? 'test_service' : 'api'
end
end