diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/tests/LongUpcalls | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tests/LongUpcalls')
-rw-r--r-- | TAO/tests/LongUpcalls/.cvsignore | 4 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/AMI_Manager.cpp | 209 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/AMI_Manager.h | 83 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Controller.cpp | 44 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Controller.h | 30 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/LongUpcalls.mpc | 37 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Manager.cpp | 113 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Manager.h | 52 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Manager_Handler.cpp | 53 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Manager_Handler.h | 35 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/README | 36 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/Test.idl | 23 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/ami_client.cpp | 124 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/ami_server.cpp | 107 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/blocking_client.cpp | 113 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/blocking_server.cpp | 107 | ||||
-rwxr-xr-x | TAO/tests/LongUpcalls/run_test.pl | 128 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/svc.conf | 5 | ||||
-rw-r--r-- | TAO/tests/LongUpcalls/svc.conf.xml | 9 |
19 files changed, 0 insertions, 1312 deletions
diff --git a/TAO/tests/LongUpcalls/.cvsignore b/TAO/tests/LongUpcalls/.cvsignore deleted file mode 100644 index 263d5e84f49..00000000000 --- a/TAO/tests/LongUpcalls/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -ami_client -ami_server -blocking_client -blocking_server diff --git a/TAO/tests/LongUpcalls/AMI_Manager.cpp b/TAO/tests/LongUpcalls/AMI_Manager.cpp deleted file mode 100644 index 01b2d58bb9e..00000000000 --- a/TAO/tests/LongUpcalls/AMI_Manager.cpp +++ /dev/null @@ -1,209 +0,0 @@ -// -// $Id$ -// - -#include "AMI_Manager.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID (LongUpcalls, - AMI_Manager, - "$Id$") - -static void -validate_connection (Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (()) -{ - ACE_TRY - { -#if (TAO_HAS_CORBA_MESSAGING == 1) - CORBA::PolicyList_var unused; - controller->_validate_connection (unused - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#else - controller->_is_a ("Not_an_IDL_Type" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif - } - ACE_CATCHANY - { - } - ACE_ENDTRY; -} - -AMI_Manager::AMI_Manager (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -AMI_Manager::start_workers (CORBA::Short worker_count, - CORBA::Long milliseconds, - Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_Thread_Manager thread_manager; - - validate_connection(controller - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Starting %d workers\n", worker_count)); - Worker worker (&thread_manager, - controller, milliseconds, - this->orb_.in ()); - - worker.activate (THR_NEW_LWP | THR_JOINABLE, worker_count); - - thread_manager.wait (); -} - -void -AMI_Manager::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} - -// **************************************************************** - -Worker::Worker (ACE_Thread_Manager *thr_mgr, - Test::Controller_ptr controller, - CORBA::Long milliseconds, - CORBA::ORB_ptr orb) - : ACE_Task_Base (thr_mgr) - , controller_ (Test::Controller::_duplicate (controller)) - , milliseconds_ (milliseconds) - , orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -int -Worker::svc (void) -{ - // ACE_DEBUG ((LM_DEBUG, "Worker starts\n")); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - TAO_SYNCH_MUTEX mutex; - int pending_requests = 2; - Test::AMI_ControllerHandler_var handler; - - { - Controller_Handler *handler_impl; - ACE_NEW_RETURN (handler_impl, - Controller_Handler (&mutex, - &pending_requests), - -1); - - PortableServer::ServantBase_var auto_destroy (handler_impl); - handler = handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - validate_connection(this->controller_.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->controller_->sendc_worker_started (handler.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Worker start reported\n")); - - ACE_Time_Value tv (0, 1000 * this->milliseconds_); - ACE_OS::sleep (tv); - - this->controller_->sendc_worker_finished (handler.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Worker completion reported\n")); - - for (;;) - { - ACE_Time_Value tv (0, 1000 * this->milliseconds_); - this->orb_->run (tv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, mutex, -1); - if (pending_requests == 0) - break; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception in svc() method\n"); - } - ACE_ENDTRY; - return 0; -} - -// **************************************************************** - -Controller_Handler::Controller_Handler (TAO_SYNCH_MUTEX *mutex, - int *pending_replies) - : mutex_ (mutex) - , pending_replies_ (pending_replies) -{ -} - -void -Controller_Handler::worker_started (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->mutex_); - (*this->pending_replies_)--; -} - -void -Controller_Handler::worker_started_excep - (::Messaging::ExceptionHolder* h - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - h->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Controller_Handler exception raised in" - " worker_started"); - } - ACE_ENDTRY; -} - -void -Controller_Handler::worker_finished (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->mutex_); - (*this->pending_replies_)--; -} - -void -Controller_Handler::worker_finished_excep - (::Messaging::ExceptionHolder *h - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - h->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Controller_Handler exception raised in" - " worker_finished"); - } - ACE_ENDTRY; -} diff --git a/TAO/tests/LongUpcalls/AMI_Manager.h b/TAO/tests/LongUpcalls/AMI_Manager.h deleted file mode 100644 index 5d7d6a82eec..00000000000 --- a/TAO/tests/LongUpcalls/AMI_Manager.h +++ /dev/null @@ -1,83 +0,0 @@ -// $Id$ - -#ifndef LONGUPCALLS_AMI_MANAGER_H -#define LONGUPCALLS_AMI_MANAGER_H - -#include "TestS.h" -#include "ace/Task.h" - -class AMI_Manager - : public virtual POA_Test::Manager -{ -public: - AMI_Manager (CORBA::ORB_ptr orb); - // Constructor - - // = The skeleton methods - virtual void start_workers (CORBA::Short worker_count, - CORBA::Long milliseconds, - Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB, to shutdown -}; - -// **************************************************************** - -class Worker : public ACE_Task_Base -{ -public: - Worker (ACE_Thread_Manager *thr_mgr, - Test::Controller_ptr controller, - CORBA::Long milliseconds, - CORBA::ORB_ptr orb); - - virtual int svc (void); - // The service method - -private: - Test::Controller_var controller_; - // The controller pointer - - CORBA::Long milliseconds_; - // The number of milliseconds. - - CORBA::ORB_var orb_; - // The orb -}; - -// **************************************************************** - -class Controller_Handler - : public virtual POA_Test::AMI_ControllerHandler -{ -public: - Controller_Handler (TAO_SYNCH_MUTEX *mutex, - int *pending_replies); - // Constructor - - virtual void worker_started (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void worker_started_excep (::Messaging::ExceptionHolder* - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void worker_finished (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void worker_finished_excep (::Messaging::ExceptionHolder* - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - TAO_SYNCH_MUTEX *mutex_; - int *pending_replies_; - // The pending replies is decremented each time a reply is - // received. - // The mutex is used to protect the access to the flag. -}; - -#endif /* LONGUPCALLS_AMI_MANAGER_H */ diff --git a/TAO/tests/LongUpcalls/Controller.cpp b/TAO/tests/LongUpcalls/Controller.cpp deleted file mode 100644 index 94008f0a364..00000000000 --- a/TAO/tests/LongUpcalls/Controller.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// $Id$ -// -#include "Controller.h" - -ACE_RCSID(LongUpcalls, Controller, "$Id$") - -Controller::Controller (void) - : start_count_ (0) - , finish_count_ (0) -{ -} - -void -Controller::dump_results () -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); - if (this->start_count_ != this->finish_count_) - { - ACE_ERROR ((LM_ERROR, - "ERROR - mismatched count! (%d,%d)\n", - this->start_count_, this->finish_count_)); - } -} - -void -Controller::worker_started (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); - this->start_count_++; - - // ACE_DEBUG ((LM_DEBUG, "Received worker start report\n")); -} - -void -Controller::worker_finished (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_); - this->finish_count_++; - - // ACE_DEBUG ((LM_DEBUG, "Received worker completion report\n")); -} diff --git a/TAO/tests/LongUpcalls/Controller.h b/TAO/tests/LongUpcalls/Controller.h deleted file mode 100644 index a3992eb5c59..00000000000 --- a/TAO/tests/LongUpcalls/Controller.h +++ /dev/null @@ -1,30 +0,0 @@ -// $Id$ - -#ifndef LONGUPCALLS_CONTROLLER_H -#define LONGUPCALLS_CONTROLLER_H - -#include "TestS.h" - -class Controller - : public virtual POA_Test::Controller -{ -public: - Controller (void); - // Constructor - - void dump_results (void); - // Print out the results and any errors - - // = The skeleton methods - virtual void worker_started (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void worker_finished (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - TAO_SYNCH_MUTEX mutex_; - CORBA::ULong start_count_; - CORBA::ULong finish_count_; -}; - -#endif /* LONGUPCALLS_CONTROLLER_H */ diff --git a/TAO/tests/LongUpcalls/LongUpcalls.mpc b/TAO/tests/LongUpcalls/LongUpcalls.mpc deleted file mode 100644 index 13a0c026057..00000000000 --- a/TAO/tests/LongUpcalls/LongUpcalls.mpc +++ /dev/null @@ -1,37 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver, messaging, ami { - exename = blocking_server - Source_Files { - Manager.cpp - blocking_server.cpp - } -} - -project(*Client): messaging, taoexe, portableserver, ami { - after += *Server - Source_Files { - Controller.cpp - blocking_client.cpp - } -} - -project(*AMI_Server): taoserver, messaging, ami { - exename = ami_server - after += *Client - Source_Files { - AMI_Manager.cpp - ami_server.cpp - } -} - -project(*AMI_Client): messaging, taoexe, portableserver, ami { - after += *AMI_Server - Source_Files { - Controller.cpp - Manager_Handler.cpp - ami_client.cpp - } -} - diff --git a/TAO/tests/LongUpcalls/Manager.cpp b/TAO/tests/LongUpcalls/Manager.cpp deleted file mode 100644 index 562ff8f262c..00000000000 --- a/TAO/tests/LongUpcalls/Manager.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// $Id$ -// - -#include "Manager.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID (LongUpcalls, - Manager, - "$Id$") - -static void -validate_connection (Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (()) -{ - ACE_TRY - { -#if (TAO_HAS_CORBA_MESSAGING == 1) - CORBA::PolicyList_var unused; - controller->_validate_connection (unused - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#else - controller->_is_a ("Not_an_IDL_Type" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; -#endif - } - ACE_CATCHANY - { - } - ACE_ENDTRY; -} - -Manager::Manager (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -void -Manager::start_workers (CORBA::Short worker_count, - CORBA::Long milliseconds, - Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_Thread_Manager thread_manager; - - validate_connection(controller - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Starting %d workers\n", worker_count)); - Worker worker (&thread_manager, - controller, milliseconds); - - worker.activate (THR_NEW_LWP | THR_JOINABLE, worker_count); - - thread_manager.wait (); -} - -void -Manager::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} - - -// **************************************************************** - -Worker::Worker (ACE_Thread_Manager *thr_mgr, - Test::Controller_ptr controller, - CORBA::Long milliseconds) - : ACE_Task_Base (thr_mgr) - , controller_ (Test::Controller::_duplicate (controller)) - , milliseconds_ (milliseconds) -{ -} - -int -Worker::svc (void) -{ - // ACE_DEBUG ((LM_DEBUG, "Worker starts\n")); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - validate_connection(this->controller_.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->controller_->worker_started (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Worker start reported\n")); - - ACE_Time_Value tv (0, 1000 * this->milliseconds_); - ACE_OS::sleep (tv); - - this->controller_->worker_finished (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "Worker completion reported\n")); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception in svc() method\n"); - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/LongUpcalls/Manager.h b/TAO/tests/LongUpcalls/Manager.h deleted file mode 100644 index 65e7934f00c..00000000000 --- a/TAO/tests/LongUpcalls/Manager.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// $Id$ -// - -#ifndef LONGUPCALLS_MANAGER_H -#define LONGUPCALLS_MANAGER_H - -#include "TestS.h" -#include "ace/Task.h" - -class Manager - : public virtual POA_Test::Manager -{ -public: - Manager (CORBA::ORB_ptr orb); - // Constructor - - // = The skeleton methods - virtual void start_workers (CORBA::Short worker_count, - CORBA::Long milliseconds, - Test::Controller_ptr controller - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB, to shutdown -}; - -// **************************************************************** - -class Worker : public ACE_Task_Base -{ -public: - Worker (ACE_Thread_Manager *thr_mgr, - Test::Controller_ptr controller, - CORBA::Long milliseconds); - - virtual int svc (void); - // The service method - -private: - Test::Controller_var controller_; - // The controller pointer - - CORBA::Long milliseconds_; - // The number of milliseconds. -}; - -#endif /* LONGUPCALLS_MANAGER_H */ diff --git a/TAO/tests/LongUpcalls/Manager_Handler.cpp b/TAO/tests/LongUpcalls/Manager_Handler.cpp deleted file mode 100644 index c1532a2eb86..00000000000 --- a/TAO/tests/LongUpcalls/Manager_Handler.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// $Id$ -// - -#include "Manager_Handler.h" - -ACE_RCSID(LongUpcalls, Manager_Handler, "$Id$") - -Manager_Handler::Manager_Handler (Test::Manager_ptr manager, - Test::Controller_ptr controller) - : manager_ (Test::Manager::_duplicate (manager)) - , controller_ (Test::Controller::_duplicate (controller)) -{ -} - -void -Manager_Handler::start_workers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - this->manager_->start_workers (CORBA::Short(10), - CORBA::Long(1000), - this->controller_.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception raised in nested start workers: "); - } - ACE_ENDTRY; -} - -void -Manager_Handler::start_workers_excep (::Messaging::ExceptionHolder * holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception raised in asynch start workers: "); - } - ACE_ENDTRY; -} - diff --git a/TAO/tests/LongUpcalls/Manager_Handler.h b/TAO/tests/LongUpcalls/Manager_Handler.h deleted file mode 100644 index 8ee1d472c2e..00000000000 --- a/TAO/tests/LongUpcalls/Manager_Handler.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// $Id$ -// - -#ifndef LONGUPCALLS_MANAGER_HANDLER_H -#define LONGUPCALLS_MANAGER_HANDLER_H - -#include "TestS.h" -#include "ace/Task.h" - -class Manager_Handler - : public virtual POA_Test::AMI_ManagerHandler -{ -public: - Manager_Handler (Test::Manager_ptr manager, - Test::Controller_ptr controller); - // Constructor - - // = The skeleton methods - virtual void start_workers (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void start_workers_excep (::Messaging::ExceptionHolder *holder - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - Test::Manager_var manager_; - // The manager to reissue the request from the context of the - // upcall - - Test::Controller_var controller_; - // The controller -}; - -#endif /* LONGUPCALLS_MANAGER_HANDLER_H */ diff --git a/TAO/tests/LongUpcalls/README b/TAO/tests/LongUpcalls/README deleted file mode 100644 index 3e7e6a576b1..00000000000 --- a/TAO/tests/LongUpcalls/README +++ /dev/null @@ -1,36 +0,0 @@ -/** - -@page Long Upcalls Test README File - - Verify that the ORB does not dead-lock, even in the presence -of very long or unbounded upcalls. This is a regression test for: - -http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=175 - - In the old days the leader thread would not allow any -followers to take over while a long upcall or reply handler -was running. This could produce deadlocks as in some cases the upcall -may want for follower threads before returning. - - To execute the test simply run - -$ ./run_test.pl - - The test returns 0 on success. - -@section Known problems - - This test can also be used to verify that bug - -http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=575 - - is still unresolved, all you need to do is run the following -programs: - -$ ./ami_server -ORBSvcConf svc.conf -o test.ior - -$ ./ami_client -ORBSvcConf svc.conf -k file://test.ior - - the client will deadlock. - -*/ diff --git a/TAO/tests/LongUpcalls/Test.idl b/TAO/tests/LongUpcalls/Test.idl deleted file mode 100644 index 047bd3bde5f..00000000000 --- a/TAO/tests/LongUpcalls/Test.idl +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -module Test -{ - interface Controller { - void worker_started (); - // A worker has started - - void worker_finished (); - // A worker has finished - }; - - interface Manager { - void start_workers (in short worker_count, - in long milliseconds, - in Controller the_controller); - // Start <worker_count> workers, each one runs for the pescribed - // number of milliseconds, and report progress to <the_controller> - - oneway void shutdown (); - // Shutdown the Manager's ORB, just for cleanup purposes - }; -}; diff --git a/TAO/tests/LongUpcalls/ami_client.cpp b/TAO/tests/LongUpcalls/ami_client.cpp deleted file mode 100644 index e22153a203d..00000000000 --- a/TAO/tests/LongUpcalls/ami_client.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "Controller.h" -#include "Manager_Handler.h" - -ACE_RCSID(LongUpcalls, ami_client, "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Controller controller_impl; - - Test::Controller_var controller = - controller_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - object = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Manager_var manager = - Test::Manager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (manager.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Manager is nil\n"), - 1); - - Manager_Handler handler_impl (manager.in (), - controller.in ()); - Test::AMI_ManagerHandler_var handler = - handler_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - const CORBA::Short worker_count = 10; - manager->sendc_start_workers (handler.in (), - worker_count, - CORBA::Long (1000), - controller.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_Time_Value tv (30, 0); - orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - controller_impl.dump_results (); - - manager->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/LongUpcalls/ami_server.cpp b/TAO/tests/LongUpcalls/ami_server.cpp deleted file mode 100644 index ed7307129f9..00000000000 --- a/TAO/tests/LongUpcalls/ami_server.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "AMI_Manager.h" - -ACE_RCSID(LongUpcalls, ami_server, "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - AMI_Manager manager_impl (orb.in ()); - - Test::Manager_var manager = - manager_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (manager.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/LongUpcalls/blocking_client.cpp b/TAO/tests/LongUpcalls/blocking_client.cpp deleted file mode 100644 index b914c957950..00000000000 --- a/TAO/tests/LongUpcalls/blocking_client.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "Controller.h" - -ACE_RCSID(LongUpcalls, blocking_client, "$Id$") - -const char *ior = "file://test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Controller controller_impl; - - Test::Controller_var controller = - controller_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - object = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Manager_var manager = - Test::Manager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (manager.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Manager is nil\n"), - 1); - - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - const CORBA::Short worker_count = 10; - manager->start_workers (worker_count, - CORBA::Long (1000), - controller.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - controller_impl.dump_results (); - - manager->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/LongUpcalls/blocking_server.cpp b/TAO/tests/LongUpcalls/blocking_server.cpp deleted file mode 100644 index eb5c55c3bf0..00000000000 --- a/TAO/tests/LongUpcalls/blocking_server.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "Manager.h" - -ACE_RCSID(LongUpcalls, blocking_server, "$Id$") - -const char *ior_output_file = "test.ior"; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - Manager manager_impl (orb.in ()); - - Test::Manager_var manager = - manager_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (manager.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - - root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/LongUpcalls/run_test.pl b/TAO/tests/LongUpcalls/run_test.pl deleted file mode 100755 index c02f3c6b708..00000000000 --- a/TAO/tests/LongUpcalls/run_test.pl +++ /dev/null @@ -1,128 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../bin'; -use PerlACE::Run_Test; - -$status = 0; - -$iorfile = PerlACE::LocalFile ("test.ior"); -$svcfile = PerlACE::LocalFile ("svc$PerlACE::svcconf_ext"); - -$BSV = new PerlACE::Process ("blocking_server", - "-ORBSvcConf $svcfile -o $iorfile"); -$ASV = new PerlACE::Process ("ami_server", - "-ORBSvcConf $svcfile -o $iorfile"); -$BCL = new PerlACE::Process ("blocking_client", - "-ORBSvcConf $svcfile -k file://$iorfile"); -$ACL = new PerlACE::Process ("ami_client", - "-ORBSvcConf $svcfile -k file://$iorfile"); - -print STDERR "==== Server upcall waits for operations on other threads\n"; - -unlink $iorfile; - -$BSV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 30) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $BSV->Kill (); - exit 1; -} - -$client = $BCL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $BSV->WaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -print STDERR "==== Server upcall waits for AMI operations on other threads\n"; - -unlink $iorfile; -$ASV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 30) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $ASV->Kill (); - exit 1; -} - -$client = $BCL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $ASV->WaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -print STDERR "==== AMI Client, Server upcall waits for operations on other threads\n"; - -unlink $iorfile; -$BSV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 30) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $BSV->Kill (); - exit 1; -} - -$client = $ACL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $BSV->WaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -print STDERR "==== AMI Client, Server upcall waits AMI operations\n"; - -unlink $iorfile; -$ASV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 30) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $ASV->Kill (); - exit 1; -} - -$client = $ACL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $ASV->WaitKill (30); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/LongUpcalls/svc.conf b/TAO/tests/LongUpcalls/svc.conf deleted file mode 100644 index f04d979d03e..00000000000 --- a/TAO/tests/LongUpcalls/svc.conf +++ /dev/null @@ -1,5 +0,0 @@ -# -# $Id$ -# -static Resource_Factory "-ORBFlushingStrategy blocking" -static Client_Strategy_Factory "-ORBClientConnectionHandler MT -ORBTransportMuxStrategy MUXED" diff --git a/TAO/tests/LongUpcalls/svc.conf.xml b/TAO/tests/LongUpcalls/svc.conf.xml deleted file mode 100644 index 8fb8581c2a0..00000000000 --- a/TAO/tests/LongUpcalls/svc.conf.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./tests/LongUpcalls/svc.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- --> - <!-- $Id$ --> - <!-- --> - <static id="Resource_Factory" params="-ORBFlushingStrategy blocking"/> - <static id="Client_Strategy_Factory" params="-ORBClientConnectionHandler MT -ORBTransportMuxStrategy MUXED"/> -</ACE_Svc_Conf> |