summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-08-05 19:04:35 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-08-05 19:04:35 +0000
commit238301acc756db87429c129abf0f4d8f4e99fa8e (patch)
treeeb731ccceca1fa8c967ccc1574ba16807b8678d2
parent87c4bcb15efc2078019f8ce6a951f392fef4eb55 (diff)
downloadATCD-238301acc756db87429c129abf0f4d8f4e99fa8e.tar.gz
ChangeLogTag: Tue Aug 5 14:01:32 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog15
-rw-r--r--TAO/TAO_IDL/ast/ast_home.cpp15
-rw-r--r--TAO/TAO_IDL/include/ast_home.h4
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp65
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp6
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp7
-rw-r--r--TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp11
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp495
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h9
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl16
10 files changed, 605 insertions, 38 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 1f3b05bd9cf..7435dd0ba8b 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,18 @@
+Tue Aug 5 14:01:32 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/ast/ast_home.cpp:
+ * TAO_IDL/include/ast_home.h:
+ * orbsvcs/IFR_Service/ifr_adding_visitor.cpp:
+ * orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp:
+ * orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp:
+ * orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp:
+ * orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp:
+ * orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h:
+ * orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl:
+
+ Testing and debugging of IFR support for valuetypes
+ and component homes.
+
Tue Aug 5 05:11:25 UTC 2003 Don Hinton <dhinton@dresystems.com>
* orbsvcs/ImplRepo_Service/ImR_Locator_i.h:
diff --git a/TAO/TAO_IDL/ast/ast_home.cpp b/TAO/TAO_IDL/ast/ast_home.cpp
index 532d527fe87..0e0568b7b7d 100644
--- a/TAO/TAO_IDL/ast/ast_home.cpp
+++ b/TAO/TAO_IDL/ast/ast_home.cpp
@@ -64,6 +64,21 @@ AST_Home::base_home (void) const
return this->pd_base_home;
}
+// These next two look ugly, but it is to keep from having to
+// create separate visitors for homes in the back end.
+
+AST_Interface **
+AST_Home::supports (void) const
+{
+ return this->pd_base_home ? this->inherits () + 1 : this->inherits ();
+}
+
+long
+AST_Home::n_supports (void) const
+{
+ return this->pd_base_home ? this->n_inherits () - 1 : this->n_inherits ();
+}
+
AST_Component *
AST_Home::managed_component (void) const
{
diff --git a/TAO/TAO_IDL/include/ast_home.h b/TAO/TAO_IDL/include/ast_home.h
index 1b731f7c2e1..f68276c7adc 100644
--- a/TAO/TAO_IDL/include/ast_home.h
+++ b/TAO/TAO_IDL/include/ast_home.h
@@ -31,6 +31,10 @@ public:
AST_Home *base_home (void) const;
+ AST_Interface **supports (void) const;
+
+ long n_supports (void) const;
+
AST_Component *managed_component (void) const;
AST_ValueType *primary_key (void) const;
diff --git a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp
index 8b21d73d688..176c5fe6a1b 100644
--- a/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp
+++ b/TAO/orbsvcs/IFR_Service/ifr_adding_visitor.cpp
@@ -3780,6 +3780,15 @@ ifr_adding_visitor::fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
CORBA::ComponentIR::HomeDef::_narrow (holder.in ()
ACE_ENV_ARG_PARAMETER);
}
+ else
+ {
+ /// Maybe the base home is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) base_home->ast_accept (this);
+ this->fill_base_home (result,
+ node
+ ACE_ENV_ARG_DECL);
+ }
}
void
@@ -3808,6 +3817,15 @@ ifr_adding_visitor::fill_managed_component (
CORBA::ComponentIR::ComponentDef::_narrow (holder.in ()
ACE_ENV_ARG_PARAMETER);
}
+ else
+ {
+ /// Maybe the managed component is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) managed_component->ast_accept (this);
+ this->fill_managed_component (result,
+ node
+ ACE_ENV_ARG_DECL);
+ }
}
void
@@ -3834,6 +3852,15 @@ ifr_adding_visitor::fill_primary_key (CORBA::ValueDef_ptr &result,
CORBA::ValueDef::_narrow (holder.in ()
ACE_ENV_ARG_PARAMETER);
}
+ else
+ {
+ /// Maybe the primary key is in an included IDL file - put it in
+ /// the repository and go again.
+ (void) primary_key->ast_accept (this);
+ this->fill_primary_key (result,
+ node
+ ACE_ENV_ARG_DECL);
+ }
}
void
@@ -3926,8 +3953,8 @@ ifr_adding_visitor::fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
case AST_Decl::NT_home:
{
AST_Home *h = AST_Home::narrow_from_decl (node);
- s_length = h->n_inherits ();
- list = h->inherits ();
+ s_length = h->n_supports ();
+ list = h->supports ();
break;
}
default:
@@ -4134,17 +4161,20 @@ ifr_adding_visitor::fill_exceptions (CORBA::ExceptionDefSeq &result,
for (UTL_ExceptlistActiveIterator ei (list);
!ei.is_done ();
- ei.next ())
+ ei.next (), ++index)
{
d = ei.item ();
- holder =
- be_global->repository ()->lookup_id (d->repoID ()
- ACE_ENV_ARG_PARAMETER);
+
+ // Just to make sure. The call will return quickly if d has already
+ // been visited. Can't use ir_current_ because ExceptionDef doesn't
+ // inherit from IDLType.
+ (void) d->ast_accept (this);
+
+ holder = be_global->repository ()->lookup_id (d->repoID ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- // @@@ (JP) We should probably throw some kind of exception here
- // if the lookup return 0.
- result[index++] =
+ result[index] =
CORBA::ExceptionDef::_narrow (holder.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
@@ -4166,23 +4196,22 @@ ifr_adding_visitor::fill_params (CORBA::ParDescriptionSeq &result,
for (UTL_ScopeActiveIterator iter (node,
UTL_Scope::IK_decls);
! iter.is_done ();
- iter.next ())
+ iter.next (), ++index)
{
arg = AST_Argument::narrow_from_decl (iter.item ());
result[index].name =
CORBA::string_dup (arg->local_name ()->get_string ());
- result[index].type = CORBA::TypeCode::_nil ();
- holder =
- be_global->repository ()->lookup_id (arg->field_type ()->repoID ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ result[index].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ // Get the arg type into ir_current_.
+ (void) arg->ast_accept (this);
result[index].type_def =
- CORBA::IDLType::_narrow (holder.in ()
- ACE_ENV_ARG_PARAMETER);
+ CORBA::IDLType::_duplicate (this->ir_current_.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- result[index++].mode = CORBA::PARAM_IN;
+ result[index].mode = CORBA::PARAM_IN;
}
}
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp
index 5ce6ad3164e..6491665a684 100644
--- a/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ComponentContainer_i.cpp
@@ -258,13 +258,11 @@ TAO_ComponentContainer_i::create_home_i (
}
}
- char *primary_key_path = 0;
-
if (! CORBA::is_nil (primary_key))
{
- primary_key_path =
+ char *primary_key_path =
TAO_IFR_Service_Utils::reference_to_path (primary_key);
- this->repo_->config ()->set_string_value (this->section_key_,
+ this->repo_->config ()->set_string_value (new_key,
"primary_key",
primary_key_path);
}
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp
index 607d7f2d146..4a3b9f3067d 100644
--- a/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/IFRService/ExtValueDef_i.cpp
@@ -687,6 +687,13 @@ TAO_ExtValueDef_i::describe_ext_value_i (
this->repo_->config ()->get_string_value (arg_key,
"arg_path",
holder);
+ TAO_IDLType_i *impl =
+ TAO_IFR_Service_Utils::path_to_idltype (holder,
+ this->repo_);
+ fv_desc->initializers[i].members[j].type =
+ impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
obj =
TAO_IFR_Service_Utils::path_to_ir_object (
holder,
diff --git a/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp
index 6a951af0b1c..cf932d2a422 100644
--- a/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/IFRService/HomeDef_i.cpp
@@ -718,6 +718,10 @@ TAO_HomeDef_i::create_common (CORBA::DefinitionKind created_kind,
"excepts",
1,
excepts_key);
+
+ this->repo_->config ()->set_integer_value (excepts_key,
+ "count",
+ length);
char *type_path = 0;
for (i = 0; i < length; ++i)
@@ -974,10 +978,9 @@ TAO_HomeDef_i::fill_exc_desc (ACE_Configuration_Section_Key &key,
ACE_ENV_ARG_PARAMETER
);
- TAO_IDLType_i *impl =
- TAO_IFR_Service_Utils::path_to_idltype (path,
- this->repo_);
- ed.type = impl->type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ TAO_ExceptionDef_i impl (this->repo_);
+ impl.section_key (except_def_key);
+ ed.type = impl.type_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
void
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
index e5eca2f98a8..52865dad20b 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
@@ -18,6 +18,11 @@ const char *VALUETYPE_ID = "IDL:mod/test_valuetype:1.0";
const char *VALUETYPE_SCOPED_NAME = "::mod::test_valuetype";
const char *VT_BASE_ID = "IDL:help/v_base:1.0";
+const char *HOME_ID = "IDL:mod/test_home:1.0";
+const char *HOME_SCOPED_NAME = "::mod::test_home";
+const char *HOME_BASE_ID = "IDL:help/h_base:1.0";
+const char *HOME_KEY_ID = "IDL:help/h_key:1.0";
+
const CORBA::ULong ATTRS_LEN = 1;
const CORBA::ULong OPS_LEN = 1;
const CORBA::ULong FACTORY_LEN = 2;
@@ -163,28 +168,79 @@ const char *MEM_IDS[] =
"IDL:mod/test_valuetype/test_mem2:1.0",
};
-const CORBA::ULong FACTORY_MEMBER_LENS[] =
+const CORBA::ULong VT_FACTORY_PARAM_LENS[] =
{
1,
2
};
-const CORBA::ULong FACTORY_EXCEP_LENS[] =
+const CORBA::ULong VT_FACTORY_EXCEP_LENS[] =
{
0,
2
};
-const char *FACTORY_MEMBER_NAMES[][2] =
+const char *VT_FACTORY_PARAM_NAMES[][2] =
{
{"set_tm1", 0},
{"set_tm1a", "set_tm2"}
};
-const char *FACTORY_EXCEP_NAMES[][2] =
+const char *VT_FACTORY_EXCEP_NAMES[][2] =
{
{0, 0},
- {"help::whups", "help::doh"}
+ {"whups", "doh"}
+ };
+
+const CORBA::ULong HOME_SUPPORTED_LEN = 2;
+
+const char *HOME_SUPPORTED_IDS[] =
+ {
+ "IDL:help/h_supp1:1.0",
+ "IDL:help/h_supp2:1.0"
+ };
+
+const CORBA::ULong HOME_FACTORY_LEN = 1;
+const CORBA::ULong HOME_FINDER_LEN = 1;
+
+const CORBA::ULong HOME_FACTORY_PARAM_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FACTORY_PARAM_NAMES[][1] =
+ {
+ {"set_uid"}
+ };
+
+const CORBA::ULong HOME_FACTORY_EXCEP_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FACTORY_EXCEP_NAMES[][1] =
+ {
+ {"doh"}
+ };
+
+const CORBA::ULong HOME_FINDER_PARAM_LENS[] =
+ {
+ 3
+ };
+
+const char *HOME_FINDER_PARAM_NAMES[][3] =
+ {
+ {"id_number", "id_string", "pkey"}
+ };
+
+const CORBA::ULong HOME_FINDER_EXCEP_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FINDER_EXCEP_NAMES[][1] =
+ {
+ {"whups"}
};
IDL3_Client::IDL3_Client (void)
@@ -258,6 +314,14 @@ IDL3_Client::run (ACE_ENV_SINGLE_ARG_DECL)
return status;
}
+ status = this->home_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
return 0;
}
@@ -420,6 +484,140 @@ IDL3_Client::component_test (ACE_ENV_SINGLE_ARG_DECL)
int
IDL3_Client::home_test (ACE_ENV_SINGLE_ARG_DECL)
{
+ CORBA::Contained_var result =
+ this->repo_->lookup_id (HOME_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: lookup by id failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ComponentIR::HomeDef_var home =
+ CORBA::ComponentIR::HomeDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: home narrow failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ComponentIR::ComponentDef_var managed =
+ home->managed_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (managed.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: managed component is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = managed->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), COMPONENT_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: bad id for managed component\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ValueDef_var pkey =
+ home->primary_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (pkey.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: primary key is null\n"));
+ }
+
+ return -1;
+ }
+
+ str = pkey->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), HOME_KEY_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: bad id for managed component\n"));
+ }
+
+ return -1;
+ }
+
+ int status = this->home_inheritance_test (home
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ CORBA::Contained::Description_var desc =
+ home->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::HomeDescription *home_desc = 0;
+
+ if ((desc->value >>= home_desc) == 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: extraction of HomeDescription failed\n"));
+ }
+
+ return -1;
+ }
+
+ status = this->home_factory_test (home_desc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->home_finder_test (home_desc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
return 0;
}
@@ -972,7 +1170,7 @@ IDL3_Client::valuetype_inheritance_test (CORBA::ExtValueDef_var &vd
CORBA::String_var str = bvd->id (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
- if (str.in () ==0 || ACE_OS::strcmp (str.in (), VT_BASE_ID) != 0)
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), VT_BASE_ID) != 0)
{
if (this->debug_)
{
@@ -1304,7 +1502,7 @@ IDL3_Client::valuetype_factory_test (
{
inside_len = desc->initializers[i].members.length ();
- if (inside_len != FACTORY_MEMBER_LENS[i])
+ if (inside_len != VT_FACTORY_PARAM_LENS[i])
{
if (this->debug_)
{
@@ -1319,12 +1517,12 @@ IDL3_Client::valuetype_factory_test (
CORBA::ULong j = 0;
- for (j = 0; j < FACTORY_MEMBER_LENS[i]; ++j)
+ for (j = 0; j < VT_FACTORY_PARAM_LENS[i]; ++j)
{
tmp = desc->initializers[i].members[j].name.in ();
if (tmp == 0
- || ACE_OS::strcmp (tmp, FACTORY_MEMBER_NAMES[i][j]) != 0)
+ || ACE_OS::strcmp (tmp, VT_FACTORY_PARAM_NAMES[i][j]) != 0)
{
if (this->debug_)
{
@@ -1341,7 +1539,7 @@ IDL3_Client::valuetype_factory_test (
inside_len = desc->initializers[i].exceptions.length ();
- if (inside_len != FACTORY_EXCEP_LENS[i])
+ if (inside_len != VT_FACTORY_EXCEP_LENS[i])
{
if (this->debug_)
{
@@ -1354,12 +1552,12 @@ IDL3_Client::valuetype_factory_test (
return -1;
}
- for (j = 0; j < FACTORY_EXCEP_LENS[i]; ++j)
+ for (j = 0; j < VT_FACTORY_EXCEP_LENS[i]; ++j)
{
tmp = desc->initializers[i].exceptions[j].name.in ();
if (tmp == 0
- || ACE_OS::strcmp (tmp, FACTORY_EXCEP_NAMES[i][j]) != 0)
+ || ACE_OS::strcmp (tmp, VT_FACTORY_EXCEP_NAMES[i][j]) != 0)
{
if (this->debug_)
{
@@ -1377,3 +1575,276 @@ IDL3_Client::valuetype_factory_test (
return 0;
}
+
+int
+IDL3_Client::home_inheritance_test (CORBA::ComponentIR::HomeDef_var &hd
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ComponentIR::HomeDef_var bhd =
+ hd->base_home (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (bhd.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "base home is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = bhd->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), HOME_BASE_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "wrong repo id for base home\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::InterfaceDefSeq_var supported =
+ hd->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ULong length = supported->length ();
+
+ if (length != HOME_SUPPORTED_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "wrong number of supported interfaces\n"));
+ }
+
+ return -1;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ str = supported[i].in ()->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0
+ || ACE_OS::strcmp (str.in (), HOME_SUPPORTED_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "bad id on supported interface #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_factory_test (CORBA::ComponentIR::HomeDescription *hd
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong length = hd->factories.length ();
+
+ if (length != HOME_FACTORY_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of factories\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong inside_len = 0;
+ CORBA::ULong j = 0;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < HOME_FACTORY_LEN; ++i)
+ {
+ inside_len = hd->factories[i].parameters.length ();
+
+ if (inside_len != HOME_FACTORY_PARAM_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of params in factory #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->factories[i].parameters[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FACTORY_PARAM_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong name for param #%d in factory #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ inside_len = hd->factories[i].exceptions.length ();
+
+ if (inside_len != HOME_FACTORY_EXCEP_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of exceptions in factory #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->factories[i].exceptions[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FACTORY_EXCEP_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong name for exception #%d in factory #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_finder_test (CORBA::ComponentIR::HomeDescription *hd
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ULong length = hd->finders.length ();
+
+ if (length != HOME_FINDER_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of finders\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong inside_len = 0;
+ CORBA::ULong j = 0;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < HOME_FINDER_LEN; ++i)
+ {
+ inside_len = hd->finders[i].parameters.length ();
+
+ if (inside_len != HOME_FINDER_PARAM_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of params in finder #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->finders[i].parameters[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FINDER_PARAM_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong name for param #%d in finder #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ inside_len = hd->finders[i].exceptions.length ();
+
+ if (inside_len != HOME_FINDER_EXCEP_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of exceptions in finder #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->finders[i].exceptions[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FINDER_EXCEP_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong name for exception #%d in finder #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h
index 1cfd4d487e7..51571d433d2 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h
@@ -102,6 +102,15 @@ private:
ACE_ENV_ARG_DECL
);
+ int home_inheritance_test (CORBA::ComponentIR::HomeDef_var &
+ ACE_ENV_ARG_DECL);
+
+ int home_factory_test (CORBA::ComponentIR::HomeDescription *
+ ACE_ENV_ARG_DECL);
+
+ int home_finder_test (CORBA::ComponentIR::HomeDescription *
+ ACE_ENV_ARG_DECL);
+
private:
CORBA::Boolean debug_;
// Flag to output detailed error messages.
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
index 25244c29a51..30f0a3e43c5 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
@@ -16,6 +16,10 @@ module help
valuetype v_base : v_base_base {};
interface v_supp1 {};
abstract interface v_supp2 {};
+ home h_base manages c_base {};
+ valuetype h_key {};
+ interface h_supp1 {};
+ interface h_supp2 {};
};
module help
@@ -70,6 +74,18 @@ module mod
in short set_tm2)
raises (help::whups, help::doh);
};
+
+ home test_home : help::h_base supports help::h_supp1, help::h_supp2
+ manages test_component primarykey help::h_key
+ {
+ factory create_tc (in string set_uid)
+ raises (help::doh);
+
+ finder find_tc (in long id_number,
+ in string id_string,
+ in help::h_key pkey)
+ raises (help::whups);
+ };
};