summaryrefslogtreecommitdiff
path: root/TAO/tests/Server_Connection_Purging
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:11 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:11 +0000
commit6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch)
treeda50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/tests/Server_Connection_Purging
parent0e555b9150d38e3b3473ba325b56db2642e6352b (diff)
downloadATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/tests/Server_Connection_Purging')
-rw-r--r--TAO/tests/Server_Connection_Purging/.cvsignore2
-rw-r--r--TAO/tests/Server_Connection_Purging/Server_Connection_Purging.mpc18
-rw-r--r--TAO/tests/Server_Connection_Purging/Test.idl10
-rw-r--r--TAO/tests/Server_Connection_Purging/Test_i.cpp12
-rw-r--r--TAO/tests/Server_Connection_Purging/Test_i.h24
-rw-r--r--TAO/tests/Server_Connection_Purging/client.cpp137
-rwxr-xr-xTAO/tests/Server_Connection_Purging/run_test.pl45
-rw-r--r--TAO/tests/Server_Connection_Purging/server.cpp110
-rw-r--r--TAO/tests/Server_Connection_Purging/svc.conf3
9 files changed, 0 insertions, 361 deletions
diff --git a/TAO/tests/Server_Connection_Purging/.cvsignore b/TAO/tests/Server_Connection_Purging/.cvsignore
deleted file mode 100644
index f2ad85300eb..00000000000
--- a/TAO/tests/Server_Connection_Purging/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-client
-server
diff --git a/TAO/tests/Server_Connection_Purging/Server_Connection_Purging.mpc b/TAO/tests/Server_Connection_Purging/Server_Connection_Purging.mpc
deleted file mode 100644
index a50eda03b14..00000000000
--- a/TAO/tests/Server_Connection_Purging/Server_Connection_Purging.mpc
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project(*Server): taoserver {
- Source_Files {
- Test_i.cpp
- server.cpp
- }
-}
-
-project(*Client): taoclient, anytypecode {
- after += *Server
- Source_Files {
- TestC.cpp
- client.cpp
- }
-}
-
diff --git a/TAO/tests/Server_Connection_Purging/Test.idl b/TAO/tests/Server_Connection_Purging/Test.idl
deleted file mode 100644
index ca9b3e126c0..00000000000
--- a/TAO/tests/Server_Connection_Purging/Test.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// $Id$
-
-interface test
-{
- /*
- * A simple remote operation..
- */
- void send_stuff(in string foo);
-
-};
diff --git a/TAO/tests/Server_Connection_Purging/Test_i.cpp b/TAO/tests/Server_Connection_Purging/Test_i.cpp
deleted file mode 100644
index da045e2503f..00000000000
--- a/TAO/tests/Server_Connection_Purging/Test_i.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// $Id$
-//
-#include "Test_i.h"
-
-void
-test_i::send_stuff (const char* string
- ACE_ENV_ARG_DECL_NOT_USED)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - %s\n", string));
-}
diff --git a/TAO/tests/Server_Connection_Purging/Test_i.h b/TAO/tests/Server_Connection_Purging/Test_i.h
deleted file mode 100644
index 0f6e923322d..00000000000
--- a/TAO/tests/Server_Connection_Purging/Test_i.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// $Id$
-//
-
-#ifndef TEST_I_H
-#define TEST_I_H
-#include /**/ "ace/pre.h"
-
-#include "TestS.h"
-
-class test_i
- : public virtual POA_test
-{
-public:
- // = The skeleton methods
- virtual void send_stuff (const char* string
- ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((CORBA::SystemException));
-
-private:
-};
-
-#include /**/ "ace/post.h"
-#endif /* TEST_I_H */
diff --git a/TAO/tests/Server_Connection_Purging/client.cpp b/TAO/tests/Server_Connection_Purging/client.cpp
deleted file mode 100644
index 80d03ad751b..00000000000
--- a/TAO/tests/Server_Connection_Purging/client.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-// $Id$
-#include "ace/Get_Opt.h"
-#include "ace/Log_Msg.h"
-#include "ace/SOCK_Connector.h"
-#include "ace/TP_Reactor.h"
-#include "ace/Reactor.h"
-
-const char *host = "localhost";
-static int port = 10008;
-const int iter = 80;
-int purged_handles = 0;
-
-int
-parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, "h:p:");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'h':
- host = get_opts.opt_arg ();
- break;
- case 'p':
- port = ACE_OS::atoi (get_opts.opt_arg ());
- break;
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "-h <host> "
- "-p <port>"
- "-i <iterations>"
- "\n",
- argv [0]),
- -1);
- }
-
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-class Purging_Handler : public ACE_Event_Handler
-{
-public:
- virtual int handle_input (ACE_HANDLE h);
- virtual int handle_close (ACE_HANDLE h,
- ACE_Reactor_Mask m);
-};
-
-int
-Purging_Handler::handle_input (ACE_HANDLE )
-{
- return -1;
-}
-
-int
-Purging_Handler::handle_close (ACE_HANDLE h,
- ACE_Reactor_Mask )
-{
- if (purged_handles % 10 == 0)
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) purging handle [%d] \n",
- h));
-
- ++purged_handles;
-
- return 0;
-}
-
-int
-main (int argc, char *argv[])
-{
- if (parse_args (argc, argv) == -1)
- return -1;
-
- ACE_Select_Reactor sr;
-
- ACE_Reactor reac (&sr);
-
- ACE_Reactor::instance (&reac);
-
- ACE_SOCK_Stream stream[iter];
-
- ACE_SOCK_Connector connector[iter];
-
- Purging_Handler ph[iter];
-
- ACE_INET_Addr addr (port,
- host);
-
-
- ACE_Reactor *singleton =
- ACE_Reactor::instance ();
-
- for (int i = 0; i != iter; ++i)
- {
- if (connector[i].connect (stream[i],
- addr) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Error while connecting: %p\n",
- "client"),
- -1);
-
- if (stream[i].get_handle () == ACE_INVALID_HANDLE)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Got invalid handles after connecting the [%d] time\n",i),
- -1);
- if (singleton->register_handler (stream[i].get_handle (),
- &ph[i],
- ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Registration failed \n"),
- -1);
-
- ACE_Time_Value tv (1);
-
- while (singleton->handle_events (&tv) >= 1);
- }
-
- // Remove the handlers to avoid the possibility of the reactor
- // using any of them after they leave the scope (those that haven't
- // been closed and removed already, that is).
- for (int j = 0; j != iter; ++j)
- {
- singleton->remove_handler (stream[j].get_handle (),
- ACE_Event_Handler::READ_MASK);
- }
-
- if ((iter - purged_handles) > 20)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Purging hasnt worked at all \n"),
- -1);
-
- return 0;
-}
diff --git a/TAO/tests/Server_Connection_Purging/run_test.pl b/TAO/tests/Server_Connection_Purging/run_test.pl
deleted file mode 100755
index 4220bc5fc4f..00000000000
--- a/TAO/tests/Server_Connection_Purging/run_test.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");
-$orbport = 10000 + PerlACE::uniqueid ();
-unlink $iorfile;
-$status = 0;
-
-$SV = new PerlACE::Process ("server", "-ORBEndpoint iiop://localhost:$orbport");
-$CL = new PerlACE::Process ("client", "-h localhost -p $orbport");
-
-print STDERR $CL->CommandLine(), "\n" ;
-$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 (120);
-
-if ($server != 0) {
- print STDERR "ERROR: server returned $server\n";
- $status = 1;
-}
-
-unlink $iorfile;
-
-exit $status;
diff --git a/TAO/tests/Server_Connection_Purging/server.cpp b/TAO/tests/Server_Connection_Purging/server.cpp
deleted file mode 100644
index 52c7b5e6395..00000000000
--- a/TAO/tests/Server_Connection_Purging/server.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-// $Id$
-
-#include "Test_i.h"
-#include "ace/Get_Opt.h"
-#include "ace/OS_NS_stdio.h"
-
-const char *ior_output_file = "server.ior";
-
-int
-parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, "");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "\n",
- argv [0]),
- -1);
- }
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-int
-main (int argc, char *argv[])
-{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- ACE_TRY
- {
- 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;
-
- test_i *test_impl;
- ACE_NEW_RETURN (test_impl,
- test_i (),
- 1);
- PortableServer::ServantBase_var owner_transfer(test_impl);
-
- test_var test =
- test_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::String_var ior =
- orb->object_to_string (test.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;
-
- ACE_Time_Value tv (120, 0);
-
- orb->run (&tv ACE_ENV_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;
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Exception caught:");
- return 1;
- }
- ACE_ENDTRY;
-
- return 0;
-}
diff --git a/TAO/tests/Server_Connection_Purging/svc.conf b/TAO/tests/Server_Connection_Purging/svc.conf
deleted file mode 100644
index e20a98842a7..00000000000
--- a/TAO/tests/Server_Connection_Purging/svc.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id$
-#
-static Resource_Factory "-ORBConnectionPurgingStrategy lru -ORBConnectionCacheMax 20 -ORBConnectionCachePurgePercentage 30"