diff options
author | msmit <msmit@remedy.nl> | 2010-06-08 13:53:21 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2010-06-08 13:53:21 +0000 |
commit | 5ea31bda743657f93a8a59c695100d010f9ebe37 (patch) | |
tree | 06bec5e5d1c61ca7a16ba71f786c248dbf23f13b | |
parent | 0650d196b93f2fc641b0738a6d37db6205714f5b (diff) | |
download | ATCD-5ea31bda743657f93a8a59c695100d010f9ebe37.tar.gz |
Tue Jun 8 13:44:55 UTC 2010 Marcel Smit <msmit@remedy.nl>
* connectors/dds4ccm/impl/dds/ContentFilterSetting.h:
* connectors/dds4ccm/impl/dds/ContentFilterSetting.cpp:
* connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp:
* connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp:
* connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h:
* connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp:
* connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc:
Implemented DDS4LwCCM Beta 3 spec regarding contentfilteredTopics.
This could not be fully tested since passing structs from the deployment
plans to the connector didn't work yet. So all accompanying tests will
fail for now.
* connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/*:
Added contentfilteredTopics for listeners on the Event connector.
* connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/*:
Added test for the reader and getter extended ports,
having a different query.
* connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/*:
Added contentfilteredTopics for listeners on the State connector.
* connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc:
* connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc:
* connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc:
* connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc:
* connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc:
Renamed projects in order to prevent duplicate project names.
58 files changed, 6651 insertions, 58 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 9ebb342f13e..1c9f1c22540 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,34 @@ +Tue Jun 8 13:44:55 UTC 2010 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/impl/dds/ContentFilterSetting.h: + * connectors/dds4ccm/impl/dds/ContentFilterSetting.cpp: + * connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp: + * connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp: + * connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h: + * connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp: + * connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc: + Implemented DDS4LwCCM Beta 3 spec regarding contentfilteredTopics. + This could not be fully tested since passing structs from the deployment + plans to the connector didn't work yet. So all accompanying tests will + fail for now. + + * connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/*: + Added contentfilteredTopics for listeners on the Event connector. + + * connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/*: + Added test for the reader and getter extended ports, + having a different query. + + * connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/*: + Added contentfilteredTopics for listeners on the State connector. + + * connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc: + * connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc: + * connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc: + * connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc: + * connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc: + Renamed projects in order to prevent duplicate project names. + Tue Jun 8 13:20:36 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> * tests/Bug_3769_Regression/Foo_exec.cpp: diff --git a/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.cpp b/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.cpp new file mode 100644 index 00000000000..e623d662ce0 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.cpp @@ -0,0 +1,100 @@ +// $Id$ + +#include "ContentFilterSetting.h" +#include "dds4ccm/impl/logger/Log_Macros.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO +{ + namespace DDS4CCM + { + CCM_DDS_ContentFilterSetting_i::CCM_DDS_ContentFilterSetting_i () + { + DDS4CCM_TRACE ("CCM_DDS_ContentFilterSetting_i::CCM_DDS_ContentFilterSetting_i"); + } + + CCM_DDS_ContentFilterSetting_i::~CCM_DDS_ContentFilterSetting_i () + { + DDS4CCM_TRACE ("CCM_DDS_ContentFilterSetting_i::~CCM_DDS_ContentFilterSetting_i"); + } + + ::CCM_DDS::QueryFilter * + CCM_DDS_ContentFilterSetting_i::filter (void) + { + DDS4CCM_TRACE ("CCM_DDS_ContentFilterSetting_i::filter"); + + return &this->filter_; + } + + void + CCM_DDS_ContentFilterSetting_i::filter ( + const ::CCM_DDS::QueryFilter & filter) + { + DDS4CCM_TRACE ("CCM_DDS_ContentFilterSetting_i::filter"); + + this->filter_ = filter; + DDS4CCM_DEBUG (6, (LM_DEBUG, CLINFO "CCM_DDS_ContentFilterSetting_i::filter - ")); + DDS4CCM_DEBUG (6, (LM_DEBUG, CLINFO "Expression : %C\t\n", + filter.expression.in ())); + DDS4CCM_DEBUG (6, (LM_DEBUG, CLINFO "Parameters :\n")); + for (::CORBA::ULong i = 0; i < filter.parameters.length (); ++i) + { + DDS4CCM_DEBUG (6, (LM_DEBUG, CLINFO "\t%C\n", + filter.parameters[i].in ())); + } + } + + ::DDS::ContentFilteredTopic_ptr + CCM_DDS_ContentFilterSetting_i::create_contentfilteredtopic ( + ::DDS::Topic_ptr topic, + ::DDS::Subscriber_ptr subscriber) + { + ACE_CString name ("DDS4CCM_CFT_"); + name.append (topic->get_name (), + ACE_OS::strlen (topic->get_name ())); + ::DDS::DomainParticipant_var dp = subscriber->get_participant (); + if (CORBA::is_nil (dp.in ())) + { + DDS4CCM_ERROR (1, (LM_EMERGENCY, "CCM_DDS_ContentFilterSetting_i::create_contentfilteredtopic: " + "Unable to get DomainParticipant.\n")); + throw CORBA::INTERNAL (); + } + this->cft_ = dp->create_contentfilteredtopic (name.c_str (), + topic, + this->filter_.expression, + this->filter_.parameters); + if (CORBA::is_nil (this->cft_.in ())) + { + DDS4CCM_ERROR (1, (LM_EMERGENCY, "CCM_DDS_ContentFilterSetting_i::create_contentfilteredtopic: " + "Error creating ContentfilteredTopic.\n")); + throw CORBA::INTERNAL (); + } + DDS4CCM_DEBUG (6, (LM_DEBUG, "CCM_DDS_ContentFilterSetting_i::create_contentfilteredtopic: " + "successfully created ContentFilteredTopic\n")); + + return ::DDS::ContentFilteredTopic::_duplicate (this->cft_); + } + + void + CCM_DDS_ContentFilterSetting_i::set_filter_parameters ( + const ::DDS::StringSeq & parameters) + { + DDS4CCM_TRACE ("CCM_DDS_ContentFilterSetting_i::set_filter_parameters"); + + ::DDS::ReturnCode_t retcode = this->cft_->set_expression_parameters (parameters); + if (retcode == DDS_RETCODE_OK) + { + DDS4CCM_DEBUG (6, (LM_DEBUG, "CCM_DDS_ContentFilterSetting_i::set_filter_parameters: " + "successfully set parameters on ContentfilteredTopic\n")); + this->filter_.parameters = parameters; + } + else + { + DDS4CCM_ERROR (1, (LM_ERROR, "CCM_DDS_ContentFilterSetting_i::set_filter_parameters:" + "Error setting filter parameters: <%C>\n", + translate_retcode (retcode))); + throw CCM_DDS::InternalError (); + } + } + } +} diff --git a/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.h b/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.h new file mode 100644 index 00000000000..28e1313d9e6 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/dds/ContentFilterSetting.h @@ -0,0 +1,55 @@ +/** + * @author Marcel Smit <msmit@remedy.nl> + * + * $Id$ + * + * Wrapper facade for NDDS. + */ + +#ifndef CCM_DDS_CONTENTFILTERSETTING_H +#define CCM_DDS_CONTENTFILTERSETTING_H + +#include "dds4ccm/impl/dds/dds4ccm_dds_impl_export.h" +#include "dds4ccm/impl/dds4ccm_conf.h" +#include "dds4ccm/idl/dds4ccm_BaseC.h" +#include "dds4ccm/idl/dds4ccm_BaseEC.h" +#include "dds4ccm/impl/dds/ContentFilteredTopic.h" +#include "tao/LocalObject.h" + +namespace CIAO +{ + namespace DDS4CCM + { + class DDS4CCM_DDS_IMPL_Export CCM_DDS_ContentFilterSetting_i + : public virtual ::CCM_DDS::CCM_ContentFilterSetting, + public virtual ::CORBA::LocalObject + { + public: + /// Constructor + CCM_DDS_ContentFilterSetting_i (); + + /// Destructor + virtual ~CCM_DDS_ContentFilterSetting_i (void); + + virtual void + set_filter_parameters ( + const ::DDS::StringSeq & parameters); + + ::CCM_DDS::QueryFilter * + filter (void); + + void + filter (const ::CCM_DDS::QueryFilter & filter); + + ::DDS::ContentFilteredTopic_ptr + create_contentfilteredtopic (::DDS::Topic_ptr topic, + ::DDS::Subscriber_ptr subscriber); + + private: + ::CCM_DDS::QueryFilter filter_; + ::DDS::ContentFilteredTopic_var cft_; + }; + } +} + +#endif diff --git a/CIAO/connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp index 354fedadc41..c3a69164638 100644 --- a/CIAO/connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/dds/DDS_Event_Connector_T.cpp @@ -118,7 +118,8 @@ DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_consumer_filter (void) template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_consumer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_consumer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_consumer_filter"); @@ -156,7 +157,8 @@ DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_consumer_filter (void) template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_consumer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_consumer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_consumer_filter"); diff --git a/CIAO/connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp index 4332a2c29b8..04f77cca55b 100644 --- a/CIAO/connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/dds/DDS_State_Connector_T.cpp @@ -91,7 +91,8 @@ DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::passive_observer_filter (void) template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::passive_observer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::passive_observer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::passive_observer_filter"); @@ -149,7 +150,8 @@ DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_observer_filter (void) template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_observer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_observer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::pull_observer_filter"); @@ -207,7 +209,8 @@ DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_observer_filter (void) template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_observer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_observer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_observer_filter"); @@ -265,7 +268,8 @@ DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_state_observer_filter (vo template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> void -DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_state_observer_filter (const ::CCM_DDS::QueryFilter & filter) +DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_state_observer_filter ( + const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED>::push_state_observer_filter"); diff --git a/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp b/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp index a03663da65a..e5dfba7379a 100644 --- a/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.cpp @@ -2,6 +2,7 @@ // $Id$ #include "dds4ccm/impl/logger/Log_Macros.h" +#include "dds4ccm/impl/dds/ContentFilteredTopic.h" template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::DDS_Subscriber_Base_T (void) : @@ -25,15 +26,34 @@ DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::configuration_complete ( DDS4CCM_TRACE ("DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::configuration_complete"); this->configuration_complete_ = true; - + try { if (!this->data_reader_.get_impl ()) { - this->data_reader_.create_datareader (topic, - subscriber, - library_name, - profile_name); + if (ACE_OS::strlen (this->cft_setting_.filter ()->expression.in ()) > 0) + { + ::DDS::ContentFilteredTopic_var cft = + this->cft_setting_.create_contentfilteredtopic (topic, + subscriber); + if (CORBA::is_nil (cft.in ())) + { + DDS4CCM_ERROR (1, (LM_ERROR, "DDS_Subscriber_Base_T::configuration_complete: " + "Error creating ContentFilteredTopic.\n")); + throw CORBA::INTERNAL (); + } + this->data_reader_.create_datareader (cft, + subscriber, + library_name, + profile_name); + } + else + { + this->data_reader_.create_datareader (topic, + subscriber, + library_name, + profile_name); + } this->dds_read_.set_impl (&this->data_reader_); return true; } @@ -133,8 +153,7 @@ DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::get_filter_config (void) { DDS4CCM_TRACE ("DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::get_filter_config"); - // TODO BETA3 - return ::CCM_DDS::CCM_ContentFilterSetting::_nil (); + return &this->cft_setting_; } template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> @@ -143,8 +162,7 @@ DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::filter (void) { DDS4CCM_TRACE ("DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::filter"); - // TODO BETA3 - return 0; + return this->cft_setting_.filter (); } template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> @@ -153,13 +171,19 @@ DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::filter ( const ::CCM_DDS::QueryFilter & filter) { DDS4CCM_TRACE ("DDS_Subscriber_Base_T<DDS_TYPE, CCM_TYPE, FIXED>::filter"); - if (this->configuration_complete_) { throw ::CCM_DDS::NonChangeable (); } else { - this->filter_ = filter; + if (ACE_OS::strlen (filter.expression.in ()) == 0) + { + DDS4CCM_ERROR (1, (LM_ERROR, "DDS_Subscriber_Base_T::get_filter_config: " + "Filter expression not set. Unable to create " + "ContentFilterSetting interface.\n")); + throw ::CCM_DDS::InternalError (); + } + this->cft_setting_.filter (filter); } } diff --git a/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h b/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h index 75874e64f10..137cb9814d5 100644 --- a/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h +++ b/CIAO/connectors/dds4ccm/impl/dds/DDS_Subscriber_Base_T.h @@ -13,6 +13,8 @@ #include "dds4ccm/impl/dds/Reader_T.h" #include "dds4ccm/impl/dds/DataReader_T.h" #include "dds4ccm/impl/dds/PortStatusListener_T.h" +#include "dds4ccm/impl/dds/ContentFilterSetting.h" +#include "dds4ccm/impl/dds/ContentFilteredTopic.h" template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED> class DDS_Subscriber_Base_T @@ -57,10 +59,9 @@ protected: */ //@{ ::DDS::DataReaderListener_var listener_; - ::DDS::ContentFilteredTopic_var cft_; + ::CIAO::DDS4CCM::CCM_DDS_ContentFilterSetting_i cft_setting_; ::CIAO::DDS4CCM::DDS_CCM::Reader_T<DDS_TYPE, CCM_TYPE, FIXED> dds_read_; ::CIAO::DDS4CCM::DataReader_T<DDS_TYPE, CCM_TYPE> data_reader_; - ::CCM_DDS::QueryFilter filter_; bool configuration_complete_; //@} typedef ::CIAO::DDS4CCM::PortStatusListener_T <DDS_TYPE, CCM_TYPE> PortStatusListener; diff --git a/CIAO/connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc b/CIAO/connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc index 02e38c26181..32557df22c7 100644 --- a/CIAO/connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc +++ b/CIAO/connectors/dds4ccm/impl/dds/dds4ccm_impl.mpc @@ -26,6 +26,7 @@ project(CIAO_DDS4CCM_DDS_Impl) : install, dds4ccm_skel, taolib, ciao_output, ccm DomainParticipantListener.cpp DomainParticipantFactory.cpp ContentFilteredTopic.cpp + ContentFilterSetting.cpp Topic.cpp TopicDescription.cpp Publisher.cpp diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.idl new file mode 100644 index 00000000000..1b82760facb --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file CFTLE_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_BASE_IDL +#define CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_BASE_IDL + +#pragma ndds typesupport "Base/CFTLE_Test_BaseSupport.h" + +struct ContentFilteredTopicListenEventTest { + string key; //@key + long iteration; +}; + +typedef sequence<ContentFilteredTopicListenEventTest> ContentFilteredTopicListenEventTestSeq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.mpc new file mode 100755 index 00000000000..67c718583db --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Base/CFTLE_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CFTLE_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CFTLE_Test_Base_stub + dynamicflags += CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=CFTLE_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CFTLE_Test_Base.idl + } + + opendds_ts_flags += --export=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_BASE_STUB_Export + + DDSGenerator_Files { + CFTLE_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.idl new file mode 100644 index 00000000000..af834d46a57 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file CFTLE_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_IDL_ +#define CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CFTLE_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CFTLE_Test_ConnectorE.idl" + +module CFTLE_Test +{ + module ::CCM_DDS::Typed < ::ContentFilteredTopicListenEventTest, ::ContentFilteredTopicListenEventTestSeq> ContentFilteredTopicListenEventTestConnector; +}; + +#endif /* CFTLE_Test_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.mpc new file mode 100755 index 00000000000..db07b2a06ed --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Connector/CFTLE_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CFTLE_Test_Base -l .. -o ../lib -u DDS CFTLE_Test_Connector" + +project(DDS_CFTLE_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CFTLE_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CFTLE_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CFTLE_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CFTLE_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + CFTLE_Test_Connector.idl + } +} + +project(DDS_CFTLE_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CFTLE_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CFTLE_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CFTLE_Test_ConnectorE.idl + } +} + +project(DDS_CFTLE_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLE_Test_Connector_lem_gen DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_CFTLE_Test_Base_stub DDS_CFTLE_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CFTLE_Test_Connector_lem_stub + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ConnectorEC.cpp + } + + Header_Files { + CFTLE_Test_ConnectorEC.h + CFTLE_Test_Connector_lem_stub_export.h + } + + Inline_Files { + CFTLE_Test_ConnectorEC.inl + } +} + +project(DDS_CFTLE_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLE_Test_Connector_idl_gen DDS_CFTLE_Test_Base_stub + libs += DDS_CFTLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CFTLE_Test_Connector_stub + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ConnectorC.cpp + } + + Header_Files { + CFTLE_Test_ConnectorC.h + CFTLE_Test_Connector_stub_export.h + } + + Inline_Files { + CFTLE_Test_ConnectorC.inl + } +} + +project(DDS_CFTLE_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CFTLE_Test_Connector_lem_stub DDS_CFTLE_Test_Connector_stub DDS4CCM_lem_stub DDS_CFTLE_Test_Base_stub + sharedname = DDS_CFTLE_Test_Connector_exec + libs += DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Connector_lem_stub DDS_CFTLE_Test_Base_stub DDS4CCM_lem_stub DDS_CFTLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_Connector_conn.cpp + } + + Header_Files { + CFTLE_Test_Connector_conn.h + CFTLE_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLE_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CFTLE_Test_Connector_lem_stub DDS_CFTLE_Test_Connector_exec DDS_CFTLE_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CFTLE_Test_Connector_svnt + libs += DDS_CFTLE_Test_Connector_stub \ + DDS_CFTLE_Test_Connector_lem_stub \ + DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ConnectorS.cpp + CFTLE_Test_Connector_svnt.cpp + } + + Header_Files { + CFTLE_Test_ConnectorS.h + CFTLE_Test_Connector_svnt.h + CFTLE_Test_Connector_svnt_export.h + } + + Inline_Files { + CFTLE_Test_ConnectorS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.idl new file mode 100644 index 00000000000..d391fd42242 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CFTLE_Test_Connector.idl" + +module CFTLE_Test +{ + component Receiver + { + port ContentFilteredTopicListenEventTestConnector::DDS_Listen info_listen; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.mpc new file mode 100755 index 00000000000..50699bab140 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_CFTLE_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CFTLE_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h \ + -Wb,svnt_export_macro=RECEIVER_SVNT_Export \ + -Wb,svnt_export_include=Receiver_svnt_export.h \ + -Wb,exec_export_macro=RECEIVER_EXEC_Export \ + -Wb,exec_export_include=Receiver_exec_export.h -I.. + + IDL_Files { + CFTLE_Test_Receiver.idl + } +} + +project(DDS_CFTLE_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CFTLE_Test_Receiver_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ + -Wb,stub_export_include=Receiver_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + CFTLE_Test_ReceiverE.idl + } +} + +project(DDS_CFTLE_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLE_Test_Receiver_lem_gen DDS_CFTLE_Test_Receiver_stub \ + DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Base_stub + libs += Receiver_stub DDS_CFTLE_Test_Connector_stub \ + DDS_CFTLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ReceiverEC.cpp + } + + Header_Files { + CFTLE_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CFTLE_Test_ReceiverEC.inl + } +} + +project(DDS_CFTLE_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLE_Test_Receiver_idl_gen DDS_CFTLE_Test_Connector_stub \ + DDS_CFTLE_Test_Base_stub DDS_CFTLE_Test_Connector_lem_gen + libs += DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ReceiverC.cpp + } + + Header_Files { + CFTLE_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CFTLE_Test_ReceiverC.inl + } +} + +project(DDS_CFTLE_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CFTLE_Test_Receiver_lem_stub DDS_CFTLE_Test_Receiver_stub \ + DDS_CFTLE_Test_Base_stub DDS_CFTLE_Test_Connector_stub \ + DDS_CFTLE_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_Receiver_exec.cpp + } + + Header_Files { + CFTLE_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLE_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CFTLE_Test_Receiver_lem_stub DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Connector_svnt \ + DDS_CFTLE_Test_Receiver_exec DDS_CFTLE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Connector_svnt \ + Receiver_exec DDS_CFTLE_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_ReceiverS.cpp + CFTLE_Test_Receiver_svnt.cpp + } + + Header_Files { + CFTLE_Test_ReceiverS.h + CFTLE_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CFTLE_Test_ReceiverS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..cd8de13e9d3 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.cpp @@ -0,0 +1,226 @@ +// -*- C++ -*- +// +// $Id$ + +#include "CFTLE_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +#define MIN_ITERATION 2 +#define MAX_ITERATION 5 + +namespace CIAO_CFTLE_Test_Receiver_Impl +{ + //============================================================ + // ContentFilteredTopicListenEventTest_Listener_exec_i + //============================================================ + ContentFilteredTopicListenEventTest_Listener::ContentFilteredTopicListenEventTest_Listener ( + Atomic_ThreadId &thread_id) + : thread_id_ (thread_id) + { + } + + ContentFilteredTopicListenEventTest_Listener::~ContentFilteredTopicListenEventTest_Listener (void) + { + } + + void + ContentFilteredTopicListenEventTest_Listener::on_one_data ( + const ContentFilteredTopicListenEventTest & an_instance, + const ::CCM_DDS::ReadInfo & info) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "ContentFilteredTopicListenEventTest_Listener::on_one_data: " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + if (!info.instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, "ERROR: ContentFilteredTopicListenEventTest_Listener::on_one_data: " + "instance handle seems to be invalid " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + } + if (info.source_timestamp.sec == 0 && + info.source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ContentFilteredTopicListenEventTest_Listener::on_one_data: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + } + if (an_instance.iteration <= MIN_ITERATION || + an_instance.iteration > MAX_ITERATION ) + { + ACE_ERROR ((LM_ERROR, "ContentFilteredTopicListenEventTest_Listener::on_one_data: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + ContentFilteredTopicListenEventTest_Listener::on_many_data ( + const ContentFilteredTopicListenEventTestSeq & /* an_instance */, + const ::CCM_DDS::ReadInfoSeq & /*info*/) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : thread_id_listener_ (0), + iterations_ (10), + keys_ (5) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + void + Receiver_exec_i::start () + { + ::CCM_DDS::DataListenerControl_var dlc = + this->context_->get_connection_info_listen_data_control (); + dlc->mode (::CCM_DDS::ONE_BY_ONE); + } + + ::CFTLE_Test::ContentFilteredTopicListenEventTestConnector::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + return new ContentFilteredTopicListenEventTest_Listener ( + this->thread_id_listener_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Receiver_exec_i::keys (void) + { + return this->keys_; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CFTLE_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + this->reader_ = this->context_->get_connection_info_listen_data (); + if (CORBA::is_nil (this->reader_)) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::configuration_complete - " + "Error get reader connection.\n")); + } + } + + void + Receiver_exec_i::ccm_activate (void) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::ccm_activate - " + "Start listening.\n")); + start (); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for ReaderListener not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "QF_EVENT: " + "Thread switch for ReaderListener seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: QF_EVENT: " + "Thread switch for ReaderListener " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: QF_EVENT: ReaderListener: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "QF_EVENT: ReaderListener: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLE_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.h new file mode 100644 index 00000000000..dc4a5c693c5 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Receiver/CFTLE_Test_Receiver_exec.h @@ -0,0 +1,103 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CFTLE_Test_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" +#include "ace/OS_NS_Thread.h" +#include "ace/Reactor.h" +#include "ace/Task.h" + +#include <map> + +namespace CIAO_CFTLE_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ContentFilteredTopicListenEventTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ContentFilteredTopicListenEventTest_Listener + : public virtual ::CFTLE_Test::ContentFilteredTopicListenEventTestConnector::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + ContentFilteredTopicListenEventTest_Listener ( + Atomic_ThreadId &thread_id); + virtual ~ContentFilteredTopicListenEventTest_Listener (void); + + virtual void + on_one_data ( + const ContentFilteredTopicListenEventTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const ContentFilteredTopicListenEventTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ThreadId &thread_id_; + }; + + //============================================================ + // Receiver_exec_i + //============================================================ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + void start (); + + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + virtual ::CFTLE_Test::ContentFilteredTopicListenEventTestConnector::CCM_Listener_ptr + get_info_listen_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + + 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: + ::CFTLE_Test::CCM_Receiver_Context_var context_; + ::CFTLE_Test::ContentFilteredTopicListenEventTestConnector::Reader_var reader_; + + Atomic_ThreadId thread_id_listener_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLE_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.idl new file mode 100644 index 00000000000..72a132108ac --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_SENDER_IDL +#define DDS_CONTENTFILTEREDTOPIC_LISTEN_EVENT_TEST_SENDER_IDL + +#include "Connector/CFTLE_Test_Connector.idl" + +module CFTLE_Test +{ + component Sender + { + port ContentFilteredTopicListenEventTestConnector::DDS_Write info_write; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.mpc new file mode 100755 index 00000000000..360fec1473f --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CFTLE_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CFTLE_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CFTLE_Test_Connector_idl_gen DDS_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ + -Wb,stub_export_include=Sender_stub_export.h \ + -Wb,skel_export_macro=SENDER_SVNT_Export \ + -Wb,skel_export_include=Sender_svnt_export.h \ + -Wb,svnt_export_macro=SENDER_SVNT_Export \ + -Wb,svnt_export_include=Sender_svnt_export.h \ + -Wb,exec_export_macro=SENDER_EXEC_Export \ + -Wb,exec_export_include=Sender_exec_export.h \ + -I .. + + IDL_Files { + CFTLE_Test_Sender.idl + } +} + +project(DDS_CFTLE_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CFTLE_Test_Sender_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ + -Wb,stub_export_include=Sender_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + CFTLE_Test_SenderE.idl + } +} + +project(DDS_CFTLE_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLE_Test_Sender_lem_gen DDS_CFTLE_Test_Sender_stub \ + DDS_CFTLE_Test_Base_stub + libs += DDS_CFTLE_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_SenderEC.cpp + } + + Header_Files { + CFTLE_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CFTLE_Test_SenderEC.inl + } +} + +project(DDS_CFTLE_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLE_Test_Sender_idl_gen DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_stub + libs += DDS_CFTLE_Test_Base_stub DDS_CFTLE_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_SenderC.cpp + } + + Header_Files { + CFTLE_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CFTLE_Test_SenderC.inl + } +} + +project(DDS_CFTLE_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CFTLE_Test_Sender_lem_stub DDS_CFTLE_Test_Sender_stub \ + DDS_CFTLE_Test_Connector_lem_stub DDS_CFTLE_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CFTLE_Test_Base_stub \ + DDS_CFTLE_Test_Connector_lem_stub DDS_CFTLE_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_Sender_exec.cpp + } + + Header_Files { + CFTLE_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLE_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CFTLE_Test_Base_stub DDS_CFTLE_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_CFTLE_Test_Connector_stub \ + DDS_CFTLE_Test_Connector_svnt DDS_CFTLE_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_CFTLE_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_CFTLE_Test_Connector_stub DDS_CFTLE_Test_Connector_svnt \ + DDS_CFTLE_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLE_Test_SenderS.cpp + CFTLE_Test_Sender_svnt.cpp + } + + Header_Files { + CFTLE_Test_SenderS.h + CFTLE_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CFTLE_Test_SenderS.inl + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.cpp new file mode 100644 index 00000000000..871435cc17f --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.cpp @@ -0,0 +1,200 @@ +// -*- C++ -*- +// $Id$ + +#include "CFTLE_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "ace/Date_Time.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_CFTLE_Test_Sender_Impl +{ + //============================================================ + // WriteManyHandler + //============================================================ + WriteTicker::WriteTicker (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteTicker::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->callback_.write_one (); + return 0; + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (10), + keys_ (5) + { + this->ticker_ = new WriteTicker (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::write_one (void) + { + if (this->last_key_ != this->samples_.end ()) + { + try + { + ++this->last_key_->second->iteration; + this->writer_->write_one (this->last_key_->second, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Written key <%C> - <%u>\n", + this->last_key_->first.c_str (), + this->last_key_->second->iteration)); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("while updating writer info for <%C>.\n"), + this->last_key_->first.c_str ())); + } + ++this->last_key_; + } + else + { + //onto the next iteration + this->last_key_ = this->samples_.begin (); + while (this->last_key_ != this->samples_.end ()) + { + if (this->last_key_->second->iteration == this->iterations_) + { + //next key + ++this->last_key_; + } + else + { + break; + } + } + if (this->last_key_ == this->samples_.end ()) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + } + } + } + + + void + Sender_exec_i::start (void) + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, + this->mutex_, CORBA::INTERNAL ()); + + for (CORBA::UShort i = 1; i < this->keys_ + 1; ++i) + { + char key[7]; + ContentFilteredTopicListenEventTest *new_key = new ContentFilteredTopicListenEventTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 0; + + this->samples_[key] = new_key; + } + this->last_key_ = this->samples_.begin (); + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (5, 50000), + ACE_Time_Value (0, 50000)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + ::CORBA::UShort + Sender_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Sender_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Sender_exec_i::keys (void) + { + return this->keys_; + } + + void + Sender_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CFTLE_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + } + + void + Sender_exec_i::ccm_activate (void) + { + try + { + this->writer_ = this->context_->get_connection_info_write_data (); + start (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Exception caught\n"))); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Unknown exception caught\n"))); + } + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLE_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.h new file mode 100644 index 00000000000..75172b7aa3a --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/Sender/CFTLE_Test_Sender_exec.h @@ -0,0 +1,86 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CFTLE_Test_SenderEC.h" + +#include /**/ "Sender_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_CFTLE_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // WriteTicker + //============================================================ + class WriteTicker : + public ACE_Event_Handler + { + public: + WriteTicker (Sender_exec_i &callback); + int handle_timeout (const ACE_Time_Value &, const void *); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &callback_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (void); + + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + 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); + + void start (void); + void write_one (void); + + private: + ::CFTLE_Test::CCM_Sender_Context_var context_; + ::CFTLE_Test::ContentFilteredTopicListenEventTestConnector::Writer_var writer_; + + WriteTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, ContentFilteredTopicListenEventTest_var> Writer_Table; + Writer_Table samples_; + + Writer_Table::iterator last_key_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLE_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/Plan.cdp new file mode 100644 index 00000000000..efd1f638192 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/Plan.cdp @@ -0,0 +1,440 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CFTLE_Test_Depl_1</label> + <UUID>CFTLE_Test_Depl_1</UUID> + + <implementation xmi:id="ReceiverComponentImplementation"> + <name>ReceiverComponentImplementation</name> + <source/> + <artifact xmi:idref="Receiver_ExecArtifact" /> + <artifact xmi:idref="Receiver_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_Receiver_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="CFTLE_Test_ConnectorComponentImplementation"> + <name>CFTLE_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CFTLE_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="CFTLE_Test_Connector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_ContentFilteredTopicListenEventTestConnector_DDS_Event_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_ContentFilteredTopicListenEventTestConnector_DDS_Event_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLE_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLE_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="SenderComponentImplementation"> + <name>SenderComponentImplementation</name> + <source/> + <artifact xmi:idref="Sender_ExecArtifact" /> + <artifact xmi:idref="Sender_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLE_Test_Sender_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="ReceiverComponentInstance"> + <name>ReceiverComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReceiverComponentImplementation" /> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CFTLE_Test_ConnectorComponentInstance"> + <name>CFTLE_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CFTLE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLE_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CFTLE_Test_ConnectorComponentInstance2"> + <name>CFTLE_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CFTLE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLE_Test</string> + </value> + </value> + </configProperty> + <configProperty> + <name>filter</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>QueryFilter</name> + <typeId>IDL:CCM_DDS/QueryFilter:1.0</typeId> + <member> + <name>expression</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>parameters</name> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_string</kind> + </elementType> + </sequence> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>expression</name> + <value> + <string>( (iteration > %0) AND (iteration < %1) )</string> + </value> + </member> + <member> + <name>parameters</name> + <value> + <element> + <string>2</string> + </element> + <element> + <string>5</string> + </element> + </value> + </member> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_listen_reader_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLE_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_listen_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_data_listener</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CFTLE_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_listen_data_control</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_data_control</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data_control</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLE_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_write_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLE_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Sender_ExecArtifact"> + <name>Sender_exec</name> + <source/> + <node/> + <location>Sender_exec</location> + </artifact> + <artifact xmi:id="Sender_SvntArtifact"> + <name>Sender_svnt</name> + <source/> + <node/> + <location>Sender_svnt</location> + </artifact> + <artifact xmi:id="Sender_StubArtifact"> + <name>Sender_stub</name> + <source/> + <node/> + <location>Sender_stub</location> + </artifact> + <artifact xmi:id="CFTLE_Test_Connector_ExecArtifact"> + <name>CFTLE_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_CFTLE_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="CFTLE_Test_Connector_SvntArtifact"> + <name>CFTLE_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CFTLE_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="CFTLE_Test_Connector_StubArtifact"> + <name>CFTLE_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_CFTLE_Test_Connector_stub</location> + </artifact> + <artifact xmi:id="Receiver_ExecArtifact"> + <name>Receiver_exec</name> + <source/> + <node/> + <location>Receiver_exec</location> + </artifact> + <artifact xmi:id="Receiver_SvntArtifact"> + <name>Receiver_svnt</name> + <source/> + <node/> + <location>Receiver_svnt</location> + </artifact> + <artifact xmi:id="Receiver_StubArtifact"> + <name>Receiver_stub</name> + <source/> + <node/> + <location>Receiver_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/run_test.pl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/run_test.pl new file mode 100755 index 00000000000..c54f6824248 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/EventListener/descriptors/run_test.pl @@ -0,0 +1,244 @@ +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; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DANCE_ROOT = "$ENV{'DANCE_ROOT'}"; + +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; + +$nr_daemon = 2; +@ports = ( 60001, 60002 ); +@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" ); +@iorfiles = 0; +@nodenames = ( "SenderNode", "ReceiverNode" ); + +# ior files other than daemon +# ior files other than daemon +$ior_nsbase = "ns.ior"; +$ior_nsfile = 0; +$ior_embase = "EM.ior"; +$ior_emfile = 0; + +# Processes +$E = 0; +$EM = 0; +$NS = 0; +@DEAMONS = 0; + +# targets +@tg_daemons = 0; +$tg_naming = 0; +$tg_exe_man = 0; +$tg_executor = 0; + +$status = 0; +$cdp_file = "Plan.cdp"; + +sub create_targets { + # naming service + $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + $tg_naming->AddLibPath ('../lib'); + # daemon + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for deamon $i failed\n"; + $tg_daemons[$i]->AddLibPath ('../lib'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('../lib'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('../lib'); +} + +sub init_ior_files { + $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase); + $ior_emfile = $tg_exe_man->LocalFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } + delete_ior_files (); +} + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i]->DeleteFile ($iorbases[$i]); + } + $tg_naming->DeleteFile ($ior_nsbase); + $tg_exe_man->DeleteFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } +} + +sub kill_node_daemon { + for ($i = 0; $i < $nr_daemon; ++$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemon (); + } + + if ($em_running == 1) { + $EM->Kill (); $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); $NS->TimedWait (1); + } + # in case shutdown did not perform as expected + $tg_executor->KillAll ('dance_locality_manager'); +} + +sub run_node_daemons { + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorbase = $iorbases[$i]; + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = PerlACE::GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager"; + + $d_cmd = "$DANCE_ROOT/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService"; + + print "Run dance_node_manager with $d_param\n"; + + $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param); + $DEAMONS[$i]->Spawn (); + + if ($tg_daemons[$i]->WaitForFileTimed($iorbase, + $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +create_targets (); +init_ior_files (); + +# Invoke naming service + +$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 1 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + +$ns_status = $NS->Spawn (); + +if ($ns_status != 0) { + print STDERR "ERROR: Unable to execute the naming service\n"; + kill_open_processes (); + exit 1; +} + +print STDERR "Starting Naming Service with -m 1 -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; + +if ($tg_naming->WaitForFileTimed ($ior_nsbase, + $tg_naming->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; +} + +$ns_running = 1; +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + +# Invoke node daemon. +print "Invoking node daemon\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n"; +$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager", + "-e$ior_emfile --domain-nc corbaloc:rir:/NameService"); +$em_status = $EM->Spawn (); + +if ($em_status != 0) { + print STDERR "ERROR: dance_execution_manager returned $em_status"; + exit 1; +} + +if ($tg_exe_man->WaitForFileTimed ($ior_embase, + $tg_exe_man->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; +} + +$em_running = 1; + +# Invoke executor - start the application -. +print "Invoking executor - launch the application -\n"; + +print "Start dance_plan_launcher.exe with -x $cdp_file -k file://$ior_emfile\n"; +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $cdp_file -k file://$ior_emfile"); +$pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +for ($i = 0; $i < $nr_daemon; ++$i) { + if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i], + $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) { + print STDERR "ERROR: The ior file of daemon $i could not be found\n"; + kill_open_processes (); + exit 1; + } +} + +print "Sleeping 30 seconds to allow task to complete\n"; +sleep (30); + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $cdp_file -q\n"; + +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $cdp_file -s"); +$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.idl new file mode 100644 index 00000000000..84cc3548b04 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file ReadGet_Starter.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERYCONDITION_STARTER_IDL +#define QUERYCONDITION_STARTER_IDL + +#pragma ciao lem "Base/ReadGet_StarterE.idl" + +interface ReadGetStarter +{ + void set_reader_properties (in unsigned short nr_keys, + in unsigned short nr_iterations); + void start_read (in unsigned short run); +}; + +interface ReadGetRestarter +{ + void restart_write (); +}; + +#endif /* QUERYCONDITION_STARTER_IDL */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.mpc new file mode 100755 index 00000000000..639f74af418 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Starter.mpc @@ -0,0 +1,114 @@ +// $Id$ + +project(CFT_ReadGet_Starter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=ReadGet_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=ReadGet_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=ReadGet_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=ReadGet_Starter_exec_export.h -I.. + + IDL_Files { + ReadGet_Starter.idl + } +} + +project(CFT_ReadGet_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += CFT_ReadGet_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=ReadGet_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + ReadGet_StarterE.idl + } +} + +project(CFT_ReadGet_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += CFT_ReadGet_Starter_lem_gen CFT_ReadGet_Starter_stub + libs += ReadGet_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = ReadGet_Starter_lem_stub + dynamicflags = READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_StarterEC.cpp + } + + Header_Files { + ReadGet_StarterEC.h + ReadGet_Starter_lem_stub_export.h + } + + Inline_Files { + ReadGet_StarterEC.inl + } +} + +project(CFT_ReadGet_Starter_stub) : ccm_stub, dds4ccm_base { + after += CFT_ReadGet_Starter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = ReadGet_Starter_stub + dynamicflags = READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_StarterC.cpp + } + + Header_Files { + ReadGet_StarterC.h + ReadGet_Starter_stub_export.h + } + + Inline_Files { + ReadGet_StarterC.inl + } +} + + +project(CFT_ReadGet_Starter_svnt) : ciao_servant, dds4ccm_base { + after += CFT_ReadGet_Starter_lem_stub CFT_ReadGet_Starter_stub\ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = ReadGet_Starter_svnt + libs += ReadGet_Starter_stub ReadGet_Starter_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_StarterS.cpp + ReadGet_Starter_svnt.cpp + } + + Header_Files { + ReadGet_StarterS.h + ReadGet_Starter_svnt.h + ReadGet_Starter_svnt_export.h + } + + Inline_Files { + ReadGet_StarterS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.idl new file mode 100644 index 00000000000..0e08b809b03 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file ReadGet_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_CONDITION_TEST_BASE_IDL +#define QUERY_CONDITION_TEST_BASE_IDL + +#pragma ndds typesupport "Base/ReadGet_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "QueryConditionTest" +#pragma DCPS_DATA_KEY "QueryConditionTest symbol" + +struct QueryConditionTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<QueryConditionTest> QueryConditionTestSeq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.mpc new file mode 100755 index 00000000000..752a855e25e --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Base/ReadGet_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project(CFT_ReadGet_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = ReadGet_Test_Base_stub + dynamicflags += QUERY_CONDITION_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=QUERY_CONDITION_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=ReadGet_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + ReadGet_Test_Base.idl + } + + opendds_ts_flags += --export=QUERY_CONDITION_TEST_BASE_STUB_Export + + DDSGenerator_Files { + ReadGet_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.idl new file mode 100644 index 00000000000..370ba27eaaa --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file ReadGet_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_CONDITION_TEST_CONNECTOR_IDL_ +#define QUERY_CONDITION_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/ReadGet_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/ReadGet_Test_ConnectorE.idl" + +module ReadGet_Test +{ + module ::CCM_DDS::Typed < ::QueryConditionTest, ::QueryConditionTestSeq> QueryConditionTestConnector; +}; + +#endif /* QUERY_CONDITION_TEST_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.mpc new file mode 100755 index 00000000000..b6ef00ea9d8 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Connector/ReadGet_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p ReadGet_Test_Base -l .. -o ../lib -u DDS ReadGet_Test_Connector" + +project(CFT_ReadGet_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=ReadGet_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=QUERY_CONDITION_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=ReadGet_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=QUERY_CONDITION_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=ReadGet_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=QUERY_CONDITION_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=ReadGet_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + ReadGet_Test_Connector.idl + } +} + +project(CFT_ReadGet_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += ReadGet_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=ReadGet_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + ReadGet_Test_ConnectorE.idl + } +} + +project(CFT_ReadGet_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += ReadGet_Test_Connector_lem_gen ReadGet_Test_Connector_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub + libs += ReadGet_Test_Base_stub ReadGet_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = ReadGet_Test_Connector_lem_stub + dynamicflags = QUERY_CONDITION_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ConnectorEC.cpp + } + + Header_Files { + ReadGet_Test_ConnectorEC.h + ReadGet_Test_Connector_lem_stub_export.h + } + + Inline_Files { + ReadGet_Test_ConnectorEC.inl + } +} + +project(CFT_ReadGet_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += ReadGet_Test_Connector_idl_gen ReadGet_Test_Base_stub + libs += ReadGet_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = ReadGet_Test_Connector_stub + dynamicflags = QUERY_CONDITION_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ConnectorC.cpp + } + + Header_Files { + ReadGet_Test_ConnectorC.h + ReadGet_Test_Connector_stub_export.h + } + + Inline_Files { + ReadGet_Test_ConnectorC.inl + } +} + +project(CFT_ReadGet_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub DDS4CCM_lem_stub ReadGet_Test_Base_stub + sharedname = ReadGet_Test_Connector_exec + libs += ReadGet_Test_Connector_stub ReadGet_Test_Connector_lem_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub ReadGet_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_CONDITION_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_Connector_conn.cpp + } + + Header_Files { + ReadGet_Test_Connector_conn.h + ReadGet_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(CFT_ReadGet_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_exec ReadGet_Test_Connector_stub DDS4CCM_lem_stub + sharedname = ReadGet_Test_Connector_svnt + libs += ReadGet_Test_Connector_stub \ + ReadGet_Test_Connector_lem_stub \ + ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_CONDITION_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ConnectorS.cpp + ReadGet_Test_Connector_svnt.cpp + } + + Header_Files { + ReadGet_Test_ConnectorS.h + ReadGet_Test_Connector_svnt.h + ReadGet_Test_Connector_svnt_export.h + } + + Inline_Files { + ReadGet_Test_ConnectorS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.idl new file mode 100644 index 00000000000..eab115ce81c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/ReadGet_Test_Connector.idl" +#include "Base/ReadGet_Starter.idl" + +module ReadGet_Test +{ + component Receiver + { + port QueryConditionTestConnector::DDS_Get get_port; + + port QueryConditionTestConnector::DDS_Read read_port; + + provides ReadGetStarter reader_start; + uses ReadGetRestarter writer_restart; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.mpc new file mode 100755 index 00000000000..e33672339ee --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(CFT_ReadGet_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += ReadGet_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h \ + -Wb,svnt_export_macro=RECEIVER_SVNT_Export \ + -Wb,svnt_export_include=Receiver_svnt_export.h \ + -Wb,exec_export_macro=RECEIVER_EXEC_Export \ + -Wb,exec_export_include=Receiver_exec_export.h -I.. + + IDL_Files { + ReadGet_Test_Receiver.idl + } +} + +project(CFT_ReadGet_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += ReadGet_Test_Receiver_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ + -Wb,stub_export_include=Receiver_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + ReadGet_Test_ReceiverE.idl + } +} + +project(CFT_ReadGet_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += ReadGet_Test_Receiver_lem_gen ReadGet_Test_Receiver_stub \ + ReadGet_Test_Connector_stub ReadGet_Test_Base_stub \ + CFT_ReadGet_Starter_stub + libs += Receiver_stub ReadGet_Test_Connector_stub \ + ReadGet_Test_Base_stub ReadGet_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ReceiverEC.cpp + } + + Header_Files { + ReadGet_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + ReadGet_Test_ReceiverEC.inl + } +} + +project(CFT_ReadGet_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += ReadGet_Test_Receiver_idl_gen ReadGet_Test_Connector_stub \ + ReadGet_Test_Base_stub ReadGet_Test_Connector_lem_gen \ + CFT_ReadGet_Starter_stub CFT_ReadGet_Starter_lem_stub + libs += ReadGet_Test_Connector_stub ReadGet_Test_Base_stub \ + ReadGet_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ReceiverC.cpp + } + + Header_Files { + ReadGet_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + ReadGet_Test_ReceiverC.inl + } +} + +project(CFT_ReadGet_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += ReadGet_Test_Receiver_lem_stub ReadGet_Test_Receiver_stub \ + ReadGet_Test_Base_stub ReadGet_Test_Connector_stub \ + ReadGet_Test_Connector_lem_stub DDS4CCM_lem_stub \ + CFT_ReadGet_Starter_lem_stub CFT_ReadGet_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_stub ReadGet_Test_Connector_lem_stub \ + DDS4CCM_lem_stub ReadGet_Starter_lem_stub ReadGet_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_Receiver_exec.cpp + } + + Header_Files { + ReadGet_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(CFT_ReadGet_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += ReadGet_Test_Receiver_lem_stub ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ + ReadGet_Test_Receiver_exec ReadGet_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel CFT_ReadGet_Starter_stub \ + CFT_ReadGet_Starter_svnt CFT_ReadGet_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ + Receiver_exec ReadGet_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel ReadGet_Starter_stub ReadGet_Starter_svnt \ + ReadGet_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_ReceiverS.cpp + ReadGet_Test_Receiver_svnt.cpp + } + + Header_Files { + ReadGet_Test_ReceiverS.h + ReadGet_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + ReadGet_Test_ReceiverS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..f240d9bf421 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.cpp @@ -0,0 +1,663 @@ +// -*- C++ -*- +// +// $Id$ + +#include "ReadGet_Test_Receiver_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +#define QUERY_GETTER_PORT "( (iteration > %0) AND (iteration < %1) )" +#define QUERY_READER_PORT "( (iteration < %0) OR (iteration > %1) )" + +// initial values set in deploymentplan as well. +// Need to be the same +#define ITER1_VALUE1 "2" +#define ITER1_VALUE2 "5" + +#define ITER2_VALUE1 "12" +#define ITER2_VALUE2 "25" + +namespace CIAO_ReadGet_Test_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback, int run) + : callback_ (callback), + run_ (run) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + ACE_DEBUG ((LM_DEBUG, "Checking if last sample " + "is available in DDS...\n")); + if (this->run_ == 1 || this->callback_.check_last ()) + { + this->callback_.run (this->run_); + } + return 0; + } + + //============================================================ + // Starter_exec_i + //============================================================ + Starter_exec_i::Starter_exec_i (Receiver_exec_i & callback) + : callback_ (callback) + { + } + + Starter_exec_i::~Starter_exec_i (void) + { + } + + void + Starter_exec_i::set_reader_properties (CORBA::UShort nr_keys, + CORBA::UShort nr_iterations) + { + this->callback_.keys (nr_keys); + this->callback_.iterations (nr_iterations); + } + + void + Starter_exec_i::start_read (CORBA::UShort run) + { + this->callback_.start_read (run); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (10), + keys_ (5), + has_run_ (false), + current_iter_value1_ (ACE_OS::atoi (ITER1_VALUE1)), + current_iter_value2_ (ACE_OS::atoi (ITER1_VALUE2)), + ticker_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + QueryConditionTest queryfiltertest_info; + ::CCM_DDS::ReadInfo readinfo; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", this->keys_); + queryfiltertest_info.symbol = CORBA::string_dup (key); + this->get_reader_->read_one_last ( + queryfiltertest_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last - " + "last iteration <%d> - <%d>\n", + queryfiltertest_info.iteration, + this->current_iter_value2_ - 1)); + return queryfiltertest_info.iteration >= this->current_iter_value2_ - 1; + } + catch (...) + { + // no need to catch. An error is given + // when this example didn't run at all. + } + return false; + } + + // Supported operations and attributes. + void + Receiver_exec_i::check_iter_on_reader_port (const QueryConditionTest & sample) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ALL ON READER PORT : ") + ACE_TEXT ("sample received for <%C>: iteration <%u>\n"), + sample.symbol.in (), + sample.iteration)); + if (sample.iteration > this->current_iter_value1_ && + sample.iteration < this->current_iter_value2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL ON READER PORT : " + "Didn't expect samples between " + "%d and %d\n", + this->current_iter_value1_, + this->current_iter_value2_)); + } + } + + void + Receiver_exec_i::check_iter_on_getter_port (const QueryConditionTest & sample, + const char * test) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%C ALL ON GETTER PORT : ") + ACE_TEXT ("sample received for <%C>: iteration <%u>\n"), + test, + sample.symbol.in (), + sample.iteration)); + if (sample.iteration <= ACE_OS::atoi (ITER1_VALUE1)) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL ON GETTER PORT : " + "Didn't expect samples with iterations " + "<= %d\n", + test, + this->current_iter_value1_)); + } + if (sample.iteration > this->current_iter_value2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL ON GETTER PORT : " + "Didn't expect samples with iterations " + "> %d\n", + test, + this->current_iter_value2_)); + } + } + + + void + Receiver_exec_i::read_all_on_reader_port (void) + { + QueryConditionTestSeq queryfiltertest_info_seq; + ::CCM_DDS::ReadInfoSeq readinfo_seq; + this->read_reader_->read_all (queryfiltertest_info_seq, readinfo_seq); + if (queryfiltertest_info_seq.length () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR : Receiver_exec_i::read_all : " + "No samples available in Reader!\n")); + } + for (CORBA::ULong it = 0; it < queryfiltertest_info_seq.length (); ++it) + { + this->check_iter_on_reader_port (queryfiltertest_info_seq[it]); + } + } + + void + Receiver_exec_i::read_all_on_getter_port (void) + { + QueryConditionTestSeq queryfiltertest_info_seq; + ::CCM_DDS::ReadInfoSeq readinfo_seq; + this->get_reader_->read_all (queryfiltertest_info_seq, readinfo_seq); + if (queryfiltertest_info_seq.length () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR : Receiver_exec_i::read_all : " + "No samples available in Reader!\n")); + } + for (CORBA::ULong it = 0; it < queryfiltertest_info_seq.length (); ++it) + { + this->check_iter_on_getter_port (queryfiltertest_info_seq[it], "READ"); + } + } + + void + Receiver_exec_i::get_all_on_getter_port (void) + { + if (::CORBA::is_nil (this->get_getter_)) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::get_all - " + "ERROR: No Getter\n")); + } + QueryConditionTest * qf_info = new QueryConditionTest; + ::CCM_DDS::ReadInfo readinfo; + bool result = this->get_getter_->get_one (qf_info, readinfo); + if (result) + { + this->check_iter_on_getter_port (*qf_info, "GET"); + } + else + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::get_all - " + "ERROR: time out when retrieving " + "first sample.\n")); + } + while (result) + { + result = this->get_getter_->get_one (qf_info, readinfo); + if (result) + { + this->check_iter_on_getter_port (*qf_info, "GET"); + } + } + } + + void + Receiver_exec_i::test_all () + { + const char * test = "GET ALL"; + try + { + get_all_on_getter_port (); + test = "READ ALL GETTER"; + read_all_on_getter_port (); + test = "READ ALL READER"; + read_all_on_reader_port (); + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ERROR %C: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + test, + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: %C: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + test, + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception (test); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::test_all : Exception caught\n"))); + } + } + + void + Receiver_exec_i::check_filter () + { +// check_filter (true); +// check_filter (false); + } + + void + Receiver_exec_i::check_filter (bool check_reader) + { + ::CCM_DDS::QueryFilter * filter = 0; + const char * port = ""; + check_reader ? port = "Reader" : port = "Getter"; + try + { + CORBA::Object_var cmp = this->get_getter_->_get_component (); + if (CORBA::is_nil (cmp.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unable to get component interface\n")); + throw ::CCM_DDS::InternalError (); + } + ::ReadGet_Test::QueryConditionTestConnector::CCM_DDS_Event_var conn = + ::ReadGet_Test::QueryConditionTestConnector::CCM_DDS_Event::_narrow (cmp.in ()); + if (CORBA::is_nil (conn.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unable to get connector interface\n")); + throw CCM_DDS::InternalError (); + } + + if (check_reader) + { + filter = conn->push_consumer_filter (); + } + else + { + filter = conn->pull_consumer_filter (); + } + if (!filter) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Filter is nil\n")); + return; + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "caught InternalError exception: retval <%u>\n", + port, + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::check_filter: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Exception caught\n", + port)); + return; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "caught unknown exception\n", + port)); + return; + } + + //check query + bool error = false; + if (ACE_OS::strcmp (filter->expression, QUERY_GETTER_PORT) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + port, QUERY_GETTER_PORT, filter->expression.in ())); + error = true; + } + //check current parameters. + if (filter->parameters.length () != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unexpected number of parameters: " + "expected <%d> - received <%d>\n", + port, 2, filter->parameters.length ())); + error = true; + } + + if (filter->parameters.length () >= 1) + { + if (ACE_OS::atoi (filter->parameters[0]) != this->current_iter_value1_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + port, QUERY_GETTER_PORT, filter->expression.in ())); + error = true; + } + } + if (filter->parameters.length () >= 2) + { + if (ACE_OS::atoi (filter->parameters[1]) != this->current_iter_value2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter <%C> - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + port, QUERY_GETTER_PORT, filter->expression.in ())); + error = true; + } + } + if (!error) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_filter - " + "Passed check_filter test.\n")); + } + } + + void + Receiver_exec_i::test_set_query_parameters () + { + bool exception_caught = false; + try + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::test_set_query_parameters: Test exception\n")); + ::DDS::StringSeq parameters; + parameters.length (4); + parameters[0] = CORBA::string_dup (ITER2_VALUE1); + parameters[1] = CORBA::string_dup (ITER2_VALUE2); + parameters[2] = CORBA::string_dup (ITER2_VALUE1); + parameters[3] = CORBA::string_dup (ITER2_VALUE2); + + this->get_filter_setting_->set_filter_parameters (parameters); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::test_set_query_parameters - " + "caught expected InternalError exception.\n")); + exception_caught = true; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::test_set_query_parameters: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "Exception caught\n")); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "caught unknown exception\n")); + } + if (!exception_caught) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "Didn't catch the exprected exception\n")); + } + try + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::test_set_query_parameters: Set parameters\n")); + ::DDS::StringSeq parameters; + parameters.length (2); + parameters[0] = CORBA::string_dup (ITER2_VALUE1); + parameters[1] = CORBA::string_dup (ITER2_VALUE2); + + this->get_filter_setting_->set_filter_parameters (parameters); + this->read_filter_setting_->set_filter_parameters (parameters); + + this->current_iter_value1_ = ACE_OS::atoi (ITER2_VALUE1); + this->current_iter_value2_ = ACE_OS::atoi (ITER2_VALUE2); + ACE_DEBUG ((LM_DEBUG, "DONE Receiver_exec_i::test_set_query_parameters\n")); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "caught InternalError exception: retval <%u>\n", + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::test_set_query_parameters: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "Exception caught\n")); + return; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "caught unknown exception\n")); + return; + } + } + + void + Receiver_exec_i::start_read (CORBA::UShort run) + { + this->ticker_ = new read_action_Generator (*this, run); + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(1, 0), + ACE_Time_Value(1, 0)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::run (CORBA::UShort run) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + this->has_run_ = true; + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::run - " + "Starting run number <%d>\n", + run)); + switch (run) + { + case 1: + { + check_filter (); + this->restarter_->restart_write (); + } + break; + case 2: + { + test_all (); + check_filter (); + test_set_query_parameters (); + this->restarter_->restart_write (); + } + break; + case 3: + { + test_all (); + check_filter (); + } + break; + } + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Receiver_exec_i::keys (void) + { + return this->keys_; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_get_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_read_port_status(void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_ReadGetStarter_ptr + Receiver_exec_i::get_reader_start () + { + return new Starter_exec_i (*this); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::ReadGet_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + } + + void + Receiver_exec_i::ccm_activate (void) + { + this->read_reader_ = this->context_->get_connection_read_port_data (); + this->get_reader_ = this->context_->get_connection_get_port_data (); + this->get_getter_ = this->context_->get_connection_get_port_fresh_data (); + this->get_filter_setting_ = this->context_->get_connection_get_port_filter_config (); + this->read_filter_setting_ = this->context_->get_connection_read_port_filter_config (); + + if (CORBA::is_nil (this->get_filter_setting_.in ()) || + CORBA::is_nil (this->read_filter_setting_.in ()) || + CORBA::is_nil (this->read_reader_.in ()) || + CORBA::is_nil (this->get_reader_.in ()) || + CORBA::is_nil (this->get_getter_.in ())) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::ccm_activate : " + "ERROR: Error while retrieving connections " + "Filter settings getter <%@>\n" + "Filter settings reader <%@>\n" + "Reader on Reader port <%@>\n" + "Reader on Getter port <%@>\n" + "Getter on Getter port <%@>\n", + this->get_filter_setting_.in (), + this->read_filter_setting_.in (), + this->read_reader_.in (), + this->get_reader_.in (), + this->get_getter_.in ())); + } + + DDS::Duration_t to; + to.sec = 5; + to.nanosec = 0; + if (! ::CORBA::is_nil (this->get_getter_)) + { + this->get_getter_->time_out (to); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to set time out.\n")); + } + this->restarter_ = this->context_->get_connection_writer_restart (); +} + + void + Receiver_exec_i::ccm_passivate (void) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->has_run_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("Test did not run: Didn't receive ") + ACE_TEXT ("the expected number of DATA_ON_READER ") + ACE_TEXT ("events.\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished query filter test.\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_ReadGet_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.h new file mode 100644 index 00000000000..7d1ad20fc13 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Receiver/ReadGet_Test_Receiver_exec.h @@ -0,0 +1,145 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "ReadGet_Test_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_ReadGet_Test_Receiver_Impl +{ + class Receiver_exec_i; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback, + int run); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Receiver_exec_i &callback_; + int run_; + + }; + + //============================================================ + // Starter_exec_i + //============================================================ + class Starter_exec_i + : public virtual ::CCM_ReadGetStarter, + public virtual ::CORBA::LocalObject + { + public: + Starter_exec_i (Receiver_exec_i & callback); + virtual ~Starter_exec_i (void); + + virtual void set_reader_properties (CORBA::UShort nr_keys, + CORBA::UShort nr_iterations); + virtual void start_read (CORBA::UShort run); + + private: + Receiver_exec_i &callback_; + }; + + //============================================================ + // Receiver_exec_i + //============================================================ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + // Supported operations and attributes. + // Component attributes. + + // Port operations. + virtual ::CCM_ReadGetStarter_ptr + get_reader_start (); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_get_port_status (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_read_port_status(void); + + bool check_last (); + void start_read (CORBA::UShort run); + void run (CORBA::UShort run); + + ::CORBA::UShort iterations (void); + + void iterations (::CORBA::UShort iterations); + + ::CORBA::UShort keys (void); + + void keys (::CORBA::UShort keys); + + // 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: + ::ReadGet_Test::CCM_Receiver_Context_var context_; + ::ReadGet_Test::QueryConditionTestConnector::Reader_var read_reader_; + ::ReadGet_Test::QueryConditionTestConnector::Reader_var get_reader_; + ::ReadGet_Test::QueryConditionTestConnector::Getter_var get_getter_; + ::CCM_DDS::ContentFilterSetting_var get_filter_setting_; + ::CCM_DDS::ContentFilterSetting_var read_filter_setting_; + + ReadGetRestarter_var restarter_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + bool has_run_; + + int current_iter_value1_; + int current_iter_value2_; + + read_action_Generator *ticker_; + + void test_all (void); + void read_all_on_getter_port (void); + void get_all_on_getter_port (void); + void read_all_on_reader_port (void); + void check_iter_on_getter_port (const QueryConditionTest & sample, + const char * test); + void check_iter_on_reader_port (const QueryConditionTest & sample); + + void check_filter (void); + void check_filter (bool check_reader); + void test_set_query_parameters (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_ReadGet_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.idl new file mode 100644 index 00000000000..3e1c34e19c6 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_QUERY_CONDITION_TEST_SENDER_IDL +#define DDS_QUERY_CONDITION_TEST_SENDER_IDL + +#include "Connector/ReadGet_Test_Connector.idl" +#include "Base/ReadGet_Starter.idl" + +module ReadGet_Test +{ + component Sender + { + port ReadGet_Test::QueryConditionTestConnector::DDS_Write info_write; + + uses ReadGetStarter start_reader; + provides ReadGetRestarter restart_writer; + + attribute unsigned short keys; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.mpc new file mode 100755 index 00000000000..25f5479830e --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender.mpc @@ -0,0 +1,155 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p ReadGet_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(CFT_ReadGet_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += ReadGet_Test_Connector_idl_gen DDS_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ + -Wb,stub_export_include=Sender_stub_export.h \ + -Wb,skel_export_macro=SENDER_SVNT_Export \ + -Wb,skel_export_include=Sender_svnt_export.h \ + -Wb,svnt_export_macro=SENDER_SVNT_Export \ + -Wb,svnt_export_include=Sender_svnt_export.h \ + -Wb,exec_export_macro=SENDER_EXEC_Export \ + -Wb,exec_export_include=Sender_exec_export.h \ + -I .. + + IDL_Files { + ReadGet_Test_Sender.idl + } +} + +project(CFT_ReadGet_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += ReadGet_Test_Sender_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ + -Wb,stub_export_include=Sender_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + ReadGet_Test_SenderE.idl + } +} + +project(CFT_ReadGet_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += ReadGet_Test_Sender_lem_gen ReadGet_Test_Sender_stub \ + ReadGet_Test_Base_stub CFT_ReadGet_Starter_stub + libs += ReadGet_Test_Base_stub Sender_stub ReadGet_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_SenderEC.cpp + } + + Header_Files { + ReadGet_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + ReadGet_Test_SenderEC.inl + } +} + +project(CFT_ReadGet_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += ReadGet_Test_Sender_idl_gen ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_stub CFT_ReadGet_Starter_stub \ + CFT_ReadGet_Starter_lem_stub + libs += ReadGet_Test_Base_stub ReadGet_Test_Connector_stub \ + ReadGet_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_SenderC.cpp + } + + Header_Files { + ReadGet_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + ReadGet_Test_SenderC.inl + } +} + +project(CFT_ReadGet_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += ReadGet_Test_Sender_lem_stub ReadGet_Test_Sender_stub \ + ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub \ + DDS4CCM_lem_stub CFT_ReadGet_Starter_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub ReadGet_Test_Base_stub \ + ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub \ + ReadGet_Starter_stub DDS4CCM_lem_stub ReadGet_Starter_lem_stub \ + ReadGet_Starter_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_Sender_exec.cpp + } + + Header_Files { + ReadGet_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(CFT_ReadGet_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += ReadGet_Test_Base_stub ReadGet_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel ReadGet_Test_Connector_stub \ + ReadGet_Test_Connector_svnt ReadGet_Test_Connector_lem_stub \ + CFT_ReadGet_Starter_stub CFT_ReadGet_Starter_svnt \ + CFT_ReadGet_Starter_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ + ReadGet_Test_Connector_lem_stub ReadGet_Starter_stub \ + ReadGet_Starter_svnt ReadGet_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReadGet_Test_SenderS.cpp + ReadGet_Test_Sender_svnt.cpp + } + + Header_Files { + ReadGet_Test_SenderS.h + ReadGet_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + ReadGet_Test_SenderS.inl + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.cpp new file mode 100644 index 00000000000..2973d88bc37 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.cpp @@ -0,0 +1,182 @@ +// -*- C++ -*- +// $Id$ + +#include "ReadGet_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +#define ITERATIONS 10 + +namespace CIAO_ReadGet_Test_Sender_Impl +{ + //============================================================ + // WriteHandler + //============================================================ + WriteHandler::WriteHandler (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteHandler::handle_exception (ACE_HANDLE) + { + this->callback_.start (); + return 0; + } + + //============================================================ + // Restarter_exec_i + //============================================================ + Restarter_exec_i::Restarter_exec_i (Sender_exec_i & callback) + : callback_ (callback) + { + } + + Restarter_exec_i::~Restarter_exec_i (void) + { + } + + void + Restarter_exec_i::restart_write () + { + this->callback_.restart (); + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (ITERATIONS), + keys_ (5), + run_ (1) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::restart (void) + { + ++this->run_; + WriteHandler *wh = new WriteHandler (*this); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->notify (wh); + } + + void + Sender_exec_i::start (void) + { + if (! ::CORBA::is_nil (this->starter_)) + { + this->starter_->set_reader_properties (this->keys_, this->iterations_); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to start the reader\n"))); + } + if (this->run_ > 1) + { + for (CORBA::UShort iter_key = 1; iter_key < this->keys_ + 1; ++iter_key) + { + char key[7]; + QueryConditionTest *new_key = new QueryConditionTest; + ACE_OS::sprintf (key, "KEY_%d", iter_key); + new_key->symbol = CORBA::string_dup(key); + for (CORBA::UShort iter = ((this->run_ - 2) * this->iterations_) + 1; + iter < this->run_ * this->iterations_ + 1; + ++iter) + { + new_key->iteration = iter; + this->writer_->write_one (*new_key, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written key <%C> with <%d>\n"), + key, iter)); + } + } + ACE_OS::sleep (1); + } + this->starter_->start_read (this->run_); + } + + ::CORBA::UShort + Sender_exec_i::keys (void) + { + return this->keys_; + } + + void + Sender_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + ::CCM_ReadGetRestarter_ptr + Sender_exec_i::get_restart_writer (void) + { + return new Restarter_exec_i (*this); + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::ReadGet_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + } + + void + Sender_exec_i::ccm_activate (void) + { + try + { + this->writer_ = this->context_->get_connection_info_write_data (); + this->starter_ = this->context_->get_connection_start_reader (); + WriteHandler *wh = new WriteHandler (*this); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->notify (wh); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: GET_CONNECTION_START_READER : Exception caught\n"))); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: GET_CONNECTION_START_READER : Unknown exception caught\n"))); + } + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_ReadGet_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.h new file mode 100644 index 00000000000..5527e7ed789 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/Sender/ReadGet_Test_Sender_exec.h @@ -0,0 +1,96 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "ReadGet_Test_SenderEC.h" + +#include /**/ "Sender_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_ReadGet_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // WriteHandler + //============================================================ + class WriteHandler : + public ACE_Event_Handler + { + public: + WriteHandler (Sender_exec_i &callback); + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + private: + Sender_exec_i &callback_; + }; + + //============================================================ + // Restarter_exec_i + //============================================================ + class Restarter_exec_i + : public virtual ::CCM_ReadGetRestarter, + public virtual ::CORBA::LocalObject + { + public: + Restarter_exec_i (Sender_exec_i & callback); + virtual ~Restarter_exec_i (void); + + virtual void restart_write (); + + private: + Sender_exec_i &callback_; + }; + + //============================================================ + // Sender_exec_i + //============================================================ + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (void); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + virtual ::CCM_ReadGetRestarter_ptr + get_restart_writer (void); + + 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); + + void start (void); + void restart (void); + + private: + ::ReadGet_Test::CCM_Sender_Context_var context_; + ::ReadGet_Test::QueryConditionTestConnector::Writer_var writer_; + ReadGetStarter_var starter_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + CORBA::UShort run_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_ReadGet_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/Plan.cdp new file mode 100644 index 00000000000..1a92ed1b4be --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/Plan.cdp @@ -0,0 +1,553 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>ReadGet_Test_Depl_1</label> + <UUID>ReadGet_Test_Depl_1</UUID> + + <implementation xmi:id="ReceiverComponentImplementation"> + <name>ReceiverComponentImplementation</name> + <source/> + <artifact xmi:idref="Receiver_ExecArtifact" /> + <artifact xmi:idref="Receiver_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_Receiver_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ReadGet_Test_ReceiverConnectorImplementation"> + <name>ReadGet_Test_ReceiverConnectorImplementation</name> + <source/> + <artifact xmi:idref="ReadGet_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="ReadGet_Test_Connector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_QueryConditionTestConnector_DDS_State_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_QueryConditionTestConnector_DDS_State_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="ReadGet_Test_SenderConnectorImplementation"> + <name>ReadGet_Test_ReceiverConnectorImplementation</name> + <source/> + <artifact xmi:idref="ReadGet_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="ReadGet_Test_Connector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_QueryConditionTestConnector_DDS_Event_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_QueryConditionTestConnector_DDS_Event_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="SenderComponentImplementation"> + <name>SenderComponentImplementation</name> + <source/> + <artifact xmi:idref="Sender_ExecArtifact" /> + <artifact xmi:idref="Sender_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_ReadGet_Test_Sender_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="ReceiverComponentInstance"> + <name>ReceiverComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReceiverComponentImplementation" /> + </instance> + + <instance xmi:id="ReadGet_Test_SenderConnectorInstance"> + <name>ReadGet_Test_SenderConnector</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReadGet_Test_SenderConnectorImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryCondition_Library#QueryCondition_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="ReadGet_Test_ReceiverConnectorInstance"> + <name>ReadGet_Test_ReceiverConnector</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReadGet_Test_ReceiverConnectorImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryCondition_Library#QueryCondition_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReadGet_Test</string> + </value> + </value> + </configProperty> + <configProperty> + <name>get_port_filter</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>QueryFilter</name> + <typeId>IDL:CCM_DDS/QueryFilter:1.0</typeId> + <member> + <name>expression</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>parameters</name> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_string</kind> + </elementType> + </sequence> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>expression</name> + <value> + <string>( (iteration > %0) AND (iteration < %1) )</string> + </value> + </member> + <member> + <name>parameters</name> + <value> + <element> + <string>2</string> + </element> + <element> + <string>5</string> + </element> + </value> + </member> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>read_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>read_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_ReceiverConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_port_fresh_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>get_port_fresh_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_ReceiverConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>get_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_ReceiverConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_port_filter_config</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>get_port_filter_config</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_filter_config</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_ReceiverConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>read_port_filter_config</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>read_port_filter_config</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_filter_config</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_ReceiverConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_write_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReadGet_Test_SenderConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>reader_starter</name> + <internalEndpoint> + <portName>start_reader</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>reader_start</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>restart_writer</name> + <internalEndpoint> + <portName>writer_restart</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>restart_writer</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Sender_ExecArtifact"> + <name>Sender_exec</name> + <source/> + <node/> + <location>Sender_exec</location> + </artifact> + <artifact xmi:id="Sender_SvntArtifact"> + <name>Sender_svnt</name> + <source/> + <node/> + <location>Sender_svnt</location> + </artifact> + <artifact xmi:id="Sender_StubArtifact"> + <name>Sender_stub</name> + <source/> + <node/> + <location>Sender_stub</location> + </artifact> + <artifact xmi:id="ReadGet_Test_Connector_ExecArtifact"> + <name>ReadGet_Test_Connector_exec</name> + <source/> + <node/> + <location>ReadGet_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="ReadGet_Test_Connector_SvntArtifact"> + <name>ReadGet_Test_Connector_svnt</name> + <source/> + <node/> + <location>ReadGet_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="ReadGet_Test_Connector_StubArtifact"> + <name>ReadGet_Test_Connector_stub</name> + <source/> + <node/> + <location>ReadGet_Test_Connector_stub</location> + </artifact> + <artifact xmi:id="Receiver_ExecArtifact"> + <name>Receiver_exec</name> + <source/> + <node/> + <location>Receiver_exec</location> + </artifact> + <artifact xmi:id="Receiver_SvntArtifact"> + <name>Receiver_svnt</name> + <source/> + <node/> + <location>Receiver_svnt</location> + </artifact> + <artifact xmi:id="Receiver_StubArtifact"> + <name>Receiver_stub</name> + <source/> + <node/> + <location>Receiver_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..5b00bed1712 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +Description +XML QoS Profile + +The QoS configuration of the DDS entities in the generated example is +loaded from this file. + +This file is used only when it is in the current working directory +or when the enviroment variable +NDDS_QOS_PROFILES is defined and points to this file. + +For more information about XML QoS Profiles see Chapter 15 in the +RTI Data Distribution Service user manual. +--> +<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="c:/ndds/ndds.4.4d/scripts/../resource/rtiddsgen/../qos_profiles_4.4d/schema/rti_dds_qos_profiles.xsd" version="4.4d"> + <!-- QoS Library containing the QoS profile used in the generated example. + + A QoS library is a named set of QoS profiles. + --> + <qos_library name="QueryCondition_Library"> + <!-- QoS profile used to configure reliable communication between the DataWriter + and DataReader created in the example code. + + A QoS profile groups a set of related QoS. + --> + <qos_profile name="QueryCondition_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>10</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <!-- QoS used to configure the data reader created in the example code --> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds> diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/run_test.pl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/run_test.pl new file mode 100755 index 00000000000..168fccae45c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/ReadGet/descriptors/run_test.pl @@ -0,0 +1,244 @@ +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; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DANCE_ROOT = "$ENV{'DANCE_ROOT'}"; + +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; + +$nr_daemon = 2; +@ports = ( 60001, 60002 ); +@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" ); +@iorfiles = 0; +@nodenames = ( "SenderNode", "ReceiverNode" ); + +# ior files other than daemon +# ior files other than daemon +$ior_nsbase = "ns.ior"; +$ior_nsfile = 0; +$ior_embase = "EM.ior"; +$ior_emfile = 0; + +# Processes +$E = 0; +$EM = 0; +$NS = 0; +@DEAMONS = 0; + +# targets +@tg_daemons = 0; +$tg_naming = 0; +$tg_exe_man = 0; +$tg_executor = 0; + +$status = 0; +$cdp_file = "Plan.cdp"; + +sub create_targets { + # naming service + $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + $tg_naming->AddLibPath ('../lib'); + # daemon + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for deamon $i failed\n"; + $tg_daemons[$i]->AddLibPath ('../lib'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('../lib'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('../lib'); +} + +sub init_ior_files { + $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase); + $ior_emfile = $tg_exe_man->LocalFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } + delete_ior_files (); +} + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i]->DeleteFile ($iorbases[$i]); + } + $tg_naming->DeleteFile ($ior_nsbase); + $tg_exe_man->DeleteFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } +} + +sub kill_node_daemon { + for ($i = 0; $i < $nr_daemon; ++$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemon (); + } + + if ($em_running == 1) { + $EM->Kill (); $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); $NS->TimedWait (1); + } + # in case shutdown did not perform as expected + $tg_executor->KillAll ('dance_locality_manager'); +} + +sub run_node_daemons { + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorbase = $iorbases[$i]; + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = PerlACE::GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager"; + + $d_cmd = "$DANCE_ROOT/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService"; + + print "Run dance_node_manager with $d_param\n"; + + $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param); + $DEAMONS[$i]->Spawn (); + + if ($tg_daemons[$i]->WaitForFileTimed($iorbase, + $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +create_targets (); +init_ior_files (); + +# Invoke naming service + +$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 1 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + +$ns_status = $NS->Spawn (); + +if ($ns_status != 0) { + print STDERR "ERROR: Unable to execute the naming service\n"; + kill_open_processes (); + exit 1; +} + +print STDERR "Starting Naming Service with -m 1 -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; + +if ($tg_naming->WaitForFileTimed ($ior_nsbase, + $tg_naming->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; +} + +$ns_running = 1; +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + +# Invoke node daemon. +print "Invoking node daemon\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n"; +$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager", + "-e$ior_emfile --domain-nc corbaloc:rir:/NameService"); +$em_status = $EM->Spawn (); + +if ($em_status != 0) { + print STDERR "ERROR: dance_execution_manager returned $em_status"; + exit 1; +} + +if ($tg_exe_man->WaitForFileTimed ($ior_embase, + $tg_exe_man->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; +} + +$em_running = 1; + +# Invoke executor - start the application -. +print "Invoking executor - launch the application -\n"; + +print "Start dance_plan_launcher.exe with -x $cdp_file -k file://$ior_emfile\n"; +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $cdp_file -k file://$ior_emfile"); +$pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +for ($i = 0; $i < $nr_daemon; ++$i) { + if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i], + $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) { + print STDERR "ERROR: The ior file of daemon $i could not be found\n"; + kill_open_processes (); + exit 1; + } +} + +print "Sleeping 30 seconds to allow task to complete\n"; +sleep (30); + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $cdp_file -s\n"; + +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $cdp_file -s"); +$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.idl new file mode 100644 index 00000000000..116d7c052e7 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file CFTLS_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_BASE_IDL +#define CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/CFTLS_Test_BaseSupport.h" + +struct ContentFilteredTopicListenStateTest { + string key; //@key + long iteration; +}; + +typedef sequence<ContentFilteredTopicListenStateTest> ContentFilteredTopicListenStateTestSeq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.mpc new file mode 100755 index 00000000000..b49b9b9e682 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Base/CFTLS_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CFTLS_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CFTLS_Test_Base_stub + dynamicflags += CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=CFTLS_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CFTLS_Test_Base.idl + } + + opendds_ts_flags += --export=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + CFTLS_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.idl new file mode 100644 index 00000000000..3a5a3c8bbfe --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file CFTLS_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_IDL_ +#define CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CFTLS_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CFTLS_Test_ConnectorE.idl" + +module CFTLS_Test +{ + module ::CCM_DDS::Typed < ::ContentFilteredTopicListenStateTest, ::ContentFilteredTopicListenStateTestSeq> ContentFilteredTopicListenStateTestConnector; +}; + +#endif /* CFTLS_Test_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.mpc new file mode 100755 index 00000000000..8a876f56a95 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Connector/CFTLS_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CFTLS_Test_Base -l .. -o ../lib -u DDS CFTLS_Test_Connector" + +project(DDS_CFTLS_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CFTLS_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CFTLS_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CFTLS_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CFTLS_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + CFTLS_Test_Connector.idl + } +} + +project(DDS_CFTLS_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CFTLS_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CFTLS_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CFTLS_Test_ConnectorE.idl + } +} + +project(DDS_CFTLS_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLS_Test_Connector_lem_gen DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_CFTLS_Test_Base_stub DDS_CFTLS_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CFTLS_Test_Connector_lem_stub + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ConnectorEC.cpp + } + + Header_Files { + CFTLS_Test_ConnectorEC.h + CFTLS_Test_Connector_lem_stub_export.h + } + + Inline_Files { + CFTLS_Test_ConnectorEC.inl + } +} + +project(DDS_CFTLS_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLS_Test_Connector_idl_gen DDS_CFTLS_Test_Base_stub + libs += DDS_CFTLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CFTLS_Test_Connector_stub + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ConnectorC.cpp + } + + Header_Files { + CFTLS_Test_ConnectorC.h + CFTLS_Test_Connector_stub_export.h + } + + Inline_Files { + CFTLS_Test_ConnectorC.inl + } +} + +project(DDS_CFTLS_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CFTLS_Test_Connector_lem_stub DDS_CFTLS_Test_Connector_stub DDS4CCM_lem_stub DDS_CFTLS_Test_Base_stub + sharedname = DDS_CFTLS_Test_Connector_exec + libs += DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Connector_lem_stub DDS_CFTLS_Test_Base_stub DDS4CCM_lem_stub DDS_CFTLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_Connector_conn.cpp + } + + Header_Files { + CFTLS_Test_Connector_conn.h + CFTLS_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLS_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CFTLS_Test_Connector_lem_stub DDS_CFTLS_Test_Connector_exec DDS_CFTLS_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CFTLS_Test_Connector_svnt + libs += DDS_CFTLS_Test_Connector_stub \ + DDS_CFTLS_Test_Connector_lem_stub \ + DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ConnectorS.cpp + CFTLS_Test_Connector_svnt.cpp + } + + Header_Files { + CFTLS_Test_ConnectorS.h + CFTLS_Test_Connector_svnt.h + CFTLS_Test_Connector_svnt_export.h + } + + Inline_Files { + CFTLS_Test_ConnectorS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.idl new file mode 100644 index 00000000000..0238830efdc --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CFTLS_Test_Connector.idl" + +module CFTLS_Test +{ + component Receiver + { + port ContentFilteredTopicListenStateTestConnector::DDS_StateListen info_state; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.mpc new file mode 100755 index 00000000000..9fcb4d9a291 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_CFTLS_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CFTLS_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h \ + -Wb,svnt_export_macro=RECEIVER_SVNT_Export \ + -Wb,svnt_export_include=Receiver_svnt_export.h \ + -Wb,exec_export_macro=RECEIVER_EXEC_Export \ + -Wb,exec_export_include=Receiver_exec_export.h -I.. + + IDL_Files { + CFTLS_Test_Receiver.idl + } +} + +project(DDS_CFTLS_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CFTLS_Test_Receiver_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ + -Wb,stub_export_include=Receiver_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + CFTLS_Test_ReceiverE.idl + } +} + +project(DDS_CFTLS_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLS_Test_Receiver_lem_gen DDS_CFTLS_Test_Receiver_stub \ + DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Base_stub + libs += Receiver_stub DDS_CFTLS_Test_Connector_stub \ + DDS_CFTLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ReceiverEC.cpp + } + + Header_Files { + CFTLS_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CFTLS_Test_ReceiverEC.inl + } +} + +project(DDS_CFTLS_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLS_Test_Receiver_idl_gen DDS_CFTLS_Test_Connector_stub \ + DDS_CFTLS_Test_Base_stub DDS_CFTLS_Test_Connector_lem_gen + libs += DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ReceiverC.cpp + } + + Header_Files { + CFTLS_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CFTLS_Test_ReceiverC.inl + } +} + +project(DDS_CFTLS_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CFTLS_Test_Receiver_lem_stub DDS_CFTLS_Test_Receiver_stub \ + DDS_CFTLS_Test_Base_stub DDS_CFTLS_Test_Connector_stub \ + DDS_CFTLS_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_Receiver_exec.cpp + } + + Header_Files { + CFTLS_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLS_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CFTLS_Test_Receiver_lem_stub DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Connector_svnt \ + DDS_CFTLS_Test_Receiver_exec DDS_CFTLS_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Connector_svnt \ + Receiver_exec DDS_CFTLS_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_ReceiverS.cpp + CFTLS_Test_Receiver_svnt.cpp + } + + Header_Files { + CFTLS_Test_ReceiverS.h + CFTLS_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CFTLS_Test_ReceiverS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..51f8505268b --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.cpp @@ -0,0 +1,235 @@ +// -*- C++ -*- +// +// $Id$ + +#include "CFTLS_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +#define QUERY "( (iteration > %0) AND (iteration < %1) )" + +#define MIN_ITERATION "2" +#define MAX_ITERATION "5" + +namespace CIAO_CFTLS_Test_Receiver_Impl +{ + //============================================================ + // ContentFilteredTopicListenStateTest_Listener_exec_i + //============================================================ + ContentFilteredTopicListenStateTest_Listener::ContentFilteredTopicListenStateTest_Listener ( + Atomic_ThreadId &thread_id) + : thread_id_ (thread_id) + { + } + + ContentFilteredTopicListenStateTest_Listener::~ContentFilteredTopicListenStateTest_Listener (void) + { + } + + void + ContentFilteredTopicListenStateTest_Listener::on_creation ( + const ContentFilteredTopicListenStateTest& an_instance, + const CCM_DDS::ReadInfo& /*read_info*/) + { + ACE_DEBUG ((LM_DEBUG, "ContentFilteredTopicListenStateTest_Listener::on_creation: " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + if (an_instance.iteration <= ACE_OS::atoi (MIN_ITERATION) || + an_instance.iteration > ACE_OS::atoi (MAX_ITERATION) ) + { + ACE_ERROR ((LM_ERROR, "ContentFilteredTopicListenStateTest_Listener::on_creation: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + ContentFilteredTopicListenStateTest_Listener::on_one_update ( + const ContentFilteredTopicListenStateTest& an_instance, + const CCM_DDS::ReadInfo& /*read_info*/) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "ContentFilteredTopicListenStateTest_Listener::on_one_update: " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + if (an_instance.iteration <= ACE_OS::atoi (MIN_ITERATION) || + an_instance.iteration > ACE_OS::atoi (MAX_ITERATION) ) + { + ACE_ERROR ((LM_ERROR, "ContentFilteredTopicListenStateTest_Listener::on_one_update: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + ContentFilteredTopicListenStateTest_Listener::on_many_updates ( + const ContentFilteredTopicListenStateTestSeq& /*an_instance*/, + const CCM_DDS::ReadInfoSeq& /*read_info*/) + { + } + + void + ContentFilteredTopicListenStateTest_Listener::on_deletion ( + const ContentFilteredTopicListenStateTest& /*an_instance*/, + const CCM_DDS::ReadInfo& /*read_info*/) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : thread_id_listener_ (0), + iterations_ (10), + keys_ (5) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + void + Receiver_exec_i::start () + { + ::CCM_DDS::DataListenerControl_var dlc = + this->context_->get_connection_info_state_data_control (); + dlc->mode (::CCM_DDS::ONE_BY_ONE); + } + + ::CFTLS_Test::ContentFilteredTopicListenStateTestConnector::CCM_StateListener_ptr + Receiver_exec_i::get_info_state_data_listener (void) + { + return new ContentFilteredTopicListenStateTest_Listener ( + this->thread_id_listener_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_state_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Receiver_exec_i::keys (void) + { + return this->keys_; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CFTLS_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + this->reader_ = this->context_->get_connection_info_state_data (); + if (CORBA::is_nil (this->reader_.in ())) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::configuration_complete - " + "Error get reader connection.\n")); + } + } + + void + Receiver_exec_i::ccm_activate (void) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::ccm_activate - " + "Start listening.\n")); + start (); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for ReaderListener not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "QF_STATE: " + "Thread switch for ReaderListener seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: QF_STATE: " + "Thread switch for ReaderListener " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: QF_STATE: ReaderListener: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "QF_STATE: ReaderListener: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLS_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.h new file mode 100644 index 00000000000..ae981682551 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Receiver/CFTLS_Test_Receiver_exec.h @@ -0,0 +1,111 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CFTLS_Test_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" +#include "ace/OS_NS_Thread.h" +#include "ace/Reactor.h" +#include "ace/Task.h" + +#include <map> + +namespace CIAO_CFTLS_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ContentFilteredTopicListenStateTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ContentFilteredTopicListenStateTest_Listener + : public virtual ::CFTLS_Test::ContentFilteredTopicListenStateTestConnector::CCM_StateListener, + public virtual ::CORBA::LocalObject + { + public: + ContentFilteredTopicListenStateTest_Listener ( + Atomic_ThreadId &thread_id); + virtual ~ContentFilteredTopicListenStateTest_Listener (void); + + virtual void + on_creation (const ContentFilteredTopicListenStateTest& an_instance, + const CCM_DDS::ReadInfo& read_info); + + virtual void + on_one_update (const ContentFilteredTopicListenStateTest& an_instance, + const CCM_DDS::ReadInfo& read_info); + + virtual void + on_many_updates (const ContentFilteredTopicListenStateTestSeq& an_instance, + const CCM_DDS::ReadInfoSeq& read_info); + + virtual void + on_deletion (const ContentFilteredTopicListenStateTest& an_instance, + const CCM_DDS::ReadInfo& read_info); + + private: + Atomic_ThreadId &thread_id_; + }; + + //============================================================ + // Receiver_exec_i + //============================================================ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + void start (); + + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + virtual ::CFTLS_Test::ContentFilteredTopicListenStateTestConnector::CCM_StateListener_ptr + get_info_state_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_state_status (void); + + 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: + ::CFTLS_Test::CCM_Receiver_Context_var context_; + ::CFTLS_Test::ContentFilteredTopicListenStateTestConnector::Reader_var reader_; + + Atomic_ThreadId thread_id_listener_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLS_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.idl new file mode 100644 index 00000000000..b57f75d7142 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_SENDER_IDL +#define DDS_CONTENTFILTEREDTOPIC_LISTEN_STATE_TEST_SENDER_IDL + +#include "Connector/CFTLS_Test_Connector.idl" + +module CFTLS_Test +{ + component Sender + { + port ContentFilteredTopicListenStateTestConnector::DDS_Update info_update; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.mpc new file mode 100755 index 00000000000..d43b38e4121 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CFTLS_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CFTLS_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CFTLS_Test_Connector_idl_gen DDS_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ + -Wb,stub_export_include=Sender_stub_export.h \ + -Wb,skel_export_macro=SENDER_SVNT_Export \ + -Wb,skel_export_include=Sender_svnt_export.h \ + -Wb,svnt_export_macro=SENDER_SVNT_Export \ + -Wb,svnt_export_include=Sender_svnt_export.h \ + -Wb,exec_export_macro=SENDER_EXEC_Export \ + -Wb,exec_export_include=Sender_exec_export.h \ + -I .. + + IDL_Files { + CFTLS_Test_Sender.idl + } +} + +project(DDS_CFTLS_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CFTLS_Test_Sender_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ + -Wb,stub_export_include=Sender_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + CFTLS_Test_SenderE.idl + } +} + +project(DDS_CFTLS_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CFTLS_Test_Sender_lem_gen DDS_CFTLS_Test_Sender_stub \ + DDS_CFTLS_Test_Base_stub + libs += DDS_CFTLS_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_SenderEC.cpp + } + + Header_Files { + CFTLS_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CFTLS_Test_SenderEC.inl + } +} + +project(DDS_CFTLS_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CFTLS_Test_Sender_idl_gen DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_stub + libs += DDS_CFTLS_Test_Base_stub DDS_CFTLS_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_SenderC.cpp + } + + Header_Files { + CFTLS_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CFTLS_Test_SenderC.inl + } +} + +project(DDS_CFTLS_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CFTLS_Test_Sender_lem_stub DDS_CFTLS_Test_Sender_stub \ + DDS_CFTLS_Test_Connector_lem_stub DDS_CFTLS_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CFTLS_Test_Base_stub \ + DDS_CFTLS_Test_Connector_lem_stub DDS_CFTLS_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_Sender_exec.cpp + } + + Header_Files { + CFTLS_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CFTLS_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CFTLS_Test_Base_stub DDS_CFTLS_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_CFTLS_Test_Connector_stub \ + DDS_CFTLS_Test_Connector_svnt DDS_CFTLS_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_CFTLS_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_CFTLS_Test_Connector_stub DDS_CFTLS_Test_Connector_svnt \ + DDS_CFTLS_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CFTLS_Test_SenderS.cpp + CFTLS_Test_Sender_svnt.cpp + } + + Header_Files { + CFTLS_Test_SenderS.h + CFTLS_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CFTLS_Test_SenderS.inl + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.cpp new file mode 100644 index 00000000000..f3c9cf5e333 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.cpp @@ -0,0 +1,203 @@ +// -*- C++ -*- +// $Id$ + +#include "CFTLS_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "ace/Date_Time.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_CFTLS_Test_Sender_Impl +{ + //============================================================ + // StartHandler + //============================================================ + StartHandler::StartHandler(Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + StartHandler::handle_exception (ACE_HANDLE) + { + this->callback_.run (); + return 0; + } + + //============================================================ + // UpdateTicker + //============================================================ + UpdateTicker::UpdateTicker (Sender_exec_i &callback) + : callback_ (callback), + last_iter_ (0) + { + } + + int + UpdateTicker::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->callback_.update_one (++this->last_iter_); + return 0; + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (10), + keys_ (5) + { + this->ticker_ = new UpdateTicker (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::update_one (CORBA::UShort iter) + { + if (iter <= this->iterations ()) + { + for (CORBA::UShort i = 1; i < this->keys () + 1; ++i) + { + char key[7]; + ACE_OS::sprintf (key, "KEY_%d", i); + ContentFilteredTopicListenStateTest update_key; + update_key.key = CORBA::string_dup (key); + update_key.iteration = iter; + this->updater_->update_one (update_key, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Updated key <%C> - <%u>\n", + key, iter)); + + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::update_one - " + "Finished updating. Cancel Timer.\n")); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer ( + this->ticker_); + } + } + + void + Sender_exec_i::run () + { + + //first create the instances for consecutive updating. + for (CORBA::UShort i = 1; i < this->keys () + 1; ++i) + { + char key[7]; + ACE_OS::sprintf (key, "KEY_%d", i); + ContentFilteredTopicListenStateTest new_key; + new_key.key = CORBA::string_dup(key); + new_key.iteration = 0; + this->updater_->create_one (new_key); + } + + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (5, 50000), + ACE_Time_Value (0, 50000)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::start (void) + { + StartHandler *rh = new StartHandler (*this); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->notify (rh); + } + + ::CORBA::UShort + Sender_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Sender_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Sender_exec_i::keys (void) + { + return this->keys_; + } + + void + Sender_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CFTLS_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + } + + void + Sender_exec_i::ccm_activate (void) + { + try + { + this->updater_ = this->context_->get_connection_info_update_data (); + start (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Exception caught\n"))); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Sender_exec_i::ccm_activate: Unknown exception caught\n"))); + } + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLS_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.h new file mode 100644 index 00000000000..87acaada5df --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/Sender/CFTLS_Test_Sender_exec.h @@ -0,0 +1,95 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CFTLS_Test_SenderEC.h" + +#include /**/ "Sender_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_CFTLS_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // StartHandler + //============================================================ + class StartHandler : + public ACE_Event_Handler + { + public: + StartHandler (Sender_exec_i &callback); + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + private: + Sender_exec_i &callback_; + }; + + //============================================================ + // UpdateTicker + //============================================================ + class UpdateTicker : + public ACE_Event_Handler + { + public: + UpdateTicker (Sender_exec_i &callback); + int handle_timeout (const ACE_Time_Value &, const void *); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &callback_; + CORBA::UShort last_iter_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (void); + + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + 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); + + void start (void); + void run (void); + void update_one (CORBA::UShort iter); + + private: + ::CFTLS_Test::CCM_Sender_Context_var context_; + ::CFTLS_Test::ContentFilteredTopicListenStateTestConnector::Updater_var updater_; + + UpdateTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CFTLS_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/Plan.cdp new file mode 100644 index 00000000000..93273bc936f --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/Plan.cdp @@ -0,0 +1,392 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CFTLS_Test_Depl_1</label> + <UUID>CFTLS_Test_Depl_1</UUID> + + <implementation xmi:id="ReceiverComponentImplementation"> + <name>ReceiverComponentImplementation</name> + <source/> + <artifact xmi:idref="Receiver_ExecArtifact" /> + <artifact xmi:idref="Receiver_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_Receiver_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="CFTLS_Test_ConnectorComponentImplementation"> + <name>CFTLS_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CFTLS_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="CFTLS_Test_Connector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_ContentFilteredTopicListenStateTestConnector_DDS_State_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_ContentFilteredTopicListenStateTestConnector_DDS_State_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLS_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLS_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="SenderComponentImplementation"> + <name>SenderComponentImplementation</name> + <source/> + <artifact xmi:idref="Sender_ExecArtifact" /> + <artifact xmi:idref="Sender_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CFTLS_Test_Sender_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="ReceiverComponentInstance"> + <name>ReceiverComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReceiverComponentImplementation" /> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CFTLS_Test_ConnectorComponentInstance"> + <name>CFTLS_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CFTLS_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLS_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CFTLS_Test_ConnectorComponentInstance2"> + <name>CFTLS_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CFTLS_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CFTLS_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_state_rdr</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_state_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLS_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_state_dl</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_state_data_listener</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_data_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CFTLS_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_state_dc</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_state_data_control</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_data_control</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLS_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>updater_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_update_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="CFTLS_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Sender_ExecArtifact"> + <name>Sender_exec</name> + <source/> + <node/> + <location>Sender_exec</location> + </artifact> + <artifact xmi:id="Sender_SvntArtifact"> + <name>Sender_svnt</name> + <source/> + <node/> + <location>Sender_svnt</location> + </artifact> + <artifact xmi:id="Sender_StubArtifact"> + <name>Sender_stub</name> + <source/> + <node/> + <location>Sender_stub</location> + </artifact> + <artifact xmi:id="CFTLS_Test_Connector_ExecArtifact"> + <name>CFTLS_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_CFTLS_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="CFTLS_Test_Connector_SvntArtifact"> + <name>CFTLS_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CFTLS_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="CFTLS_Test_Connector_StubArtifact"> + <name>CFTLS_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_CFTLS_Test_Connector_stub</location> + </artifact> + <artifact xmi:id="Receiver_ExecArtifact"> + <name>Receiver_exec</name> + <source/> + <node/> + <location>Receiver_exec</location> + </artifact> + <artifact xmi:id="Receiver_SvntArtifact"> + <name>Receiver_svnt</name> + <source/> + <node/> + <location>Receiver_svnt</location> + </artifact> + <artifact xmi:id="Receiver_StubArtifact"> + <name>Receiver_stub</name> + <source/> + <node/> + <location>Receiver_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/run_test.pl b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/run_test.pl new file mode 100755 index 00000000000..c54f6824248 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/ContentFilteredTopic/StateListener/descriptors/run_test.pl @@ -0,0 +1,244 @@ +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; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DANCE_ROOT = "$ENV{'DANCE_ROOT'}"; + +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; + +$nr_daemon = 2; +@ports = ( 60001, 60002 ); +@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" ); +@iorfiles = 0; +@nodenames = ( "SenderNode", "ReceiverNode" ); + +# ior files other than daemon +# ior files other than daemon +$ior_nsbase = "ns.ior"; +$ior_nsfile = 0; +$ior_embase = "EM.ior"; +$ior_emfile = 0; + +# Processes +$E = 0; +$EM = 0; +$NS = 0; +@DEAMONS = 0; + +# targets +@tg_daemons = 0; +$tg_naming = 0; +$tg_exe_man = 0; +$tg_executor = 0; + +$status = 0; +$cdp_file = "Plan.cdp"; + +sub create_targets { + # naming service + $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + $tg_naming->AddLibPath ('../lib'); + # daemon + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for deamon $i failed\n"; + $tg_daemons[$i]->AddLibPath ('../lib'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('../lib'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('../lib'); +} + +sub init_ior_files { + $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase); + $ior_emfile = $tg_exe_man->LocalFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } + delete_ior_files (); +} + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i]->DeleteFile ($iorbases[$i]); + } + $tg_naming->DeleteFile ($ior_nsbase); + $tg_exe_man->DeleteFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } +} + +sub kill_node_daemon { + for ($i = 0; $i < $nr_daemon; ++$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemon (); + } + + if ($em_running == 1) { + $EM->Kill (); $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); $NS->TimedWait (1); + } + # in case shutdown did not perform as expected + $tg_executor->KillAll ('dance_locality_manager'); +} + +sub run_node_daemons { + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorbase = $iorbases[$i]; + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = PerlACE::GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager"; + + $d_cmd = "$DANCE_ROOT/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService"; + + print "Run dance_node_manager with $d_param\n"; + + $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param); + $DEAMONS[$i]->Spawn (); + + if ($tg_daemons[$i]->WaitForFileTimed($iorbase, + $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +create_targets (); +init_ior_files (); + +# Invoke naming service + +$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 1 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + +$ns_status = $NS->Spawn (); + +if ($ns_status != 0) { + print STDERR "ERROR: Unable to execute the naming service\n"; + kill_open_processes (); + exit 1; +} + +print STDERR "Starting Naming Service with -m 1 -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; + +if ($tg_naming->WaitForFileTimed ($ior_nsbase, + $tg_naming->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; +} + +$ns_running = 1; +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + +# Invoke node daemon. +print "Invoking node daemon\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n"; +$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager", + "-e$ior_emfile --domain-nc corbaloc:rir:/NameService"); +$em_status = $EM->Spawn (); + +if ($em_status != 0) { + print STDERR "ERROR: dance_execution_manager returned $em_status"; + exit 1; +} + +if ($tg_exe_man->WaitForFileTimed ($ior_embase, + $tg_exe_man->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; +} + +$em_running = 1; + +# Invoke executor - start the application -. +print "Invoking executor - launch the application -\n"; + +print "Start dance_plan_launcher.exe with -x $cdp_file -k file://$ior_emfile\n"; +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $cdp_file -k file://$ior_emfile"); +$pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +for ($i = 0; $i < $nr_daemon; ++$i) { + if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i], + $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) { + print STDERR "ERROR: The ior file of daemon $i could not be found\n"; + kill_open_processes (); + exit 1; + } +} + +print "Sleeping 30 seconds to allow task to complete\n"; +sleep (30); + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $cdp_file -q\n"; + +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $cdp_file -s"); +$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc index ca665ff08b6..d69e321d6f2 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Starter.mpc @@ -1,6 +1,6 @@ // $Id$ -project(DDS_ReadGet_Starter_idl_gen) : componentidldefaults, dds4ccm { +project(QC_ReadGet_Starter_idl_gen) : componentidldefaults, dds4ccm { custom_only = 1 idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ -Wb,stub_export_include=ReadGet_Starter_stub_export.h \ @@ -16,8 +16,8 @@ project(DDS_ReadGet_Starter_idl_gen) : componentidldefaults, dds4ccm { } } -project(DDS_ReadGet_Starter_lem_gen) : ciaoidldefaults, dds4ccm { - after += DDS_ReadGet_Starter_idl_gen +project(QC_ReadGet_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += QC_ReadGet_Starter_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ -Wb,stub_export_include=ReadGet_Starter_lem_stub_export.h \ @@ -28,8 +28,8 @@ project(DDS_ReadGet_Starter_lem_gen) : ciaoidldefaults, dds4ccm { } } -project(DDS_ReadGet_Starter_lem_stub) : ccm_svnt, dds4ccm_base { - after += DDS_ReadGet_Starter_lem_gen DDS_ReadGet_Starter_stub +project(QC_ReadGet_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += QC_ReadGet_Starter_lem_gen QC_ReadGet_Starter_stub libs += ReadGet_Starter_stub libpaths += ../lib libout = ../lib @@ -54,8 +54,8 @@ project(DDS_ReadGet_Starter_lem_stub) : ccm_svnt, dds4ccm_base { } } -project(DDS_ReadGet_Starter_stub) : ccm_stub, dds4ccm_base { - after += DDS_ReadGet_Starter_idl_gen +project(QC_ReadGet_Starter_stub) : ccm_stub, dds4ccm_base { + after += QC_ReadGet_Starter_idl_gen libs += libpaths += ../lib libout = ../lib @@ -81,8 +81,8 @@ project(DDS_ReadGet_Starter_stub) : ccm_stub, dds4ccm_base { } -project(DDS_ReadGet_Starter_svnt) : ciao_servant, dds4ccm_base { - after += DDS_ReadGet_Starter_lem_stub DDS_ReadGet_Starter_stub\ +project(QC_ReadGet_Starter_svnt) : ciao_servant, dds4ccm_base { + after += QC_ReadGet_Starter_lem_stub QC_ReadGet_Starter_stub\ DDS4CCM_lem_stub DDS4CCM_skel sharedname = ReadGet_Starter_svnt libs += ReadGet_Starter_stub ReadGet_Starter_lem_stub \ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc index c7e832358c8..afac2dfd66f 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Base/ReadGet_Test_Base.mpc @@ -1,6 +1,6 @@ // $Id$ -project (ReadGet_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { +project(QC_ReadGet_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { sharedname = ReadGet_Test_Base_stub dynamicflags += QUERY_CONDITION_TEST_BASE_STUB_BUILD_DLL libout = ../lib diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc index f5ade4a4189..77874354a24 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Connector/ReadGet_Test_Connector.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -p ReadGet_Test_Base -l .. -o ../lib -u DDS ReadGet_Test_Connector" -project(ReadGet_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { +project(QC_ReadGet_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { after += DDS4CCM_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_STUB_Export \ @@ -19,7 +19,7 @@ project(ReadGet_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { } } -project(ReadGet_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { +project(QC_ReadGet_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { custom_only = 1 after += ReadGet_Test_Connector_idl_gen idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_LEM_STUB_Export \ @@ -32,7 +32,7 @@ project(ReadGet_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { } } -project(ReadGet_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { +project(QC_ReadGet_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { after += ReadGet_Test_Connector_lem_gen ReadGet_Test_Connector_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub libs += ReadGet_Test_Base_stub ReadGet_Test_Connector_stub DDS4CCM_lem_stub libpaths += ../lib @@ -58,7 +58,7 @@ project(ReadGet_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { } } -project(ReadGet_Test_Connector_stub) : ccm_stub, dds4ccm_base { +project(QC_ReadGet_Test_Connector_stub) : ccm_stub, dds4ccm_base { after += ReadGet_Test_Connector_idl_gen ReadGet_Test_Base_stub libs += ReadGet_Test_Base_stub libpaths += ../lib @@ -84,7 +84,7 @@ project(ReadGet_Test_Connector_stub) : ccm_stub, dds4ccm_base { } } -project(ReadGet_Test_Connector_exec) : ciao_executor, dds4ccm_impl { +project(QC_ReadGet_Test_Connector_exec) : ciao_executor, dds4ccm_impl { after += ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub DDS4CCM_lem_stub ReadGet_Test_Base_stub sharedname = ReadGet_Test_Connector_exec libs += ReadGet_Test_Connector_stub ReadGet_Test_Connector_lem_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub ReadGet_Test_Base_stub @@ -110,7 +110,7 @@ project(ReadGet_Test_Connector_exec) : ciao_executor, dds4ccm_impl { } -project(ReadGet_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { +project(QC_ReadGet_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { after += ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_exec ReadGet_Test_Connector_stub DDS4CCM_lem_stub sharedname = ReadGet_Test_Connector_svnt libs += ReadGet_Test_Connector_stub \ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc index 9cbaf440193..3c374fb02fa 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Receiver/ReadGet_Test_Receiver.mpc @@ -1,6 +1,6 @@ // $Id$ -project(ReadGet_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { +project(QC_ReadGet_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { custom_only = 1 after += ReadGet_Test_Connector_idl_gen idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ @@ -17,7 +17,7 @@ project(ReadGet_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { } } -project(ReadGet_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { +project(QC_ReadGet_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { after += ReadGet_Test_Receiver_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ @@ -29,10 +29,10 @@ project(ReadGet_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { } } -project(ReadGet_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { +project(QC_ReadGet_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { after += ReadGet_Test_Receiver_lem_gen ReadGet_Test_Receiver_stub \ ReadGet_Test_Connector_stub ReadGet_Test_Base_stub \ - DDS_ReadGet_Starter_stub + QC_ReadGet_Starter_stub libs += Receiver_stub ReadGet_Test_Connector_stub \ ReadGet_Test_Base_stub ReadGet_Starter_stub libpaths += ../lib @@ -58,10 +58,10 @@ project(ReadGet_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { } } -project(ReadGet_Test_Receiver_stub) : ccm_stub, dds4ccm_base { +project(QC_ReadGet_Test_Receiver_stub) : ccm_stub, dds4ccm_base { after += ReadGet_Test_Receiver_idl_gen ReadGet_Test_Connector_stub \ ReadGet_Test_Base_stub ReadGet_Test_Connector_lem_gen \ - DDS_ReadGet_Starter_stub DDS_ReadGet_Starter_lem_stub + QC_ReadGet_Starter_stub QC_ReadGet_Starter_lem_stub libs += ReadGet_Test_Connector_stub ReadGet_Test_Base_stub \ ReadGet_Starter_stub libpaths += ../lib @@ -87,11 +87,11 @@ project(ReadGet_Test_Receiver_stub) : ccm_stub, dds4ccm_base { } } -project(ReadGet_Test_Receiver_exec) : ciao_executor, dds4ccm_base { +project(QC_ReadGet_Test_Receiver_exec) : ciao_executor, dds4ccm_base { after += ReadGet_Test_Receiver_lem_stub ReadGet_Test_Receiver_stub \ ReadGet_Test_Base_stub ReadGet_Test_Connector_stub \ ReadGet_Test_Connector_lem_stub DDS4CCM_lem_stub \ - DDS_ReadGet_Starter_lem_stub DDS_ReadGet_Starter_stub + QC_ReadGet_Starter_lem_stub QC_ReadGet_Starter_stub sharedname = Receiver_exec libs += Receiver_stub Receiver_lem_stub ReadGet_Test_Base_stub \ ReadGet_Test_Connector_stub ReadGet_Test_Connector_lem_stub \ @@ -118,12 +118,12 @@ project(ReadGet_Test_Receiver_exec) : ciao_executor, dds4ccm_base { } -project(ReadGet_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { +project(QC_ReadGet_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { after += ReadGet_Test_Receiver_lem_stub ReadGet_Test_Base_stub \ ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ ReadGet_Test_Receiver_exec ReadGet_Test_Connector_lem_stub \ - DDS4CCM_lem_stub DDS4CCM_skel DDS_ReadGet_Starter_stub \ - DDS_ReadGet_Starter_svnt DDS_ReadGet_Starter_lem_stub + DDS4CCM_lem_stub DDS4CCM_skel QC_ReadGet_Starter_stub \ + QC_ReadGet_Starter_svnt QC_ReadGet_Starter_lem_stub sharedname = Receiver_svnt libs += Receiver_stub Receiver_lem_stub ReadGet_Test_Base_stub \ ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc index 2ff0fd3a2ea..99d8b2d1e36 100755 --- a/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/ReadGet/Sender/ReadGet_Test_Sender.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -p ReadGet_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" -project(ReadGet_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { +project(QC_ReadGet_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { after += ReadGet_Test_Connector_idl_gen DDS_Starter_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ @@ -19,7 +19,7 @@ project(ReadGet_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { } } -project(ReadGet_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { +project(QC_ReadGet_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { after += ReadGet_Test_Sender_idl_gen custom_only = 1 idlflags += -Wb,stub_export_macro=SENDER_LEM_STUB_Export \ @@ -31,9 +31,9 @@ project(ReadGet_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { } } -project(ReadGet_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { +project(QC_ReadGet_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { after += ReadGet_Test_Sender_lem_gen ReadGet_Test_Sender_stub \ - ReadGet_Test_Base_stub DDS_ReadGet_Starter_stub + ReadGet_Test_Base_stub QC_ReadGet_Starter_stub libs += ReadGet_Test_Base_stub Sender_stub ReadGet_Starter_stub libpaths += ../lib libout = ../lib @@ -58,10 +58,10 @@ project(ReadGet_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { } } -project(ReadGet_Test_Sender_stub) : ccm_stub, dds4ccm_base { +project(QC_ReadGet_Test_Sender_stub) : ccm_stub, dds4ccm_base { after += ReadGet_Test_Sender_idl_gen ReadGet_Test_Base_stub \ - ReadGet_Test_Connector_stub DDS_ReadGet_Starter_stub \ - DDS_ReadGet_Starter_lem_stub + ReadGet_Test_Connector_stub QC_ReadGet_Starter_stub \ + QC_ReadGet_Starter_lem_stub libs += ReadGet_Test_Base_stub ReadGet_Test_Connector_stub \ ReadGet_Starter_stub includes += .. @@ -87,10 +87,10 @@ project(ReadGet_Test_Sender_stub) : ccm_stub, dds4ccm_base { } } -project(ReadGet_Test_Sender_exec) : ciao_executor, dds4ccm_base { +project(QC_ReadGet_Test_Sender_exec) : ciao_executor, dds4ccm_base { after += ReadGet_Test_Sender_lem_stub ReadGet_Test_Sender_stub \ ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub \ - DDS4CCM_lem_stub DDS_ReadGet_Starter_lem_stub + DDS4CCM_lem_stub QC_ReadGet_Starter_lem_stub sharedname = Sender_exec libs += Sender_stub Sender_lem_stub ReadGet_Test_Base_stub \ ReadGet_Test_Connector_lem_stub ReadGet_Test_Connector_stub \ @@ -118,12 +118,12 @@ project(ReadGet_Test_Sender_exec) : ciao_executor, dds4ccm_base { } -project(ReadGet_Test_Sender_svnt) : ciao_servant, dds4ccm_base { +project(QC_ReadGet_Test_Sender_svnt) : ciao_servant, dds4ccm_base { after += ReadGet_Test_Base_stub ReadGet_Test_Sender_lem_stub \ DDS4CCM_lem_stub DDS4CCM_skel ReadGet_Test_Connector_stub \ ReadGet_Test_Connector_svnt ReadGet_Test_Connector_lem_stub \ - DDS_ReadGet_Starter_stub DDS_ReadGet_Starter_svnt \ - DDS_ReadGet_Starter_lem_stub + QC_ReadGet_Starter_stub QC_ReadGet_Starter_svnt \ + QC_ReadGet_Starter_lem_stub sharedname = Sender_svnt libs += Sender_stub Sender_lem_stub ReadGet_Test_Base_stub DDS4CCM_lem_stub \ DDS4CCM_skel ReadGet_Test_Connector_stub ReadGet_Test_Connector_svnt \ |