diff options
Diffstat (limited to 'TAO/tests/CallbackTest')
-rw-r--r-- | TAO/tests/CallbackTest/Callback.cpp | 4 | ||||
-rw-r--r-- | TAO/tests/CallbackTest/Callback.h | 2 | ||||
-rw-r--r-- | TAO/tests/CallbackTest/Service.cpp | 32 | ||||
-rw-r--r-- | TAO/tests/CallbackTest/Service.h | 9 | ||||
-rw-r--r-- | TAO/tests/CallbackTest/client.cpp | 34 | ||||
-rw-r--r-- | TAO/tests/CallbackTest/server.cpp | 30 |
6 files changed, 45 insertions, 66 deletions
diff --git a/TAO/tests/CallbackTest/Callback.cpp b/TAO/tests/CallbackTest/Callback.cpp index 833974f7588..60c5e152398 100644 --- a/TAO/tests/CallbackTest/Callback.cpp +++ b/TAO/tests/CallbackTest/Callback.cpp @@ -11,7 +11,7 @@ Callback::Callback (CORBA::ORB_ptr orb) } CORBA::Boolean -Callback::are_you_there (CORBA::String_out answer ACE_ENV_ARG_DECL_NOT_USED) +Callback::are_you_there (CORBA::String_out answer) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_DEBUG ((LM_DEBUG, @@ -37,5 +37,5 @@ Callback::shutdown (void) ACE_DEBUG ((LM_DEBUG, "(%P|%t) Callback - shutdown!\n")); - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0); } diff --git a/TAO/tests/CallbackTest/Callback.h b/TAO/tests/CallbackTest/Callback.h index d98dc9313d3..cc0e453bcc1 100644 --- a/TAO/tests/CallbackTest/Callback.h +++ b/TAO/tests/CallbackTest/Callback.h @@ -17,7 +17,7 @@ public: Callback (CORBA::ORB_ptr orb); // = The skeleton methods - virtual CORBA::Boolean are_you_there (CORBA::String_out answer ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual CORBA::Boolean are_you_there (CORBA::String_out answer) ACE_THROW_SPEC ((CORBA::SystemException)); virtual void test_oneway (void) diff --git a/TAO/tests/CallbackTest/Service.cpp b/TAO/tests/CallbackTest/Service.cpp index afc8568114d..191c432fbfa 100644 --- a/TAO/tests/CallbackTest/Service.cpp +++ b/TAO/tests/CallbackTest/Service.cpp @@ -22,15 +22,14 @@ Service::dump_results (void) } void -Service::run_test (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) +Service::run_test (Test::Callback_ptr callback) ACE_THROW_SPEC ((CORBA::SystemException)) { int exceptions = - this->call_are_you_there (callback ACE_ENV_ARG_PARAMETER); + this->call_are_you_there (callback); exceptions += - this->call_test_oneway (callback ACE_ENV_ARG_PARAMETER); + this->call_test_oneway (callback); if (exceptions != 0) { @@ -41,24 +40,22 @@ Service::run_test (Test::Callback_ptr callback /// Increment the number of tests completed this->test_count_++; - ACE_TRY + try { callback->shutdown (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { ACE_DEBUG ((LM_ERROR, "(%P|%t) - Service, client shutdown FAILED\n")); } - ACE_ENDTRY; // shutdown ourselves - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0); } int -Service::call_are_you_there (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) +Service::call_are_you_there (Test::Callback_ptr callback) ACE_THROW_SPEC (()) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, calling are_you_there\n")); @@ -69,15 +66,14 @@ Service::call_are_you_there (Test::Callback_ptr callback { char* outstr; CORBA::String_out out_str (outstr); - ACE_TRY + try { - (void) callback->are_you_there (out_str ACE_ENV_ARG_PARAMETER); + (void) callback->are_you_there (out_str); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { exception_count++; } - ACE_ENDTRY; ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, answer = %s\n", outstr)); } @@ -85,8 +81,7 @@ Service::call_are_you_there (Test::Callback_ptr callback } int -Service::call_test_oneway (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) +Service::call_test_oneway (Test::Callback_ptr callback) ACE_THROW_SPEC (()) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, calling test_oneway\n")); @@ -95,15 +90,14 @@ Service::call_test_oneway (Test::Callback_ptr callback int exception_count = 0; for (int i = 0; i != iterations; ++i) { - ACE_TRY + try { (void) callback->test_oneway (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { exception_count++; } - ACE_ENDTRY; } return exception_count; } diff --git a/TAO/tests/CallbackTest/Service.h b/TAO/tests/CallbackTest/Service.h index f8773771eb4..a3b5f905c89 100644 --- a/TAO/tests/CallbackTest/Service.h +++ b/TAO/tests/CallbackTest/Service.h @@ -23,8 +23,7 @@ public: void dump_results (void); // = The skeleton methods - virtual void run_test (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) + virtual void run_test (Test::Callback_ptr callback) ACE_THROW_SPEC ((CORBA::SystemException)); private: @@ -32,16 +31,14 @@ private: /** * @return Number of exceptions raised */ - int call_are_you_there (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) + int call_are_you_there (Test::Callback_ptr callback) ACE_THROW_SPEC (()); /// Call the test_oneway method mutiple times. /** * @return Number of exceptions raised */ - int call_test_oneway (Test::Callback_ptr callback - ACE_ENV_ARG_DECL) + int call_test_oneway (Test::Callback_ptr callback) ACE_THROW_SPEC (()); private: diff --git a/TAO/tests/CallbackTest/client.cpp b/TAO/tests/CallbackTest/client.cpp index de331840625..35f36497bd8 100644 --- a/TAO/tests/CallbackTest/client.cpp +++ b/TAO/tests/CallbackTest/client.cpp @@ -38,16 +38,16 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + orb->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, @@ -60,11 +60,9 @@ main (int argc, char *argv[]) // Make all oneways "reliable." { CORBA::Object_var manager_object = - orb->resolve_initial_references("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references("ORBPolicyManager"); CORBA::PolicyManager_var policy_manager = - CORBA::PolicyManager::_narrow(manager_object.in() - ACE_ENV_ARG_PARAMETER); + CORBA::PolicyManager::_narrow(manager_object.in()); if (CORBA::is_nil (policy_manager.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -75,12 +73,10 @@ main (int argc, char *argv[]) CORBA::PolicyList policies(1); policies.length(1); policies[0] = orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE, - policy_value - ACE_ENV_ARG_PARAMETER); + policy_value); policy_manager->set_policy_overrides (policies, - CORBA::ADD_OVERRIDE - ACE_ENV_ARG_PARAMETER); + CORBA::ADD_OVERRIDE); policies[0]->destroy (); } @@ -89,10 +85,10 @@ main (int argc, char *argv[]) return 1; CORBA::Object_var tmp = - orb->string_to_object(ior ACE_ENV_ARG_PARAMETER); + orb->string_to_object(ior); Test::Service_var service = - Test::Service::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); + Test::Service::_narrow(tmp.in ()); if (CORBA::is_nil (service.in ())) { @@ -116,24 +112,22 @@ main (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - starting test\n")); - service->run_test (callback.in () ACE_ENV_ARG_PARAMETER); + service->run_test (callback.in ()); ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - running ORB\n")); orb->run (); - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + root_poa->destroy (1, 1); orb->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; } diff --git a/TAO/tests/CallbackTest/server.cpp b/TAO/tests/CallbackTest/server.cpp index 278bb19fecc..4017a6a9d42 100644 --- a/TAO/tests/CallbackTest/server.cpp +++ b/TAO/tests/CallbackTest/server.cpp @@ -39,16 +39,16 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); + orb->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, @@ -61,11 +61,9 @@ main (int argc, char *argv[]) // Make all oneways "reliable." { CORBA::Object_var manager_object = - orb->resolve_initial_references("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references("ORBPolicyManager"); CORBA::PolicyManager_var policy_manager = - CORBA::PolicyManager::_narrow(manager_object.in() - ACE_ENV_ARG_PARAMETER); + CORBA::PolicyManager::_narrow(manager_object.in()); if (CORBA::is_nil (policy_manager.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -76,12 +74,10 @@ main (int argc, char *argv[]) CORBA::PolicyList policies(1); policies.length(1); policies[0] = orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE, - policy_value - ACE_ENV_ARG_PARAMETER); + policy_value); policy_manager->set_policy_overrides (policies, - CORBA::ADD_OVERRIDE - ACE_ENV_ARG_PARAMETER); + CORBA::ADD_OVERRIDE); policies[0]->destroy (); } @@ -99,7 +95,7 @@ main (int argc, char *argv[]) service_impl->_this (); CORBA::String_var ior = - orb->object_to_string (service.in () ACE_ENV_ARG_PARAMETER); + orb->object_to_string (service.in ()); // If the ior_output_file exists, output the ior to it FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); @@ -119,17 +115,15 @@ main (int argc, char *argv[]) service_impl->dump_results (); - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + root_poa->destroy (1, 1); orb->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; } |