diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-05 12:17:47 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-11-05 12:17:47 +0000 |
commit | be7f551d4c1f0814dc5797b314432e12f06f1968 (patch) | |
tree | 45d20cc28edc1ee935267aed3d27d1b86ac97c35 | |
parent | 7de78a75382de9f8d3c035cf26cb285780bae13b (diff) | |
download | ATCD-be7f551d4c1f0814dc5797b314432e12f06f1968.tar.gz |
Mon Nov 5 12:17:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
4 files changed, 22 insertions, 48 deletions
diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_3080/Client_ORBInitializer.cpp index 8d4fa4133a8..8390121b3b2 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/Client_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3080/Client_ORBInitializer.cpp @@ -21,23 +21,9 @@ Client_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) void Client_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info) { - CORBA::String_var orb_id = info->orb_id (); - - CORBA::StringSeq_var args = info->arguments (); - - CORBA::String_var forward_str; - - // Extract the last forward reference from the argument list. - CORBA::ULong args_len = args->length (); - for (CORBA::ULong i = 0; i < args_len; ++i) - if (ACE_OS::strcmp ("-s", args[i]) == 0 - && i < (args_len - 1)) - forward_str = args[i + 1]; - // Install the client request interceptor. ACE_NEW_THROW_EX (client_interceptor_, - Client_Request_Interceptor (orb_id.in (), - forward_str.in ()), + Client_Request_Interceptor, CORBA::NO_MEMORY ( CORBA::SystemException::_tao_minor_code ( TAO::VMCID, diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.cpp index d0694bcdbbb..a1644b2892d 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.cpp @@ -8,17 +8,19 @@ ACE_RCSID (Redirection, Client_Request_Interceptor, "$Id$") -Client_Request_Interceptor::Client_Request_Interceptor ( - const char *orb_id, - const char *forward_str) - : orb_id_ (CORBA::string_dup (orb_id)), - orb_ (), - request_count_ (0), - forward_str_ (CORBA::string_dup (forward_str)) +Client_Request_Interceptor::Client_Request_Interceptor (void) + : request_count_ (0), + receive_exception_count_ (0) { } CORBA::ULong +Client_Request_Interceptor::receive_exception_count (void) const +{ + return this->receive_exception_count_; +} + +CORBA::ULong Client_Request_Interceptor::request_count (void) const { return this->request_count_; @@ -58,20 +60,7 @@ void Client_Request_Interceptor::receive_exception ( PortableInterceptor::ClientRequestInfo_ptr) { - ACE_DEBUG ((LM_DEBUG, "RECEIVED EXCEPTION\n")); - if (CORBA::is_nil (this->orb_.in ())) - { - int argc = 0; - this->orb_ = CORBA::ORB_init (argc, - 0, - this->orb_id_.in ()); - } - - CORBA::Object_var forward = - this->orb_->string_to_object (this->forward_str_.in ()); - - // Notice that this is not a permanent forward. - throw PortableInterceptor::ForwardRequest (forward.in ()); + ++this->receive_exception_count_; } void diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.h b/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.h index b5efe82cb25..6ac9f691aec 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.h +++ b/TAO/tests/Portable_Interceptors/Bug_3080/Client_Request_Interceptor.h @@ -31,8 +31,7 @@ class Client_Request_Interceptor public: /// Constructor. - Client_Request_Interceptor (const char *orb_id, - const char *forward_str); + Client_Request_Interceptor (void); /** * @name Methods Required by the Client Request Interceptor @@ -66,20 +65,13 @@ public: CORBA::ULong request_count (void) const; -private: - - ///The ID of the ORB this interceptor is registered with. - CORBA::String_var orb_id_; - - /// Pseudo-reference to the ORB this interceptor is registered - /// with. - CORBA::ORB_var orb_; + CORBA::ULong receive_exception_count (void) const; +private: /// The number of requests intercepted by this interceptor. CORBA::ULong request_count_; - CORBA::String_var forward_str_; - + CORBA::ULong receive_exception_count_; }; #if defined(_MSC_VER) diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp b/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp index 0c7071694b3..e7ce02e9cfb 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp @@ -95,6 +95,13 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) "Error, send request interceptor not called\n"), 1); } + + if (temp_initializer->client_interceptor_->receive_exception_count () != 1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Error, receive exception interceptor not called\n"), + 1); + } } catch (const CORBA::Exception& ex) { |