summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authormarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-06 05:15:46 +0000
committermarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-06 05:15:46 +0000
commit01742cd090753884bc7bbbaa820dfb0ce81a27ff (patch)
treeb21df62781c9ed352c8deea33776279bc45865b3 /TAO/orbsvcs/tests
parent4ad03a2f2ed96e63abf27b06e20ef820515c18fc (diff)
downloadATCD-01742cd090753884bc7bbbaa820dfb0ce81a27ff.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/orbsvcs/tests')
-rwxr-xr-xTAO/orbsvcs/tests/Naming/Makefile2
-rw-r--r--TAO/orbsvcs/tests/Naming/ns_tree.cpp56
2 files changed, 18 insertions, 40 deletions
diff --git a/TAO/orbsvcs/tests/Naming/Makefile b/TAO/orbsvcs/tests/Naming/Makefile
index b8b66a203cf..1392aebabdf 100755
--- a/TAO/orbsvcs/tests/Naming/Makefile
+++ b/TAO/orbsvcs/tests/Naming/Makefile
@@ -6,7 +6,7 @@
CXX = CC -g
IDL = $(TAO_ROOT)/TAO_IDL/tao_idl
-CPPFLAGS = -c -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs -I. -DHIERARCHICAL_BIND -DRECURSIVE_BIND
+CPPFLAGS = -c -I$(ACE_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs -I.
IDLFLAGS =
# All ACE/TAO related libraries have links in the $ACE_ROOT/ace
diff --git a/TAO/orbsvcs/tests/Naming/ns_tree.cpp b/TAO/orbsvcs/tests/Naming/ns_tree.cpp
index 0cf7c426ca3..6bf979212f7 100644
--- a/TAO/orbsvcs/tests/Naming/ns_tree.cpp
+++ b/TAO/orbsvcs/tests/Naming/ns_tree.cpp
@@ -11,6 +11,7 @@
// Ross Lillie <lillie@rsch.comm.mot.com>
// LMPS Systems Research Lab
//
+//
// ============================================================================
#include "tao/TAO.h"
@@ -32,6 +33,7 @@ main (int argc, char **argv)
TAO_TRY
{
+ // Initialize and obtain reference to the Naming Context
if (orbmgr.init (argc, argv, TAO_TRY_ENV) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"failed to init ORB\n"),
@@ -57,66 +59,40 @@ main (int argc, char **argv)
myObject._this (TAO_TRY_ENV);
TAO_CHECK_ENV;
-#if !defined (HIERARCHICAL_BIND)
+
+ // Create a child context.
CosNaming::Name test_context (1);
test_context.length (1);
test_context[0].id =
CORBA::string_dup ("MyContext");
- CORBA::Object_var myobj =
+ CORBA::Object_var mycontext =
ns_ctx->bind_new_context (test_context,
TAO_TRY_ENV);
TAO_CHECK_ENV;
- if (CORBA::is_nil (myobj))
+ if (CORBA::is_nil (mycontext))
ACE_ERROR_RETURN ((LM_ERROR,
- "unabled to resolve naming context \"MyContext\"\n"),
+ "unabled to create new naming context \"MyContext\"\n"),
-1);
CosNaming::NamingContext_var my_context =
- CosNaming::NamingContext::_narrow (myobj.in (),
+ CosNaming::NamingContext::_narrow (mycontext.in (),
TAO_TRY_ENV);
TAO_CHECK_ENV;
-#endif /* !HIERARCHICAL_BIND */
-#if defined (RECURSIVE_BIND)
+ cerr << "Created new context OK" << endl;
+
+ // bind an object to a child context
CosNaming::Name test_name (2);
- test_name.length (1);
+ test_name.length (2);
test_name[0].id = CORBA::string_dup ("MyContext");
test_name[1].id = CORBA::string_dup ("MyName");
ns_ctx->bind (test_name,
myObject_var.in (),
TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
-#else
-#if defined (HIERARCHICAL_BIND)
- CosNaming::Name test_context (1);
- test_context.length (1);
- test_context[0].id = CORBA::string_dup ("MyContext");
-
- CORBA::Object_var myobj = ns_ctx->resolve (test_context,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- if (CORBA::is_nil (myobj))
- ACE_ERROR_RETURN ((LM_ERROR,
- "unabled to resolve naming context \"MyContext\"\n"),
- -1);
- CosNaming::NamingContext_var my_context =
- CosNaming::NamingContext::_narrow (myobj.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-#endif /* HIERARCHICAL_BIND */
- CosNaming::Name test_name (1);
- test_name.length (1);
- test_name[0].id = CORBA::string_dup ("MyName");
-
- my_context->bind (test_name,
- myObject_var.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-#endif /* RECURSIVE_BIND */
+ TAO_CHECK_ENV;
+ cerr << "Bound compound name OK" << endl;
// Finally, try now to resolve the compound name.
CosNaming::Name result_name (2);
@@ -130,7 +106,9 @@ main (int argc, char **argv)
Test_Object_var resultObject =
Test_Object::_narrow (resolvedobj.in (),
- TAO_TRY_ENV);
+ TAO_TRY_ENV);
+
+ cerr << "Resolved compound name OK" << endl;
}
TAO_CATCHANY
{