indexing description: "Test SOAP Faults" project: "Project Goanna " library: "test SOAP" date: "$Date$" revision: "$Revision$" author: "Colin Adams " copyright: "Copyright (c) 2005 Colin Adams and others" license: "Eiffel Forum License v2 (see forum.txt)." deferred class SOAP_TEST_FAULT inherit TS_TEST_CASE GOA_SOAP_MESSAGE_FACTORY KL_SHARED_STANDARD_FILES feature -- Test test_parse_with_detail is -- Test parse of test1.xml. local a_node: UT_URI a_processor: GOA_SOAP_TEST_PROCESSOR do create a_node.make ("http://goanna.sourceforge.net/test") create a_processor.make (a_node) a_processor.set_ultimate_receiver (True) a_processor.process (fault_message, base_uri) assert ("Parse sucessful", a_processor.is_build_sucessful) assert ("Validation sucessful", a_processor.is_valid) end test_new_envelope is -- Test construct a SOAP message. local an_envelope: GOA_SOAP_ENVELOPE a_body: GOA_SOAP_BODY a_node: UT_URI a_formatter: GOA_SOAP_NODE_FORMATTER do create a_node.make ("http://goanna.sourceforge.net/test") an_envelope := new_envelope a_body := new_body (an_envelope, a_node) assert ("Valid envelope", an_envelope.validated) --create a_formatter.make --a_formatter.set_output (std.output) --a_formatter.process_document (an_envelope.root_node) end test_bad_header is -- Test generation of Fault for a bad header. local a_node: UT_URI a_processor: GOA_SOAP_TEST_PROCESSOR do create a_node.make ("http://goanna.sourceforge.net/test") create a_processor.make (a_node) a_processor.set_ultimate_receiver (True) a_processor.process (faulty_message_one, base_uri) assert ("Parse sucessful", a_processor.is_build_sucessful) end test_version_mismatch is -- Test construction of a VersionMismatch fault, with upgrade header local a_node: UT_URI a_processor: GOA_SOAP_TEST_PROCESSOR do create a_node.make ("http://goanna.sourceforge.net/test") create a_processor.make (a_node) a_processor.set_ultimate_receiver (True) a_processor.process (faulty_message_two, base_uri) assert ("Parse error", not a_processor.is_build_sucessful) end test_not_understood is -- Test construction of a MustUnderstand fault, with NotUnderstood headers. local a_node: UT_URI a_processor: GOA_SOAP_TEST_PROCESSOR do create a_node.make ("http://goanna.sourceforge.net/test") create a_processor.make (a_node) a_processor.set_ultimate_receiver (True) a_processor.process (faulty_message_three, base_uri) assert ("No parse error", a_processor.is_build_sucessful) end feature -- Access base_uri: UT_URI is -- Base URI for all requests do create Result.make ("dummy:request-uri") end feature -- Messages fault_message: STRING is -- Example env:Fault once Result := "[ env:Sender m:MessageTimeout Sender Timeout P5M ]" end faulty_message_one: STRING is -- Header has wrong namespace once Result := "[
]" end faulty_message_two: STRING is -- Envelope has wrong namespace once Result := "[ ]" end faulty_message_three: STRING is -- Headers not understood once Result := "[ ]" end end -- class SOAP_TEST_FAULT