summaryrefslogtreecommitdiff
path: root/TAO/tests/Connection_Timeout
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/Connection_Timeout
parent0e555b9150d38e3b3473ba325b56db2642e6352b (diff)
downloadATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/tests/Connection_Timeout')
-rw-r--r--TAO/tests/Connection_Timeout/.cvsignore1
-rw-r--r--TAO/tests/Connection_Timeout/Connection_Timeout.mpc12
-rw-r--r--TAO/tests/Connection_Timeout/README15
-rw-r--r--TAO/tests/Connection_Timeout/Test.idl20
-rw-r--r--TAO/tests/Connection_Timeout/client.cpp186
-rwxr-xr-xTAO/tests/Connection_Timeout/run_test.pl27
6 files changed, 0 insertions, 261 deletions
diff --git a/TAO/tests/Connection_Timeout/.cvsignore b/TAO/tests/Connection_Timeout/.cvsignore
deleted file mode 100644
index b051c6c57fa..00000000000
--- a/TAO/tests/Connection_Timeout/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-client
diff --git a/TAO/tests/Connection_Timeout/Connection_Timeout.mpc b/TAO/tests/Connection_Timeout/Connection_Timeout.mpc
deleted file mode 100644
index 9d58f4e8439..00000000000
--- a/TAO/tests/Connection_Timeout/Connection_Timeout.mpc
+++ /dev/null
@@ -1,12 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project(*client): taoserver, messaging {
- exename = client
- avoids += ace_for_tao
- Source_Files {
- TestC.cpp
- client.cpp
- }
-}
-
diff --git a/TAO/tests/Connection_Timeout/README b/TAO/tests/Connection_Timeout/README
deleted file mode 100644
index 05a7ee90273..00000000000
--- a/TAO/tests/Connection_Timeout/README
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
-
-@page Connection_Timeout Test README File
-
- The simplest possible test for the proprietary
-Connection_Timeouts. This test sets the connection timeouts through a
-policy. The client tries to connect to an non-existent server. The
-timeout for the connection is controlled by the value supplied by that
-policy.
-
-$ ./run_test.pl
-
- the script returns 0 if the test was successful.
-
-*/
diff --git a/TAO/tests/Connection_Timeout/Test.idl b/TAO/tests/Connection_Timeout/Test.idl
deleted file mode 100644
index 3c0976e106d..00000000000
--- a/TAO/tests/Connection_Timeout/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/Connection_Timeout/client.cpp b/TAO/tests/Connection_Timeout/client.cpp
deleted file mode 100644
index 5a8556e908a..00000000000
--- a/TAO/tests/Connection_Timeout/client.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-// $Id$
-
-#include "TestC.h"
-#include "ace/Get_Opt.h"
-#include "ace/Profile_Timer.h"
-#include "tao/Messaging/Messaging.h"
-#include "tao/AnyTypeCode/Any.h"
-
-ACE_RCSID(Connection_Timeout, client, "$Id$")
-
-const char *ior =
- "corbaloc:iiop:192.3.47/10007/RandomObject";
-
-ACE_Profile_Timer profile_timer;
-TimeBase::TimeT timeout_period = 1000000;
-
-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
-test_timeout (CORBA::Object_ptr object ACE_ENV_ARG_DECL)
-{
- // Start the timer
- profile_timer.start ();
-
- ACE_TRY
- {
- // First connection happens here..
- Test::Hello_var hello =
- Test::Hello::_narrow(object 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;
- }
- ACE_CATCHANY
- {
- // Stop the timer
- profile_timer.stop ();
-
- // Get the elampsed time
- ACE_Profile_Timer::ACE_Elapsed_Time el;
- profile_timer.elapsed_time (el);
-
- // Give a 30% error margin for handling exceptions etc. It is a
- // high margin, though!. But the timeout is too small and wider
- // range would help.
-#if defined (ACE_LACKS_FLOATING_POINT) && (ACE_LACKS_FLOATING_POINT != 0)
- // The elapsed time is in usecs
- if (el.real_time > 200000)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) ERROR: Too long to timeout: %u \n",
- el.real_time),
- 1);
- }
- else
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Success, timeout: %u \n",
- el.real_time));
-#else
- // The elapsed time is in secs
- if (el.real_time > 0.200)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) ERROR: Too long to timeout: %F \n",
- el.real_time),
- 1);
- }
- else
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Success, timeout: %F \n",
- el.real_time));
-
-#endif /* ACE_LACKS_FLOATING_POINT == 1*/
- }
- ACE_ENDTRY;
-
- return 0;
-}
-
-int
-main (int argc, char *argv[])
-{
- int retval = 1;
-
- 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;
-
- CORBA::Object_var object =
- orb->resolve_initial_references ("PolicyCurrent"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::PolicyCurrent_var policy_current =
- CORBA::PolicyCurrent::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::Any timeout_as_any;
- timeout_as_any <<= timeout_period;
-
- CORBA::PolicyList policy_list (1);
- policy_list.length (1);
- policy_list[0] =
- orb->create_policy (TAO::CONNECTION_TIMEOUT_POLICY_TYPE,
- timeout_as_any
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- policy_current->set_policy_overrides (policy_list,
- CORBA::ADD_OVERRIDE
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- for (CORBA::ULong l = 0;
- l != policy_list.length ();
- ++l)
- {
- policy_list[l]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
-
- retval = test_timeout (tmp.in () 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 retval;
-}
diff --git a/TAO/tests/Connection_Timeout/run_test.pl b/TAO/tests/Connection_Timeout/run_test.pl
deleted file mode 100755
index 8a5b5817f0f..00000000000
--- a/TAO/tests/Connection_Timeout/run_test.pl
+++ /dev/null
@@ -1,27 +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;
-
-if (PerlACE::is_vxworks_test()) {
- $CL = new PerlACE::ProcessVX ("client", "");
-}
-else {
- $CL = new PerlACE::Process ("client", "");
-}
-
-$client = $CL->SpawnWaitKill (25);
-
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
- $status = 1;
-}
-
-exit $status;