summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Redundant_Naming
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Redundant_Naming')
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/Makefile.am84
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/README89
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc7
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/client.cpp540
-rwxr-xr-xTAO/orbsvcs/tests/Redundant_Naming/run_test.pl118
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/test_object.idl11
6 files changed, 0 insertions, 849 deletions
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am b/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am
deleted file mode 100644
index 7ff62dd7eec..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am
+++ /dev/null
@@ -1,84 +0,0 @@
-## Process this file with automake to create Makefile.in
-##
-## $Id$
-##
-## This file was generated by MPC. Any changes made directly to
-## this file will be lost the next time it is generated.
-##
-## MPC Command:
-## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
-
-ACE_BUILDDIR = $(top_builddir)/..
-ACE_ROOT = $(top_srcdir)/..
-TAO_BUILDDIR = $(top_builddir)
-TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
-TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
-TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
-TAO_ROOT = $(top_srcdir)
-
-## Makefile.Redundant_Naming_Client.am
-
-BUILT_SOURCES = \
- test_objectC.cpp \
- test_objectC.h \
- test_objectC.inl \
- test_objectS.cpp \
- test_objectS.h \
- test_objectS.inl \
- test_objectS_T.cpp \
- test_objectS_T.h \
- test_objectS_T.inl
-
-CLEANFILES = \
- test_object-stamp \
- test_objectC.cpp \
- test_objectC.h \
- test_objectC.inl \
- test_objectS.cpp \
- test_objectS.h \
- test_objectS.inl \
- test_objectS_T.cpp \
- test_objectS_T.h \
- test_objectS_T.inl
-
-test_objectC.cpp test_objectC.h test_objectC.inl test_objectS.cpp test_objectS.h test_objectS.inl test_objectS_T.cpp test_objectS_T.h test_objectS_T.inl: test_object-stamp
-
-test_object-stamp: $(srcdir)/test_object.idl $(TAO_IDL_DEP)
- $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/test_object.idl
- @touch $@
-
-noinst_PROGRAMS = client
-
-client_CPPFLAGS = \
- -I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -I$(TAO_ROOT) \
- -I$(TAO_BUILDDIR) \
- -I$(TAO_ROOT)/orbsvcs \
- -I$(TAO_BUILDDIR)/orbsvcs
-
-client_SOURCES = \
- client.cpp \
- test_objectC.cpp \
- test_objectS.cpp \
- test_objectC.h \
- test_objectC.inl \
- test_objectS.h \
- test_objectS.inl \
- test_objectS_T.h \
- test_objectS_T.inl
-
-client_LDADD = \
- $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
- $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
- $(TAO_BUILDDIR)/tao/libTAO.la \
- $(ACE_BUILDDIR)/ace/libACE.la
-
-## Clean up template repositories, etc.
-clean-local:
- -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
- -rm -f gcctemp.c gcctemp so_locations *.ics
- -rm -rf cxx_repository ptrepository ti_files
- -rm -rf templateregistry ir.out
- -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/README b/TAO/orbsvcs/tests/Redundant_Naming/README
deleted file mode 100644
index 85ad95373a1..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/README
+++ /dev/null
@@ -1,89 +0,0 @@
-// $Id$
-
-This application tests the redundancy feature of TAO's Naming Service.
-
-To run all tests automatically -
- execute Perl script run_test.pl
-
-To run tests manually -
- start the Naming Service (see
- TAO/orbsvcs/Naming_Service/README for valid options),
- then run ./client the optional options are shown below.
-
-NOTE: if running tests manually, the NameService directory must exist
-before starting the Naming Service and this directory must be cleaned out
-manually after stopping the Naming Service.
-
-The following options exist:
----------------------------
--b Breath of Context tree, default is 4, minimum is 2
-
--d Depth of Context tree, default is 4, minimum is 2
-
--o Breath of Object tree, default is 4, minimum is 2
-
--p ior for Naming Server 1
-
--q ior for Naming Server 2
-
-The client creates two context trees, one of breath b and one of depth d,
-and another node with o objects. It then removes the contexts b-1, d and
-the object o-1. All these are done using the first name server. The
-client then accesses contexts b, b-1, d, d-1, and objects o, o-1 looking
-for the appropriate found/not-found returns using the second name server.
-
- Example (on a Unix system):
- $ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o nsior1\
- -r NameService -ORBEndPoint iiop://localhost:10001 &
- $ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o nsior2\
- -r NameService -ORBEndPoint iiop://localhost:10002 &
- $ ./client -p file://nsior1 -q file://nsior2
-
- where the steps correspond to 1&2)starting the Naming Service
- in redundant mode, 3) running the client.
- Don't forget to kill the name servers after you are done.
-
-
-
-EXPECTED OUTPUT FOR THIS TEST
-*****************************
-
-Redundancy test OK.
-
-The default test runs in a few seconds. (4 on my 500MHz Linux)
-
-
-*****************************
-Restrictions, performance notes, and future
-
-While the redundant naming service is only fully function on Tru64
-clusters, it can be used on any two systems that share a file system
-with locking. However, this test puts the two naming servers on the
-local system doesn't test the locking (probablistic to do, at best)
-and runs the client on the same system. This will specifically test
-only the functionality of the redundancy. The extra parameters can
-be used manually to probe performance, as illustrated below.
-
-Using the b,d, and o options, I determined:
-
-As the number of objects in a single context increases, performance
-decreases. This is because of I/O limits, each addition of a new
-object reference adds about 1/2 KB and rewrites the whole file. I
-observed 9746 objects added to a single context in 100 minutes and
-noted that the disk light was on solid.
-
-As the number of contexts increase, the CPU became the limiting factor.
-2000 contexts under the root context took 20 minutes.
-
-As the depth of the contexts increases, the limit becomes the file
-system. As the number of contexts, equivalent to files, passed 12000,
-the system slowed to a crawl. The first 12000 took about 5 minutes, the
-next 15 minutes only got another 2000. Process CPU was very low, less
-than 5 %. Disk activity was high, but not contiguous, lot of head motion
-not seen in the single context above.
-
-Future enhancement of this service should address these performance
-limits. One obvious enhancement is to use IPC between the redundant
-Naming Servers to reduce the dependence on the disk, then a lazy update
-of the disk can be done. Would take a lot of code, but doable.
-
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc b/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc
deleted file mode 100644
index bbeedbc28fb..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc
+++ /dev/null
@@ -1,7 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project(*Client) : namingexe, portableserver {
- exename = client
-}
-
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/client.cpp b/TAO/orbsvcs/tests/Redundant_Naming/client.cpp
deleted file mode 100644
index 9e767cc7dad..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/client.cpp
+++ /dev/null
@@ -1,540 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO/orbsvcs/Naming_Service/
-//
-// = FILENAME
-// client.cpp
-//
-// = DESCRIPTION
-// This class implements a CORBA client for a redundant CosNaming
-// Service using stubs generated by the TAO ORB IDL compiler.
-//
-// = AUTHORS
-// Rich Seibel <seibel_r@ociweb.com>
-// ============================================================================
-
-#include "test_objectS.h"
-#include "orbsvcs/CosNamingC.h"
-#include "orbsvcs/Naming/Naming_Server.h"
-#include "tao/debug.h"
-#include "ace/Get_Opt.h"
-#include "ace/OS_NS_stdio.h"
-
-ACE_RCSID (Simple_Naming,
- client,
- "$Id$")
-
-#if defined (_MSC_VER)
-# pragma warning (disable : 4250)
-#endif /* _MSC_VER */
-
-class My_Test_Object :
- public virtual POA_Test_Object
-{
-public:
- // = Initialization and termination methods.
- My_Test_Object (CORBA::Short id = 0);
- // Constructor.
-
- ~My_Test_Object (void);
- // Destructor.
-
- // = Interface implementation accessor methods.
-
- void id (CORBA::Short id ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((CORBA::SystemException));
- // Sets id.
-
- CORBA::Short id (ACE_ENV_SINGLE_ARG_DECL)
- ACE_THROW_SPEC ((CORBA::SystemException));
- // Gets id.
-
-private:
- short id_;
-};
-
-My_Test_Object::My_Test_Object (CORBA::Short id)
- : id_ (id)
-{
-}
-
-My_Test_Object::~My_Test_Object (void)
-{
-}
-
-CORBA::Short
-My_Test_Object::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- return id_;
-}
-
-void
-My_Test_Object::id (CORBA::Short id ACE_ENV_ARG_DECL_NOT_USED)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- id_ = id;
-}
-
-
-// This function runs the test.
-
-int
-main (int argc, ACE_TCHAR **argv)
-{
- int c_breath = 4;
- int c_depth = 4;
- int o_breath = 4;
- ACE_TCHAR *ns1ref = 0;
- ACE_TCHAR *ns2ref = 0;
-
- ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("b:d:o:p:q:"));
- int c;
- int i;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'b':
- i = ACE_OS::atoi(get_opts.opt_arg ());
- if (i<2)
- {
- ACE_ERROR((LM_ERROR,
- ACE_TEXT ("Invalid breath, must be 2 or more\n")));
- exit(1);
- }
- c_breath = i;
- break;
- case 'd':
- i = ACE_OS::atoi(get_opts.opt_arg ());
- if (i<2)
- {
- ACE_ERROR((LM_ERROR,
- ACE_TEXT ("Invalid depth, must be 2 or more\n")));
- exit(1);
- }
- c_depth = i;
- break;
- case 'o':
- i = ACE_OS::atoi(get_opts.opt_arg ());
- if (i<2)
- {
- ACE_ERROR((LM_ERROR,
- ACE_TEXT ("Invalid breath, must be 2 or more\n")));
- exit(1);
- }
- o_breath = i;
- break;
- case 'p':
- ns1ref = get_opts.opt_arg ();
- break;
- case 'q':
- ns2ref = get_opts.opt_arg ();
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Argument %c \n usage: %s")
- ACE_TEXT (" [-b <breath of context tree>]")
- ACE_TEXT (" [-d <depth of context tree>]")
- ACE_TEXT (" [-o <breath of object tree>]")
- ACE_TEXT (" -p <ior of first name server>")
- ACE_TEXT (" -q <ior of second name server>")
- ACE_TEXT ("\n")),
- -1);
- }
-
- CosNaming::NamingContext_var root_context_1;
- CosNaming::NamingContext_var root_context_2;
-
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY_EX(bl_a)
- {
- // Initialize orb
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, 0 ACE_ENV_ARG_PARAMETER);
-
- // ior's are specified for the name servers through a commandline
- // option or a file.
-
- // Resolve the first name server
-
- CORBA::Object_var ns1obj = orb->string_to_object (
- ACE_TEXT_ALWAYS_CHAR (ns1ref) ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_a);
-
- if (CORBA::is_nil (ns1obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("invalid ior <%s>\n"),
- ns1ref),
- -1);
- root_context_1 = CosNaming::NamingContext::_narrow (ns1obj.in ()
- ACE_ENV_ARG_PARAMETER);
-
- ACE_TRY_CHECK_EX(bl_a);
-
- // Resolve the second name server
-
- CORBA::Object_var ns2obj = orb->string_to_object (
- ACE_TEXT_ALWAYS_CHAR (ns2ref) ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_a);
-
- if (CORBA::is_nil (ns2obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("invalid ior <%s>\n"),
- ns2ref),
- -1);
- root_context_2 = CosNaming::NamingContext::_narrow (ns2obj.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_a);
-
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to resolve name servers"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- // Create a bunch of objects in one context
- // Note: strings to the naming service must be char, not wchar
- ACE_TRY_EX(bl_b)
- {
- // Bind one context level under root.
- CosNaming::Name level1;
- level1.length (1);
- level1[0].id = CORBA::string_dup ("level1_context");
- CosNaming::NamingContext_var level1_context;
- level1_context = root_context_1->bind_new_context (level1
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_b);
- for (i=0; i<o_breath; i++)
- {
- // Instantiate a dummy object and bind it under the new context.
- My_Test_Object *impl1 = new My_Test_Object (i+1);
- Test_Object_var obj1 = impl1->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_b);
- impl1->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_b);
-
- CosNaming::Name obj_name;
- obj_name.length (1);
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "obj_%d", i);
- obj_name[0].id = CORBA::string_dup (wide_name);
- level1_context->bind (obj_name, obj1.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_b);
- }
-
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to create a lot of objects"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- // Create a deep context tree
- ACE_TRY_EX(bl_c)
- {
- CosNaming::NamingContext_var next_context = root_context_1;
- for (i=0; i<c_depth; i++)
- {
- // Bind level1 context under root.
- CosNaming::Name deep;
- deep.length (1);
- char deep_name[16];
- ACE_OS::sprintf(deep_name, "deep_%d", i);
- deep[0].id = CORBA::string_dup (deep_name);
- CosNaming::NamingContext_var deep_context;
- deep_context = next_context->bind_new_context (deep
- ACE_ENV_ARG_PARAMETER);
- next_context = deep_context;
- ACE_TRY_CHECK_EX(bl_c);
- }
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to create deep context"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- // Create a wide context tree
- ACE_TRY_EX(bl_d)
- {
- for (i=0; i<c_breath; i++)
- {
- // Bind all level of context under root.
- CosNaming::Name wide;
- wide.length (1);
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "wide_%d", i);
- wide[0].id = CORBA::string_dup (wide_name);
- CosNaming::NamingContext_var wide_context;
- wide_context = root_context_1->bind_new_context (wide
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_d);
- }
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to create wide context"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- // Delete three selected things, one from each tree
- ACE_TRY_EX(bl_e)
- {
- // Remove the second to last object from the Naming Context
- CosNaming::Name wide1;
- wide1.length (2);
- wide1[0].id = CORBA::string_dup ("level1_context");
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "obj_%d", o_breath-2);
- wide1[1].id = CORBA::string_dup (wide_name);
- root_context_1->unbind (wide1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
-
- // Remove the second to last context from the wide root Naming Context
- CosNaming::Name wide2;
- wide2.length (1);
- ACE_OS::sprintf(wide_name, "wide_%d", c_breath-2);
- wide2[0].id = CORBA::string_dup (wide_name);
- CORBA::Object_var result_obj_ref = root_context_1->resolve (wide2
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- CosNaming::NamingContext_var result_object =
- CosNaming::NamingContext::_narrow (result_obj_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- if (CORBA::is_nil (result_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving wide context ")
- ACE_TEXT ("- nil object ref.\n")),
- -1);
- result_object->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- root_context_1->unbind (wide2 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
-
- // Remove the last context from the deep Naming Context
- CosNaming::Name deep;
- deep.length (c_depth);
- char deep_name[16];
- for (i=0; i<c_depth; i++)
- {
- ACE_OS::sprintf(deep_name, "deep_%d", i);
- deep[i].id = CORBA::string_dup (deep_name);
- }
- result_obj_ref = root_context_1->resolve (deep ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- result_object =
- CosNaming::NamingContext::_narrow (result_obj_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- if (CORBA::is_nil (result_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving deep context ")
- ACE_TEXT ("- nil object ref.\n")),
- -1);
- result_object->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
- root_context_1->unbind (deep ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_e);
-
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to delete objects"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- // Now use the other name server to access 3 objects next to the
- // deleted objects and the 3 deleted objects
- ACE_TRY_EX(bl_f)
- {
- // Access the last object from the Naming Context
- CosNaming::Name wide;
- wide.length (2);
- wide[0].id = CORBA::string_dup ("level1_context");
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "obj_%d", o_breath-1);
- wide[1].id = CORBA::string_dup (wide_name);
- CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_f);
- Test_Object_var result_object = Test_Object::_narrow (result_obj_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_f);
- if (CORBA::is_nil (result_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving object from ")
- ACE_TEXT ("redundant server - nil object ref.\n")),
- -1);
- ACE_TRY_CHECK_EX(bl_f);
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to resolve object from redundant server"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- ACE_TRY_EX(bl_g)
- {
- // Access the deleted second to last object from the Naming Context
- CosNaming::Name wide;
- wide.length (2);
- wide[0].id = CORBA::string_dup ("level1_context");
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "obj_%d", o_breath-2);
- wide[1].id = CORBA::string_dup (wide_name);
- CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_g);
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving object from ")
- ACE_TEXT ("redundant server - deleted object found.\n")),
- -1);
- }
- ACE_CATCHANY
- {
- //expect exception since the context was deleted
- }
- ACE_ENDTRY;
-
- ACE_TRY_EX(bl_h)
- {
- // Access the last context from the wide Naming Context
- CosNaming::Name wide;
- wide.length (1);
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "wide_%d", c_breath-1);
- wide[0].id = CORBA::string_dup (wide_name);
- CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_h);
- CosNaming::NamingContext_var result_object =
- CosNaming::NamingContext::_narrow (result_obj_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_h);
- if (CORBA::is_nil (result_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving wide context from ")
- ACE_TEXT ("redundant server - nil object ref.\n")),
- -1);
- ACE_TRY_CHECK_EX(bl_h);
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to resolve wide context from redundant server"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- ACE_TRY_EX(bl_i)
- {
- // Access the deleted second to last object from the Naming Context
- CosNaming::Name wide;
- wide.length (2);
- char wide_name[16];
- ACE_OS::sprintf(wide_name, "wide_%d", c_breath-2);
- wide[0].id = CORBA::string_dup (wide_name);
- CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_i);
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving wide context from ")
- ACE_TEXT ("redundant server - deleted object found.\n")),
- -1);
- }
- ACE_CATCHANY
- {
- //expect exception since the context was deleted
- }
- ACE_ENDTRY;
-
- ACE_TRY_EX(bl_j)
- {
- // Access the deleted last context from the deep Naming Context
- CosNaming::Name deep;
- deep.length (c_depth);
- char deep_name[16];
- for (i=0; i<c_depth; i++)
- {
- ACE_OS::sprintf(deep_name, "deep_%d", i);
- deep[i].id = CORBA::string_dup (deep_name);
- }
- CORBA::Object_var result_obj_ref = root_context_1->resolve (deep
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_j);
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving deep context from ")
- ACE_TEXT ("redundant server - deleted object found.\n")),
- -1);
- }
- ACE_CATCHANY
- {
- //expect exception since the context was deleted
- }
- ACE_ENDTRY;
-
- ACE_TRY_EX(bl_k)
- {
- // Access the second to last object from the Naming Context
- CosNaming::Name deep;
- deep.length (c_depth-1);
- char deep_name[16];
- for (i=0; i<c_depth-1; i++)
- {
- ACE_OS::sprintf(deep_name, "deep_%d", i);
- deep[i].id = CORBA::string_dup (deep_name);
- }
- CORBA::Object_var result_obj_ref = root_context_1->resolve (deep
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_k);
- CosNaming::NamingContext_var result_object =
- CosNaming::NamingContext::_narrow (result_obj_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX(bl_k);
- if (CORBA::is_nil (result_object.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("Problems with resolving deep context from ")
- ACE_TEXT ("redundant server - nil object ref.\n")),
- -1);
-
- ACE_TRY_CHECK_EX(bl_k);
-
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Unable to resolve deep context from redundant server"));
- return -1;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (-1);
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Redundancy test OK\n")));
- return 0;
-
-}
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl b/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl
deleted file mode 100755
index cf61aa7d89d..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl
+++ /dev/null
@@ -1,118 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
-
-# $Id$
-# -*- perl -*-
-
-# This is a Perl script that runs a Naming Service test. It starts
-# all the servers and clients as necessary.
-
-use lib '../../../../bin';
-use PerlACE::Run_Test;
-use Cwd;
-
-$startdir = getcwd();
-
-# Amount of delay (in seconds) between starting a server and a client
-# to allow proper server initialization.
-$sleeptime = 10;
-
-$quiet = 0;
-
-# check for -q flag
-if ($ARGV[0] eq '-q') {
- $quiet = 1;
-}
-
-# Variables for command-line arguments to client and server
-# executables.
-$ns_orb_port1 = 10001 + PerlACE::uniqueid ();
-$ns_orb_port2 = 10002 + PerlACE::uniqueid ();
-$ns_endpoint1 = "iiop://localhost:$ns_orb_port1";
-$ns_endpoint2 = "iiop://localhost:$ns_orb_port2";
-$iorfile1 = PerlACE::LocalFile ("ns1.ior");
-$iorfile2 = PerlACE::LocalFile ("ns2.ior");
-
-$status = 0;
-
-## Allow the user to determine where the persistent file will be located
-## just in case the current directory is not suitable for locking.
-## We can't change the name of the persistent file because that is not
-## sufficient to work around locking problems for Tru64 when the current
-## directory is NFS mounted from a system that does not properly support
-## locking.
-foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}) {
- if (defined $possible && -d $possible) {
- if (chdir($possible)) {
- last;
- }
- }
-}
-
-print "INFO: Running the test in ", getcwd(), "\n";
-
-# Make sure that the directory to use to hold the naming contexts exists
-# and is cleaned out
-if ( ! -d "NameService" ) {
- mkdir (NameService, 0777);
- }
-else {
- chdir "NameService";
- opendir(THISDIR, ".");
- @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
- closedir(THISDIR);
- unlink @allfiles;
- chdir "..";
- }
-
-# Run two Naming Servers in redundant mode and one client. Client uses iors
-# in files to find the individual copies of the Naming Servers.
-
-my $args = "-ORBEndPoint $ns_endpoint1 -o $iorfile1 -m 0 -r NameService";
-my $prog = "$startdir/../../Naming_Service/Naming_Service";
-$NS1 = new PerlACE::Process ($prog, $args);
-
-unlink $iorfile1;
-
-$NS1->Spawn ();
-
-if (PerlACE::waitforfile_timed ($iorfile1, $sleeptime) == -1) {
- print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
- $NS1->Kill ();
- exit 1;
-}
-
-my $args = "-ORBEndPoint $ns_endpoint2 -o $iorfile2 -m 0 -r NameService";
-my $prog = "$startdir/../../Naming_Service/Naming_Service";
-$NS2 = new PerlACE::Process ($prog, $args);
-
-unlink $iorfile2;
-
-$NS2->Spawn ();
-
-if (PerlACE::waitforfile_timed ($iorfile2, $sleeptime) == -1) {
- print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
- $NS2->Kill ();
- exit 1;
-}
-
-my $args = "-p file://$iorfile1 -q file://$iorfile2";
-my $prog = "$startdir/client";
-
-$CL = new PerlACE::Process ($prog, $args);
-
-$client = $CL->SpawnWaitKill (12);
-
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
- $status = 1;
-}
-
-$NS1->Kill ();
-$NS2->Kill ();
-
-unlink $iorfile1;
-unlink $iorfile2;
-
-exit $status;
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl b/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl
deleted file mode 100644
index 4737f6dc6c8..00000000000
--- a/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl
+++ /dev/null
@@ -1,11 +0,0 @@
-// $Id$
-
-interface Test_Object
-{
- // = TITLE
- // This is a simple interface that tests the Naming Service.
-
- attribute short id;
- // This provides an easy way to differentiate objects if each
- // objects is served by a separate servant.
-};