diff options
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic')
9 files changed, 0 insertions, 391 deletions
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/CSD_TP_Test_Dynamic.mpc b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/CSD_TP_Test_Dynamic.mpc deleted file mode 100644 index 9da402191ea..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/CSD_TP_Test_Dynamic.mpc +++ /dev/null @@ -1,21 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver { - idlflags += -Sa -St - Source_Files { - Hello.cpp - server.cpp - } -} - -project(*Client): taoclient { - after += *Server - Source_Files { - TestC.cpp - client.cpp - } -} - - - diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.cpp deleted file mode 100644 index 70af3ea8a11..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// $Id$ -// -#include "Hello.h" - -ACE_RCSID(Hello, Hello, "$Id$") - -Hello::Hello (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ -} - -char * -Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup ("Hello there!"); -} - -void -Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.h b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.h deleted file mode 100644 index 1a404058944..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Hello.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// $Id$ -// - -#ifndef HELLO_H -#define HELLO_H -#include /**/ "ace/pre.h" - -#include "TestS.h" - -/// Implement the Test::Hello interface -class Hello - : public virtual POA_Test::Hello -{ -public: - /// Constructor - Hello (CORBA::ORB_ptr orb); - - // = The skeleton methods - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual void shutdown (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/CSD_Strategy_Tests/TP_Test_Dynamic/README b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/README deleted file mode 100644 index a4e3fbcdc2a..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/README +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ -=========================================================================== -Directory: $TAO_ROOT/tests/CSD_Strategy_Tests/TP_Test_5 - -=========================================================================== - -=========================================================================== -Directory: $TAO_ROOT/tests/CSD_Strategy_Tests/TP_Test_Static - -=========================================================================== -This test shows the ThreadPool strategy can automatically apply to the poa -via service configuration file dynamic directive. - -This simple test is a copy of $TAO_ROOT/tests/Hello test. The difference is -this test contains the svc.conf file to configure the CSD strategies and the -poas that apply the CSD strategy. - -A new TP_Strategy object is created during the initialization of the -TP_Strategy_Factory service object and it will be automatically applied to -a poa. - -The service configuration file specifies the number of threads that -the ThreadPool strategy have and also specify which poa the strategy should -apply to. We can specify multiple ThreadPool strategies and the poas via -CSDtp -option. - -e.g -dynamic TAO_CSD_TP_Strategy_Factory Service_Object * -TAO_CSD_ThreadPool:_make_TAO_CSD_TP_Strategy_Factory() "-CSDtp RootPOA:2 -CSDtp childpoa:4" - - -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/CSD_Strategy_Tests/TP_Test_Dynamic/Test.idl b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Test.idl deleted file mode 100644 index 3c0976e106d..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/Test.idl +++ /dev/null @@ -1,20 +0,0 @@ -// -// $Id$ -// - -/// Put the interfaces in a module, to avoid global namespace pollution -module Test -{ - /// A very simple interface - interface Hello - { - /// Return a simple string - string get_string (); - - /// A method to shutdown the ORB - /** - * This method is used to simplify the test shutdown process - */ - oneway void shutdown (); - }; -}; diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/client.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/client.cpp deleted file mode 100644 index f85722246b5..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/client.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// $Id$ - -#include "TestC.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(Hello, 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; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var tmp = - orb->string_to_object(ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Test::Hello_var hello = - Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (hello.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil Test::Hello reference <%s>\n", - ior), - 1); - } - - CORBA::String_var the_string = - hello->get_string (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%s>\n", - the_string.in ())); - - hello->shutdown (ACE_ENV_SINGLE_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/CSD_Strategy_Tests/TP_Test_Dynamic/run_test.pl b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/run_test.pl deleted file mode 100755 index de69f709455..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/run_test.pl +++ /dev/null @@ -1,49 +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 ("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"); -} -$CL = new PerlACE::Process ("client", " -k file://$iorfile"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$client = $CL->SpawnWaitKill (300); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (10); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/server.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/server.cpp deleted file mode 100644 index bd2b023e2b7..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/server.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// $Id$ - -#include "Hello.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/Thread_Manager.h" - -ACE_RCSID (Hello, - 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; - - 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; - - Hello *hello_impl; - ACE_NEW_RETURN (hello_impl, - Hello (orb.in ()), - 1); - PortableServer::ServantBase_var owner_transfer(hello_impl); - - Test::Hello_var hello = - hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Output the IOR to the <ior_output_file> - 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, "(%P|%t) server - 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; - - // Wait for all CSD task threads exit. - ACE_Thread_Manager::instance ()->wait (); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught:"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/svc.conf b/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/svc.conf deleted file mode 100644 index e59fb4ac94c..00000000000 --- a/TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/svc.conf +++ /dev/null @@ -1 +0,0 @@ -dynamic TAO_CSD_TP_Strategy_Factory Service_Object * TAO_CSD_ThreadPool:_make_TAO_CSD_TP_Strategy_Factory() "-CSDtp RootPOA:2" |