summaryrefslogtreecommitdiff
path: root/modules/CIAO/tests
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2010-05-21 04:11:18 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2010-05-21 04:11:18 +0000
commit163a6565c2b326242a31396e4a23e3b5f68d283d (patch)
treef7fbb1d53a27b85b39ef13da334c63055d067313 /modules/CIAO/tests
parentcbdf27ac57d327fd072299b73d3433e6a8063763 (diff)
downloadATCD-locality_manager.tar.gz
merging in headlocality_manager
Diffstat (limited to 'modules/CIAO/tests')
-rw-r--r--modules/CIAO/tests/CIF/Common/CIF_Common.cpp229
-rw-r--r--modules/CIAO/tests/CIF/Common/CIF_Common.h51
-rw-r--r--modules/CIAO/tests/CIF/Common/CIF_Common.mpc16
-rw-r--r--modules/CIAO/tests/CIF/Common/CIF_Common_export.h54
-rw-r--r--modules/CIAO/tests/CIF/Navigation/Navigation.idl18
-rw-r--r--modules/CIAO/tests/CIF/Navigation/Navigation.mpc156
-rw-r--r--modules/CIAO/tests/CIF/Navigation/Navigation_exec.cpp87
-rw-r--r--modules/CIAO/tests/CIF/Navigation/Navigation_exec.h62
-rw-r--r--modules/CIAO/tests/CIF/Navigation/client.cpp173
-rwxr-xr-xmodules/CIAO/tests/CIF/Navigation/run_test.pl30
-rw-r--r--modules/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc8
11 files changed, 882 insertions, 2 deletions
diff --git a/modules/CIAO/tests/CIF/Common/CIF_Common.cpp b/modules/CIAO/tests/CIF/Common/CIF_Common.cpp
new file mode 100644
index 00000000000..4de59ce6738
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Common/CIF_Common.cpp
@@ -0,0 +1,229 @@
+// $Id$
+
+#include "CIF_Common.h"
+#include "ciao/Logger/Logger_Service.h"
+#include "ciao/ComponentServer/Client_init.h"
+#include "ace/Get_Opt.h"
+
+CIF_Common::CIF_Common (void)
+ : artifact_name_ (""),
+ cs_path_ ("ciao_componentserver"),
+ spawn_delay_ (30)
+{
+}
+
+CIF_Common::~CIF_Common (void)
+{
+}
+
+int
+CIF_Common::parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("s:d:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 's':
+ this->cs_path_ = ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ());
+ break;
+
+ case 'd':
+ this->spawn_delay_ = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-s <path> "
+ "-d <uint> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ return 0;
+}
+
+int
+CIF_Common::init (int argc, ACE_TCHAR *argv[],
+ const char * artifact_name)
+{
+ if (this->parse_args (argc, argv) != 0)
+ return 1;
+
+ this->artifact_name_ = artifact_name;
+ ::CIAO::Logger_Service logger;
+ logger.init (argc, argv);
+ this->orb_ = CORBA::ORB_init (argc, argv);
+ ::CIAO::Client_init (this->orb_);
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("RootPOA");
+
+ this->root_poa_ =
+ PortableServer::POA::_narrow (object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager ();
+
+ poa_manager->activate ();
+ return 0;
+}
+
+void
+CIF_Common::shutdown (::CIAO::Deployment::ComponentServer_ptr server,
+ ::CIAO::Deployment::Container_ptr cont,
+ ::Components::CCMObject_ptr comp,
+ bool orb_shutdown)
+{
+ cont->remove_component (comp);
+ server->remove_container (cont);
+
+ this->sa_->remove_component_server (server);
+ if (orb_shutdown)
+ {
+ this->orb_->shutdown ();
+ }
+}
+
+::CIAO::Deployment::ComponentServer_ptr
+CIF_Common::create_componentserver ()
+{
+ ::CIAO::Deployment::ComponentInstallation_Impl *tmp_ci = 0;
+
+ ACE_NEW_THROW_EX (tmp_ci,
+ CIAO::Deployment::ComponentInstallation_Impl (),
+ CORBA::NO_MEMORY ());
+
+ this->root_poa_->activate_object (tmp_ci);
+
+ ::CIAO::Deployment::CIAO_ServerActivator_i *sa_tmp = 0;
+ ACE_NEW_THROW_EX (
+ sa_tmp,
+ ::CIAO::Deployment::CIAO_ServerActivator_i (this->spawn_delay_,
+ this->cs_path_,
+ 0,
+ false,
+ tmp_ci->_this (),
+ this->orb_.in (),
+ this->root_poa_.in ()),
+ CORBA::NO_MEMORY ());
+
+ if (::CORBA::is_nil (this->sa_.in ()))
+ {
+ this->sa_ = sa_tmp->_this ();
+ }
+ // Make a componentserver with no configvalues
+ ::CIAO::Deployment::ComponentServer_var
+ server (::CIAO::Deployment::ComponentServer::_narrow
+ (this->sa_->create_component_server (0)));
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Nil componentserver reference"),
+ 0);
+ }
+
+ ACE_CString svnt = this->artifact_name_;
+ ACE_CString exec = this->artifact_name_;
+ svnt += "_svnt";
+ exec += "_exec";
+ tmp_ci->install (svnt.c_str (), svnt.c_str ());
+ tmp_ci->install (exec.c_str (), exec.c_str ());
+
+ return server._retn ();
+}
+
+::CIAO::Deployment::Container_ptr
+CIF_Common::create_container (::CIAO::Deployment::ComponentServer_ptr server)
+{
+ ::Components::Deployment::Container_var tmp = server->create_container (0);
+ ::CIAO::Deployment::Container_var cont =
+ ::CIAO::Deployment::Container::_narrow (tmp.in ());
+ return cont._retn ();
+}
+
+::Components::CCMObject_ptr
+CIF_Common::install_component (::CIAO::Deployment::Container_ptr cont,
+ const char * entrypoint_name)
+{
+ CORBA::Any val;
+ ::Components::ConfigValues configs(3);
+ configs.length (3);
+
+ ACE_CString tmp = "create_";
+ ACE_CString impl_name = tmp;
+
+ tmp += entrypoint_name;
+ impl_name += entrypoint_name;
+ tmp += "_Servant";
+ impl_name += "_Impl";
+
+ val <<= tmp.c_str();
+ ACE_NEW_THROW_EX (
+ configs[0],
+ CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ENTRYPT,
+ val),
+ CORBA::NO_MEMORY ());
+ tmp = this->artifact_name_;
+ tmp += "_svnt";
+ val <<= tmp.c_str ();
+ ACE_NEW_THROW_EX (
+ configs[1],
+ CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ARTIFACT,
+ val),
+ CORBA::NO_MEMORY ());
+
+ tmp = this->artifact_name_;
+ tmp += "_exec";
+ val <<= tmp.c_str ();
+ ACE_NEW_THROW_EX (
+ configs[2],
+ CIAO::ConfigValue_impl (CIAO::Deployment::EXEC_ARTIFACT,
+ val),
+ CORBA::NO_MEMORY ());
+
+ // Install Component
+ Components::CCMObject_var cmp = Components::CCMObject::_nil ();
+ try
+ {
+ cmp = cont->install_component (tmp.c_str (),
+ impl_name.c_str (),
+ configs);
+ }
+ catch (const ::Components::Deployment::UnknownImplId &e)
+ {
+ ACE_ERROR ((LM_ERROR, "CIF_Common::install_component - "
+ "::Components::Deployment::UnknownImplId caught.\n"));
+ return ::Components::CCMObject::_nil ();
+ }
+ catch (const ::Components::Deployment::ImplEntryPointNotFound &e)
+ {
+ ACE_ERROR ((LM_ERROR, "CIF_Common::install_component - "
+ "::Components::Deployment::ImplEntryPointNotFound caught\n"));
+ return ::Components::CCMObject::_nil ();
+ }
+ catch (const ::Components::Deployment::InstallationFailure &e)
+ {
+ ACE_ERROR ((LM_ERROR, "CIF_Common::install_component - "
+ "::Components::Deployment::InstallationFailure caught\n"));
+ return ::Components::CCMObject::_nil ();
+ }
+ catch (const ::Components::Deployment::InvalidConfiguration &e)
+ {
+ ACE_ERROR ((LM_ERROR, "CIF_Common::install_component - "
+ "::Components::Deployment::InvalidConfiguration caught\n"));
+ return ::Components::CCMObject::_nil ();
+ }
+
+ if (CORBA::is_nil (cmp))
+ {
+ ACE_ERROR ((LM_ERROR, "CIF_Common::install_component - "
+ "Got back a nil component ref from install_component\n"));
+ return ::Components::CCMObject::_nil ();
+ }
+ return cmp._retn ();
+}
diff --git a/modules/CIAO/tests/CIF/Common/CIF_Common.h b/modules/CIAO/tests/CIF/Common/CIF_Common.h
new file mode 100644
index 00000000000..a33636e7881
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Common/CIF_Common.h
@@ -0,0 +1,51 @@
+// $Id$
+#ifndef CIF_COMMON_H_
+#define CIF_COMMON_H_
+
+#include "ciao/ComponentServer/CIAO_CS_ClientS.h"
+#include "ciao/ComponentServer/CIAO_ComponentServerC.h"
+#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h"
+#include "ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h"
+#include "ciao/ComponentServer/CIAO_PropertiesC.h"
+#include "ciao/Valuetype_Factories/ConfigValue.h"
+#include "CIF_Common_export.h"
+
+class CIF_COMMON_Export CIF_Common
+{
+public:
+ CIF_Common (void);
+ ~CIF_Common (void);
+
+ int init (int argc,
+ ACE_TCHAR *argv[],
+ const char * artifact_name);
+
+ void shutdown (::CIAO::Deployment::ComponentServer_ptr server,
+ ::CIAO::Deployment::Container_ptr cont,
+ ::Components::CCMObject_ptr comp,
+ bool orb_shutdown=true);
+
+ ::CIAO::Deployment::ComponentServer_ptr
+ create_componentserver ();
+
+ ::CIAO::Deployment::Container_ptr
+ create_container (::CIAO::Deployment::ComponentServer_ptr server);
+
+ ::Components::CCMObject_ptr
+ install_component (::CIAO::Deployment::Container_ptr cont,
+ const char * entrypoint_name);
+
+private:
+ ::CORBA::ORB_var orb_;
+ ::PortableServer::POA_var root_poa_;
+ ::CIAO::Deployment::ServerActivator_var sa_;
+ const char * artifact_name_;
+ const char *cs_path_;
+ CORBA::ULong spawn_delay_;
+
+ int
+ parse_args (int argc, ACE_TCHAR *argv[]);
+
+};
+
+#endif
diff --git a/modules/CIAO/tests/CIF/Common/CIF_Common.mpc b/modules/CIAO/tests/CIF/Common/CIF_Common.mpc
new file mode 100644
index 00000000000..c25cd4be6d3
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Common/CIF_Common.mpc
@@ -0,0 +1,16 @@
+// $Id$
+
+project (CIF_Common) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger {
+ sharedname = CIF_Common
+ libout = ../lib
+ IDL_Files {
+ }
+
+ Source_Files {
+ CIF_Common.cpp
+ }
+
+ Header_Files {
+ CIF_Common.h
+ }
+}
diff --git a/modules/CIAO/tests/CIF/Common/CIF_Common_export.h b/modules/CIAO/tests/CIF/Common/CIF_Common_export.h
new file mode 100644
index 00000000000..00136471b93
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Common/CIF_Common_export.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef CIF_COMMON_EXPORT_H
+#define CIF_COMMON_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (CIF_COMMON_HAS_DLL)
+# define CIF_COMMON_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && CIF_COMMON_HAS_DLL */
+
+#if !defined (CIF_COMMON_HAS_DLL)
+# define CIF_COMMON_HAS_DLL 1
+#endif /* ! CIF_COMMON_HAS_DLL */
+
+#if defined (CIF_COMMON_HAS_DLL) && (CIF_COMMON_HAS_DLL == 1)
+# if defined (CIF_COMMON_BUILD_DLL)
+# define CIF_COMMON_Export ACE_Proper_Export_Flag
+# define CIF_COMMON_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define CIF_COMMON_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* CIF_COMMON_BUILD_DLL */
+# define CIF_COMMON_Export ACE_Proper_Import_Flag
+# define CIF_COMMON_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define CIF_COMMON_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* CIF_COMMON_BUILD_DLL */
+#else /* CIF_COMMON_HAS_DLL == 1 */
+# define CIF_COMMON_Export
+# define CIF_COMMON_SINGLETON_DECLARATION(T)
+# define CIF_COMMON_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* CIF_COMMON_HAS_DLL == 1 */
+
+// Set CIF_COMMON_NTRACE = 0 to turn on library-specific
+// tracing even if tracing is turned off for ACE.
+#if !defined (CIF_COMMON_NTRACE)
+# if (ACE_NTRACE == 1)
+# define CIF_COMMON_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define CIF_COMMON_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !CIF_COMMON_NTRACE */
+
+#if (CIF_COMMON_NTRACE == 1)
+# define CIF_COMMON_TRACE(X)
+#else /* (CIF_COMMON_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define CIF_COMMON_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (CIF_COMMON_NTRACE == 1) */
+
+#endif /* CIF_COMMON_EXPORT_H */
+
diff --git a/modules/CIAO/tests/CIF/Navigation/Navigation.idl b/modules/CIAO/tests/CIF/Navigation/Navigation.idl
new file mode 100644
index 00000000000..afd92b3e403
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/Navigation.idl
@@ -0,0 +1,18 @@
+// $Id$
+#include <Components.idl>
+
+interface foo
+{
+ void do_foo ();
+};
+
+interface foo_inherited : Components::Navigation
+{
+ void do_inherited_foo ();
+};
+
+component Navigation
+{
+ provides foo navigation_foo;
+ provides foo_inherited inherited_foo;
+};
diff --git a/modules/CIAO/tests/CIF/Navigation/Navigation.mpc b/modules/CIAO/tests/CIF/Navigation/Navigation.mpc
new file mode 100644
index 00000000000..62c9b9b13cf
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/Navigation.mpc
@@ -0,0 +1,156 @@
+// $Id$
+
+project(Navigation_idl_gen) : componentidldefaults {
+
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=NAVIGATION_STUB_Export \
+ -Wb,stub_export_include=Navigation_stub_export.h \
+ -Wb,skel_export_macro=NAVIGATION_SVNT_Export \
+ -Wb,skel_export_include=Navigation_svnt_export.h \
+ -Wb,exec_export_macro=NAVIGATION_EXEC_Export \
+ -Wb,exec_export_include=Navigation_exec_export.h
+
+ IDL_Files {
+ Navigation.idl
+ }
+}
+
+project(Navigation_lem_gen) : ciaoidldefaults {
+
+ after += Navigation_idl_gen
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=NAVIGATION_LEM_STUB_Export \
+ -Wb,stub_export_include=Navigation_lem_stub_export.h \
+ -SS -Gxhst
+
+ IDL_Files {
+ NavigationE.idl
+ }
+}
+
+project(Navigation_lem_stub) : ccm_svnt {
+
+ after += Navigation_lem_gen Navigation_stub
+ libs += Navigation_stub
+ libpaths += ../lib
+ libout = ../lib
+
+ sharedname = Navigation_lem_stub
+ dynamicflags = NAVIGATION_LEM_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ NavigationEC.cpp
+ }
+
+ Header_Files {
+ NavigationEC.h
+ Navigation_lem_stub_export.h
+ }
+
+ Inline_Files {
+ NavigationEC.inl
+ }
+}
+
+project(Navigation_stub) : ccm_stub {
+
+ after += Navigation_idl_gen
+ libs +=
+ libpaths += ../lib
+ libout = ../lib
+
+
+ sharedname = Navigation_stub
+ dynamicflags = NAVIGATION_STUB_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ NavigationC.cpp
+ }
+
+ Header_Files {
+ NavigationC.h
+ Navigation_stub_export.h
+ }
+
+ Inline_Files {
+ NavigationC.inl
+ }
+}
+
+project(Navigation_exec) : ciao_executor {
+
+ after += Navigation_lem_stub Navigation_stub
+ sharedname = Navigation_exec
+ libs += Navigation_stub Navigation_lem_stub
+ libpaths += ../lib
+ libout = ../lib
+
+
+ dynamicflags = NAVIGATION_EXEC_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ Navigation_exec.cpp
+ }
+
+ Header_Files {
+ Navigation_exec.h
+ Navigation_exec_export.h
+ }
+
+ Inline_Files {
+ }
+}
+
+
+project(Navigation_svnt) : ciao_servant {
+
+ after += Navigation_lem_stub
+ sharedname = Navigation_svnt
+ libs += Navigation_stub Navigation_lem_stub
+ libpaths += ../lib
+ libout = ../lib
+
+
+ dynamicflags = NAVIGATION_SVNT_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ NavigationS.cpp
+ Navigation_svnt.cpp
+ }
+
+ Header_Files {
+ NavigationS.h
+ Navigation_svnt.h
+ Navigation_svnt_export.h
+ }
+
+ Inline_Files {
+ NavigationS.inl
+ }
+}
+
+project (Navigation_client_test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger {
+ after += Navigation_stub Navigation_svnt CIF_Common
+ libpaths += ../lib
+ libs += Navigation_stub CIF_Common
+ includes += ../
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/modules/CIAO/tests/CIF/Navigation/Navigation_exec.cpp b/modules/CIAO/tests/CIF/Navigation/Navigation_exec.cpp
new file mode 100644
index 00000000000..3250b4660b8
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/Navigation_exec.cpp
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Navigation_exec.h"
+#include "ciao/Logger/Log_Macros.h"
+
+namespace CIAO_Navigation_Impl
+{
+ //============================================================
+ // Component Executor Implementation Class: Navigation_exec_i
+ //============================================================
+ Navigation_exec_i::Navigation_exec_i (void)
+ {
+ }
+
+ Navigation_exec_i::~Navigation_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes and port operations.
+ ::CCM_foo_ptr
+ Navigation_exec_i::get_navigation_foo (void)
+ {
+ return ::CCM_foo::_nil ();
+ }
+
+ ::CCM_foo_inherited_ptr
+ Navigation_exec_i::get_inherited_foo (void)
+ {
+ return ::CCM_foo_inherited::_nil ();
+ }
+
+ // Operations from Components::SessionComponent.
+
+ void
+ Navigation_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ ::CCM_Navigation_Context::_narrow (ctx);
+
+ if ( ::CORBA::is_nil (this->context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ Navigation_exec_i::configuration_complete (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Navigation_exec_i::ccm_activate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Navigation_exec_i::ccm_passivate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ Navigation_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" NAVIGATION_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Navigation_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_NORETURN (
+ retval,
+ Navigation_exec_i);
+
+ return retval;
+ }
+}
+
diff --git a/modules/CIAO/tests/CIF/Navigation/Navigation_exec.h b/modules/CIAO/tests/CIF/Navigation/Navigation_exec.h
new file mode 100644
index 00000000000..82d557d586a
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/Navigation_exec.h
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef CIAO_NAVIGATION_EXEC_H_
+#define CIAO_NAVIGATION_EXEC_H_
+
+#include /**/ "ace/pre.h"
+
+#include "NavigationEC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "Navigation_exec_export.h"
+#include "tao/LocalObject.h"
+
+
+namespace CIAO_Navigation_Impl
+{
+
+ class NAVIGATION_EXEC_Export Navigation_exec_i
+ : public virtual Navigation_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ Navigation_exec_i (void);
+ virtual ~Navigation_exec_i (void);
+
+ virtual ::CCM_foo_ptr
+ get_navigation_foo (void);
+
+ virtual ::CCM_foo_inherited_ptr
+ get_inherited_foo (void);
+
+ //@{
+ /** Operations from Components::SessionComponent. */
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void configuration_complete (void);
+
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+ //@}
+
+
+ private:
+ ::CCM_Navigation_Context_var context_;
+ };
+
+ extern "C" NAVIGATION_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Navigation_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* ifndef */
+
diff --git a/modules/CIAO/tests/CIF/Navigation/client.cpp b/modules/CIAO/tests/CIF/Navigation/client.cpp
new file mode 100644
index 00000000000..65dfbb18f36
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/client.cpp
@@ -0,0 +1,173 @@
+// $Id$
+
+#include "Common/CIF_Common.h"
+#include "NavigationEC.h"
+
+const char * artifact_name = "Navigation";
+
+int
+run_test (::Navigation_ptr nav)
+{
+ try
+ {
+ try
+ {
+ nav->provide_facet ("navigation_foo");
+ nav->provide_facet ("inherited_foo");
+ }
+ catch (const ::Components::InvalidName &e)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Unexpected InvalidName exception caught "
+ "while testing provide_facet\n"));
+ }
+ ACE_DEBUG ((LM_DEBUG, "Provide facet test passed !\n"));
+
+ try
+ {
+ nav->provide_facet ("navigation_foo_1");
+ ACE_ERROR ((LM_ERROR, "Error: No InvalidName exception caught "
+ "while testing provide_facet\n"));
+ }
+ catch (const ::Components::InvalidName &e)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected InvalidName exception caught.\n"));
+ }
+
+ try
+ {
+ nav->provide_facet ("inherited_foo_1");
+ ACE_ERROR ((LM_ERROR, "Error: No InvalidName exception caught "
+ "while testing provide_facet\n"));
+ }
+ catch (const ::Components::InvalidName &e)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected InvalidName exception caught.\n"));
+ }
+
+ #if !defined (CCM_LW)
+ ::Components::FacetDescriptions_var all_facets = nav->get_all_facets ();
+ if (all_facets->length () != 2)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: unexpected number of descriptions: "
+ "expected <%u> - received <%u>\n",
+ 2, all_facets->length ()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "get_all_facets test passed !\n"));
+ }
+
+ try
+ {
+ ::Components::NameList names;
+ names.length (2);
+ names[0] = CORBA::string_dup ("navigation_foo");
+ names[1] = CORBA::string_dup ("inherited_foo");
+ ::Components::FacetDescriptions_var named_facets = nav->get_named_facets (names);
+ if (named_facets->length () != 2)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: unexpected number of descriptions: "
+ "expected <%u> - received <%u>\n",
+ 2, named_facets->length ()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "get_named_facets test passed !\n"));
+ }
+ }
+ catch (const ::Components::InvalidName &e)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Unexpected InvalidName exception caught "
+ "while testing get_named_facets\n"));
+ }
+
+ try
+ {
+ ::Components::NameList names;
+ names.length (2);
+ names[0] = CORBA::string_dup ("navigation_foo_1");
+ names[1] = CORBA::string_dup ("inherited_foo_1");
+ ::Components::FacetDescriptions_var named_facets = nav->get_named_facets (names);
+ ACE_ERROR ((LM_ERROR, "Error: No InvalidName exception caught "
+ "while testing get_named_facets\n"));
+ }
+ catch (const ::Components::InvalidName &e)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected InvalidName exception caught "
+ "while testing get_named_facets\n"));
+ }
+
+// boolean same_component (in Object object_ref);
+ #endif
+ }
+ catch (...)
+ {
+ ACE_ERROR ((LM_ERROR, "Unexpected exception caught while running test.\n"));
+ return 1;
+ }
+ return 0;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR **argv)
+{
+ using namespace ::CIAO::Deployment;
+
+ CIF_Common cmd;
+ try
+ {
+ if (cmd.init (argc, argv, artifact_name) != 0)
+ return 1;
+
+ ComponentServer_var server = cmd.create_componentserver ();
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from create_component_server "
+ "operation\n"));
+ return 1;
+ }
+
+ Container_var cont = cmd.create_container (server.in ());
+ if (CORBA::is_nil (cont.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from create_container "
+ "operation on server\n"));
+ return 1;
+ }
+
+ Components::CCMObject_var comp = cmd.install_component (cont.in (),
+ artifact_name);
+ if (CORBA::is_nil (comp.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Installing component failed.\n"));
+ return 1;
+ }
+ ::Navigation_var nav = ::Navigation::_narrow (comp.in ());
+
+ if (CORBA::is_nil (nav.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Narrow failed from CCMObject to Navigation\n"));
+ return 1;
+ }
+
+ run_test (nav.in ());
+
+ cmd.shutdown (server.in (), cont.in (), comp.in ());
+ }
+ catch (const ::Components::CreateFailure &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n"));
+ return 1;
+ }
+ catch (const ::Components::RemoveFailure &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n"));
+ return 1;
+ }
+ catch (...)
+ {
+ ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n"));
+ return 1;
+ }
+ return 0;
+}
diff --git a/modules/CIAO/tests/CIF/Navigation/run_test.pl b/modules/CIAO/tests/CIF/Navigation/run_test.pl
new file mode 100755
index 00000000000..9d1a77634f6
--- /dev/null
+++ b/modules/CIAO/tests/CIF/Navigation/run_test.pl
@@ -0,0 +1,30 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+
+$ENV {'CIAO_LOG_LEVEL'} = 9;
+
+$status = 0;
+$ciao_root = "$ENV{CIAO_ROOT}";
+
+my $target = PerlACE::TestTarget::create_target (1);
+$target->AddLibPath ('../lib');
+
+$TG = $target->CreateProcess ("client", "-s $ciao_root/bin/ciao_componentserver -d 120");
+$server_status = $TG->SpawnWaitKill ($target->ProcessStartWaitInterval ());
+
+if ($server_status != 0) {
+ print STDERR "ERROR: process returned $server_status\n";
+ $TG->Kill ();
+ exit 1;
+}
+
+$target->GetStderrLog();
+
+exit $status;
diff --git a/modules/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc b/modules/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc
index 694ee7ea3da..e0b9264a3ff 100644
--- a/modules/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc
+++ b/modules/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc
@@ -4,8 +4,12 @@
project(ICEventSource_stub): ccm_stub {
sharedname = ICEventSource_stub
- idlflags += -Wb,stub_export_macro=ICEVENTSOURCE_STUB_Export -Wb,stub_export_include=ICEventSource_stub_export.h -Wb,skel_export_macro=ICEVENTSOURCE_SVNT_Export -Wb,skel_export_include=ICEventSource_svnt_export.h -Gxhst -Gxhsk
- dynamicflags = ICEVENTSOURCE_STUB_BUILD_DLL
+ idlflags += -Wb,stub_export_macro=ICEVENTSOURCE_STUB_Export \
+ -Wb,stub_export_include=ICEventSource_stub_export.h \
+ -Wb,skel_export_macro=ICEVENTSOURCE_SVNT_Export \
+ -Wb,skel_export_include=ICEventSource_svnt_export.h \
+ -Gxhst -Gxhsk
+ dynamicflags = ICEVENTSOURCE_STUB_BUILD_DLL
IDL_Files {
ICEventSource.idl