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/Servant_To_Reference_Test | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tests/Servant_To_Reference_Test')
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/.cvsignore | 1 | ||||
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/Servant_to_Reference.mpc | 18 | ||||
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/Test.idl | 24 | ||||
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/Test_i.cpp | 43 | ||||
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/Test_i.h | 63 | ||||
-rwxr-xr-x | TAO/tests/Servant_To_Reference_Test/run_test.pl | 33 | ||||
-rw-r--r-- | TAO/tests/Servant_To_Reference_Test/server.cpp | 208 |
7 files changed, 0 insertions, 390 deletions
diff --git a/TAO/tests/Servant_To_Reference_Test/.cvsignore b/TAO/tests/Servant_To_Reference_Test/.cvsignore deleted file mode 100644 index 254defddb53..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -server diff --git a/TAO/tests/Servant_To_Reference_Test/Servant_to_Reference.mpc b/TAO/tests/Servant_To_Reference_Test/Servant_to_Reference.mpc deleted file mode 100644 index 9c240b72452..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/Servant_to_Reference.mpc +++ /dev/null @@ -1,18 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoexe, portableserver, minimum_corba { - Source_Files { - server.cpp - Test_i.cpp - TestC.cpp - TestS.cpp - } - - IDL_Files { - Test.idl - } -} - - - diff --git a/TAO/tests/Servant_To_Reference_Test/Test.idl b/TAO/tests/Servant_To_Reference_Test/Test.idl deleted file mode 100644 index 39548dcbf88..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/Test.idl +++ /dev/null @@ -1,24 +0,0 @@ -// -// $Id$ -// - -/// Put the interfaces in a module, to avoid global namespace pollution -module Test -{ - /// A very simple interface - interface One - { - /// Return a simple string - string get_string (); - }; - - interface Two - { - string get_string (); - }; - - interface Three - { - string get_string (); - }; -}; diff --git a/TAO/tests/Servant_To_Reference_Test/Test_i.cpp b/TAO/tests/Servant_To_Reference_Test/Test_i.cpp deleted file mode 100644 index 6095fe48373..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/Test_i.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// $Id$ -// -#include "Test_i.h" - -ACE_RCSID(Hello, Hello, "$Id$") - -One_Impl::One_Impl (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -char * -One_Impl::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("One_Impl there!"); -} - -Two_Impl::Two_Impl (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -char * -Two_Impl::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("One_Impl there!"); -} - - -Three_Impl::Three_Impl (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -char * -Three_Impl::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Three_Impl there!"); -} diff --git a/TAO/tests/Servant_To_Reference_Test/Test_i.h b/TAO/tests/Servant_To_Reference_Test/Test_i.h deleted file mode 100644 index 4ff3dd09b6e..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/Test_i.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// $Id$ -// - -#ifndef HELLO_H -#define HELLO_H -#include /**/ "ace/pre.h" - -#include "TestS.h" - -class One_Impl - : public virtual POA_Test::One -{ -public: - /// Constructor - One_Impl (CORBA::ORB_ptr orb); - - // = The skeleton methods - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Use an ORB reference to conver strings to objects and shutdown - /// the application. - CORBA::ORB_var orb_; -}; - -class Two_Impl - : public virtual POA_Test::Two -{ -public: - /// Constructor - Two_Impl (CORBA::ORB_ptr orb); - - // = The skeleton methods - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Use an ORB reference to conver strings to objects and shutdown - /// the application. - CORBA::ORB_var orb_; -}; - -class Three_Impl - : public virtual POA_Test::Three -{ -public: - /// Constructor - Three_Impl (CORBA::ORB_ptr orb); - - // = The skeleton methods - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Use an ORB reference to conver strings to objects and shutdown - /// the application. - CORBA::ORB_var orb_; -}; - -#include /**/ "ace/post.h" -#endif /* HELLO_H */ diff --git a/TAO/tests/Servant_To_Reference_Test/run_test.pl b/TAO/tests/Servant_To_Reference_Test/run_test.pl deleted file mode 100755 index dd868e17e78..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/run_test.pl +++ /dev/null @@ -1,33 +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; - -$iorfile = PerlACE::LocalFile ("server.ior"); -unlink $iorfile; -$status = 0; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $iorfile"); -} - -$SV->Spawn (); - -$server = $SV->WaitKill (120); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/Servant_To_Reference_Test/server.cpp b/TAO/tests/Servant_To_Reference_Test/server.cpp deleted file mode 100644 index 65139d0cd63..00000000000 --- a/TAO/tests/Servant_To_Reference_Test/server.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// $Id$ - -#include "Test_i.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/Task.h" - -ACE_RCSID (Hello, - server, - "$Id$") - -const char *ior_output_file = "test.ior"; - -class MT_Task : public ACE_Task_Base -{ -public: - MT_Task (PortableServer::POA_ptr p, - PortableServer::Servant one, - PortableServer::Servant two, - PortableServer::Servant three) - : p_ (PortableServer::POA::_duplicate (p)) - , one_ (one) - , two_ (two) - , three_ (three) - { - } - - int svc (void); - -private: - PortableServer::POA_var p_; - PortableServer::Servant one_; - PortableServer::Servant two_; - PortableServer::Servant three_; -}; - -int -MT_Task::svc (void) -{ - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - for (CORBA::Long i = 0; - i != 2000; - ++i) - { - CORBA::Object_var one_ref = - this->p_->servant_to_reference (this->one_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var two_ref = - this->p_->servant_to_reference (this->two_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::Object_var three_ref = - this->p_->servant_to_reference (this->three_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "(%P|%t) Caugh exception \n"); - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - -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; - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Panic: nil RootPOA\n"), - 1); - - 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; - - One_Impl *one_impl; - ACE_NEW_RETURN (one_impl, - One_Impl (orb.in ()), - 1); - Two_Impl *two_impl; - ACE_NEW_RETURN (two_impl, - Two_Impl (orb.in ()), - 1); - - Three_Impl *three_impl; - ACE_NEW_RETURN (three_impl, - Three_Impl (orb.in ()), - 1); - - - PortableServer::ServantBase_var owner_transfer1 (one_impl); - PortableServer::ServantBase_var owner_transfer2 (two_impl); - PortableServer::ServantBase_var owner_transfer3 (three_impl); - - CORBA::PolicyList policies; // Empty policy list. - - PortableServer::POA_var first_poa = - root_poa->create_POA ("first POA", - poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - - PortableServer::ObjectId_var oid1 = - first_poa->activate_object (one_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::ObjectId_var oid2 = - first_poa->activate_object (two_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::ObjectId_var oid3 = - first_poa->activate_object (three_impl - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - - MT_Task task (first_poa.in (), - one_impl, - two_impl, - three_impl); - - if (task.activate (THR_NEW_LWP | THR_JOINABLE, - 32) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot activate threads\n"), - 1); - - task.thr_mgr ()->wait (); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - test 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; -} |