diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:17:52 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:17:52 +0000 |
commit | 2ee7b7eed4c0cc10f4ec25b186b04202af01b565 (patch) | |
tree | 08a8a649c90559cf5b2228c1caad15515902613e /TAO/tests/Collocation_Exception_Test | |
parent | c979767a00db4ea1299af482033a68829cc16675 (diff) | |
download | ATCD-2ee7b7eed4c0cc10f4ec25b186b04202af01b565.tar.gz |
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tests/Collocation_Exception_Test')
5 files changed, 47 insertions, 62 deletions
diff --git a/TAO/tests/Collocation_Exception_Test/Client_Task.cpp b/TAO/tests/Collocation_Exception_Test/Client_Task.cpp index e5cafff6bc8..a88f7def836 100644 --- a/TAO/tests/Collocation_Exception_Test/Client_Task.cpp +++ b/TAO/tests/Collocation_Exception_Test/Client_Task.cpp @@ -17,81 +17,77 @@ Client_Task::Client_Task (const char *ior, void Client_Task::test_system_exception ( - Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL) + Test::Hello_ptr hello_ptr) { - ACE_TRY + try { hello_ptr->system_exception_test (); } - ACE_CATCH (CORBA::INTERNAL, ex) + catch (const CORBA::INTERNAL& ) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught internal exception as expected\n")); // ignore } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in test_system_exception:"); - ACE_RE_THROW; + ex._tao_print_exception ( + "Unexpected exception caught in test_system_exception:"); + throw; } - ACE_ENDTRY; } void Client_Task::test_user_exception_expected ( - Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL) + Test::Hello_ptr hello_ptr) { - ACE_TRY + try { hello_ptr->user_exception_expected (); } - ACE_CATCH (::Test::Hello::A, ex) + catch (const ::Test::Hello::A& ) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught user A exception as expected\n")); // ignore } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in test_user_exception_expected:"); - ACE_RE_THROW; + ex._tao_print_exception ( + "Unexpected exception caught in test_user_exception_expected:"); + throw; } - ACE_ENDTRY; } void Client_Task::test_user_exception_not_expected ( - Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL) + Test::Hello_ptr hello_ptr) { - ACE_TRY + try { hello_ptr->user_exception_not_expected (); } - ACE_CATCH (CORBA::UNKNOWN, ex) + catch (const CORBA::UNKNOWN& ) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Caught unknown exception as expected\n")); // ignore } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unexpected exception caught in user_exception_not_expected:"); - ACE_RE_THROW; + ex._tao_print_exception ( + "Unexpected exception caught in user_exception_not_expected:"); + throw; } - ACE_ENDTRY; } int Client_Task::svc (void) { - ACE_TRY_NEW_ENV + try { CORBA::Object_var tmp = - this->corb_->string_to_object (input_ - ACE_ENV_ARG_PARAMETER); + this->corb_->string_to_object (input_); Test::Hello_var hello = - Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); + Test::Hello::_narrow(tmp.in ()); if (CORBA::is_nil (hello.in ())) { @@ -107,21 +103,19 @@ Client_Task::svc (void) ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%s>\n", the_string.in ())); - this->test_system_exception (hello.in () ACE_ENV_ARG_PARAMETER); + this->test_system_exception (hello.in ()); - this->test_user_exception_expected (hello.in () ACE_ENV_ARG_PARAMETER); + this->test_user_exception_expected (hello.in ()); - this->test_user_exception_not_expected (hello.in () ACE_ENV_ARG_PARAMETER); + this->test_user_exception_not_expected (hello.in ()); hello->shutdown (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); + ex._tao_print_exception ("Exception caught:"); return 1; } - ACE_ENDTRY; return 0; diff --git a/TAO/tests/Collocation_Exception_Test/Client_Task.h b/TAO/tests/Collocation_Exception_Test/Client_Task.h index 7d675ac6143..33eb64be258 100644 --- a/TAO/tests/Collocation_Exception_Test/Client_Task.h +++ b/TAO/tests/Collocation_Exception_Test/Client_Task.h @@ -28,9 +28,9 @@ public: int svc (void); private: - void test_system_exception (Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL); - void test_user_exception_expected (Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL); - void test_user_exception_not_expected (Test::Hello_ptr hello_ptr ACE_ENV_ARG_DECL); + void test_system_exception (Test::Hello_ptr hello_ptr); + void test_user_exception_expected (Test::Hello_ptr hello_ptr); + void test_user_exception_not_expected (Test::Hello_ptr hello_ptr); const char *input_; diff --git a/TAO/tests/Collocation_Exception_Test/Collocated_Test.cpp b/TAO/tests/Collocation_Exception_Test/Collocated_Test.cpp index 500e72adc88..1213d69c276 100644 --- a/TAO/tests/Collocation_Exception_Test/Collocated_Test.cpp +++ b/TAO/tests/Collocation_Exception_Test/Collocated_Test.cpp @@ -49,15 +49,13 @@ main (int argc, char *argv[]) argv) == -1) return -1; - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { ACE_Argv_Type_Converter satc (argc, argv); CORBA::ORB_var sorb = CORBA::ORB_init (satc.get_argc (), satc.get_TCHAR_argv (), - server_orb.c_str () - ACE_ENV_ARG_PARAMETER); + server_orb.c_str ()); ACE_Manual_Event me; Server_Task server_task (output, @@ -79,8 +77,7 @@ main (int argc, char *argv[]) CORBA::ORB_var corb = CORBA::ORB_init (catc.get_argc (), catc.get_TCHAR_argv (), - client_orb.c_str () - ACE_ENV_ARG_PARAMETER); + client_orb.c_str ()); Client_Task client_task (input, corb.in (), @@ -95,10 +92,9 @@ main (int argc, char *argv[]) ACE_Thread_Manager::instance ()->wait (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { // Ignore exceptions.. } - ACE_ENDTRY; return 0; } diff --git a/TAO/tests/Collocation_Exception_Test/Hello.cpp b/TAO/tests/Collocation_Exception_Test/Hello.cpp index 2d01e524ae7..4d91591ca64 100644 --- a/TAO/tests/Collocation_Exception_Test/Hello.cpp +++ b/TAO/tests/Collocation_Exception_Test/Hello.cpp @@ -18,14 +18,14 @@ void Hello::system_exception_test (void) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW (CORBA::INTERNAL ()); + throw CORBA::INTERNAL (); } void Hello::user_exception_expected (void) ACE_THROW_SPEC ((CORBA::SystemException, ::Test::Hello::A)) { - ACE_THROW (::Test::Hello::A ()); + throw ::Test::Hello::A (); } void @@ -38,7 +38,7 @@ Hello::user_exception_not_expected (void) void Hello::throw_internal_b (void) { - ACE_THROW (::Test::Hello::B ()); + throw ::Test::Hello::B (); } char * @@ -88,5 +88,5 @@ void Hello::shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0); } diff --git a/TAO/tests/Collocation_Exception_Test/Server_Task.cpp b/TAO/tests/Collocation_Exception_Test/Server_Task.cpp index 8129e39ffc9..c6e578fa422 100644 --- a/TAO/tests/Collocation_Exception_Test/Server_Task.cpp +++ b/TAO/tests/Collocation_Exception_Test/Server_Task.cpp @@ -26,15 +26,13 @@ Server_Task::Server_Task (const char *output, int Server_Task::svc (void) { - ACE_TRY_NEW_ENV + try { CORBA::Object_var poa_object = - this->sorb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); + this->sorb_->resolve_initial_references("RootPOA"); PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); + PortableServer::POA::_narrow (poa_object.in ()); if (CORBA::is_nil (root_poa.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -56,8 +54,7 @@ Server_Task::svc (void) hello_impl->_this (); CORBA::String_var ior = - this->sorb_->object_to_string (hello.in () - ACE_ENV_ARG_PARAMETER); + this->sorb_->object_to_string (hello.in ()); // Output the IOR to the <this->output_> FILE *output_file= ACE_OS::fopen (this->output_, @@ -80,17 +77,15 @@ Server_Task::svc (void) ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + root_poa->destroy (1, 1); this->sorb_->destroy (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); + ex._tao_print_exception ("Exception caught:"); return 1; } - ACE_ENDTRY; return 0; } |