From a127383e5648c995f3e54181b618d3db063526df Mon Sep 17 00:00:00 2001 From: mcorino Date: Wed, 8 Nov 2006 14:15:23 +0000 Subject: ChangeLogTag: Wed Nov 8 14:12:12 UTC 2006 Martin Corino --- TAO/ChangeLog | 9 +++++++++ TAO/tests/AMH_Exceptions/Test.idl | 2 ++ TAO/tests/AMH_Exceptions/client.cpp | 21 +++++++++++++-------- TAO/tests/AMH_Exceptions/run_test.pl | 2 +- TAO/tests/AMH_Exceptions/server.cpp | 12 +++++++++++- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index de85dbd9da0..82d7b2827bc 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Wed Nov 8 14:12:12 UTC 2006 Martin Corino + + * tests/AMH_Exceptions/Test.idl: + * tests/AMH_Exceptions/server.cpp: + * tests/AMH_Exceptions/client.cpp: + * tests/AMH_Exceptions/run_test.pl: + + Added clean shutdown option. + Wed Nov 8 13:22:12 UTC 2006 Martin Corino * tests/Muxing/Test.idl: diff --git a/TAO/tests/AMH_Exceptions/Test.idl b/TAO/tests/AMH_Exceptions/Test.idl index c3ffd609ca4..6a9ae77044b 100644 --- a/TAO/tests/AMH_Exceptions/Test.idl +++ b/TAO/tests/AMH_Exceptions/Test.idl @@ -23,6 +23,8 @@ module Test { Timestamp test_method (in Timestamp send_time) raises (InvalidTimestamp, ServerOverload); + + oneway void shutdown (); }; }; diff --git a/TAO/tests/AMH_Exceptions/client.cpp b/TAO/tests/AMH_Exceptions/client.cpp index 9ff92b2933d..60dbc3e8da3 100644 --- a/TAO/tests/AMH_Exceptions/client.cpp +++ b/TAO/tests/AMH_Exceptions/client.cpp @@ -30,14 +30,19 @@ main (int argc, char *argv[]) 1); } - Test::Timestamp time = 10; - roundtrip->test_method (time ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH(Test::ServerOverload, ov) - { - ACE_DEBUG ((LM_DEBUG, "Received expected exception\n")); - received_expected_exception = 1; + ACE_TRY { + Test::Timestamp time = 10; + roundtrip->test_method (time ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH(Test::ServerOverload, ov) + { + ACE_DEBUG ((LM_DEBUG, "Received expected exception\n")); + received_expected_exception = 1; + + roundtrip->shutdown (); + } + ACE_ENDTRY; } ACE_CATCHANY { diff --git a/TAO/tests/AMH_Exceptions/run_test.pl b/TAO/tests/AMH_Exceptions/run_test.pl index 11dc1f3e86a..7bd307293bf 100755 --- a/TAO/tests/AMH_Exceptions/run_test.pl +++ b/TAO/tests/AMH_Exceptions/run_test.pl @@ -42,7 +42,7 @@ if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) { $client = $CL->SpawnWaitKill (30); # Clean up. -$amhserver= $AMH->TerminateWaitKill (5); +$amhserver= $AMH->WaitKill (15); if ($amhserver != 0) { print STDERR "ERROR: AMH Server returned $amhserver\n"; diff --git a/TAO/tests/AMH_Exceptions/server.cpp b/TAO/tests/AMH_Exceptions/server.cpp index 05d82934074..4bc543e5537 100644 --- a/TAO/tests/AMH_Exceptions/server.cpp +++ b/TAO/tests/AMH_Exceptions/server.cpp @@ -3,6 +3,7 @@ #include "ace/OS_NS_stdio.h" #include "TestS.h" +#include "tao/ORB_Core.h" /***************************/ /*** Servant Declaration ***/ @@ -18,6 +19,9 @@ public: ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); + void shutdown (Test::AMH_RoundtripResponseHandler_ptr _tao_rh ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + protected: CORBA::ORB_ptr orb_; }; @@ -56,6 +60,12 @@ ST_AMH_Servant::test_method (Test::AMH_RoundtripResponseHandler_ptr _tao_rh, ACE_UNUSED_ARG (send_time); } +void +ST_AMH_Servant::shutdown (Test::AMH_RoundtripResponseHandler_ptr /*_tao_rh*/ ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); +} /*** Server Declaration ***/ @@ -192,7 +202,7 @@ ST_AMH_Server::run_event_loop () ACE_TRY { ACE_Time_Value period (0, 11000); - while (1) + while (!this->orb_->orb_core ()->has_shutdown ()) { this->orb_->perform_work (&period); ACE_TRY_CHECK; -- cgit v1.2.1