From b92c7cc4d663d8a3cdbef665b5e68969c9d0d441 Mon Sep 17 00:00:00 2001 From: elliott_c Date: Wed, 10 Jan 2007 19:24:58 +0000 Subject: ChangeLogTag: Wed Jan 10 19:24:11 UTC 2007 Chad Elliott --- TAO/ChangeLog | 29 +++++++++++++++++++++----- TAO/tests/Bug_1551_Regression/Client_Task.cpp | 30 +++++++++++++++++++++++++++ TAO/tests/Bug_1551_Regression/client.cpp | 27 ------------------------ TAO/tests/Bug_1551_Regression/run_test.pl | 9 ++++---- 4 files changed, 59 insertions(+), 36 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 15be3ee7d41..d0b17c7ec97 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,17 +1,36 @@ +Wed Jan 10 19:24:11 UTC 2007 Chad Elliott + + * tests/Bug_1551_Regression/Client_Task.cpp: + * tests/Bug_1551_Regression/client.cpp: + + Moved the setting of the policy override on the PolicyCurrent into + the thread specific code. Since overrides set on the + PolicyCurrent only apply to the thread in which they are set, it + should have been done in each client thread. + + Also, we ignore CORBA::TIMEOUT exceptions. Since the server is + aborting itself, they are expected. + + * tests/Bug_1551_Regression/run_test.pl: + + Only sleep 30 seconds if starting the three clients succeeded. + And trap the return value of the WaitKill() called on the clients + in order to determine if the test needs to continue or not. + Wed Jan 10 18:53:20 UTC 2007 Jeff Parsons * tao/DynamicAny/DynAnyUtils_T.cpp: - + New file, containing the implementation formerly in the header file. - + * tao/DynamicAny/DynAnyUtils_T.h: - + Factored out the method bodies and put them in the new file above. - + * tao/DynamicAny.mpc: - + Added the new file above explicitly in the Template_Files block, also listed explicitly the rest of the .cpp files. diff --git a/TAO/tests/Bug_1551_Regression/Client_Task.cpp b/TAO/tests/Bug_1551_Regression/Client_Task.cpp index dd653c0143a..75a9d31af82 100644 --- a/TAO/tests/Bug_1551_Regression/Client_Task.cpp +++ b/TAO/tests/Bug_1551_Regression/Client_Task.cpp @@ -29,6 +29,28 @@ Client_Task::svc (void) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { + CORBA::Object_var object = + this->orb_->resolve_initial_references ("PolicyCurrent"); + + CORBA::PolicyCurrent_var policy_current = + CORBA::PolicyCurrent::_narrow (object.in ()); + + TimeBase::TimeT timeout_period = 20 * 1000; + + CORBA::Any timeout_as_any; + timeout_as_any <<= timeout_period; + + CORBA::PolicyList policy_list (1); + policy_list.length (1); + policy_list[0] = + this->orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, + timeout_as_any); + + policy_current->set_policy_overrides (policy_list, + CORBA::ADD_OVERRIDE); + + policy_list[0]->destroy(); + // Start 25 separate concurrent request streams for (CORBA::Short i = 0; i != 25; ++i) { @@ -41,6 +63,14 @@ Client_Task::svc (void) orb_->run(tv ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } + ACE_CATCH (CORBA::TIMEOUT, ex) + { + // A CORBA::TIMEOUT exception is expected since + // the server aborts itself + ACE_UNUSED_ARG (ex); + ACE_DEBUG ((LM_DEBUG, + "Client received an expected CORBA::TIMEOUT exception.\n")); + } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, diff --git a/TAO/tests/Bug_1551_Regression/client.cpp b/TAO/tests/Bug_1551_Regression/client.cpp index a898cdb3398..1498c96ae47 100644 --- a/TAO/tests/Bug_1551_Regression/client.cpp +++ b/TAO/tests/Bug_1551_Regression/client.cpp @@ -90,33 +90,6 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; - CORBA::Object_var object = - orb->resolve_initial_references ("PolicyCurrent" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - CORBA::PolicyCurrent_var policy_current = - CORBA::PolicyCurrent::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - TimeBase::TimeT timeout_period = 20 * 1000; - - CORBA::Any timeout_as_any; - timeout_as_any <<= timeout_period; - - CORBA::PolicyList policy_list (1); - policy_list.length (1); - policy_list[0] = - orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, - timeout_as_any - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - policy_current->set_policy_overrides (policy_list, - CORBA::ADD_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Let the client perform the test in a separate thread diff --git a/TAO/tests/Bug_1551_Regression/run_test.pl b/TAO/tests/Bug_1551_Regression/run_test.pl index 12139851d73..34a54b73517 100755 --- a/TAO/tests/Bug_1551_Regression/run_test.pl +++ b/TAO/tests/Bug_1551_Regression/run_test.pl @@ -45,11 +45,12 @@ $client2 = $CL2->Spawn (); $client3 = $CL3->Spawn (); -sleep (30); +sleep (30) if ($client1 == 0 && $client2 == 0 && $client3 == 0); + $SV->WaitKill (3) unless $sv1 < 0; -$CL1->WaitKill (3); -$CL2->WaitKill (3); -$CL3->WaitKill (3); +$client1 = $CL1->WaitKill (3); +$client2 = $CL2->WaitKill (3); +$client3 = $CL3->WaitKill (3); if ($client3 != 0){ $status = -1; -- cgit v1.2.1