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/Oneways_Invoking_Twoways | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tests/Oneways_Invoking_Twoways')
17 files changed, 0 insertions, 798 deletions
diff --git a/TAO/tests/Oneways_Invoking_Twoways/.cvsignore b/TAO/tests/Oneways_Invoking_Twoways/.cvsignore deleted file mode 100644 index f2ad85300eb..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -client -server diff --git a/TAO/tests/Oneways_Invoking_Twoways/Client_Task.cpp b/TAO/tests/Oneways_Invoking_Twoways/Client_Task.cpp deleted file mode 100644 index 8f76444fb40..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Client_Task.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// $Id$ -// - -#include "Client_Task.h" - -ACE_RCSID(Muxing, Client_Task, "$Id$") - -Client_Task::Client_Task (Test::Sender_ptr reply_gen, - Test::Receiver_ptr us, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , sender_(Test::Sender::_duplicate (reply_gen)) - , us_ (Test::Receiver::_duplicate (us)) - -{ -} - -int -Client_Task::svc (void) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n")); - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - for (int i = 0; i != 1; ++i) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) sending oneways...\n")); - - this->sender_->send_ready_message (this->us_.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught Exception"); - return -1; - } - ACE_ENDTRY; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n")); - return 0; -} diff --git a/TAO/tests/Oneways_Invoking_Twoways/Client_Task.h b/TAO/tests/Oneways_Invoking_Twoways/Client_Task.h deleted file mode 100644 index 5e5570ba10d..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Client_Task.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// $Id$ -// - -#ifndef ONEWAYS_INVOKING_TWOWAYS_CLIENT_TASK_H -#define ONEWAYS_INVOKING_TWOWAYS_CLIENT_TASK_H -#include /**/ "ace/pre.h" - -#include "TestC.h" -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Implement a Task to run the experiments using multiple threads. -class Client_Task : public ACE_Task_Base -{ -public: - /// Constructor - Client_Task (Test::Sender_ptr sender, - Test::Receiver_ptr us, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - -private: - - /// Reference to the test interface - Test::Sender_var sender_; - - /// Reference to the test interface - Test::Receiver_var us_; -}; - -#include /**/ "ace/post.h" -#endif /* ONEWAYS_INVOKING_TWOWAYS_CLIENT_TASK_H */ diff --git a/TAO/tests/Oneways_Invoking_Twoways/Oneways_Invoking_Twoways.mpc b/TAO/tests/Oneways_Invoking_Twoways/Oneways_Invoking_Twoways.mpc deleted file mode 100644 index bd6dfbc4ff5..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Oneways_Invoking_Twoways.mpc +++ /dev/null @@ -1,21 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver { - Source_Files { - Server_Task.cpp - Sender_i.cpp - server.cpp - } -} - -project(*Client): taoexe, portableserver { - after += *Server - Source_Files { - Client_Task.cpp - Server_Task.cpp - Receiver_i.cpp - client.cpp - } -} - diff --git a/TAO/tests/Oneways_Invoking_Twoways/README b/TAO/tests/Oneways_Invoking_Twoways/README deleted file mode 100644 index 240db115c96..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/README +++ /dev/null @@ -1,25 +0,0 @@ -/** - -@page Oneways_Invoking_Twoways Test README File - - This is a sort of a stress test for bug 575. The design of the - test may not depict real world conditions, but what it gets to - the fore is a problem that we are trying to fix. - - The test is designed this way. The client makes a oneway call - to the server.The server, turns around to make a normal - invocation on the client. The client again tries to make a two - way invocation on the server as a part of the upcall. Threads - are created to stress things a bit... - - There is a svcconf file that uses the select reactor. The - run_test_svc.pl script uses that svcconf file. The test would - run fine with the select reactor. - - To run the test use the run_test.pl script: - -$ ./run_test.pl - - the script returns 0 if the test was successful. - -*/ diff --git a/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.cpp b/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.cpp deleted file mode 100644 index e33c63186f9..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "Receiver_i.h" - -ACE_RCSID(Oneways_Invoking_Twoways, Receiver_i, "$Id$") - -Receiver_i::Receiver_i (CORBA::ORB_ptr orb, - Test::Sender_ptr sender, - CORBA::ULong iter) - : orb_ (CORBA::ORB::_duplicate (orb)), - sender_ (Test::Sender::_duplicate (sender)), - iteration_ (iter), - no_calls_ (0) -{ -} - -Receiver_i::~Receiver_i (void) -{ -} - - - -CORBA::Long -Receiver_i::receive_call (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Doing a ping... \n")); - - this->sender_->ping (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - return this->no_calls_++; -} - -CORBA::Long -Receiver_i::get_call_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->iteration_; -} diff --git a/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.h b/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.h deleted file mode 100644 index a5f13e29217..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Receiver_i.h +++ /dev/null @@ -1,58 +0,0 @@ -// This may look like C, but it's really -*- C++ -*- -// =================================================================== -/** - * @file Receiver_i.h - * - * $Id$ - * - * @author Balachandran Natarajan <bala@cs.wustl.edu> - **/ -// =================================================================== - -#ifndef TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_RECEIVER_I_H -#define TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_RECEIVER_I_H -#include /**/ "ace/pre.h" - -#include "TestS.h" - -/// Implement the Test::Receiver interface -/** - * Skeleton implementation.. - */ - -class Receiver_i - : public virtual POA_Test::Receiver -{ -public: - /// Constructor - Receiver_i (CORBA::ORB_ptr orb, - Test::Sender_ptr sender, - CORBA::ULong iter); - - ///Destructor - virtual ~Receiver_i (void); - - // = The skeleton methods - virtual CORBA::Long receive_call (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Retun the number of calls that every thread would make... - virtual CORBA::Long get_call_count (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Our Orb... - CORBA::ORB_var orb_; - - /// THe sender.. - Test::Sender_var sender_; - - /// Number of invocations to be made on the sender.. - CORBA::ULong iteration_; - - /// Number of calls processed so far.. - CORBA::ULong no_calls_; -}; - -#include /**/ "ace/post.h" -#endif /*TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_RECEIVER_I_H*/ diff --git a/TAO/tests/Oneways_Invoking_Twoways/Sender_i.cpp b/TAO/tests/Oneways_Invoking_Twoways/Sender_i.cpp deleted file mode 100644 index 8ac983b0163..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Sender_i.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "Sender_i.h" - -ACE_RCSID(Oneways_Invoking_Twoways, Sender_i, "$Id$") - -Sender_i::Sender_i (CORBA::ORB_ptr orb, - CORBA::ULong no) - : orb_ (CORBA::ORB::_duplicate (orb)), - number_ (no), - active_objects_ (0) -{ -} - -Sender_i::~Sender_i (void) -{ -} - -void -Sender_i::active_objects (CORBA::Short no_threads - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER */ ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->active_objects_ = no_threads; -} - - -void -Sender_i::send_ready_message (Test::Receiver_ptr receiver - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "Received a call ...\n")); - - ACE_DEBUG ((LM_DEBUG, - "Calling the Receiver ..\n")); - - for (CORBA::ULong i = 0; - i < this->number_; - ++i) - { - receiver->receive_call (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - -} - -void -Sender_i::ping (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return; -} diff --git a/TAO/tests/Oneways_Invoking_Twoways/Sender_i.h b/TAO/tests/Oneways_Invoking_Twoways/Sender_i.h deleted file mode 100644 index 1d372a6707a..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Sender_i.h +++ /dev/null @@ -1,59 +0,0 @@ -// This may look like C, but it's really -*- C++ -*- -// =================================================================== -/** - * @file Sender_i.h - * - * $Id$ - * - * @author Balachandran Natarajan <bala@cs.wustl.edu> - **/ -// =================================================================== - -#ifndef TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_SENDER_I_H -#define TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_SENDER_I_H -#include /**/ "ace/pre.h" - -#include "TestS.h" - -/// Implement the Test::Sender interface -/** - * Implements the oneway call send_ready_message. This in turn calls - * the receiver with two way invocations.. - */ - -class Sender_i - : public virtual POA_Test::Sender -{ -public: - /// Constructor - Sender_i (CORBA::ORB_ptr orb, - CORBA::ULong no); - - ///Destructor - virtual ~Sender_i (void); - - // = The skeleton methods - virtual void active_objects (CORBA::Short ao - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void send_ready_message (Test::Receiver_ptr receiver - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void ping (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Our local ORB ptr - CORBA::ORB_ptr orb_; - - /// Number of invocations to be made on the receiver - CORBA::ULong number_; - - /// Number of active objects who are trying to connect - CORBA::Short active_objects_; -}; - -#include /**/ "ace/post.h" -#endif /*TAO_TESTS_ONEWAYS_INVOKING_TWOWAYS_SENDER_I_H*/ diff --git a/TAO/tests/Oneways_Invoking_Twoways/Server_Task.cpp b/TAO/tests/Oneways_Invoking_Twoways/Server_Task.cpp deleted file mode 100644 index db7a0b5a63a..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Server_Task.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// $Id$ -// - -#include "Server_Task.h" - -ACE_RCSID(Muxing, Server_Task, "$Id$") - -Server_Task::Server_Task (CORBA::ORB_ptr orb, - ACE_Thread_Manager *thr_mgr) - : ACE_Task_Base (thr_mgr) - , orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -int -Server_Task::svc (void) -{ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting server task\n")); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - // run the test for at most 60 seconds... - ACE_Time_Value tv (60, 0); - this->orb_->run (tv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - return -1; - } - ACE_ENDTRY; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server task finished\n")); - return 0; -} diff --git a/TAO/tests/Oneways_Invoking_Twoways/Server_Task.h b/TAO/tests/Oneways_Invoking_Twoways/Server_Task.h deleted file mode 100644 index a6ecae2217a..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Server_Task.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// $Id$ -// - -#ifndef ONEWAYS_INVOKING_TWOWAYS_SERVER_TASK_H -#define ONEWAYS_INVOKING_TWOWAYS_SERVER_TASK_H -#include /**/ "ace/pre.h" - -#include "tao/ORB.h" -#include "ace/Task.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -/// Implement a Task to run the experiments using multiple threads. -class Server_Task : public ACE_Task_Base -{ -public: - /// Constructor - Server_Task (CORBA::ORB_ptr orb, - ACE_Thread_Manager *thr_mgr); - - /// Thread entry point - int svc (void); - -private: - /// Reference to the ORB - CORBA::ORB_var orb_; -}; - -#include /**/ "ace/post.h" -#endif /* ONEWAYS_INVOKING_TWOWAYS_SERVER_TASK_H*/ diff --git a/TAO/tests/Oneways_Invoking_Twoways/Test.idl b/TAO/tests/Oneways_Invoking_Twoways/Test.idl deleted file mode 100644 index 9e23b7b2c9e..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/Test.idl +++ /dev/null @@ -1,28 +0,0 @@ -// -// $Id$ -// - -module Test -{ - interface Receiver { - - /// Receive a call and send back the number of calls received.. - long receive_call (); - - /// Get the number of calls that every thread would make... - long get_call_count (); - - }; - - interface Sender { - - /// Ping message.. - void ping (); - - /// Number of active objects trying to use this interface - oneway void active_objects (in short ao); - - /// Send a ready message - oneway void send_ready_message (in Receiver callback); - }; -}; diff --git a/TAO/tests/Oneways_Invoking_Twoways/client.cpp b/TAO/tests/Oneways_Invoking_Twoways/client.cpp deleted file mode 100644 index 9d2b4cc90e8..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/client.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// $Id$ - -#include "Receiver_i.h" -#include "Client_Task.h" -#include "Server_Task.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(Muxing, 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 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; - - // Get the sender reference.. - CORBA::Object_var tmp = - orb->string_to_object(ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Sender_var sender = - Test::Sender::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (sender.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil coordinator reference <%s>\n", - ior), - 1); - } - - Receiver_i *receiver_impl; - ACE_NEW_RETURN (receiver_impl, - Receiver_i (orb.in (), - sender.in (), - 10), - 1); - - PortableServer::ServantBase_var receiver_owner_transfer(receiver_impl); - - Test::Receiver_var receiver = - receiver_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Activate poa manager - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Client_Task client_task (sender.in (), - receiver.in (), - ACE_Thread_Manager::instance ()); - - Server_Task server_task (orb.in (), - ACE_Thread_Manager::instance ()); - - // Before creating threads we will let the sender know that we - // will have two threads that would make invocations.. - sender->active_objects ((CORBA::Short) 2 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, 2,1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - - if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, 2, 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating client task\n")); - } - - ACE_Thread_Manager::instance ()->wait (); - - ACE_DEBUG ((LM_DEBUG, - "Event Loop finished \n")); - - 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/Oneways_Invoking_Twoways/run_test.pl b/TAO/tests/Oneways_Invoking_Twoways/run_test.pl deleted file mode 100755 index 8c885c7c88b..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/run_test.pl +++ /dev/null @@ -1,50 +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; - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $iorfile"); -} -$CL1 = new PerlACE::Process ("client", " -k file://$iorfile"); - - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$CL1->Spawn (60); - - -$client1 = $CL1->WaitKill (75); - -if ($client1 != 0) { - print STDERR "ERROR: client 1 returned $client1\n"; - $status = 1; -} - -$server = $SV->TerminateWaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/Oneways_Invoking_Twoways/run_test_svc.pl b/TAO/tests/Oneways_Invoking_Twoways/run_test_svc.pl deleted file mode 100755 index 387088db924..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/run_test_svc.pl +++ /dev/null @@ -1,45 +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; - -$SV = new PerlACE::Process ("server","-ORBSvcConf svcconf -o $iorfile"); -$CL1 = new PerlACE::Process ("client", "-ORBSvcConf svcconf -k file://$iorfile"); - - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$CL1->Spawn (60); - - -$client1 = $CL1->WaitKill (75); - -if ($client1 != 0) { - print STDERR "ERROR: client 1 returned $client1\n"; - $status = 1; -} - -$server = $SV->TerminateWaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/Oneways_Invoking_Twoways/server.cpp b/TAO/tests/Oneways_Invoking_Twoways/server.cpp deleted file mode 100644 index 2c3131b2cda..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/server.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// $Id$ - -#include "Sender_i.h" -#include "Server_Task.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(Oneways_Invoking_Twoways, 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; - - Sender_i *sender_impl; - ACE_NEW_RETURN (sender_impl, - Sender_i (orb.in (), - 10), - 1); - PortableServer::ServantBase_var receiver_owner_transfer(sender_impl); - - Test::Sender_var sender = - sender_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (sender.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; - - Server_Task server_task (orb.in (), - ACE_Thread_Manager::instance ()); - - if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, 4, 1) == -1) - { - ACE_ERROR ((LM_ERROR, "Error activating server task\n")); - } - ACE_Thread_Manager::instance ()->wait (); - - ACE_DEBUG ((LM_DEBUG, "Now terminating test\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/Oneways_Invoking_Twoways/svcconf b/TAO/tests/Oneways_Invoking_Twoways/svcconf deleted file mode 100644 index 1987d3d81c6..00000000000 --- a/TAO/tests/Oneways_Invoking_Twoways/svcconf +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ -# - -# This configuration file is used to use only the default TAO -# strategies - -dynamic Advanced_Resource_Factory Service_Object * TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_mt" - - |