aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb')
-rw-r--r--actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb b/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
new file mode 100644
index 0000000000..13f193e2c5
--- /dev/null
+++ b/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/abstract_dispatcher'
+
+class TC_DispatcherActionControllerXmlRpc < Test::Unit::TestCase
+ include DispatcherTest
+ include DispatcherCommonTests
+
+ def setup
+ @encoder = WS::Encoding::XmlRpcEncoding.new
+ @marshaler = WS::Marshaling::XmlRpcMarshaler.new
+ @direct_controller = DirectController.new
+ @delegated_controller = DelegatedController.new
+ end
+
+ protected
+ def exception_message(xmlrpc_fault_exception)
+ xmlrpc_fault_exception.faultString
+ end
+
+ def is_exception?(obj)
+ obj.is_a?(XMLRPC::FaultException)
+ end
+
+ def create_ap_request(container, body, public_method_name, *args)
+ test_request = ActionController::TestRequest.new
+ test_request.request_parameters['action'] = service_name(container)
+ test_request.env['REQUEST_METHOD'] = "POST"
+ test_request.env['HTTP_CONTENTTYPE'] = 'text/xml'
+ test_request.env['RAW_POST_DATA'] = body
+ test_request
+ end
+
+ def service_name(container)
+ container.is_a?(DelegatedController) ? 'test_service' : 'api'
+ end
+end