diff options
Diffstat (limited to 'modules/CIAO/connectors/dds4ccm/tests')
662 files changed, 78088 insertions, 0 deletions
diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.idl new file mode 100644 index 00000000000..80c19976e0b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file CSL_DeadlineTest_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_DEADLINETEST_BASE_IDL +#define CSL_DEADLINETEST_BASE_IDL + +#pragma ndds typesupport "Base/CSL_DeadlineTest_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.mpc new file mode 100644 index 00000000000..40aac3f95d9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Base/CSL_DeadlineTest_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CSL_DeadlineTest_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CSL_DeadlineTest_Base_stub + dynamicflags += CSL_DEADLINETEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CSL_DEADLINETEST_BASE_STUB_Export \ + -Wb,stub_export_include=CSL_DeadlineTest_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CSL_DeadlineTest_Base.idl + } + + opendds_ts_flags += --export=CSL_DEADLINETEST_BASE_STUB_Export + + DDSGenerator_Files { + CSL_DeadlineTest_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.idl new file mode 100644 index 00000000000..92070bfb8d4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file CSL_DeadlineTest_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_DeadlineTest_CONNECTOR_IDL_ +#define CSL_DeadlineTest_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CSL_DeadlineTest_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CSL_DeadlineTest_ConnectorE.idl" + +module CSL_DeadlineTest +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector CSL_DeadlineTest_Connector : TestTopicConn::DDS_Event + { + }; +}; + +#endif /* CSL_DeadlineTest_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.mpc new file mode 100644 index 00000000000..5ec42ccda2e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Connector/CSL_DeadlineTest_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_DeadlineTest_Base -l .. -o ../lib -u DDS CSL_DeadlineTest_Connector" + +project(DDS_CSL_DT_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CSL_DEADLINETEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CSL_DeadlineTest_Connector_stub_export.h \ + -Wb,skel_export_macro=CSL_DEADLINETEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CSL_DeadlineTest_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CSL_DEADLINETEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CSL_DeadlineTest_Connector_svnt_export.h \ + -Wb,conn_export_macro=CSL_DEADLINETEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CSL_DeadlineTest_Connector_conn_export.h \ + -I .. + + IDL_Files { + CSL_DeadlineTest_Connector.idl + } +} + +project(DDS_CSL_DT_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_DT_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CSL_DEADLINETEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CSL_DeadlineTest_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CSL_DeadlineTest_ConnectorE.idl + } +} + +project(DDS_CSL_DT_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_DT_Connector_lem_gen DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Base_stub DDS4CCM_lem_stub + libs += DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_DT_Connector_lem_stub + dynamicflags = CSL_DEADLINETEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ConnectorEC.cpp + } + + Header_Files { + CSL_DeadlineTest_ConnectorEC.h + CSL_DeadlineTest_Connector_lem_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_ConnectorEC.inl + } +} + +project(DDS_CSL_DeadlineTest_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_DT_Connector_idl_gen DDS_CSL_DeadlineTest_Base_stub + libs += DDS_CSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_DeadlineTest_Connector_stub + dynamicflags = CSL_DEADLINETEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ConnectorC.cpp + } + + Header_Files { + CSL_DeadlineTest_ConnectorC.h + CSL_DeadlineTest_Connector_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_ConnectorC.inl + } +} + +project(DDS_CSL_DeadlineTest_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CSL_DT_Connector_lem_stub DDS_CSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_DeadlineTest_Connector_exec + libs += DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DT_Connector_lem_stub DDS_CSL_DeadlineTest_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_DEADLINETEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_Connector_conn.cpp + } + + Header_Files { + CSL_DeadlineTest_Connector_conn.h + CSL_DeadlineTest_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_DeadlineTest_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CSL_DT_Connector_lem_stub DDS_CSL_DeadlineTest_Connector_exec DDS_CSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_DeadlineTest_Connector_svnt + libs += DDS_CSL_DeadlineTest_Connector_stub \ + DDS_CSL_DT_Connector_lem_stub \ + DDS_CSL_DeadlineTest_Base_stub \ + DDS_CSL_DeadlineTest_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_DEADLINETEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ConnectorS.cpp + CSL_DeadlineTest_Connector_svnt.cpp + } + + Header_Files { + CSL_DeadlineTest_ConnectorS.h + CSL_DeadlineTest_Connector_svnt.h + CSL_DeadlineTest_Connector_svnt_export.h + } + + Inline_Files { + CSL_DeadlineTest_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.idl new file mode 100644 index 00000000000..9779bddbc23 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CSL_DeadlineTest_Connector.idl" + +module CSL_DeadlineTest +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.mpc new file mode 100644 index 00000000000..f071c196131 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_CSL_DeadlineTest_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_DT_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 { + CSL_DeadlineTest_Receiver.idl + } +} + +project(DDS_CSL_DeadlineTest_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_DeadlineTest_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 { + CSL_DeadlineTest_ReceiverE.idl + } +} + +project(DDS_CSL_DT_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Receiver_lem_gen DDS_CSL_DeadlineTest_Receiver_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Base_stub + libs += Receiver_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ReceiverEC.cpp + } + + Header_Files { + CSL_DeadlineTest_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_ReceiverEC.inl + } +} + +project(DDS_CSL_DeadlineTest_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Receiver_idl_gen DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DT_Connector_lem_gen + libs += DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ReceiverC.cpp + } + + Header_Files { + CSL_DeadlineTest_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_ReceiverC.inl + } +} + +project(DDS_CSL_DeadlineTest_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_DT_Receiver_lem_stub DDS_CSL_DeadlineTest_Receiver_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DT_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DT_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_Receiver_exec.cpp + } + + Header_Files { + CSL_DeadlineTest_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_DeadlineTest_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_DT_Receiver_lem_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Connector_svnt DDS_CSL_DeadlineTest_Receiver_exec DDS_CSL_DT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Connector_svnt Receiver_exec DDS_CSL_DT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_ReceiverS.cpp + CSL_DeadlineTest_Receiver_svnt.cpp + } + + Header_Files { + CSL_DeadlineTest_ReceiverS.h + CSL_DeadlineTest_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CSL_DeadlineTest_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.cpp new file mode 100644 index 00000000000..3ed0c09801e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.cpp @@ -0,0 +1,193 @@ +// -*- C++ -*- +// $Id$ + +#include "CSL_DeadlineTest_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" + +namespace CIAO_CSL_DeadlineTest_Receiver_Impl +{ + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &deadline_missed) + : deadline_missed_ (deadline_missed) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + this->deadline_missed_ = true; + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + TestTopic_RawListener_exec_i::TestTopic_RawListener_exec_i (Atomic_ULong &received) + : received_ (received) + { + } + + TestTopic_RawListener_exec_i::~TestTopic_RawListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::TestTopic_RawListener + + void + TestTopic_RawListener_exec_i::on_one_data ( + const TestTopic & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ++this->received_; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestTopic_RawListener: ") + ACE_TEXT ("received test_topic_info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.x)); + } + + void + TestTopic_RawListener_exec_i::on_many_data ( + const TestTopicSeq & /*an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : deadline_missed_ (false) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + // Component attributes. + // Port operations. + ::CSL_DeadlineTest::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return new TestTopic_RawListener_exec_i (this->received_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->deadline_missed_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CSL_DeadlineTest::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) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::ONE_BY_ONE); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->deadline_missed_.value ()) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Didn't receive ") + ACE_TEXT ("'on_offered_deadline_missed'\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: Received the unexpected ") + ACE_TEXT ("'on_offered_deadline_missed'\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_DeadlineTest_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.h new file mode 100644 index 00000000000..1f673465fb1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Receiver/CSL_DeadlineTest_Receiver_exec.h @@ -0,0 +1,130 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CSL_DeadlineTest_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" + +namespace CIAO_CSL_DeadlineTest_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean> Atomic_Boolean; + + class Receiver_exec_i; + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export TestTopic_RawListener_exec_i + : public virtual ::CSL_DeadlineTest::TestTopicConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + TestTopic_RawListener_exec_i (Atomic_ULong &); + virtual ~TestTopic_RawListener_exec_i (void); + + virtual void + on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info); + + virtual void + on_many_data ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & info); + + private: + Atomic_ULong &received_; + }; + + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &); + + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &deadline_missed_; + }; + + //============================================================ + // 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); + + // Port operations. + virtual ::CSL_DeadlineTest::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::CSL_DeadlineTest::CCM_Receiver_Context_var context_; + Atomic_ULong received_; + Atomic_Boolean deadline_missed_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_DeadlineTest_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.idl new file mode 100644 index 00000000000..78837331b98 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CSL_DEADLINETEST_SENDER_IDL +#define DDS_CSL_DEADLINETEST_SENDER_IDL + +#include "Connector/CSL_DeadlineTest_Connector.idl" + +module CSL_DeadlineTest +{ + component Sender + { + port TestTopicConn::DDS_Write test_topic_write; + provides CCM_DDS::ConnectorStatusListener test_topic_connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.mpc new file mode 100644 index 00000000000..a35d1f4f89d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_DeadlineTest_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CSL_DeadlineTest_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CSL_DT_Connector_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 { + CSL_DeadlineTest_Sender.idl + } +} + +project(DDS_CSL_DeadlineTest_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_DeadlineTest_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 { + CSL_DeadlineTest_SenderE.idl + } +} + +project(DDS_CSL_DeadlineTest_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Sender_lem_gen DDS_CSL_DeadlineTest_Sender_stub DDS_CSL_DeadlineTest_Base_stub + libs += DDS_CSL_DeadlineTest_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_SenderEC.cpp + } + + Header_Files { + CSL_DeadlineTest_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_SenderEC.inl + } +} + +project(DDS_CSL_DeadlineTest_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Sender_idl_gen DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub + libs += DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_SenderC.cpp + } + + Header_Files { + CSL_DeadlineTest_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CSL_DeadlineTest_SenderC.inl + } +} + +project(DDS_CSL_DeadlineTest_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Sender_lem_stub DDS_CSL_DeadlineTest_Sender_stub DDS_CSL_DT_Connector_lem_stub DDS_CSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DT_Connector_lem_stub DDS_CSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_Sender_exec.cpp + } + + Header_Files { + CSL_DeadlineTest_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_DeadlineTest_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_DeadlineTest_Base_stub DDS_CSL_DeadlineTest_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Connector_svnt DDS_CSL_DT_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_CSL_DeadlineTest_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_DeadlineTest_Connector_stub DDS_CSL_DeadlineTest_Connector_svnt DDS_CSL_DT_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_DeadlineTest_SenderS.cpp + CSL_DeadlineTest_Sender_svnt.cpp + } + + Header_Files { + CSL_DeadlineTest_SenderS.h + CSL_DeadlineTest_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CSL_DeadlineTest_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.cpp new file mode 100644 index 00000000000..5b26849663b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.cpp @@ -0,0 +1,235 @@ +// -*- C++ -*- +// $Id$ + +// Test for OFFERED_DEADLINE_MISSED status : Writer failed to write data within the deadline time period set in the profile. + +#include "CSL_DeadlineTest_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_DeadlineTest_Sender_Impl +{ + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &deadline_missed, + Atomic_ThreadId &thread_id) + : deadline_missed_ (deadline_missed), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status) + { + this->thread_id_ = ACE_Thread::self (); + if(status.last_instance_handle.isValid && ! ::CORBA::is_nil (the_writer)) + { + this->deadline_missed_ = true; + } + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : deadline_missed_ (false), + thread_id_listener_ (0) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_test_topic_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->deadline_missed_, + this->thread_id_listener_); + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::CSL_DeadlineTest::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_test_topic_write_data (); + } + + void + Sender_exec_i::write (void) + { + //to force an 'offered_deadline_missed' write the topics with a pause of 2 sec in between and + //in the profile the deadline is set to 1 sec. + for (CSL_QoSTest_Table::iterator i = this->_ktests_.begin (); + i != this->_ktests_.end (); + ++i) + { + try + { + if (! ::CORBA::is_nil (this->writer_) ) + { + ACE_OS::sleep (2); + ::DDS::InstanceHandle_t hnd = this->writer_->register_instance (i->second); + this->writer_->write_one(i->second,hnd); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while writing topic for <%C>.\n"), + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::add_instance_of_topic (const char * key, int x) + { + TestTopic *new_key = new TestTopic; + new_key->key = CORBA::string_dup(key); + new_key->x = x; + this->_ktests_[key] = new_key; + } + + void + Sender_exec_i::ccm_activate (void) + { + //add 2 different instances of topic + this->add_instance_of_topic ("ONE",1); + this->add_instance_of_topic ("TWO",2); + + //write the instances once for the test + this->write(); + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (this->deadline_missed_.value ()) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'on_offered_deadline_missed'\n") + )); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_offered_deadline_missed'\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for ConnectorStatusListener 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, "SENDER OK: " + "Thread switch for ConnectorStatusListener 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, "SENDER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "SENDER ERROR: ConnectorStatusListener: " + "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, "SENDER OK: ConnectorStatusListener: " + "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" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_DeadlineTest_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.h new file mode 100644 index 00000000000..8638d2f3332 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/Sender/CSL_DeadlineTest_Sender_exec.h @@ -0,0 +1,105 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CSL_DeadlineTest_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_CSL_DeadlineTest_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Sender_exec_i; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &deadline_missed_; + Atomic_ThreadId &thread_id_; + }; + +//============================================================ + // 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 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); + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_test_topic_connector_status(void); + + private: + ::CSL_DeadlineTest::CCM_Sender_Context_var context_; + ::CSL_DeadlineTest::TestTopicConn::Writer_var writer_; + + Atomic_Boolean deadline_missed_; + Atomic_ThreadId thread_id_listener_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, TestTopic_var> CSL_QoSTest_Table; + CSL_QoSTest_Table _ktests_; + + void add_instance_of_topic (const char *, int x ); + void write (void); + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_DeadlineTest_Sender_Impl (void); + + + +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/Plan.cdp new file mode 100644 index 00000000000..f5943bb1d47 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/Plan.cdp @@ -0,0 +1,411 @@ +<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>CSL_DeadlineTest_Depl_1</label> + <UUID>CSL_DeadlineTest_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_CSL_DeadlineTest_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_DeadlineTest_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="CSL_DeadlineTest_ConnectorComponentImplementation"> + <name>CSL_DeadlineTest_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CSL_DeadlineTest_Connector_ExecArtifact" /> + <artifact xmi:idref="CSL_DeadlineTest_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_CSL_DeadlineTest_CSL_DeadlineTest_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_DeadlineTest_CSL_DeadlineTest_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_DeadlineTest_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_DeadlineTest_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_CSL_DeadlineTest_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_DeadlineTest_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="CSL_DeadlineTest_ConnectorComponentInstance"> + <name>CSL_DeadlineTest_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_DeadlineTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CSL_DeadlineTest_ConnectorComponentInstance2"> + <name>CSL_DeadlineTest_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_DeadlineTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>test_topic_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_DeadlineTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="CSL_DeadlineTest_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="CSL_DeadlineTest_Connector_ExecArtifact"> + <name>CSL_DeadlineTest_Connector_exec</name> + <source/> + <node/> + <location>DDS_CSL_DeadlineTest_Connector_exec</location> + </artifact> + <artifact xmi:id="CSL_DeadlineTest_Connector_SvntArtifact"> + <name>CSL_DeadlineTest_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CSL_DeadlineTest_Connector_svnt</location> + </artifact> + <artifact xmi:id="CSL_DeadlineTest_Connector_StubArtifact"> + <name>CSL_DeadlineTest_Connector_stub</name> + <source/> + <node/> + <location>DDS_CSL_DeadlineTest_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/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..0ce3f46ffdf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,79 @@ +<?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="HelloTest_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="Hello_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>2</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + <deadline> + <period> + <sec>1</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </datawriter_qos> + <!-- QoS used to configure the data reader created in the example code --> + <datareader_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + <deadline> + <period> + <sec>1</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </datareader_qos> + + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/descriptors/run_test.pl new file mode 100755 index 00000000000..b2a5229d554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLDeadline/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.idl new file mode 100644 index 00000000000..829b30a0587 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file CSL_QoSTest_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_QOSTEST_BASE_IDL +#define CSL_QOSTEST_BASE_IDL + +#pragma ndds typesupport "Base/CSL_QoSTest_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.mpc new file mode 100644 index 00000000000..63ab9a3f374 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Base/CSL_QoSTest_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CSL_QoSTest_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CSL_QoSTest_Base_stub + dynamicflags += CSL_QOSTEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CSL_QOSTEST_BASE_STUB_Export \ + -Wb,stub_export_include=CSL_QoSTest_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CSL_QoSTest_Base.idl + } + + opendds_ts_flags += --export=CSL_QOSTEST_BASE_STUB_Export + + DDSGenerator_Files { + CSL_QoSTest_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.idl new file mode 100644 index 00000000000..90ad8006fb5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file CSL_QoSTest_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_QOSTEST_CONNECTOR_IDL_ +#define CSL_QOSTEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CSL_QoSTest_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CSL_QoSTest_ConnectorE.idl" + +module CSL_QoSTest +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector CSL_QoSTest_Connector : TestTopicConn::DDS_Event + { + }; +}; + +#endif /* CSL_QoSTest_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.mpc new file mode 100644 index 00000000000..65082f10cc9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Connector/CSL_QoSTest_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_QoSTest_Base -l .. -o ../lib -u DDS CSL_QoSTest_Connector" + +project(DDS_CSL_QoSTest_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CSL_QOSTEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CSL_QoSTest_Connector_stub_export.h \ + -Wb,skel_export_macro=CSL_QOSTEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CSL_QoSTest_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CSL_QOSTEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CSL_QoSTest_Connector_svnt_export.h \ + -Wb,conn_export_macro=CSL_QOSTEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CSL_QoSTest_Connector_conn_export.h \ + -I .. + + IDL_Files { + CSL_QoSTest_Connector.idl + } +} + +project(DDS_CSL_QoSTest_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_QoSTest_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CSL_QOSTEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CSL_QoSTest_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CSL_QoSTest_ConnectorE.idl + } +} + +project(DDS_CSL_QoSTest_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_QoSTest_Connector_lem_gen DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Base_stub DDS4CCM_lem_stub + libs += DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_QoSTest_Connector_lem_stub + dynamicflags = CSL_QOSTEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ConnectorEC.cpp + } + + Header_Files { + CSL_QoSTest_ConnectorEC.h + CSL_QoSTest_Connector_lem_stub_export.h + } + + Inline_Files { + CSL_QoSTest_ConnectorEC.inl + } +} + +project(DDS_CSL_QoSTest_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_QoSTest_Connector_idl_gen DDS_CSL_QoSTest_Base_stub + libs += DDS_CSL_QoSTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_QoSTest_Connector_stub + dynamicflags = CSL_QOSTEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ConnectorC.cpp + } + + Header_Files { + CSL_QoSTest_ConnectorC.h + CSL_QoSTest_Connector_stub_export.h + } + + Inline_Files { + CSL_QoSTest_ConnectorC.inl + } +} + +project(DDS_CSL_QoSTest_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CSL_QoSTest_Connector_lem_stub DDS_CSL_QoSTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_QoSTest_Connector_exec + libs += DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_lem_stub DDS_CSL_QoSTest_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_QOSTEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_Connector_conn.cpp + } + + Header_Files { + CSL_QoSTest_Connector_conn.h + CSL_QoSTest_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_QoSTest_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CSL_QoSTest_Connector_lem_stub DDS_CSL_QoSTest_Connector_exec DDS_CSL_QoSTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_QoSTest_Connector_svnt + libs += DDS_CSL_QoSTest_Connector_stub \ + DDS_CSL_QoSTest_Connector_lem_stub \ + DDS_CSL_QoSTest_Base_stub \ + DDS_CSL_QoSTest_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_QOSTEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ConnectorS.cpp + CSL_QoSTest_Connector_svnt.cpp + } + + Header_Files { + CSL_QoSTest_ConnectorS.h + CSL_QoSTest_Connector_svnt.h + CSL_QoSTest_Connector_svnt_export.h + } + + Inline_Files { + CSL_QoSTest_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.idl new file mode 100644 index 00000000000..caf1bcab8ea --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CSL_QoSTest_Connector.idl" + +module CSL_QoSTest +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.mpc new file mode 100644 index 00000000000..abf97c993e8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_CSL_QoSTest_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_QoSTest_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 { + CSL_QoSTest_Receiver.idl + } +} + +project(DDS_CSL_QoSTest_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_QoSTest_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 { + CSL_QoSTest_ReceiverE.idl + } +} + +project(DDS_CSL_QoSTest_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_QoSTest_Receiver_lem_gen DDS_CSL_QoSTest_Receiver_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Base_stub + libs += Receiver_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ReceiverEC.cpp + } + + Header_Files { + CSL_QoSTest_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CSL_QoSTest_ReceiverEC.inl + } +} + +project(DDS_CSL_QoSTest_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_QoSTest_Receiver_idl_gen DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_lem_gen + libs += DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ReceiverC.cpp + } + + Header_Files { + CSL_QoSTest_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CSL_QoSTest_ReceiverC.inl + } +} + +project(DDS_CSL_QoSTest_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_QoSTest_Receiver_lem_stub DDS_CSL_QoSTest_Receiver_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_Receiver_exec.cpp + } + + Header_Files { + CSL_QoSTest_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_QoSTest_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_QoSTest_Receiver_lem_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_svnt DDS_CSL_QoSTest_Receiver_exec DDS_CSL_QoSTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_svnt Receiver_exec DDS_CSL_QoSTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_ReceiverS.cpp + CSL_QoSTest_Receiver_svnt.cpp + } + + Header_Files { + CSL_QoSTest_ReceiverS.h + CSL_QoSTest_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CSL_QoSTest_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp new file mode 100644 index 00000000000..5f778789fb7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp @@ -0,0 +1,205 @@ +// -*- C++ -*- +// +// $Id$ + +//Test for ConnectorStatusListener: on_requested_incompatible_qos + +#include "CSL_QoSTest_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_QoSTest_Receiver_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &incompatible, + Atomic_ThreadId &thread_id) + : incompatible_ (incompatible), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + this->thread_id_ = ACE_Thread::self (); + if(! ::CORBA::is_nil(the_reader)) + { + this->incompatible_ = true; + } + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind */) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : incompatible_ (false), + thread_id_listener_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CSL_QoSTest::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return ::CSL_QoSTest::TestTopicConn::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->incompatible_, + this->thread_id_listener_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CSL_QoSTest::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) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->incompatible_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_requested_incompatible_Qos' in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Received the expected ") + ACE_TEXT ("'on_requested_incompatible_Qos' in Receiver\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread ID for ConnectorStatusListener 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, "RECEIVER OK: " + "Thread switch for ConnectorStatusListener 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, "RECEIVER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "RECEIVER ERROR: ConnectorStatusListener: " + "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, "RECEIVER OK: ConnectorStatusListener: " + "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_CSL_QoSTest_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.h new file mode 100644 index 00000000000..f9d59483c21 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.h @@ -0,0 +1,101 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CSL_QoSTest_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" + +namespace CIAO_CSL_QoSTest_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &incompatible_; + 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); + + // Port operations. + virtual ::CSL_QoSTest::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::CSL_QoSTest::CCM_Receiver_Context_var context_; + Atomic_Boolean incompatible_; + Atomic_ThreadId thread_id_listener_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_QoSTest_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.idl new file mode 100644 index 00000000000..fd8f7b1c770 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CSL_QOSTEST_SENDER_IDL +#define DDS_CSL_QOSTEST_SENDER_IDL + +#include "Connector/CSL_QoSTest_Connector.idl" + +module CSL_QoSTest +{ + component Sender + { + port TestTopicConn::DDS_Write info_write; + provides CCM_DDS::ConnectorStatusListener test_topic_connector_status; + + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.mpc new file mode 100644 index 00000000000..19398ae21f6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_QoSTest_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CSL_QoSTest_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CSL_QoSTest_Connector_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 { + CSL_QoSTest_Sender.idl + } +} + +project(DDS_CSL_QoSTest_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_QoSTest_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 { + CSL_QoSTest_SenderE.idl + } +} + +project(DDS_CSL_QoSTest_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_QoSTest_Sender_lem_gen DDS_CSL_QoSTest_Sender_stub DDS_CSL_QoSTest_Base_stub + libs += DDS_CSL_QoSTest_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_SenderEC.cpp + } + + Header_Files { + CSL_QoSTest_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CSL_QoSTest_SenderEC.inl + } +} + +project(DDS_CSL_QoSTest_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_QoSTest_Sender_idl_gen DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub + libs += DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_SenderC.cpp + } + + Header_Files { + CSL_QoSTest_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CSL_QoSTest_SenderC.inl + } +} + +project(DDS_CSL_QoSTest_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_QoSTest_Sender_lem_stub DDS_CSL_QoSTest_Sender_stub DDS_CSL_QoSTest_Connector_lem_stub DDS_CSL_QoSTest_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Connector_lem_stub DDS_CSL_QoSTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_Sender_exec.cpp + } + + Header_Files { + CSL_QoSTest_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_QoSTest_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_QoSTest_Base_stub DDS_CSL_QoSTest_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_svnt DDS_CSL_QoSTest_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_CSL_QoSTest_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_QoSTest_Connector_stub DDS_CSL_QoSTest_Connector_svnt DDS_CSL_QoSTest_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_QoSTest_SenderS.cpp + CSL_QoSTest_Sender_svnt.cpp + } + + Header_Files { + CSL_QoSTest_SenderS.h + CSL_QoSTest_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CSL_QoSTest_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.cpp new file mode 100644 index 00000000000..501be3c9d3b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.cpp @@ -0,0 +1,195 @@ +// -*- C++ -*- +// $Id$ + +//Test for ConnectorStatusListener: on_offered_incompatible_qos + +#include "CSL_QoSTest_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_QoSTest_Sender_Impl +{ + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &incompatible, + Atomic_ThreadId &thread_id) + : incompatible_ (incompatible), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + this->thread_id_ = ACE_Thread::self (); + if(! ::CORBA::is_nil(the_writer)) + { + this->incompatible_ = true; + } + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : incompatible_ (false), + thread_id_listener_ (0) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_test_topic_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->incompatible_, + this->thread_id_listener_); + } + + // Supported operations and attributes. + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CSL_QoSTest::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) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (!this->incompatible_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_offered_incompatible_qos'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'on_offered_incompatible_qos'\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for ConnectorStatusListener 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, "SENDER OK: " + "Thread switch for ConnectorStatusListener 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, "SENDER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "SENDER ERROR: ConnectorStatusListener: " + "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, "SENDER OK: ConnectorStatusListener: " + "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" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_QoSTest_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.h new file mode 100644 index 00000000000..4606c9ce5df --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/Sender/CSL_QoSTest_Sender_exec.h @@ -0,0 +1,93 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CSL_QoSTest_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_CSL_QoSTest_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Sender_exec_i; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &incompatible_; + Atomic_ThreadId &thread_id_; + }; + + //============================================================ + // 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 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); + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_test_topic_connector_status(void); + + private: + ::CSL_QoSTest::CCM_Sender_Context_var context_; + + Atomic_Boolean incompatible_; + Atomic_ThreadId thread_id_listener_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_QoSTest_Sender_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/Plan.cdp new file mode 100644 index 00000000000..3a38cc88104 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/Plan.cdp @@ -0,0 +1,372 @@ +<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>CSL_QoSTest_Depl_1</label> + <UUID>CSL_QoSTest_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_CSL_QoSTest_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_QoSTest_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="CSL_QoSTest_ConnectorComponentImplementation"> + <name>CSL_QoSTest_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CSL_QoSTest_Connector_ExecArtifact" /> + <artifact xmi:idref="CSL_QoSTest_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_CSL_QoSTest_CSL_QoSTest_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_QoSTest_CSL_QoSTest_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_QoSTest_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_QoSTest_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_CSL_QoSTest_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_QoSTest_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="CSL_QoSTest_ConnectorComponentInstance"> + <name>CSL_QoSTest_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_QoSTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QoSTest_Library#Sender_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CSL_QoSTest_ConnectorComponentInstance2"> + <name>CSL_QoSTest_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_QoSTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QoSTest_Library#Receiver_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_QoSTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_QoSTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>test_topic_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_QoSTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>test_topic_writer</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="CSL_QoSTest_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="CSL_QoSTest_Connector_ExecArtifact"> + <name>CSL_QoSTest_Connector_exec</name> + <source/> + <node/> + <location>DDS_CSL_QoSTest_Connector_exec</location> + </artifact> + <artifact xmi:id="CSL_QoSTest_Connector_SvntArtifact"> + <name>CSL_QoSTest_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CSL_QoSTest_Connector_svnt</location> + </artifact> + <artifact xmi:id="CSL_QoSTest_Connector_StubArtifact"> + <name>CSL_QoSTest_Connector_stub</name> + <source/> + <node/> + <location>DDS_CSL_QoSTest_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/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..00209f072de --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,74 @@ +<?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="QoSTest_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="Sender_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>2</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <liveliness> + <kind>DDS_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS</kind> + </liveliness> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + </qos_profile> + + <qos_profile name="Receiver_Profile" is_default_qos="true"> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <liveliness> + <kind>DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS</kind> + </liveliness> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/descriptors/run_test.pl new file mode 100755 index 00000000000..b2a5229d554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLQoS/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.idl new file mode 100644 index 00000000000..0ca498b542d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.idl @@ -0,0 +1,19 @@ +// $Id$ + +/** + * @file CSL_SRTest_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_SRTEST_BASE_IDL +#define CSL_SRTEST_BASE_IDL + +#pragma ndds typesupport "Base/CSL_SRTest_BaseSupport.h" + +struct TestTopic { + string key; //@key + long x; +}; +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.mpc new file mode 100644 index 00000000000..ce968a4a7eb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Base/CSL_SRTest_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CSL_SRTest_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CSL_SRTest_Base_stub + dynamicflags += CSL_SRTEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CSL_SRTEST_BASE_STUB_Export \ + -Wb,stub_export_include=CSL_SRTest_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CSL_SRTest_Base.idl + } + + opendds_ts_flags += --export=CSL_SRTEST_BASE_STUB_Export + + DDSGenerator_Files { + CSL_SRTest_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.idl new file mode 100644 index 00000000000..aebb35751bb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file CSL_SRTest_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_SRTEST_CONNECTOR_IDL_ +#define CSL_SRTEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CSL_SRTest_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CSL_SRTest_ConnectorE.idl" + +module CSL_SRTest +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector CSL_SRTest_Connector : TestTopicConn::DDS_Event + { + }; + +}; + +#endif /* CSL_SRTEST_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.mpc new file mode 100644 index 00000000000..eba1bec9072 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Connector/CSL_SRTest_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_SRTest_Base -l .. -o ../lib -u DDS CSL_SRTest_Connector" + +project(DDS_CSL_SRTest_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CSL_SRTEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CSL_SRTest_Connector_stub_export.h \ + -Wb,skel_export_macro=CSL_SRTEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CSL_SRTest_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CSL_SRTEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CSL_SRTest_Connector_svnt_export.h \ + -Wb,conn_export_macro=CSL_SRTEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CSL_SRTest_Connector_conn_export.h \ + -I .. + + IDL_Files { + CSL_SRTest_Connector.idl + } +} + +project(DDS_CSL_SRTest_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_SRTest_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CSL_SRTEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CSL_SRTest_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CSL_SRTest_ConnectorE.idl + } +} + +project(DDS_CSL_SRTest_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_SRTest_Connector_lem_gen DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Base_stub DDS4CCM_lem_stub + libs += DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_SRTest_Connector_lem_stub + dynamicflags = CSL_SRTEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ConnectorEC.cpp + } + + Header_Files { + CSL_SRTest_ConnectorEC.h + CSL_SRTest_Connector_lem_stub_export.h + } + + Inline_Files { + CSL_SRTest_ConnectorEC.inl + } +} + +project(DDS_CSL_SRTest_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_SRTest_Connector_idl_gen DDS_CSL_SRTest_Base_stub + libs += DDS_CSL_SRTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_SRTest_Connector_stub + dynamicflags = CSL_SRTEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ConnectorC.cpp + } + + Header_Files { + CSL_SRTest_ConnectorC.h + CSL_SRTest_Connector_stub_export.h + } + + Inline_Files { + CSL_SRTest_ConnectorC.inl + } +} + +project(DDS_CSL_SRTest_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CSL_SRTest_Connector_lem_stub DDS_CSL_SRTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_SRTest_Connector_exec + libs += DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_lem_stub DDS_CSL_SRTest_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_SRTEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_Connector_conn.cpp + } + + Header_Files { + CSL_SRTest_Connector_conn.h + CSL_SRTest_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_SRTest_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CSL_SRTest_Connector_lem_stub DDS_CSL_SRTest_Connector_exec DDS_CSL_SRTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_SRTest_Connector_svnt + libs += DDS_CSL_SRTest_Connector_stub \ + DDS_CSL_SRTest_Connector_lem_stub \ + DDS_CSL_SRTest_Base_stub \ + DDS_CSL_SRTest_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_SRTEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ConnectorS.cpp + CSL_SRTest_Connector_svnt.cpp + } + + Header_Files { + CSL_SRTest_ConnectorS.h + CSL_SRTest_Connector_svnt.h + CSL_SRTest_Connector_svnt_export.h + } + + Inline_Files { + CSL_SRTest_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.idl new file mode 100644 index 00000000000..c8eb57ca52f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CSL_SRTest_Connector.idl" + +module CSL_SRTest +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + attribute unsigned long rate; + attribute boolean read_data;//if true, read_all is invoked. + attribute boolean raw_listen; //if true, raw listen port is enabled. + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.mpc new file mode 100644 index 00000000000..3481260f7d7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_CSL_SRTest_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_SRTest_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 { + CSL_SRTest_Receiver.idl + } +} + +project(DDS_CSL_SRTest_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_SRTest_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 { + CSL_SRTest_ReceiverE.idl + } +} + +project(DDS_CSL_SRTest_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_SRTest_Receiver_lem_gen DDS_CSL_SRTest_Receiver_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Base_stub + libs += Receiver_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ReceiverEC.cpp + } + + Header_Files { + CSL_SRTest_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CSL_SRTest_ReceiverEC.inl + } +} + +project(DDS_CSL_SRTest_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_SRTest_Receiver_idl_gen DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_lem_gen + libs += DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ReceiverC.cpp + } + + Header_Files { + CSL_SRTest_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CSL_SRTest_ReceiverC.inl + } +} + +project(DDS_CSL_SRTest_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_SRTest_Receiver_lem_stub DDS_CSL_SRTest_Receiver_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_Receiver_exec.cpp + } + + Header_Files { + CSL_SRTest_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_SRTest_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_SRTest_Receiver_lem_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_svnt DDS_CSL_SRTest_Receiver_exec DDS_CSL_SRTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_svnt Receiver_exec DDS_CSL_SRTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_ReceiverS.cpp + CSL_SRTest_Receiver_svnt.cpp + } + + Header_Files { + CSL_SRTest_ReceiverS.h + CSL_SRTest_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CSL_SRTest_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.cpp new file mode 100644 index 00000000000..00552835afb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.cpp @@ -0,0 +1,373 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for ConnectorStatusListener:REJECTED_SAMPLE status through too much instances +// in Sender <max_instances>2</max_instances>, in Receiver <max_instances>1</max_instances> + +#include "CSL_SRTest_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_SRTest_Receiver_Impl +{ + +//============================================================ + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &rejected, + Atomic_ThreadId &thread_id) + : rejected_ (rejected), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status) + { + this->thread_id_ = ACE_Thread::self (); + if (status.last_reason == DDS::REJECTED_BY_INSTANCES_LIMIT && + ! ::CORBA::is_nil(the_reader)) + { + this->rejected_ = true; + } + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + try + { + if (pulse_callback_.read_data ()) + { + this->pulse_callback_.read_all(); + } + } + catch (...) + { + } + return 0; + } + + //============================================================ + // Facet Executor Implementation Class: TestTopic_Listener_exec_i + //============================================================ + + TestTopic_Listener_exec_i::TestTopic_Listener_exec_i (Atomic_ULong &received) + : received_ (received) + { + } + + TestTopic_Listener_exec_i::~TestTopic_Listener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::TestTopic_Listener + void + TestTopic_Listener_exec_i::on_many_data ( + const TestTopicSeq & /* an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + void + TestTopic_Listener_exec_i::on_one_data ( + const TestTopic & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ++this->received_; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestTopic_Listener: ") + ACE_TEXT ("received testtopic_info for <%C> at %dl\n"), + an_instance.key.in (), + an_instance.x)); + } + + //============================================================ + // Component Executor Implementation Class: Receiver_exec_iTestTopic_Listener_exec_i (); + //============================================================ + + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (0), + read_data_ (true), + raw_listen_ (false), + received_ (0), + rejected_(0), + thread_id_listener_ (0) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + + void + Receiver_exec_i::read_all (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + TestTopicSeq_var TestTopic_infos; + ::CCM_DDS::ReadInfoSeq_var readinfoseq; + this->reader_->read_all(TestTopic_infos.out(), readinfoseq.out()); + for(CORBA::ULong i = 0; i < readinfoseq->length(); ++i) + { + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for(CORBA::ULong i = 0; i < TestTopic_infos->length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + TestTopic_infos[i].key.in (), + TestTopic_infos[i].x)); + } + } + + // Component attributes. + ::CORBA::ULong + Receiver_exec_i::rate (void) + { + return this->rate_; + } + + void + Receiver_exec_i::rate (::CORBA::ULong rate) + { + this->rate_ = rate; + } + + ::CORBA::Boolean + Receiver_exec_i::read_data (void) + { + return this->read_data_; + } + + void + Receiver_exec_i::read_data ( + ::CORBA::Boolean read_data) + { + this->read_data_ = read_data; + } + + ::CORBA::Boolean + Receiver_exec_i::raw_listen (void) + { + return this->raw_listen_; + } + + void + Receiver_exec_i::raw_listen ( + ::CORBA::Boolean raw_listen) + { + this->raw_listen_ = raw_listen; + } + + // Port operations. + ::CSL_SRTest::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return new TestTopic_Listener_exec_i (this->received_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->rejected_, + this->thread_id_listener_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CSL_SRTest::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + if (this->read_data ()) + { + this->reader_ = this->context_->get_connection_info_out_data(); + } + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (this->raw_listen_ ? ::CCM_DDS::ONE_BY_ONE : ::CCM_DDS::NOT_ENABLED); + + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(0, usec), + ACE_Time_Value(0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->rejected_.value ()) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Have received the expected ") + ACE_TEXT ("'on_sample_rejected'\n") + )); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: did not receive the expected ") + ACE_TEXT ("warning 'on_sample_rejected'\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread ID for ConnectorStatusListener 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, "RECEIVER OK: " + "Thread switch for ConnectorStatusListener 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, "RECEIVER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "RECEIVER ERROR: ConnectorStatusListener: " + "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, "RECEIVER OK: ConnectorStatusListener: " + "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_CSL_SRTest_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.h new file mode 100644 index 00000000000..f36ecafe6a8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Receiver/CSL_SRTest_Receiver_exec.h @@ -0,0 +1,169 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CSL_SRTest_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" + +namespace CIAO_CSL_SRTest_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean> Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &rejected_; + Atomic_ThreadId &thread_id_; + }; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + private: + Receiver_exec_i &pulse_callback_; + }; + + //============================================================ + // TestTopic_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export TestTopic_Listener_exec_i + : public virtual ::CSL_SRTest::TestTopicConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + TestTopic_Listener_exec_i (Atomic_ULong &); + virtual ~TestTopic_Listener_exec_i (void); + + virtual void + on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const TestTopicSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ULong &received_; + }; + + //============================================================ + // 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. + void read_all (void); + + // Component attributes. + virtual ::CORBA::ULong rate (void); + + virtual void rate (::CORBA::ULong rate); + + virtual ::CORBA::Boolean read_data (void); + + virtual void read_data (::CORBA::Boolean read_data); + + virtual ::CORBA::Boolean raw_listen (void); + + virtual void raw_listen (::CORBA::Boolean raw_listen); + + // Port operations. + virtual ::CSL_SRTest::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::CSL_SRTest::CCM_Receiver_Context_var context_; + ::CSL_SRTest::TestTopicConn::Reader_var reader_; + + read_action_Generator * ticker_; + CORBA::ULong rate_; + CORBA::Boolean read_data_, raw_listen_; + Atomic_ULong received_; + Atomic_Boolean rejected_; + Atomic_ThreadId thread_id_listener_; + }; + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_SRTest_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.idl new file mode 100644 index 00000000000..53134ceaec5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CSL_SRTEST_SENDER_IDL +#define DDS_CSL_SRTEST_SENDER_IDL + +#include "Connector/CSL_SRTest_Connector.idl" + +module CSL_SRTest +{ + component Sender + { + port TestTopicConn::DDS_Write test_topic_write; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.mpc new file mode 100644 index 00000000000..ba7649d7040 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_SRTest_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CSL_SRTest_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CSL_SRTest_Connector_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 { + CSL_SRTest_Sender.idl + } +} + +project(DDS_CSL_SRTest_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_SRTest_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 { + CSL_SRTest_SenderE.idl + } +} + +project(DDS_CSL_SRTest_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_SRTest_Sender_lem_gen DDS_CSL_SRTest_Sender_stub DDS_CSL_SRTest_Base_stub + libs += DDS_CSL_SRTest_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_SenderEC.cpp + } + + Header_Files { + CSL_SRTest_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CSL_SRTest_SenderEC.inl + } +} + +project(DDS_CSL_SRTest_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_SRTest_Sender_idl_gen DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub + libs += DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_SenderC.cpp + } + + Header_Files { + CSL_SRTest_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CSL_SRTest_SenderC.inl + } +} + +project(DDS_CSL_SRTest_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_SRTest_Sender_lem_stub DDS_CSL_SRTest_Sender_stub DDS_CSL_SRTest_Connector_lem_stub DDS_CSL_SRTest_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Connector_lem_stub DDS_CSL_SRTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_Sender_exec.cpp + } + + Header_Files { + CSL_SRTest_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_SRTest_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_SRTest_Base_stub DDS_CSL_SRTest_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_svnt DDS_CSL_SRTest_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_CSL_SRTest_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_SRTest_Connector_stub DDS_CSL_SRTest_Connector_svnt DDS_CSL_SRTest_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_SRTest_SenderS.cpp + CSL_SRTest_Sender_svnt.cpp + } + + Header_Files { + CSL_SRTest_SenderS.h + CSL_SRTest_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CSL_SRTest_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.cpp new file mode 100644 index 00000000000..70a74d28775 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.cpp @@ -0,0 +1,155 @@ +// -*- C++ -*- +// $Id$ + + +// Test for ConnectorStatusListener:REJECTED_SAMPLE status through too much instances +// in Sender <max_instances>2</max_instances>, in Receiver <max_instances>1</max_instances> + +#include "CSL_SRTest_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "dds4ccm/impl/dds/Utils.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_SRTest_Sender_Impl +{ + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : rate_ (100) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + void + Sender_exec_i::tick () + { + for (CSL_SRTest_Table::iterator i = this->_ktests_.begin (); + i != this->_ktests_.end (); + ++i) + { + try + { + if (! ::CORBA::is_nil (this->writer_)) + { + this->writer_->write_one(i->second,::DDS::HANDLE_NIL); + i->second->x++; + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while creating topic for <%C>.\n"), + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::start (void) + { + // calculate the interval time + long usec = 10000000 / this->rate_; + + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer\n"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::CSL_SRTest::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_test_topic_write_data (); + } + + void + Sender_exec_i::add_instance_of_topic (const char * key, int x) + { + TestTopic *new_key = new TestTopic; + new_key->key = CORBA::string_dup(key); + new_key->x = x; + this->_ktests_[key] = new_key; + } + + void + Sender_exec_i::ccm_activate (void) + { + //add 2 different instances of topic + this->add_instance_of_topic ("ONE", 1); + this->add_instance_of_topic ("TWO", 2); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_SRTest_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.h new file mode 100644 index 00000000000..d74e8feac3f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/Sender/CSL_SRTest_Sender_exec.h @@ -0,0 +1,83 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CSL_SRTest_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_CSL_SRTest_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_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); + + void tick (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: + void start (void); + void stop (void); + + ::CSL_SRTest::TestTopicConn::Writer_var writer_; + ::CSL_SRTest::CCM_Sender_Context_var context_; + pulse_Generator * ticker_; + + CORBA::ULong rate_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, TestTopic_var> CSL_SRTest_Table; + CSL_SRTest_Table _ktests_; + + void add_instance_of_topic (const char *, int x); + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_SRTest_Sender_Impl (void); + + + +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/Plan.cdp new file mode 100644 index 00000000000..0d7d955a648 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/Plan.cdp @@ -0,0 +1,457 @@ +<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>CSL_SRTest_Depl_1</label> + <UUID>CSL_SRTest_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_CSL_SRTest_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_SRTest_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="CSL_SRTest_ConnectorComponentImplementation"> + <name>CSL_SRTest_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CSL_SRTest_Connector_ExecArtifact" /> + <artifact xmi:idref="CSL_SRTest_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_CSL_SRTest_CSL_SRTest_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_SRTest_CSL_SRTest_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_SRTest_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_SRTest_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_CSL_SRTest_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_SRTest_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>rate</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1</long> + </value> + </value> + </configProperty> + <!--configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty--> + <!--configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>10</ulong> + </value> + </value> + </configProperty--> + <!--configProperty> + <name>get_data</name> + <value> + <type> + <kind>tk_boolean</kind> + </type> + <value> + <boolean>true</boolean> + </value> + </value> + </configProperty--> + <configProperty> + <name>read_data</name> + <value> + <type> + <kind>tk_boolean</kind> + </type> + <value> + <boolean>true</boolean> + </value> + </value> + </configProperty> + <configProperty> + <name>raw_listen</name> + <value> + <type> + <kind>tk_boolean</kind> + </type> + <value> + <boolean>false</boolean> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="CSL_SRTest_ConnectorComponentInstance"> + <name>CSL_SRTest_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_SRTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CSL_SRTest_ConnectorComponentInstance2"> + <name>CSL_SRTest_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_SRTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_SRTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_SRTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_SRTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="CSL_SRTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_SRTest_ConnectorComponentInstance2" /> + </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="CSL_SRTest_Connector_ExecArtifact"> + <name>CSL_SRTest_Connector_exec</name> + <source/> + <node/> + <location>DDS_CSL_SRTest_Connector_exec</location> + </artifact> + <artifact xmi:id="CSL_SRTest_Connector_SvntArtifact"> + <name>CSL_SRTest_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CSL_SRTest_Connector_svnt</location> + </artifact> + <artifact xmi:id="CSL_SRTest_Connector_StubArtifact"> + <name>CSL_SRTest_Connector_stub</name> + <source/> + <node/> + <location>DDS_CSL_SRTest_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/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..2ebc1749f3f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +Description +XML QoS Profile + +This file is used to create a situation which causes an on_rejected_sample event. + +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="HelloTest_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="Hello_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>0</sec> + <nanosec>100000000</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <durability_service> + <history_kind>KEEP_LAST_HISTORY_QOS</history_kind> + <history_depth>10</history_depth> + <max_samples>10</max_samples> + <max_samples_per_instance>5</max_samples_per_instance> + <max_instances>2</max_instances> + </durability_service> + <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> + <durability> + <kind>VOLATILE_DURABILITY_QOS</kind> + </durability> + <deadline> + <period> + <sec>DURATION_INFINITE_SEC</sec> + <nanosec>DURATION_INFINITE_NSEC</nanosec> + </period> + </deadline> + <latency_budget> + <duration> + <sec>0</sec> + <nanosec>0</nanosec> + </duration> + </latency_budget> + <liveliness> + <kind>AUTOMATIC_LIVELINESS_QOS</kind> + <lease_duration> + <sec>DURATION_INFINITE_SEC</sec> + <nanosec>DURATION_INFINITE_NSEC</nanosec> + </lease_duration> + </liveliness> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>0</sec> + <nanosec>100000000</nanosec> + </max_blocking_time> + </reliability> + <destination_order> + <kind>BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS</kind> + </destination_order> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>10</depth> + </history> + <resource_limits> + <initial_samples>1</initial_samples> + <initial_instances>1</initial_instances> + <max_samples>10</max_samples> + <max_instances>1</max_instances> + <max_samples_per_instance>10</max_samples_per_instance> + </resource_limits> + <user_data> + <value></value> + </user_data> + <ownership> + <kind>SHARED_OWNERSHIP_QOS</kind> + </ownership> + <time_based_filter> + <minimum_separation> + <sec>0</sec> + <nanosec>0</nanosec> + </minimum_separation> + </time_based_filter> + <reader_data_lifecycle> + <autopurge_nowriter_samples_delay> + <sec>DURATION_INFINITE_SEC</sec> + <nanosec>DURATION_INFINITE_NSEC</nanosec> + </autopurge_nowriter_samples_delay> + <autopurge_disposed_samples_delay> + <sec>DURATION_INFINITE_SEC</sec> + <nanosec>DURATION_INFINITE_NSEC</nanosec> + </autopurge_disposed_samples_delay> + </reader_data_lifecycle> + </datareader_qos> + + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/descriptors/run_test.pl new file mode 100755 index 00000000000..5d0ab35419d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLSampleRejected/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.idl new file mode 100644 index 00000000000..fe3b049bc59 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.idl @@ -0,0 +1,19 @@ +// $Id$ + +/** + * @file CSL_USTest_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_USTEST_BASE_IDL +#define CSL_USTEST_BASE_IDL + +#pragma ndds typesupport "Base/CSL_USTest_BaseSupport.h" + +struct TestTopic { + string key; //@key + long x; +}; +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.mpc new file mode 100644 index 00000000000..d6df1c193f7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Base/CSL_USTest_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_CSL_USTest_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_CSL_USTest_Base_stub + dynamicflags += CSL_USTEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=CSL_USTEST_BASE_STUB_Export \ + -Wb,stub_export_include=CSL_USTest_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CSL_USTest_Base.idl + } + + opendds_ts_flags += --export=CSL_USTEST_BASE_STUB_Export + + DDSGenerator_Files { + CSL_USTest_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.idl new file mode 100644 index 00000000000..51fd2524919 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file CSL_USTest_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef CSL_USTEST_CONNECTOR_IDL_ +#define CSL_USTEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CSL_USTest_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CSL_USTest_ConnectorE.idl" + +module CSL_USTest +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector CSL_USTest_Connector : TestTopicConn::DDS_Event + { + }; +}; + +#endif /* CSL_USTest_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.mpc new file mode 100644 index 00000000000..c59804238f9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Connector/CSL_USTest_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_USTest_Base -l .. -o ../lib -u DDS CSL_USTest_Connector" + +project(DDS_CSL_USTest_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=CSL_USTEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CSL_USTest_Connector_stub_export.h \ + -Wb,skel_export_macro=CSL_USTEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CSL_USTest_Connector_svnt_export.h \ + -Wb,svnt_export_macro=CSL_USTEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CSL_USTest_Connector_svnt_export.h \ + -Wb,conn_export_macro=CSL_USTEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CSL_USTest_Connector_conn_export.h \ + -I .. + + IDL_Files { + CSL_USTest_Connector.idl + } +} + +project(DDS_CSL_USTest_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_USTest_Connector_idl_gen + idlflags += -Wb,stub_export_macro=CSL_USTEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CSL_USTest_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CSL_USTest_ConnectorE.idl + } +} + +project(DDS_CSL_USTest_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_USTest_Connector_lem_gen DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Base_stub DDS4CCM_lem_stub + libs += DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_USTest_Connector_lem_stub + dynamicflags = CSL_USTEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ConnectorEC.cpp + } + + Header_Files { + CSL_USTest_ConnectorEC.h + CSL_USTest_Connector_lem_stub_export.h + } + + Inline_Files { + CSL_USTest_ConnectorEC.inl + } +} + +project(DDS_CSL_USTest_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_USTest_Connector_idl_gen DDS_CSL_USTest_Base_stub + libs += DDS_CSL_USTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_CSL_USTest_Connector_stub + dynamicflags = CSL_USTEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ConnectorC.cpp + } + + Header_Files { + CSL_USTest_ConnectorC.h + CSL_USTest_Connector_stub_export.h + } + + Inline_Files { + CSL_USTest_ConnectorC.inl + } +} + +project(DDS_CSL_USTest_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_CSL_USTest_Connector_lem_stub DDS_CSL_USTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_USTest_Connector_exec + libs += DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_lem_stub DDS_CSL_USTest_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_USTEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_Connector_conn.cpp + } + + Header_Files { + CSL_USTest_Connector_conn.h + CSL_USTest_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_USTest_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_CSL_USTest_Connector_lem_stub DDS_CSL_USTest_Connector_exec DDS_CSL_USTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_CSL_USTest_Connector_svnt + libs += DDS_CSL_USTest_Connector_stub \ + DDS_CSL_USTest_Connector_lem_stub \ + DDS_CSL_USTest_Base_stub \ + DDS_CSL_USTest_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = CSL_USTEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ConnectorS.cpp + CSL_USTest_Connector_svnt.cpp + } + + Header_Files { + CSL_USTest_ConnectorS.h + CSL_USTest_Connector_svnt.h + CSL_USTest_Connector_svnt_export.h + } + + Inline_Files { + CSL_USTest_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.idl new file mode 100644 index 00000000000..84a4fe8639a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CSL_USTest_Connector.idl" + +module CSL_USTest +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + port TestTopicConn::DDS_Read info_read; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.mpc new file mode 100644 index 00000000000..8071b999aa2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_CSL_USTest_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_CSL_USTest_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 { + CSL_USTest_Receiver.idl + } +} + +project(DDS_CSL_USTest_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_USTest_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 { + CSL_USTest_ReceiverE.idl + } +} + +project(DDS_CSL_USTest_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_USTest_Receiver_lem_gen DDS_CSL_USTest_Receiver_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Base_stub + libs += Receiver_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ReceiverEC.cpp + } + + Header_Files { + CSL_USTest_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CSL_USTest_ReceiverEC.inl + } +} + +project(DDS_CSL_USTest_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_USTest_Receiver_idl_gen DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_lem_gen + libs += DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ReceiverC.cpp + } + + Header_Files { + CSL_USTest_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CSL_USTest_ReceiverC.inl + } +} + +project(DDS_CSL_USTest_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_USTest_Receiver_lem_stub DDS_CSL_USTest_Receiver_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_Receiver_exec.cpp + } + + Header_Files { + CSL_USTest_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_USTest_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_USTest_Receiver_lem_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_svnt DDS_CSL_USTest_Receiver_exec DDS_CSL_USTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_svnt Receiver_exec DDS_CSL_USTest_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_ReceiverS.cpp + CSL_USTest_Receiver_svnt.cpp + } + + Header_Files { + CSL_USTest_ReceiverS.h + CSL_USTest_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CSL_USTest_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.cpp new file mode 100644 index 00000000000..bbf07fcd65f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.cpp @@ -0,0 +1,425 @@ +// -*- C++ -*- +// +// $Id$ + +//Test for on_unexpected_status with status LIVELINESS_CHANGED_STATUS' and 'SUBSCRIPTION_MATCHED_STATUS + +#include "CSL_USTest_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_USTest_Receiver_Impl +{ + //============================================================ + // Pulser + //============================================================ + Pulser::Pulser (Receiver_exec_i &callback) + : callback_ (callback) + { + } + + int + Pulser::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->callback_.read_all (); + return 0; + } + + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &subscription_matched_received, + Atomic_Boolean &liveliness_changed_received, + Atomic_ThreadId &thread_id_subcription_matched, + Atomic_ThreadId &thread_id_liveliness_changed) + : subscription_matched_received_ (subscription_matched_received), + liveliness_changed_received_ (liveliness_changed_received), + thread_id_subcription_matched_ (thread_id_subcription_matched), + thread_id_liveliness_changed_ (thread_id_liveliness_changed) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + ACE_DEBUG ((LM_DEBUG, "RECEIVER\tConnectorStatusListener_exec_i::on_unexpected_status: " + "received <%C>\n", + CIAO::DDS4CCM::translate_statuskind (status_kind))); + + if (! ::CORBA::is_nil (the_entity) && status_kind == DDS::SUBSCRIPTION_MATCHED_STATUS) + { + this->subscription_matched_received_ = true; + this->thread_id_subcription_matched_ = ACE_Thread::self (); + } + else if (! ::CORBA::is_nil(the_entity) && status_kind == DDS::LIVELINESS_CHANGED_STATUS) + { + this->liveliness_changed_received_ = true; + this->thread_id_liveliness_changed_ = ACE_Thread::self (); + } + } + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + TestTopic_RawListener_exec_i::TestTopic_RawListener_exec_i (Atomic_ULong &received, + Receiver_exec_i &callback) + : received_ (received), + callback_ (callback) + { + } + + TestTopic_RawListener_exec_i::~TestTopic_RawListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::TestTopic_RawListener + void + TestTopic_RawListener_exec_i::on_one_data ( + const TestTopic & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ++this->received_; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestTopic_RawListener: ") + ACE_TEXT ("received test_topic_info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.x)); + if (this->received_ == 10) + this->callback_.stop (); + } + + void + TestTopic_RawListener_exec_i::on_many_data ( + const TestTopicSeq & /*an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : subscription_matched_received_ (false), + liveliness_changed_received_ (false), + thread_id_listener_subscription_matched_ (0), + thread_id_listener_liveliness_changed_ (0), + received_(0) + { + this->lc_ = ::CCM_DDS::DataListenerControl::_nil (); + this->pulser_= new Pulser (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_read_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CSL_USTest::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return new TestTopic_RawListener_exec_i (this->received_, + *this); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->subscription_matched_received_, + this->liveliness_changed_received_, + this->thread_id_listener_subscription_matched_, + this->thread_id_listener_liveliness_changed_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CSL_USTest::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::stop (void) + { + if (::CORBA::is_nil (this->lc_.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + } + this->lc_->mode (::CCM_DDS::NOT_ENABLED); + } + + void + Receiver_exec_i::start (void) + { + this->lc_ = this->context_->get_connection_info_out_data_control (); + if (::CORBA::is_nil (this->lc_.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + } + this->lc_->mode (::CCM_DDS::NOT_ENABLED); + } + + void + Receiver_exec_i::configuration_complete (void) + { + this->reader_ = this->context_->get_connection_info_read_data (); + } + + void + Receiver_exec_i::read_all () + { + try + { + TestTopicSeq *readertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + if (this->received_ < 30) + { + this->reader_->read_all ( + readertest_info_seq, + readinfo_seq); + ACE_DEBUG ((LM_DEBUG, "Read %u samples\n", + readinfo_seq->length ())); + this->received_ += readinfo_seq->length (); + } + else + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->pulser_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::start :Stop reading.\n"))); + delete this->pulser_; + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ALL: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ALL: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_all : Exception caught\n"))); + } + } + + void + Receiver_exec_i::ccm_activate (void) + { + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->pulser_, + 0, + ACE_Time_Value (6, 0), + ACE_Time_Value (3, 0)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer\n"))); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->subscription_matched_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: Didn't receive the expected ") + ACE_TEXT ("'SUBSCRIPTION_MATCHED_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Received the expected ") + ACE_TEXT ("'SUBSCRIPTION_MATCHED_STATUS'\n") + )); + } + if (!this->liveliness_changed_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: Didn't receive the expected ") + ACE_TEXT ("'LIVELINESS_CHANGED_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Received the expected ") + ACE_TEXT ("'LIVELINESS_CHANGED_STATUS' \n") + )); + } + + //test thread switch for SUBSCRIPTION_MATCHED_STATUS + if (this->thread_id_listener_subscription_matched_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread ID for 'SUBSCRIPTION_MATCHED_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: " + "Thread switch for 'SUBSCRIPTION_MATCHED_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread switch for 'SUBSCRIPTION_MATCHED_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: 'SUBSCRIPTION_MATCHED_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: 'SUBSCRIPTION_MATCHED_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_subscription_matched_.value (), + ACE_Thread::self ())); + } + #endif + + //test thread switch for LIVELINESS_CHANGED_STATUS + if (this->thread_id_listener_liveliness_changed_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread ID for 'LIVELINESS_CHANGED_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: " + "Thread switch for 'LIVELINESS_CHANGED_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread switch for 'LIVELINESS_CHANGED_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: 'LIVELINESS_CHANGED_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: 'LIVELINESS_CHANGED_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_changed_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_USTest_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.h new file mode 100644 index 00000000000..8c3f05c5941 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Receiver/CSL_USTest_Receiver_exec.h @@ -0,0 +1,167 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CSL_USTest_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_CSL_USTest_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong > Atomic_ULong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // Pulser + //============================================================ + class Pulser : + public ACE_Event_Handler + { + public: + Pulser (Receiver_exec_i &callback); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Receiver_exec_i &callback_; + }; + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export TestTopic_RawListener_exec_i + : public virtual ::CSL_USTest::TestTopicConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + TestTopic_RawListener_exec_i (Atomic_ULong &, + Receiver_exec_i &callback); + virtual ~TestTopic_RawListener_exec_i (void); + + virtual void + on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info); + + virtual void + on_many_data ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & info); + + private: + Atomic_ULong &received_; + Receiver_exec_i &callback_; + }; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_Boolean &, + Atomic_ThreadId &, + Atomic_ThreadId &); + + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos( ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status( ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + + private: + Atomic_Boolean &subscription_matched_received_; + Atomic_Boolean &liveliness_changed_received_; + Atomic_ThreadId &thread_id_subcription_matched_; + Atomic_ThreadId &thread_id_liveliness_changed_; + }; + + //============================================================ + // 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. + void stop (void); + void start (void); + void read_all (void); + + // Port operations. + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CSL_USTest::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_read_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::CSL_USTest::CCM_Receiver_Context_var context_; + ::CCM_DDS::DataListenerControl_var lc_; + ::CSL_USTest::TestTopicConn::Reader_var reader_; + + Pulser *pulser_; + + Atomic_Boolean subscription_matched_received_; + Atomic_Boolean liveliness_changed_received_; + Atomic_ThreadId thread_id_listener_subscription_matched_; + Atomic_ThreadId thread_id_listener_liveliness_changed_; + Atomic_ULong received_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_USTest_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.idl new file mode 100644 index 00000000000..9b12ba19106 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_CSL_USTEST_SENDER_IDL +#define DDS_CSL_USTEST_SENDER_IDL + +#include "Connector/CSL_USTest_Connector.idl" + +module CSL_USTest +{ + component Sender + { + port TestTopicConn::DDS_Write test_topic_write; + provides CCM_DDS::ConnectorStatusListener test_topic_connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.mpc new file mode 100644 index 00000000000..676ed1d6a48 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_CSL_USTest_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_CSL_USTest_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_CSL_USTest_Connector_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 { + CSL_USTest_Sender.idl + } +} + +project(DDS_CSL_USTest_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_CSL_USTest_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 { + CSL_USTest_SenderE.idl + } +} + +project(DDS_CSL_USTest_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_CSL_USTest_Sender_lem_gen DDS_CSL_USTest_Sender_stub DDS_CSL_USTest_Base_stub + libs += DDS_CSL_USTest_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_SenderEC.cpp + } + + Header_Files { + CSL_USTest_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CSL_USTest_SenderEC.inl + } +} + +project(DDS_CSL_USTest_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_CSL_USTest_Sender_idl_gen DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub + libs += DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_SenderC.cpp + } + + Header_Files { + CSL_USTest_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CSL_USTest_SenderC.inl + } +} + +project(DDS_CSL_USTest_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_CSL_USTest_Sender_lem_stub DDS_CSL_USTest_Sender_stub DDS_CSL_USTest_Connector_lem_stub DDS_CSL_USTest_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Connector_lem_stub DDS_CSL_USTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_Sender_exec.cpp + } + + Header_Files { + CSL_USTest_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_CSL_USTest_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_CSL_USTest_Base_stub DDS_CSL_USTest_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_svnt DDS_CSL_USTest_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_CSL_USTest_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_CSL_USTest_Connector_stub DDS_CSL_USTest_Connector_svnt DDS_CSL_USTest_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CSL_USTest_SenderS.cpp + CSL_USTest_Sender_svnt.cpp + } + + Header_Files { + CSL_USTest_SenderS.h + CSL_USTest_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CSL_USTest_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.cpp new file mode 100644 index 00000000000..77b9d43c31e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.cpp @@ -0,0 +1,485 @@ +// -*- C++ -*- +// $Id$ + + +//Test for on_unexpected_status with status LIVELINESS_CHANGED_STATUS' and 'PUBLICATION_MATCHED_STATUS +#include "CSL_USTest_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "dds4ccm/impl/dds/Utils.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_CSL_USTest_Sender_Impl +{ + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &publication_matched_received, + Atomic_Boolean &liveliness_lost_received, + Atomic_Boolean &reliable_dr_activity_changed_received, + Atomic_Boolean &reliable_writer_cache_changed_received, + Atomic_ThreadId &thread_id_publication_matched, + Atomic_ThreadId &thread_id_liveliness_lost, + Atomic_ThreadId &thread_id_reliable_dr_activity_changed, + Atomic_ThreadId &thread_id_reliable_writer_cache_changed) + : publication_matched_received_ (publication_matched_received), + liveliness_lost_received_ (liveliness_lost_received), + reliable_dr_activity_changed_received_ (reliable_dr_activity_changed_received), + reliable_writer_cache_changed_received_ (reliable_writer_cache_changed_received), + thread_id_publication_matched_ (thread_id_publication_matched), + thread_id_liveliness_lost_ (thread_id_liveliness_lost), + thread_id_reliable_dr_activity_changed_ (thread_id_reliable_dr_activity_changed), + thread_id_reliable_writer_cache_changed_ (thread_id_reliable_writer_cache_changed) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + ACE_DEBUG ((LM_DEBUG, "SENDER\t\tConnectorStatusListener_exec_i::on_unexpected_status: " + "received <%C>\n", + CIAO::DDS4CCM::translate_statuskind (status_kind))); + + if (! ::CORBA::is_nil(the_entity) && status_kind == DDS::LIVELINESS_LOST_STATUS) + { + this->liveliness_lost_received_ = true; + this->thread_id_liveliness_lost_ = ACE_Thread::self (); + } + else if (! ::CORBA::is_nil(the_entity) && status_kind == DDS::PUBLICATION_MATCHED_STATUS) + { + this->publication_matched_received_ = true; + this->thread_id_publication_matched_ = ACE_Thread::self (); + } + else if (! ::CORBA::is_nil(the_entity) && status_kind == DDS::RELIABLE_READER_ACTIVITY_CHANGED_STATUS) + { + this->reliable_dr_activity_changed_received_ = true; + this->thread_id_reliable_dr_activity_changed_ = ACE_Thread::self (); + } + else if (! ::CORBA::is_nil(the_entity) && status_kind == DDS::RELIABLE_WRITER_CACHE_CHANGED_STATUS) + { + this->reliable_writer_cache_changed_received_ = true; + this->thread_id_reliable_writer_cache_changed_ = ACE_Thread::self (); + } + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : publication_matched_received_ (false), + liveliness_lost_received_ (false), + reliable_dr_activity_changed_received_ (false), + reliable_writer_cache_changed_received_ (false), + thread_id_listener_publication_matched_ (0), + thread_id_listener_liveliness_lost_ (0), + thread_id_reliable_dr_activity_changed_ (0), + thread_id_reliable_writer_cache_changed_ (0) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_test_topic_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->publication_matched_received_, + this->liveliness_lost_received_, + this->reliable_dr_activity_changed_received_, + this->reliable_writer_cache_changed_received_, + this->thread_id_listener_publication_matched_, + this->thread_id_listener_liveliness_lost_, + this->thread_id_reliable_dr_activity_changed_, + this->thread_id_reliable_writer_cache_changed_); + } + + // Supported operations and attributes. + void + Sender_exec_i::tick () + { + for (CSL_SRTest_Table::iterator i = this->_ktests_.begin (); + i != this->_ktests_.end (); + ++i) + { + try + { + if (! ::CORBA::is_nil (this->writer_)) + { + this->writer_->write_one(i->second,::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Written sample: <%C> - <%d>\n", + i->first.c_str (), + i->second->x)); + i->second->x++; + } + else ACE_ERROR ((LM_ERROR, "Unable to write sample: <%C> - <%d>\n", + i->first.c_str (), + i->second->x)); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while creating topic for <%C>.\n"), + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::add_instance_of_topic (const char * key, int x) + { + TestTopic *new_key = new TestTopic; + new_key->key = CORBA::string_dup(key); + new_key->x = x; + this->_ktests_[key] = new_key; + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::CSL_USTest::CCM_Sender_Context::_narrow (ctx); + + if (::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_test_topic_write_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + //add 2 different instances of topic + this->add_instance_of_topic ("ONE", 1); + this->add_instance_of_topic ("TWO", 2); + // calculate the interval time + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (3, 0), + ACE_Time_Value (1, 0)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer\n"))); + } + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::ccm_remove (void) + { + if (!this->publication_matched_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: Didn't receive the expected ") + ACE_TEXT ("'PUBLICATION_MATCHED_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'PUBLICATION_MATCHED_STATUS'\n") + )); + } + if (!this->liveliness_lost_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: Didn't receive the expected ") + ACE_TEXT ("'LIVELINESS_LOST_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'LIVELINESS_LOST_STATUS'\n") + )); + } + if (!this->reliable_dr_activity_changed_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: Didn't receive the expected ") + ACE_TEXT ("'RELIABLE_READER_ACTIVITY_CHANGED_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'RELIABLE_READER_ACTIVITY_CHANGED_STATUS'\n") + )); + } + if (!this->reliable_writer_cache_changed_received_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: Didn't receive the expected ") + ACE_TEXT ("'RELIABLE_WRITER_CACHE_CHANGED_STATUS'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'RELIABLE_WRITER_CACHE_CHANGED_STATUS'\n") + )); + } + + //test thread switch for PUBLICATION_MATCHED_STATUS + if (this->thread_id_listener_publication_matched_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for 'PUBLICATION_MATCHED_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: " + "Thread switch for 'PUBLICATION_MATCHED_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread switch for 'PUBLICATION_MATCHED_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: 'PUBLICATION_MATCHED_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: 'PUBLICATION_MATCHED_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_publication_matched_.value (), + ACE_Thread::self ())); + } + #endif + + //test thread switch for LIVELINESS_LOST_STATUS + if (this->thread_id_listener_liveliness_lost_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for 'LIVELINESS_LOST_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: " + "Thread switch for 'LIVELINESS_LOST_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread switch for 'LIVELINESS_LOST_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: 'LIVELINESS_LOST_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: 'LIVELINESS_LOST_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())); + } + #endif + + //test thread switch for RELIABLE_READER_ACTIVITY_CHANGED_STATUS + if (this->thread_id_reliable_dr_activity_changed_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for 'RELIABLE_READER_ACTIVITY_CHANGED_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_reliable_dr_activity_changed_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: " + "Thread switch for 'RELIABLE_READER_ACTIVITY_CHANGED_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_dr_activity_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread switch for 'RELIABLE_READER_ACTIVITY_CHANGED_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_dr_activity_changed_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: 'RELIABLE_READER_ACTIVITY_CHANGED_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_dr_activity_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: 'RELIABLE_READER_ACTIVITY_CHANGED_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_dr_activity_changed_.value (), + ACE_Thread::self ())); + } + #endif + + //test thread switch for RELIABLE_WRITER_CACHE_CHANGED_STATUS + if (this->thread_id_reliable_writer_cache_changed_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for 'RELIABLE_WRITER_CACHE_CHANGED_STATUS' not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_reliable_writer_cache_changed_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: " + "Thread switch for 'RELIABLE_WRITER_CACHE_CHANGED_STATUS' seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_writer_cache_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread switch for 'RELIABLE_WRITER_CACHE_CHANGED_STATUS' " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_writer_cache_changed_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_liveliness_lost_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: 'RELIABLE_WRITER_CACHE_CHANGED_STATUS': " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_writer_cache_changed_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "SENDER OK: 'RELIABLE_WRITER_CACHE_CHANGED_STATUS': " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_reliable_writer_cache_changed_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_USTest_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.h new file mode 100644 index 00000000000..6cb1d5b2cc6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/Sender/CSL_USTest_Sender_exec.h @@ -0,0 +1,138 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CSL_USTest_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_CSL_USTest_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_callback_; + }; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_Boolean &, + Atomic_Boolean &, + Atomic_Boolean &, + Atomic_ThreadId &, + Atomic_ThreadId &, + Atomic_ThreadId &, + Atomic_ThreadId &); + + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos( ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status( ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + + private: + Atomic_Boolean &publication_matched_received_; + Atomic_Boolean &liveliness_lost_received_; + Atomic_Boolean &reliable_dr_activity_changed_received_; + Atomic_Boolean &reliable_writer_cache_changed_received_; + Atomic_ThreadId &thread_id_publication_matched_; + Atomic_ThreadId &thread_id_liveliness_lost_; + Atomic_ThreadId &thread_id_reliable_dr_activity_changed_; + Atomic_ThreadId &thread_id_reliable_writer_cache_changed_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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 tick (void); + + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_test_topic_connector_status (void); + + private: + ::CSL_USTest::CCM_Sender_Context_var context_; + ::CSL_USTest::TestTopicConn::Writer_var writer_; + + Atomic_Boolean publication_matched_received_; + Atomic_Boolean liveliness_lost_received_; + Atomic_Boolean reliable_dr_activity_changed_received_; + Atomic_Boolean reliable_writer_cache_changed_received_; + Atomic_ThreadId thread_id_listener_publication_matched_; + Atomic_ThreadId thread_id_listener_liveliness_lost_; + Atomic_ThreadId thread_id_reliable_dr_activity_changed_; + Atomic_ThreadId thread_id_reliable_writer_cache_changed_; + + pulse_Generator * ticker_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, TestTopic_var> CSL_SRTest_Table; + CSL_SRTest_Table _ktests_; + + void add_instance_of_topic (const char *, int x); + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CSL_USTest_Sender_Impl (void); + +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/Plan.cdp new file mode 100644 index 00000000000..83306d7eb0c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/Plan.cdp @@ -0,0 +1,431 @@ +<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>CSL_USTest_Depl_1</label> + <UUID>CSL_USTest_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_CSL_USTest_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_USTest_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="CSL_USTest_ConnectorComponentImplementation"> + <name>CSL_USTest_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CSL_USTest_Connector_ExecArtifact" /> + <artifact xmi:idref="CSL_USTest_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_CSL_USTest_CSL_USTest_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_USTest_CSL_USTest_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_USTest_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_USTest_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_CSL_USTest_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CSL_USTest_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="CSL_USTest_ConnectorComponentInstance"> + <name>CSL_USTest_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_USTest_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_Library#CSL_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CSL_USTest_ConnectorComponentInstance2"> + <name>CSL_USTest_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CSL_USTest_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CSL_Library#CSL_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_USTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_USTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CSL_USTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_USTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>test_topic_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CSL_USTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="CSL_USTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_read_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_read_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="CSL_USTest_ConnectorComponentInstance2" /> + </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="CSL_USTest_Connector_ExecArtifact"> + <name>CSL_USTest_Connector_exec</name> + <source/> + <node/> + <location>DDS_CSL_USTest_Connector_exec</location> + </artifact> + <artifact xmi:id="CSL_USTest_Connector_SvntArtifact"> + <name>CSL_USTest_Connector_svnt</name> + <source/> + <node/> + <location>DDS_CSL_USTest_Connector_svnt</location> + </artifact> + <artifact xmi:id="CSL_USTest_Connector_StubArtifact"> + <name>CSL_USTest_Connector_stub</name> + <source/> + <node/> + <location>DDS_CSL_USTest_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/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..72769833b96 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,69 @@ +<?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="CSL_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="CSL_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> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>200</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>1</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + <liveliness> + <kind>DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS</kind> + <lease_duration> + <sec>1</sec> + <nanosec>0</nanosec> + </lease_duration> + </liveliness> + </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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/descriptors/run_test.pl new file mode 100755 index 00000000000..66cc403a1fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CSLUnexpStat/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 20 seconds to allow task to complete\n"; +sleep (20); + +# 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/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.idl new file mode 100644 index 00000000000..32be383c4c2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file CoherentUpdate_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_UPDATE_TEST_BASE_IDL +#define COHERENT_UPDATE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/CoherentUpdate_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "CoherentUpdateTest" +#pragma DCPS_DATA_KEY "CoherentUpdateTest symbol" + +struct CoherentUpdateTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<CoherentUpdateTest> CoherentUpdateTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.mpc new file mode 100755 index 00000000000..490646069a7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/CoherentUpdate_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (CoherentUpdate_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = CoherentUpdate_Test_Base_stub + dynamicflags += COHERENT_UPDATE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=COHERENT_UPDATE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=CoherentUpdate_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CoherentUpdate_Test_Base.idl + } + + opendds_ts_flags += --export=COHERENT_UPDATE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + CoherentUpdate_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.idl new file mode 100644 index 00000000000..ed1e8a6ea10 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file Reader_Starter.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_WRITE_STARTER_IDL +#define COHERENT_WRITE_STARTER_IDL + +#pragma ciao lem "Base/Reader_StarterE.idl" + +interface CoherentUpdateStarter +{ + void set_reader_properties (in unsigned short nr_iterations); + void start_read (in unsigned short run); +}; + +interface CoherentUpdateRestarter +{ + void restart_update (); +}; + +#endif /* COHERENT_WRITE_STARTER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.mpc new file mode 100755 index 00000000000..ba32ea8ba26 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Base/Reader_Starter.mpc @@ -0,0 +1,114 @@ +// $Id$ + +project(DDS_Coh_Update_ReaderStarter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=Reader_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=Reader_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=Reader_Starter_exec_export.h -I.. + + IDL_Files { + Reader_Starter.idl + } +} + +project(DDS_Coh_Update_ReaderStarter_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Coh_Update_ReaderStarter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + Reader_StarterE.idl + } +} + +project(DDS_Coh_Update_ReaderStarter_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Coh_Update_ReaderStarter_lem_gen DDS_Coh_Update_ReaderStarter_stub + libs += Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_lem_stub + dynamicflags = READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterEC.cpp + } + + Header_Files { + Reader_StarterEC.h + Reader_Starter_lem_stub_export.h + } + + Inline_Files { + Reader_StarterEC.inl + } +} + +project(DDS_Coh_Update_ReaderStarter_stub) : ccm_stub, dds4ccm_base { + after += DDS_Coh_Update_ReaderStarter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_stub + dynamicflags = READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterC.cpp + } + + Header_Files { + Reader_StarterC.h + Reader_Starter_stub_export.h + } + + Inline_Files { + Reader_StarterC.inl + } +} + + +project(DDS_Coh_Update_ReaderStarter_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Coh_Update_ReaderStarter_lem_stub DDS_Coh_Update_ReaderStarter_stub\ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Reader_Starter_svnt + libs += Reader_Starter_stub Reader_Starter_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterS.cpp + Reader_Starter_svnt.cpp + } + + Header_Files { + Reader_StarterS.h + Reader_Starter_svnt.h + Reader_Starter_svnt_export.h + } + + Inline_Files { + Reader_StarterS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.idl new file mode 100644 index 00000000000..3d446b66a3d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file CoherentUpdate_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_UPDATE_TEST_CONNECTOR_IDL_ +#define COHERENT_UPDATE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CoherentUpdate_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CoherentUpdate_Test_ConnectorE.idl" + +module CoherentUpdate_Test +{ + module ::CCM_DDS::Typed < ::CoherentUpdateTest, ::CoherentUpdateTestSeq> CoherentUpdateTestConn; + connector CoherentUpdate_Test_Connector : CoherentUpdateTestConn::DDS_State + { + }; +}; + +#endif /* CoherentUpdate_TestCONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.mpc new file mode 100755 index 00000000000..cdb14074760 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Connector/CoherentUpdate_Test_Connector.mpc @@ -0,0 +1,148 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p CoherentUpdate_TestBase -l .. -o ../lib -u DDS CoherentUpdate_Test_Connector" + +project(CoherentUpdate_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COHERENT_UPDATE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CoherentUpdate_Connector_stub_export.h \ + -Wb,skel_export_macro=COHERENT_UPDATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CoherentUpdate_Connector_svnt_export.h \ + -Wb,svnt_export_macro=COHERENT_UPDATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CoherentUpdate_Connector_svnt_export.h \ + -Wb,conn_export_macro=COHERENT_UPDATE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CoherentUpdate_Connector_conn_export.h \ + -I .. + + IDL_Files { + CoherentUpdate_Test_Connector.idl + } +} + +project(CoherentUpdate_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += CoherentUpdate_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COHERENT_UPDATE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CoherentUpdate_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CoherentUpdate_Test_ConnectorE.idl + } +} + +project(CoherentUpdate_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentUpdate_Connector_lem_gen CoherentUpdate_Connector_stub CoherentUpdate_Test_Base_stub DDS4CCM_lem_stub + libs += CoherentUpdate_Test_Base_stub CoherentUpdate_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = CoherentUpdate_Connector_lem_stub + dynamicflags = COHERENT_UPDATE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ConnectorEC.cpp + } + + Header_Files { + CoherentUpdate_Test_ConnectorEC.h + CoherentUpdate_Test_Connector_lem_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_ConnectorEC.inl + } +} + +project(CoherentUpdate_Connector_stub) : ccm_stub, dds4ccm_base { + after += CoherentUpdate_Connector_idl_gen CoherentUpdate_Test_Base_stub + libs += CoherentUpdate_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = CoherentUpdate_Connector_stub + dynamicflags = COHERENT_UPDATE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ConnectorC.cpp + } + + Header_Files { + CoherentUpdate_Test_ConnectorC.h + CoherentUpdate_Test_Connector_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_ConnectorC.inl + } +} + +project(CoherentUpdate_Connector_exec) : ciao_executor, dds4ccm_impl { + after += CoherentUpdate_Connector_lem_stub CoherentUpdate_Connector_stub \ + DDS4CCM_lem_stub CoherentUpdate_Test_Base_stub + sharedname = CoherentUpdate_Connector_exec + libs += CoherentUpdate_Connector_stub CoherentUpdate_Connector_lem_stub \ + CoherentUpdate_Test_Base_stub DDS4CCM_lem_stub CoherentUpdate_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_UPDATE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_Connector_conn.cpp + } + + Header_Files { + CoherentUpdate_Test_Connector_conn.h + CoherentUpdate_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(CoherentUpdate_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += CoherentUpdate_Connector_lem_stub CoherentUpdate_Connector_exec \ + CoherentUpdate_Connector_stub DDS4CCM_lem_stub + sharedname = CoherentUpdate_Connector_svnt + libs += CoherentUpdate_Connector_stub \ + CoherentUpdate_Connector_lem_stub \ + CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_UPDATE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ConnectorS.cpp + CoherentUpdate_Test_Connector_svnt.cpp + } + + Header_Files { + CoherentUpdate_Test_ConnectorS.h + CoherentUpdate_Test_Connector_svnt.h + CoherentUpdate_Test_Connector_svnt_export.h + } + + Inline_Files { + CoherentUpdate_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.idl new file mode 100644 index 00000000000..cd877185448 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CoherentUpdate_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module CoherentUpdate_Test +{ + component Receiver + { + port CoherentUpdateTestConn::DDS_Read info_out; + + provides CoherentUpdateStarter reader_start; + uses CoherentUpdateRestarter updater_restart; + + attribute unsigned short nr_runs; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.mpc new file mode 100755 index 00000000000..864d8a6e6e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(CoherentUpdate_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += CoherentUpdate_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 { + CoherentUpdate_Test_Receiver.idl + } +} + +project(CoherentUpdate_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += CoherentUpdate_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 { + CoherentUpdate_Test_ReceiverE.idl + } +} + +project(CoherentUpdate_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentUpdate_Test_Receiver_lem_gen CoherentUpdate_Test_Receiver_stub \ + CoherentUpdate_Connector_stub CoherentUpdate_Test_Base_stub \ + DDS_Coh_Update_ReaderStarter_stub + libs += Receiver_stub CoherentUpdate_Connector_stub \ + CoherentUpdate_Test_Base_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ReceiverEC.cpp + } + + Header_Files { + CoherentUpdate_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_ReceiverEC.inl + } +} + +project(CoherentUpdate_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += CoherentUpdate_Test_Receiver_idl_gen CoherentUpdate_Connector_stub \ + CoherentUpdate_Test_Base_stub CoherentUpdate_Connector_lem_gen \ + DDS_Coh_Update_ReaderStarter_stub DDS_Coh_Update_ReaderStarter_lem_stub + libs += CoherentUpdate_Connector_stub CoherentUpdate_Test_Base_stub \ + Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ReceiverC.cpp + } + + Header_Files { + CoherentUpdate_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_ReceiverC.inl + } +} + +project(CoherentUpdate_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += CoherentUpdate_Test_Receiver_lem_stub CoherentUpdate_Test_Receiver_stub \ + CoherentUpdate_Test_Base_stub CoherentUpdate_Connector_stub \ + CoherentUpdate_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_Coh_Update_ReaderStarter_lem_stub DDS_Coh_Update_ReaderStarter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_stub CoherentUpdate_Connector_lem_stub \ + DDS4CCM_lem_stub Reader_Starter_lem_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_Receiver_exec.cpp + } + + Header_Files { + CoherentUpdate_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(CoherentUpdate_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += CoherentUpdate_Test_Receiver_lem_stub CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_stub CoherentUpdate_Connector_svnt \ + CoherentUpdate_Test_Receiver_exec CoherentUpdate_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Coh_Update_ReaderStarter_stub \ + DDS_Coh_Update_ReaderStarter_svnt DDS_Coh_Update_ReaderStarter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_stub CoherentUpdate_Connector_svnt \ + Receiver_exec CoherentUpdate_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel Reader_Starter_stub Reader_Starter_svnt \ + Reader_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_ReceiverS.cpp + CoherentUpdate_Test_Receiver_svnt.cpp + } + + Header_Files { + CoherentUpdate_Test_ReceiverS.h + CoherentUpdate_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CoherentUpdate_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..15a21ed84ff --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.cpp @@ -0,0 +1,305 @@ +// -*- C++ -*- +// +// $Id$ + +#include "CoherentUpdate_Test_Receiver_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +namespace CIAO_CoherentUpdate_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->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_iterations) + { + 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), + run_ (0), + nr_runs_ (5), + last_iter_ (0), + ticker_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + CoherentUpdateTest coherentwrite_info; + ::CCM_DDS::ReadInfo readinfo; + coherentwrite_info.symbol = CORBA::string_dup ("KEY_1"); + this->reader_->read_one_last ( + coherentwrite_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last - " + "last iteration <%d> - <%d>\n", + coherentwrite_info.iteration, + (this->run_ + 1) * this->iterations_ - 1)); + return coherentwrite_info.iteration >= (this->run_ + 1) * this->iterations_ - 1; + } + catch (...) + { + // no need to catch. An error is given + // when this example didn't run at all. + ACE_DEBUG ((LM_INFO, "CRASH !\n")); + } + return false; + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + try + { + CoherentUpdateTestSeq *coherentwrite_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_all ( + coherentwrite_info_seq, + readinfo_seq); + + for (CORBA::ULong it = 0; it < coherentwrite_info_seq->length (); ++it) + { + if ((*coherentwrite_info_seq)[it].iteration > this->last_iter_) + { + if ((*coherentwrite_info_seq)[it].iteration == ++this->last_iter_) + { + ACE_DEBUG ((LM_DEBUG, "OK: ")); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: ")); + } + ACE_DEBUG ((LM_DEBUG, "expected: <%u> - " + "received <%d>\n", + this->last_iter_, + (*coherentwrite_info_seq)[it].iteration)); + } + } + if (this->run_ < this->nr_runs () + 1) + { + this->restarter_->restart_update (); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Finished: wait for shutdown\n")); + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ALL: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ALL: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_all : Exception caught\n"))); + } + } + + 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; + } + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::run - " + "Starting run number <%d>\n", + run)); + this->run_ = run; + read_all (); + } + + ::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::nr_runs (void) + { + return this->nr_runs_; + } + + void + Receiver_exec_i::nr_runs (::CORBA::UShort nr_runs) + { + this->nr_runs_ = nr_runs; + } + + // Port operations. + ::CoherentUpdate_Test::CoherentUpdateTestConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return ::CoherentUpdate_Test::CoherentUpdateTestConn::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_CoherentUpdateStarter_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_ = + ::CoherentUpdate_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->reader_ = this->context_->get_connection_info_out_data(); + this->restarter_ = this->context_->get_connection_updater_restart (); +} + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + if (this->run_ == 1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("Test did not run") + ACE_TEXT ("events.\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished coherent update test.\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentUpdate_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.h new file mode 100644 index 00000000000..c41fe38f9ce --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Receiver/CoherentUpdate_Test_Receiver_exec.h @@ -0,0 +1,124 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CoherentUpdate_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_CoherentUpdate_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_CoherentUpdateStarter, + 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_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 ::CoherentUpdate_Test::CoherentUpdateTestConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_CoherentUpdateStarter_ptr + get_reader_start (); + + 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 nr_runs (void); + void nr_runs (::CORBA::UShort nr_runs); + + // 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: + ::CoherentUpdate_Test::CCM_Receiver_Context_var context_; + ::CoherentUpdate_Test::CoherentUpdateTestConn::Reader_var reader_; + CoherentUpdateRestarter_var restarter_; + CORBA::UShort iterations_; + CORBA::UShort run_; + CORBA::UShort nr_runs_; + CORBA::Long last_iter_; + + read_action_Generator *ticker_; + + void read_all (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentUpdate_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.idl new file mode 100644 index 00000000000..8874e90249b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_COHERENT_UPDATE_TEST_SENDER_IDL +#define DDS_COHERENT_UPDATE_TEST_SENDER_IDL + +#include "Connector/CoherentUpdate_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module CoherentUpdate_Test +{ + component Sender + { + port CoherentUpdateTestConn::DDS_Update info_update; + + uses CoherentUpdateStarter start_reader; + provides CoherentUpdateRestarter restart_updater; + + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.mpc new file mode 100755 index 00000000000..5e0c28c040a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender.mpc @@ -0,0 +1,155 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p CoherentUpdate_TestBase -l ../lib -o ../lib -c controller -u DDS Sender" + +project(CoherentUpdate_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += CoherentUpdate_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 { + CoherentUpdate_Test_Sender.idl + } +} + +project(CoherentUpdate_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += CoherentUpdate_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 { + CoherentUpdate_Test_SenderE.idl + } +} + +project(CoherentUpdate_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentUpdate_Test_Sender_lem_gen CoherentUpdate_Test_Sender_stub \ + CoherentUpdate_Test_Base_stub DDS_Coh_Update_ReaderStarter_stub + libs += CoherentUpdate_Test_Base_stub Sender_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_SenderEC.cpp + } + + Header_Files { + CoherentUpdate_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_SenderEC.inl + } +} + +project(CoherentUpdate_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += CoherentUpdate_Test_Sender_idl_gen CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_stub DDS_Coh_Update_ReaderStarter_stub \ + DDS_Coh_Update_ReaderStarter_lem_stub + libs += CoherentUpdate_Test_Base_stub CoherentUpdate_Connector_stub \ + Reader_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_SenderC.cpp + } + + Header_Files { + CoherentUpdate_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CoherentUpdate_Test_SenderC.inl + } +} + +project(CoherentUpdate_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += CoherentUpdate_Test_Sender_lem_stub CoherentUpdate_Test_Sender_stub \ + CoherentUpdate_Connector_lem_stub CoherentUpdate_Connector_stub \ + DDS4CCM_lem_stub DDS_Coh_Update_ReaderStarter_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub CoherentUpdate_Test_Base_stub \ + CoherentUpdate_Connector_lem_stub CoherentUpdate_Connector_stub \ + Reader_Starter_stub DDS4CCM_lem_stub Reader_Starter_lem_stub \ + Reader_Starter_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_Sender_exec.cpp + } + + Header_Files { + CoherentUpdate_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(CoherentUpdate_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += CoherentUpdate_Test_Base_stub CoherentUpdate_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel CoherentUpdate_Connector_stub \ + CoherentUpdate_Connector_svnt CoherentUpdate_Connector_lem_stub \ + DDS_Coh_Update_ReaderStarter_stub DDS_Coh_Update_ReaderStarter_svnt \ + DDS_Coh_Update_ReaderStarter_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub CoherentUpdate_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel CoherentUpdate_Connector_stub CoherentUpdate_Connector_svnt \ + CoherentUpdate_Connector_lem_stub Reader_Starter_stub \ + Reader_Starter_svnt Reader_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentUpdate_Test_SenderS.cpp + CoherentUpdate_Test_Sender_svnt.cpp + } + + Header_Files { + CoherentUpdate_Test_SenderS.h + CoherentUpdate_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CoherentUpdate_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.cpp new file mode 100644 index 00000000000..7b46b4ece6a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.cpp @@ -0,0 +1,188 @@ +// -*- C++ -*- +// $Id$ + +#include "CoherentUpdate_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +#define SAMPLE_KEY_NAME "KEY_1" + +namespace CIAO_CoherentUpdate_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_update () + { + this->callback_.restart (); + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (3), + run_ (1), + total_iter (0) + { + } + + 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->iterations_); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to start the reader\n"))); + } + + ACE_DEBUG ((LM_DEBUG, "Start run <%d> with <%u> iterations\n", + this->run_, + this->iterations ())); + + CoherentUpdateTestSeq update_many_seq; + update_many_seq.length (this->iterations_); + for (int i = 1; i < this->iterations_ + 1; ++i) + { + CoherentUpdateTest new_key; + new_key.symbol = CORBA::string_dup(SAMPLE_KEY_NAME); + new_key.iteration = ++total_iter; + update_many_seq[i-1] = new_key; + } + this->updater_->update_many (update_many_seq); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written <%u> keys uptil now\n"), + total_iter)); + ACE_OS::sleep (2); + this->starter_->start_read (this->run_); + } + + ::CORBA::UShort + Sender_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Sender_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CCM_CoherentUpdateRestarter_ptr + Sender_exec_i::get_restart_updater (void) + { + return new Restarter_exec_i (*this); + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CoherentUpdate_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 (); + this->updater_->is_coherent_write (true); + + //first create an instance for consecutive updating. + CoherentUpdateTest new_key; + new_key.symbol = CORBA::string_dup(SAMPLE_KEY_NAME); + new_key.iteration = 0; + this->updater_->create_one (new_key); + + 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_CoherentUpdate_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.h new file mode 100644 index 00000000000..e942c781a79 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/Sender/CoherentUpdate_Test_Sender_exec.h @@ -0,0 +1,96 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CoherentUpdate_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_CoherentUpdate_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_CoherentUpdateRestarter, + public virtual ::CORBA::LocalObject + { + public: + Restarter_exec_i (Sender_exec_i & callback); + virtual ~Restarter_exec_i (void); + + virtual void restart_update (); + + 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 iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CCM_CoherentUpdateRestarter_ptr + get_restart_updater (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: + ::CoherentUpdate_Test::CCM_Sender_Context_var context_; + ::CoherentUpdate_Test::CoherentUpdateTestConn::Updater_var updater_; + CoherentUpdateStarter_var starter_; + + CORBA::UShort iterations_; + CORBA::UShort run_; + CORBA::ULong total_iter; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentUpdate_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/Plan.cdp new file mode 100644 index 00000000000..76c0cd7dde1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/Plan.cdp @@ -0,0 +1,404 @@ +<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>CoherentUpdate_TestDepl_1</label> + <UUID>CoherentUpdate_TestDepl_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_CoherentUpdate_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_CoherentUpdate_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="CoherentUpdate_Test_ConnectorComponentImplementation"> + <name>CoherentUpdate_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CoherentUpdate_Connector_ExecArtifact" /> + <artifact xmi:idref="CoherentUpdate_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_CoherentUpdate_Test_CoherentUpdate_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CoherentUpdate_Test_CoherentUpdate_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdate_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdate_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_CoherentUpdate_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_CoherentUpdate_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>nr_runs</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CoherentUpdate_Test_ConnectorComponentInstance"> + <name>CoherentUpdate_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CoherentUpdate_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdater_Library#CoherentUpdater_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdate_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CoherentUpdate_Test_ConnectorComponentInstance2"> + <name>CoherentUpdate_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CoherentUpdate_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdater_Library#CoherentUpdater_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentUpdate_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>4</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CoherentUpdate_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_out_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_update_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="CoherentUpdate_Test_ConnectorComponentInstance" /> + </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="CoherentUpdate_Test_ConnectorComponentInstance" /> + </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_updater</name> + <internalEndpoint> + <portName>updater_restart</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>restart_updater</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="CoherentUpdate_Connector_ExecArtifact"> + <name>CoherentUpdate_Connector_exec</name> + <source/> + <node/> + <location>CoherentUpdate_Connector_exec</location> + </artifact> + <artifact xmi:id="CoherentUpdate_Connector_SvntArtifact"> + <name>CoherentUpdate_Connector_svnt</name> + <source/> + <node/> + <location>CoherentUpdate_Connector_svnt</location> + </artifact> + <artifact xmi:id="CoherentUpdate_Connector_StubArtifact"> + <name>CoherentUpdate_Connector_stub</name> + <source/> + <node/> + <location>CoherentUpdate_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/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..a19958a9ef2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/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="CoherentUpdater_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="CoherentUpdater_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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/descriptors/run_test.pl new file mode 100755 index 00000000000..4d9ba95b5f7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentUpdater/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 -q"); +$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/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl new file mode 100644 index 00000000000..9f4c18ebbd2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file CoherentWrite_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_WRITE_TEST_BASE_IDL +#define COHERENT_WRITE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/CoherentWrite_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "CoherentWriteTest" +#pragma DCPS_DATA_KEY "CoherentWriteTest symbol" + +struct CoherentWriteTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<CoherentWriteTest> CoherentWriteTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc new file mode 100755 index 00000000000..03aaeccd529 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (CoherentWrite_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = CoherentWrite_Test_Base_stub + dynamicflags += COHERENT_WRITE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=COHERENT_WRITE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=CoherentWrite_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + CoherentWrite_Test_Base.idl + } + + opendds_ts_flags += --export=COHERENT_WRITE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + CoherentWrite_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.idl new file mode 100644 index 00000000000..46dd49922d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file Reader_Starter.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_WRITE_STARTER_IDL +#define COHERENT_WRITE_STARTER_IDL + +#pragma ciao lem "Base/Reader_StarterE.idl" + +interface CoherentWriteStarter +{ + void set_reader_properties (in unsigned short nr_iterations); + void start_read (in unsigned short run); +}; + +interface CoherentWriteRestarter +{ + void restart_write (); +}; + +#endif /* COHERENT_WRITE_STARTER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.mpc new file mode 100755 index 00000000000..325e84a8554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.mpc @@ -0,0 +1,114 @@ +// $Id$ + +project(DDS_Coherent_Reader_Starter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=Reader_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=Reader_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=Reader_Starter_exec_export.h -I.. + + IDL_Files { + Reader_Starter.idl + } +} + +project(DDS_Coherent_Reader_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Coherent_Reader_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + Reader_StarterE.idl + } +} + +project(DDS_Coherent_Reader_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Coherent_Reader_Starter_lem_gen DDS_Coherent_Reader_Starter_stub + libs += Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_lem_stub + dynamicflags = READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterEC.cpp + } + + Header_Files { + Reader_StarterEC.h + Reader_Starter_lem_stub_export.h + } + + Inline_Files { + Reader_StarterEC.inl + } +} + +project(DDS_Coherent_Reader_Starter_stub) : ccm_stub, dds4ccm_base { + after += DDS_Coherent_Reader_Starter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_stub + dynamicflags = READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterC.cpp + } + + Header_Files { + Reader_StarterC.h + Reader_Starter_stub_export.h + } + + Inline_Files { + Reader_StarterC.inl + } +} + + +project(DDS_Coherent_Reader_Starter_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Coherent_Reader_Starter_lem_stub DDS_Coherent_Reader_Starter_stub\ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Reader_Starter_svnt + libs += Reader_Starter_stub Reader_Starter_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterS.cpp + Reader_Starter_svnt.cpp + } + + Header_Files { + Reader_StarterS.h + Reader_Starter_svnt.h + Reader_Starter_svnt_export.h + } + + Inline_Files { + Reader_StarterS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.idl new file mode 100644 index 00000000000..d77da8dfe86 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file CoherentWrite_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_WRITE_TEST_CONNECTOR_IDL_ +#define COHERENT_WRITE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/CoherentWrite_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/CoherentWrite_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::CoherentWriteTest, ::CoherentWriteTestSeq> CoherentWriteTest; +}; + +module CoherentWrite_Test +{ + connector CoherentWrite_Test_Connector : ::CCM_DDS::CoherentWriteTest::DDS_Event + { + }; +}; + +#endif /* CoherentWrite_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.mpc new file mode 100755 index 00000000000..e1f0128a57d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p CoherentWrite_Test_Base -l .. -o ../lib -u DDS CoherentWrite_Test_Connector" + +project(CoherentWrite_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COHERENT_WRITE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=CoherentWrite_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=COHERENT_WRITE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=CoherentWrite_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=COHERENT_WRITE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=CoherentWrite_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=COHERENT_WRITE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=CoherentWrite_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + CoherentWrite_Test_Connector.idl + } +} + +project(CoherentWrite_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += CoherentWrite_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COHERENT_WRITE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=CoherentWrite_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + CoherentWrite_Test_ConnectorE.idl + } +} + +project(CoherentWrite_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentWrite_Test_Connector_lem_gen CoherentWrite_Test_Connector_stub CoherentWrite_Test_Base_stub DDS4CCM_lem_stub + libs += CoherentWrite_Test_Base_stub CoherentWrite_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = CoherentWrite_Test_Connector_lem_stub + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ConnectorEC.cpp + } + + Header_Files { + CoherentWrite_Test_ConnectorEC.h + CoherentWrite_Test_Connector_lem_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_ConnectorEC.inl + } +} + +project(CoherentWrite_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += CoherentWrite_Test_Connector_idl_gen CoherentWrite_Test_Base_stub + libs += CoherentWrite_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = CoherentWrite_Test_Connector_stub + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ConnectorC.cpp + } + + Header_Files { + CoherentWrite_Test_ConnectorC.h + CoherentWrite_Test_Connector_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_ConnectorC.inl + } +} + +project(CoherentWrite_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += CoherentWrite_Test_Connector_lem_stub CoherentWrite_Test_Connector_stub DDS4CCM_lem_stub CoherentWrite_Test_Base_stub + sharedname = CoherentWrite_Test_Connector_exec + libs += CoherentWrite_Test_Connector_stub CoherentWrite_Test_Connector_lem_stub CoherentWrite_Test_Base_stub DDS4CCM_lem_stub CoherentWrite_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_Connector_conn.cpp + } + + Header_Files { + CoherentWrite_Test_Connector_conn.h + CoherentWrite_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(CoherentWrite_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += CoherentWrite_Test_Connector_lem_stub CoherentWrite_Test_Connector_exec CoherentWrite_Test_Connector_stub DDS4CCM_lem_stub + sharedname = CoherentWrite_Test_Connector_svnt + libs += CoherentWrite_Test_Connector_stub \ + CoherentWrite_Test_Connector_lem_stub \ + CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ConnectorS.cpp + CoherentWrite_Test_Connector_svnt.cpp + } + + Header_Files { + CoherentWrite_Test_ConnectorS.h + CoherentWrite_Test_Connector_svnt.h + CoherentWrite_Test_Connector_svnt_export.h + } + + Inline_Files { + CoherentWrite_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.idl new file mode 100644 index 00000000000..9d464e71125 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/CoherentWrite_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module CoherentWrite_Test +{ + component Receiver + { + port CCM_DDS::CoherentWriteTest::DDS_Read info_out; + + provides CoherentWriteStarter reader_start; + uses CoherentWriteRestarter writer_restart; + + attribute unsigned short nr_runs; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.mpc new file mode 100755 index 00000000000..f4b55360304 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(CoherentWrite_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += CoherentWrite_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 { + CoherentWrite_Test_Receiver.idl + } +} + +project(CoherentWrite_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += CoherentWrite_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 { + CoherentWrite_Test_ReceiverE.idl + } +} + +project(CoherentWrite_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentWrite_Test_Receiver_lem_gen CoherentWrite_Test_Receiver_stub \ + CoherentWrite_Test_Connector_stub CoherentWrite_Test_Base_stub \ + DDS_Coherent_Reader_Starter_stub + libs += Receiver_stub CoherentWrite_Test_Connector_stub \ + CoherentWrite_Test_Base_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ReceiverEC.cpp + } + + Header_Files { + CoherentWrite_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_ReceiverEC.inl + } +} + +project(CoherentWrite_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += CoherentWrite_Test_Receiver_idl_gen CoherentWrite_Test_Connector_stub \ + CoherentWrite_Test_Base_stub CoherentWrite_Test_Connector_lem_gen \ + DDS_Coherent_Reader_Starter_stub DDS_Coherent_Reader_Starter_lem_stub + libs += CoherentWrite_Test_Connector_stub CoherentWrite_Test_Base_stub \ + Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ReceiverC.cpp + } + + Header_Files { + CoherentWrite_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_ReceiverC.inl + } +} + +project(CoherentWrite_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += CoherentWrite_Test_Receiver_lem_stub CoherentWrite_Test_Receiver_stub \ + CoherentWrite_Test_Base_stub CoherentWrite_Test_Connector_stub \ + CoherentWrite_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_Coherent_Reader_Starter_lem_stub DDS_Coherent_Reader_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_stub CoherentWrite_Test_Connector_lem_stub \ + DDS4CCM_lem_stub Reader_Starter_lem_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_Receiver_exec.cpp + } + + Header_Files { + CoherentWrite_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(CoherentWrite_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += CoherentWrite_Test_Receiver_lem_stub CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_stub CoherentWrite_Test_Connector_svnt \ + CoherentWrite_Test_Receiver_exec CoherentWrite_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Coherent_Reader_Starter_stub \ + DDS_Coherent_Reader_Starter_svnt DDS_Coherent_Reader_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_stub CoherentWrite_Test_Connector_svnt \ + Receiver_exec CoherentWrite_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel Reader_Starter_stub Reader_Starter_svnt \ + Reader_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_ReceiverS.cpp + CoherentWrite_Test_Receiver_svnt.cpp + } + + Header_Files { + CoherentWrite_Test_ReceiverS.h + CoherentWrite_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + CoherentWrite_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..4e7ad5f5f79 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.cpp @@ -0,0 +1,305 @@ +// -*- C++ -*- +// +// $Id$ + +#include "CoherentWrite_Test_Receiver_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +namespace CIAO_CoherentWrite_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->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_iterations) + { + 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), + run_ (0), + nr_runs_ (5), + last_iter_ (0), + ticker_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + CoherentWriteTest coherentwrite_info; + ::CCM_DDS::ReadInfo readinfo; + coherentwrite_info.symbol = CORBA::string_dup ("KEY_1"); + this->reader_->read_one_last ( + coherentwrite_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last - " + "last iteration <%d> - <%d>\n", + coherentwrite_info.iteration, + (this->run_ + 1) * this->iterations_ - 1)); + return coherentwrite_info.iteration >= (this->run_ + 1) * this->iterations_ - 1; + } + catch (...) + { + // no need to catch. An error is given + // when this example didn't run at all. + ACE_DEBUG ((LM_INFO, "CRASH !\n")); + } + return false; + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + try + { + CoherentWriteTestSeq *coherentwrite_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_all ( + coherentwrite_info_seq, + readinfo_seq); + + for (CORBA::ULong it = 0; it < coherentwrite_info_seq->length (); ++it) + { + if ((*coherentwrite_info_seq)[it].iteration > this->last_iter_) + { + if ((*coherentwrite_info_seq)[it].iteration == ++this->last_iter_) + { + ACE_DEBUG ((LM_DEBUG, "OK: ")); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: ")); + } + ACE_DEBUG ((LM_DEBUG, "expected: <%u> - " + "received <%d>\n", + this->last_iter_, + (*coherentwrite_info_seq)[it].iteration)); + } + } + if (this->run_ < this->nr_runs () + 1) + { + this->restarter_->restart_write (); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Finished: wait for shutdown\n")); + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ALL: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ALL: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_all : Exception caught\n"))); + } + } + + 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; + } + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::run - " + "Starting run number <%d>\n", + run)); + this->run_ = run; + read_all (); + } + + ::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::nr_runs (void) + { + return this->nr_runs_; + } + + void + Receiver_exec_i::nr_runs (::CORBA::UShort nr_runs) + { + this->nr_runs_ = nr_runs; + } + + // Port operations. + ::CCM_DDS::CoherentWriteTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return ::CCM_DDS::CoherentWriteTest::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_CoherentWriteStarter_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_ = + ::CoherentWrite_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->reader_ = this->context_->get_connection_info_out_data(); + this->restarter_ = this->context_->get_connection_writer_restart (); +} + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + if (this->run_ == 1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("Test did not run") + ACE_TEXT ("events.\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished coherent write test.\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentWrite_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.h new file mode 100644 index 00000000000..efceb8b3c7b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.h @@ -0,0 +1,124 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "CoherentWrite_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_CoherentWrite_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_CoherentWriteStarter, + 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_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_DDS::CoherentWriteTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_CoherentWriteStarter_ptr + get_reader_start (); + + 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 nr_runs (void); + void nr_runs (::CORBA::UShort nr_runs); + + // 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: + ::CoherentWrite_Test::CCM_Receiver_Context_var context_; + ::CCM_DDS::CoherentWriteTest::Reader_var reader_; + CoherentWriteRestarter_var restarter_; + CORBA::UShort iterations_; + CORBA::UShort run_; + CORBA::UShort nr_runs_; + CORBA::Long last_iter_; + + read_action_Generator *ticker_; + + void read_all (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentWrite_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.idl new file mode 100644 index 00000000000..c496b47d1cb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_COHERENT_WRITE_TEST_SENDER_IDL +#define DDS_COHERENT_WRITE_TEST_SENDER_IDL + +#include "Connector/CoherentWrite_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module CoherentWrite_Test +{ + component Sender + { + port CCM_DDS::CoherentWriteTest::DDS_Write info_write; + + uses CoherentWriteStarter start_reader; + provides CoherentWriteRestarter restart_writer; + + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.mpc new file mode 100755 index 00000000000..c986fdb963c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.mpc @@ -0,0 +1,155 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p CoherentWrite_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(CoherentWrite_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += CoherentWrite_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 { + CoherentWrite_Test_Sender.idl + } +} + +project(CoherentWrite_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += CoherentWrite_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 { + CoherentWrite_Test_SenderE.idl + } +} + +project(CoherentWrite_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += CoherentWrite_Test_Sender_lem_gen CoherentWrite_Test_Sender_stub \ + CoherentWrite_Test_Base_stub DDS_Coherent_Reader_Starter_stub + libs += CoherentWrite_Test_Base_stub Sender_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_SenderEC.cpp + } + + Header_Files { + CoherentWrite_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_SenderEC.inl + } +} + +project(CoherentWrite_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += CoherentWrite_Test_Sender_idl_gen CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_stub DDS_Coherent_Reader_Starter_stub \ + DDS_Coherent_Reader_Starter_lem_stub + libs += CoherentWrite_Test_Base_stub CoherentWrite_Test_Connector_stub \ + Reader_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_SenderC.cpp + } + + Header_Files { + CoherentWrite_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + CoherentWrite_Test_SenderC.inl + } +} + +project(CoherentWrite_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += CoherentWrite_Test_Sender_lem_stub CoherentWrite_Test_Sender_stub \ + CoherentWrite_Test_Connector_lem_stub CoherentWrite_Test_Connector_stub \ + DDS4CCM_lem_stub DDS_Coherent_Reader_Starter_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub CoherentWrite_Test_Base_stub \ + CoherentWrite_Test_Connector_lem_stub CoherentWrite_Test_Connector_stub \ + Reader_Starter_stub DDS4CCM_lem_stub Reader_Starter_lem_stub \ + Reader_Starter_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_Sender_exec.cpp + } + + Header_Files { + CoherentWrite_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(CoherentWrite_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += CoherentWrite_Test_Base_stub CoherentWrite_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel CoherentWrite_Test_Connector_stub \ + CoherentWrite_Test_Connector_svnt CoherentWrite_Test_Connector_lem_stub \ + DDS_Coherent_Reader_Starter_stub DDS_Coherent_Reader_Starter_svnt \ + DDS_Coherent_Reader_Starter_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub CoherentWrite_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel CoherentWrite_Test_Connector_stub CoherentWrite_Test_Connector_svnt \ + CoherentWrite_Test_Connector_lem_stub Reader_Starter_stub \ + Reader_Starter_svnt Reader_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + CoherentWrite_Test_SenderS.cpp + CoherentWrite_Test_Sender_svnt.cpp + } + + Header_Files { + CoherentWrite_Test_SenderS.h + CoherentWrite_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + CoherentWrite_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp new file mode 100644 index 00000000000..0c3a464c95d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp @@ -0,0 +1,179 @@ +// -*- C++ -*- +// $Id$ + +#include "CoherentWrite_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +namespace CIAO_CoherentWrite_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_ (3), + run_ (1), + total_iter (0) + { + } + + 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->iterations_); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to start the reader\n"))); + } + + ACE_DEBUG ((LM_DEBUG, "Start run <%d> with <%u> iterations\n", + this->run_, + this->iterations ())); + + CoherentWriteTestSeq write_many_seq; + write_many_seq.length (this->iterations_); + for (int i = 1; i < this->iterations_ + 1; ++i) + { + CoherentWriteTest new_key; + new_key.symbol = CORBA::string_dup("KEY_1"); + new_key.iteration = ++total_iter; + write_many_seq[i-1] = new_key; + } + this->writer_->write_many (write_many_seq); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written <%u> keys uptil now\n"), + total_iter)); + ACE_OS::sleep (2); + this->starter_->start_read (this->run_); + } + + ::CORBA::UShort + Sender_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Sender_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CCM_CoherentWriteRestarter_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_ = + ::CoherentWrite_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->writer_->is_coherent_write (true); + 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_CoherentWrite_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.h new file mode 100644 index 00000000000..d86c551b456 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.h @@ -0,0 +1,96 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "CoherentWrite_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_CoherentWrite_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_CoherentWriteRestarter, + 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 iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CCM_CoherentWriteRestarter_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: + ::CoherentWrite_Test::CCM_Sender_Context_var context_; + CCM_DDS::CoherentWriteTest::Writer_var writer_; + CoherentWriteStarter_var starter_; + + CORBA::UShort iterations_; + CORBA::UShort run_; + CORBA::ULong total_iter; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentWrite_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/Plan.cdp new file mode 100644 index 00000000000..521972a9fab --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/Plan.cdp @@ -0,0 +1,384 @@ +<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>CoherentWrite_Test_Depl_1</label> + <UUID>CoherentWrite_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_CoherentWrite_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_CoherentWrite_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="CoherentWrite_Test_ConnectorComponentImplementation"> + <name>CoherentWrite_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="CoherentWrite_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="CoherentWrite_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_CoherentWrite_Test_CoherentWrite_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CoherentWrite_Test_CoherentWrite_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWrite_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWrite_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_CoherentWrite_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_CoherentWrite_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>nr_runs</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CoherentWrite_Test_ConnectorComponentInstance"> + <name>CoherentWrite_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CoherentWrite_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWriter_Library#CoherentWriter_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWrite_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="CoherentWrite_Test_ConnectorComponentInstance2"> + <name>CoherentWrite_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CoherentWrite_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWriter_Library#CoherentWriter_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CoherentWrite_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>4</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="CoherentWrite_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="CoherentWrite_Test_ConnectorComponentInstance" /> + </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="CoherentWrite_Test_Connector_ExecArtifact"> + <name>CoherentWrite_Test_Connector_exec</name> + <source/> + <node/> + <location>CoherentWrite_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="CoherentWrite_Test_Connector_SvntArtifact"> + <name>CoherentWrite_Test_Connector_svnt</name> + <source/> + <node/> + <location>CoherentWrite_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="CoherentWrite_Test_Connector_StubArtifact"> + <name>CoherentWrite_Test_Connector_stub</name> + <source/> + <node/> + <location>CoherentWrite_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/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..97da5d0ee8a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/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="CoherentWriter_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="CoherentWriter_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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/run_test.pl new file mode 100755 index 00000000000..708c17b2051 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/CoherentWriter/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.idl new file mode 100644 index 00000000000..81d03950b3f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file Writer_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_BASE_IDL +#define WRITER_BASE_IDL + +#pragma ndds typesupport "Base/Writer_BaseSupport.h" + +struct WriterTest { + string key; //@key + long iteration; +}; + +typedef sequence<WriterTest> WriterTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.mpc new file mode 100644 index 00000000000..3b14f5ee862 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Base/Writer_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_DDSWriterEntityBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_DDSWriterEntityBase_stub + dynamicflags += WRITER_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=WRITER_BASE_STUB_Export \ + -Wb,stub_export_include=Writer_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Writer_Base.idl + } + + opendds_ts_flags += --export=WRITER_BASE_STUB_Export + + DDSGenerator_Files { + Writer_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.idl new file mode 100644 index 00000000000..a5894738606 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Writer_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_CONNECTOR_IDL_ +#define WRITER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Writer_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Writer_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::WriterTest, ::WriterTestSeq> WriterTest; +}; + +module Writer +{ + connector Writer_Connector : ::CCM_DDS::WriterTest::DDS_Event + { + }; +}; + +#endif /* Writer_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.mpc new file mode 100644 index 00000000000..80b36b1213e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Connector/Writer_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_DDSWriterEntityBase -l .. -o ../lib -u DDS Writer_Connector" + +project(DDS_DDSWriterEntityConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_stub_export.h \ + -Wb,skel_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Writer_Connector_svnt_export.h \ + -Wb,svnt_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Writer_Connector_svnt_export.h \ + -Wb,conn_export_macro=WRITER_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Writer_Connector_conn_export.h \ + -I .. + + IDL_Files { + Writer_Connector.idl + } +} + +project(DDS_DDSWriterEntityConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_DDSWriterEntityConnector_idl_gen + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Writer_ConnectorE.idl + } +} + +project(DDS_DDSWriterEntityConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_DDSWriterEntityConnector_lem_gen DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityBase_stub DDS4CCM_lem_stub + libs += DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_DDSWriterEntityConnector_lem_stub + dynamicflags = WRITER_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorEC.cpp + } + + Header_Files { + Writer_ConnectorEC.h + Writer_Connector_lem_stub_export.h + } + + Inline_Files { + Writer_ConnectorEC.inl + } +} + +project(DDS_DDSWriterEntityConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_DDSWriterEntityConnector_idl_gen DDS_DDSWriterEntityBase_stub + libs += DDS_DDSWriterEntityBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_DDSWriterEntityConnector_stub + dynamicflags = WRITER_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorC.cpp + } + + Header_Files { + Writer_ConnectorC.h + Writer_Connector_stub_export.h + } + + Inline_Files { + Writer_ConnectorC.inl + } +} + +project(DDS_DDSWriterEntityConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_DDSWriterEntityConnector_lem_stub DDS_DDSWriterEntityConnector_stub DDS4CCM_lem_stub + sharedname = DDS_DDSWriterEntityConnector_exec + libs += DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_lem_stub DDS_DDSWriterEntityBase_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Connector_conn.cpp + } + + Header_Files { + Writer_Connector_conn.h + Writer_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_DDSWriterEntityConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_DDSWriterEntityConnector_lem_stub DDS_DDSWriterEntityConnector_exec DDS_DDSWriterEntityConnector_stub DDS4CCM_lem_stub + sharedname = DDS_DDSWriterEntityConnector_svnt + libs += DDS_DDSWriterEntityConnector_stub \ + DDS_DDSWriterEntityConnector_lem_stub \ + DDS_DDSWriterEntityBase_stub \ + DDS_DDSWriterEntityConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorS.cpp + Writer_Connector_svnt.cpp + } + + Header_Files { + Writer_ConnectorS.h + Writer_Connector_svnt.h + Writer_Connector_svnt_export.h + } + + Inline_Files { + Writer_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/README b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/README new file mode 100644 index 00000000000..38242380f34 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/README @@ -0,0 +1,6 @@ +# $Id$ + +Test which shows how to use the DDSDataWriter directly. + +We use the Datawriter from the DDS4CCM library. After typecasting +it can be used to perform operations on DDS directly. diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.idl new file mode 100644 index 00000000000..959d6ded63e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Receiver + { + port CCM_DDS::WriterTest::DDS_Listen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.mpc new file mode 100644 index 00000000000..36cbc7c960a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_DDSWriterEntityReceiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_DDSWriterEntityConnector_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 { + Writer_Receiver.idl + } +} + +project(DDS_DDSWriterEntityReceiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_DDSWriterEntityReceiver_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 { + Writer_ReceiverE.idl + } +} + +project(DDS_DDSWriterEntityReceiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_DDSWriterEntityReceiver_lem_gen DDS_DDSWriterEntityReceiver_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityBase_stub + libs += Receiver_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverEC.cpp + } + + Header_Files { + Writer_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Writer_ReceiverEC.inl + } +} + +project(DDS_DDSWriterEntityReceiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_DDSWriterEntityReceiver_idl_gen DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_lem_gen + libs += DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverC.cpp + } + + Header_Files { + Writer_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Writer_ReceiverC.inl + } +} + +project(DDS_DDSWriterEntityReceiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_DDSWriterEntityReceiver_lem_stub DDS_DDSWriterEntityReceiver_stub DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Receiver_exec.cpp + } + + Header_Files { + Writer_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_DDSWriterEntityReceiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_DDSWriterEntityReceiver_lem_stub DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_svnt DDS_DDSWriterEntityReceiver_exec DDS_DDSWriterEntityConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_svnt Receiver_exec DDS_DDSWriterEntityConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverS.cpp + Writer_Receiver_svnt.cpp + } + + Header_Files { + Writer_ReceiverS.h + Writer_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Writer_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.cpp new file mode 100644 index 00000000000..cae3ee568e3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.cpp @@ -0,0 +1,125 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Writer_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" + +namespace CIAO_Writer_Receiver_Impl +{ + //============================================================ + // WriterTest_Listener_exec_i + //============================================================ + WriterTest_Listener_exec_i::WriterTest_Listener_exec_i () + { + } + + WriterTest_Listener_exec_i::~WriterTest_Listener_exec_i (void) + { + } + + void + WriterTest_Listener_exec_i::on_one_data ( + const WriterTest & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("WriterTest_Listener: ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.iteration)); + } + + void + WriterTest_Listener_exec_i::on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + for (unsigned int i = 0; i < an_instance.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("WriterTest_Listener: ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance[i].key.in (), + an_instance[i].iteration)); + } + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CCM_DDS::WriterTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new WriterTest RAW listener\n"))); + return new WriterTest_Listener_exec_i (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Writer::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) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::ONE_BY_ONE); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.h new file mode 100644 index 00000000000..a6dd0077a1c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Receiver/Writer_Receiver_exec.h @@ -0,0 +1,75 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Writer_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_Writer_Receiver_Impl +{ + //============================================================ + // WriterTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export WriterTest_Listener_exec_i + : public virtual ::CCM_DDS::WriterTest::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + WriterTest_Listener_exec_i (); + virtual ~WriterTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const WriterTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + }; + + //============================================================ + // 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); + + virtual ::CCM_DDS::WriterTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_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: + ::Writer::CCM_Receiver_Context_var context_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.idl new file mode 100644 index 00000000000..e5289951f37 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_WRITER_ENTITY_SENDER_IDL +#define DDS_WRITER_ENTITY_SENDER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Sender + { + port CCM_DDS::WriterTest::DDS_Write info_write; + attribute unsigned short rate; + attribute unsigned short iterations; + attribute unsigned short keys; + }; +}; + +#endif /* DDS_WRITER_ENTITY_SENDER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.mpc new file mode 100644 index 00000000000..87658cd8967 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_DDSWriterEntityBase -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_DDSWriterEntitySender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_DDSWriterEntityConnector_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 { + Writer_Sender.idl + } +} + +project(DDS_DDSWriterEntitySender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_DDSWriterEntitySender_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 { + Writer_SenderE.idl + } +} + +project(DDS_DDSWriterEntitySender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_DDSWriterEntitySender_lem_gen DDS_DDSWriterEntitySender_stub \ + DDS_DDSWriterEntityBase_stub + libs += DDS_DDSWriterEntityBase_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderEC.cpp + } + + Header_Files { + Writer_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Writer_SenderEC.inl + } +} + +project(DDS_DDSWriterEntitySender_stub) : ccm_stub, dds4ccm_base { + after += DDS_DDSWriterEntitySender_idl_gen DDS_DDSWriterEntityBase_stub \ + DDS_DDSWriterEntityConnector_stub + libs += DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntityConnector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderC.cpp + } + + Header_Files { + Writer_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Writer_SenderC.inl + } +} + +project(DDS_DDSWriterEntitySender_exec) : ciao_executor, dds4ccm_base, dds4ccm_impl { + after += DDS_DDSWriterEntitySender_lem_stub DDS_DDSWriterEntitySender_stub \ + DDS_DDSWriterEntityConnector_lem_stub DDS_DDSWriterEntityConnector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_DDSWriterEntityBase_stub \ + DDS_DDSWriterEntityConnector_lem_stub DDS_DDSWriterEntityConnector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Sender_exec.cpp + } + + Header_Files { + Writer_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_DDSWriterEntitySender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_DDSWriterEntityBase_stub DDS_DDSWriterEntitySender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_DDSWriterEntityConnector_stub \ + DDS_DDSWriterEntityConnector_svnt DDS_DDSWriterEntityConnector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_DDSWriterEntityBase_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_DDSWriterEntityConnector_stub DDS_DDSWriterEntityConnector_svnt \ + DDS_DDSWriterEntityConnector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderS.cpp + Writer_Sender_svnt.cpp + } + + Header_Files { + Writer_SenderS.h + Writer_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Writer_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.cpp new file mode 100644 index 00000000000..e34834a215f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.cpp @@ -0,0 +1,268 @@ +// -*- C++ -*- +// $Id$ + +#include "Writer_Sender_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#include "Base/Writer_BaseSupport.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_Writer_Sender_Impl +{ + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : rate_ (1), + iterations_ (10), + keys_ (5) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::unregister_handles () + { + for (Writer_Table::iterator i = this->ktests_.begin (); + i != this->ktests_.end (); + ++i) + { + try + { + DDS_InstanceHandle_t hnd = this->handles_[i->first.c_str ()]; + this->writer_->unregister_instance (i->second, hnd); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Unregistered <%C> - iteration <%d> - valid handle <%d>\n"), + i->first.c_str (), + i->second->iteration, + hnd.isValid)); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("unknown exception caught during unregister_instance.\n"))); + } + } + } + + void + Sender_exec_i::register_handles() + { + Writer_Table::iterator i = this->ktests_.begin (); + for (i = this->ktests_.begin(); i != this->ktests_.end(); ++i) + { + DDS_InstanceHandle_t hnd = this->writer_->register_instance (i->second); + if (!hnd.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to register handle for <%C> - iteration <%d>\n"), + i->first.c_str (), i->second->iteration)); + } + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Registering instance for <%C>\n"), + i->second->key.in ())); + this->handles_[i->first.c_str ()] = hnd; + } + } + + void + Sender_exec_i::write_keyed () + { + if (this->last_key != this->ktests_.end ()) + { + ++this->last_key->second->iteration; + DDS_InstanceHandle_t hnd = this->handles_[this->last_key->first.c_str ()]; + DDS_ReturnCode_t const retval = this->writer_->write (this->last_key->second, hnd); + if (retval == DDS_RETCODE_OK) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written keyed <%C> - iteration <%d> - valid handle <%d>\n"), + this->last_key->first.c_str (), + this->last_key->second->iteration, + hnd.isValid)); + } + else ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error writing key <%C> - retcode %C\n"), + CIAO::DDS4CCM::translate_retcode (retval))); + + ++this->last_key; + } + else + { + //onto the next iteration + this->last_key = this->ktests_.begin (); + while (this->last_key != this->ktests_.end ()) + { + if (this->last_key->second->iteration == this->iterations_) + { + //next key + ++this->last_key; + } + else + { + break; + } + } + if (this->last_key == this->ktests_.end ()) + { + unregister_handles (); + this->stop (); + } + } + } + + void + Sender_exec_i::tick () + { + write_keyed (); + } + + void + Sender_exec_i::start (void) + { + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + this->ticker_ = 0; + } + } + + ::CORBA::UShort + Sender_exec_i::rate (void) + { + return this->rate_; + } + + void + Sender_exec_i::rate (::CORBA::UShort rate) + { + this->rate_ = rate; + } + + ::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_ = + ::Writer::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + DDS::DataWriter_var dds_dw = + this->context_->get_connection_info_write_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dds_dw.in ()); + DDSDataWriter * p = ccm_dds_rd->get_impl (); + this->writer_ = dynamic_cast <WriterTestDataWriter *> (p); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->start (); + + 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]; + WriterTest *new_key = new WriterTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 0; + + this->ktests_[key] = new_key; + } + this->last_key = this->ktests_.begin (); + register_handles (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.h new file mode 100644 index 00000000000..9fb2d84eccc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/Sender/Writer_Sender_exec.h @@ -0,0 +1,108 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Writer_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 "dds4ccm/impl/dds/DataWriter.h" + +#include <map> + +class WriterTestDataWriter; + +namespace CIAO_Writer_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_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 rate (void); + + virtual void rate (::CORBA::UShort rate); + + 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 tick (); + + private: + void start (void); + void stop (void); + + WriterTestDataWriter * writer_; + + pulse_Generator * ticker_; + ::Writer::CCM_Sender_Context_var context_; + CORBA::UShort rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + + void register_handles (); + void unregister_handles (); + void write_keyed (); + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, WriterTest_var> Writer_Table; + Writer_Table ktests_; + + typedef std::map<ACE_CString, DDS_InstanceHandle_t> Writer_Table_Handles; + Writer_Table_Handles handles_; + + Writer_Table::iterator last_key; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/descriptors/Plan.cdp new file mode 100644 index 00000000000..6799bd6785d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/descriptors/Plan.cdp @@ -0,0 +1,361 @@ +<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>DDSWriterEntity_Depl_1</label> + <UUID>DDSWriterEntity_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_Writer_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentImplementation"> + <name>Writer_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Writer_Connector_ExecArtifact" /> + <artifact xmi:idref="Writer_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_Writer_Writer_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_Writer_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_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_Writer_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentInstance"> + <name>Writer_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDSWriterEntity</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Writer_ConnectorComponentInstance2"> + <name>Writer_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDSWriterEntity</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>rate</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>5</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>_datacontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_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_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Writer_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="Writer_Connector_ExecArtifact"> + <name>Writer_Connector_exec</name> + <source/> + <node/> + <location>DDS_DDSWriterEntityConnector_exec</location> + </artifact> + <artifact xmi:id="Writer_Connector_SvntArtifact"> + <name>Writer_Connector_svnt</name> + <source/> + <node/> + <location>DDS_DDSWriterEntityConnector_svnt</location> + </artifact> + <artifact xmi:id="Writer_Connector_StubArtifact"> + <name>Writer_Connector_stub</name> + <source/> + <node/> + <location>DDS_DDSWriterEntityConnector_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/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/descriptors/run_test.pl new file mode 100755 index 00000000000..3ca8a0ee149 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DDSWriterEntity/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (60); + +# 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/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.idl new file mode 100644 index 00000000000..8527e5392d8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file DNM_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef DOUBLE_NESTED_MODULE_BASE_IDL +#define DOUBLE_NESTED_MODULE_BASE_IDL + +#pragma ndds typesupport "Base/DNM_BaseSupport.h" + +module X +{ + module Y + { + module Z + { + struct DNM_Test_Struct { + string key; //@key + long iter; + }; + typedef sequence<DNM_Test_Struct> DNM_Test_StructSeq; + }; + }; +}; + + +#endif /* DOUBLE_NESTED_MODULE_BASE_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.mpc new file mode 100755 index 00000000000..d6ebc846c64 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Base/DNM_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_DNM_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_DNM_Base_stub + dynamicflags += DOUBLE_NESTED_MODULE_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=DOUBLE_NESTED_MODULE_BASE_STUB_Export \ + -Wb,stub_export_include=DNM_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + DNM_Base.idl + } + + opendds_ts_flags += --export=DOUBLE_NESTED_MODULE_BASE_STUB_Export + + DDSGenerator_Files { + DNM_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.idl new file mode 100644 index 00000000000..7de844b7231 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file DNM_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef DOUBLE_NESTED_MODULE_CONNECTOR_IDL_ +#define DOUBLE_NESTED_MODULE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/DNM_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/DNM_ConnectorE.idl" +#pragma ndds typesupport "Base/DNM_BaseSupport.h" + +module DNM_Test_Connector +{ + module Nested_Connector + { + module ::CCM_DDS::Typed < X::Y::Z::DNM_Test_Struct, X::Y::Z::DNM_Test_StructSeq> DNM_TestConn; + connector Double_Nested_Module_Connector : DNM_TestConn::DDS_Event + { + }; + }; +}; + +#endif /* DOUBLE_NESTED_MODULE_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.mpc new file mode 100755 index 00000000000..9a78c3acff8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Connector/DNM_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_DNM_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=DOUBLE_NESTED_MODULE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=DNM_Connector_stub_export.h \ + -Wb,skel_export_macro=DOUBLE_NESTED_MODULE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=DNM_Connector_svnt_export.h \ + -Wb,svnt_export_macro=DOUBLE_NESTED_MODULE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=DNM_Connector_svnt_export.h \ + -Wb,conn_export_macro=DOUBLE_NESTED_MODULE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=DNM_Connector_conn_export.h \ + -I .. + + IDL_Files { + DNM_Connector.idl + } +} + +project(DDS_DNM_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_DNM_Connector_idl_gen + idlflags += -Wb,stub_export_macro=DOUBLE_NESTED_MODULE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=DNM_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + DNM_ConnectorE.idl + } +} + +project(DDS_DNM_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_DNM_Connector_lem_gen DDS_DNM_Connector_stub DDS_DNM_Base_stub DDS4CCM_lem_stub + libs += DDS_DNM_Base_stub DDS_DNM_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_DNM_Connector_lem_stub + dynamicflags = DOUBLE_NESTED_MODULE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_ConnectorEC.cpp + } + + Header_Files { + DNM_ConnectorEC.h + DNM_Connector_lem_stub_export.h + } + + Inline_Files { + DNM_ConnectorEC.inl + } +} + +project(DDS_DNM_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_DNM_Connector_idl_gen DDS_DNM_Base_stub + libs += DDS_DNM_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_DNM_Connector_stub + dynamicflags = DOUBLE_NESTED_MODULE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_ConnectorC.cpp + } + + Header_Files { + DNM_ConnectorC.h + DNM_Connector_stub_export.h + } + + Inline_Files { + DNM_ConnectorC.inl + } +} + +project(DDS_DNM_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_DNM_Connector_lem_stub DDS_DNM_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_DNM_Connector_exec + libs += DDS_DNM_Connector_stub DDS_DNM_Connector_lem_stub DDS_DNM_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = DOUBLE_NESTED_MODULE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_Connector_conn.cpp + } + + Header_Files { + DNM_Connector_conn.h + DNM_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_DNM_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_DNM_Connector_lem_stub DDS_DNM_Connector_exec DDS_DNM_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_DNM_Connector_svnt + libs += DDS_DNM_Connector_stub \ + DDS_DNM_Connector_lem_stub \ + DDS_DNM_Base_stub \ + DDS_DNM_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = DOUBLE_NESTED_MODULE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_ConnectorS.cpp + DNM_Connector_svnt.cpp + } + + Header_Files { + DNM_ConnectorS.h + DNM_Connector_svnt.h + DNM_Connector_svnt_export.h + } + + Inline_Files { + DNM_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.idl new file mode 100644 index 00000000000..eaeb8d71068 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file DNM_Sender.idl + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DNM_SENDER_IDL +#define DNM_SENDER_IDL + +#include "Connector/DNM_Connector.idl" + +module DNM_Test_Sender +{ + module Nested_Sender + { + component Sender + { + port DNM_Test_Connector::Nested_Connector::DNM_TestConn::DDS_Write info_write; + }; + }; +}; + +#endif /* DNM_SENDER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.mpc new file mode 100755 index 00000000000..591979693a3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender.mpc @@ -0,0 +1,147 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_DNM_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DNM_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_DNM_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 { + DNM_Sender.idl + } +} + +project(DNM_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DNM_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 { + DNM_SenderE.idl + } +} + +project(DNM_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DNM_Sender_lem_gen DNM_Sender_stub DDS_DNM_Base_stub + libs += DDS_DNM_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_SenderEC.cpp + } + + Header_Files { + DNM_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + DNM_SenderEC.inl + } +} + +project(DNM_Sender_stub) : ccm_stub, dds4ccm_base { + after += DNM_Sender_idl_gen DDS_DNM_Base_stub DDS_DNM_Connector_stub + libs += DDS_DNM_Base_stub DDS_DNM_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_SenderC.cpp + } + + Header_Files { + DNM_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + DNM_SenderC.inl + } +} + +project(DNM_Sender_exec) : ciao_executor, dds4ccm_base { + after += DNM_Sender_lem_stub DNM_Sender_stub \ + DDS_DNM_Connector_lem_stub DDS_DNM_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_DNM_Base_stub \ + DDS_DNM_Connector_lem_stub DDS_DNM_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_Sender_exec.cpp + } + + Header_Files { + DNM_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DNM_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_DNM_Base_stub DNM_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_DNM_Connector_stub \ + DDS_DNM_Connector_svnt DDS_DNM_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_DNM_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_DNM_Connector_stub DDS_DNM_Connector_svnt \ + DDS_DNM_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + DNM_SenderS.cpp + DNM_Sender_svnt.cpp + } + + Header_Files { + DNM_SenderS.h + DNM_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + DNM_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.cpp new file mode 100644 index 00000000000..c7d0c79c3d3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.cpp @@ -0,0 +1,71 @@ +// -*- C++ -*- +// $Id$ + +#include "DNM_Sender_exec.h" +#include "Base/DNM_BaseC.h" + +namespace CIAO_DNM_Test_Sender_Nested_Sender_Sender_Impl +{ + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::DNM_Test_Sender::Nested_Sender::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) + { + this->writer_ = this->context_->get_connection_info_write_data (); + + ::X::Y::Z::DNM_Test_Struct * dnm = + new ::X::Y::Z::DNM_Test_Struct; + dnm->key = CORBA::string_dup ("KEY_1"); + dnm->iter = 10; + this->writer_->write_one (*dnm, ::DDS::HANDLE_NIL); + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentWrite_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.h new file mode 100644 index 00000000000..9308e434562 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/DoubleNestedModule/Sender/DNM_Sender_exec.h @@ -0,0 +1,49 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "DNM_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_DNM_Test_Sender_Nested_Sender_Sender_Impl +{ + //============================================================ + // 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 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: + ::DNM_Test_Sender::Nested_Sender::CCM_Sender_Context_var context_; + ::DNM_Test_Connector::Nested_Connector::DNM_TestConn::Writer_var writer_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_CoherentWrite_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.idl new file mode 100644 index 00000000000..d34e3bf965c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file Event_Connection_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef EVENT_CONNECTION_TEST_BASE_IDL +#define EVENT_CONNECTION_TEST_BASE_IDL + +#pragma ndds typesupport "Base/Event_Connection_Test_BaseSupport.h" + +struct Event_ConnectionTest { + string key; //@key + long iteration; +}; + +typedef sequence<Event_ConnectionTest> Event_ConnectionTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.mpc new file mode 100644 index 00000000000..20cf270e105 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Base/Event_Connection_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_ECT_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_ECT_Base_stub + dynamicflags += EVENT_CONNECTION_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=EVENT_CONNECTION_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=Event_Connection_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Event_Connection_Test_Base.idl + } + + opendds_ts_flags += --export=EVENT_CONNECTION_TEST_BASE_STUB_Export + + DDSGenerator_Files { + Event_Connection_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.idl new file mode 100644 index 00000000000..0d6b36f298b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Event_Connection_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef KEYED_TEST_CONNECTOR_IDL_ +#define KEYED_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Event_Connection_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Event_Connection_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::Event_ConnectionTest, ::Event_ConnectionTestSeq> Event_ConnectionTest; +}; + +module Event_Connection_Test +{ + connector Event_Connection_Test_Connector : ::CCM_DDS::Event_ConnectionTest::DDS_Event + { + }; +}; + +#endif /* Event_Connection_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.mpc new file mode 100644 index 00000000000..a4a974acfc6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Connector/Event_Connection_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_ECT_Base -l .. -o ../lib -u DDS Event_Connection_Test_Connector" + +project(DDS_ECT_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=EVENT_CONNECTION_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Event_Connection_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=EVENT_CONNECTION_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Event_Connection_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=EVENT_CONNECTION_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Event_Connection_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=EVENT_CONNECTION_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Event_Connection_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + Event_Connection_Test_Connector.idl + } +} + +project(DDS_ECT_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_ECT_Connector_idl_gen + idlflags += -Wb,stub_export_macro=EVENT_CONNECTION_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Event_Connection_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Event_Connection_Test_ConnectorE.idl + } +} + +project(DDS_ECT_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_ECT_Connector_lem_gen DDS_ECT_Connector_stub DDS_ECT_Base_stub DDS4CCM_lem_stub + libs += DDS_ECT_Base_stub DDS_ECT_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_ECT_Connector_lem_stub + dynamicflags = EVENT_CONNECTION_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ConnectorEC.cpp + } + + Header_Files { + Event_Connection_Test_ConnectorEC.h + Event_Connection_Test_Connector_lem_stub_export.h + } + + Inline_Files { + Event_Connection_Test_ConnectorEC.inl + } +} + +project(DDS_ECT_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_ECT_Connector_idl_gen DDS_ECT_Base_stub + libs += DDS_ECT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_ECT_Connector_stub + dynamicflags = EVENT_CONNECTION_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ConnectorC.cpp + } + + Header_Files { + Event_Connection_Test_ConnectorC.h + Event_Connection_Test_Connector_stub_export.h + } + + Inline_Files { + Event_Connection_Test_ConnectorC.inl + } +} + +project(DDS_ECT_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_ECT_Connector_lem_stub DDS_ECT_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_ECT_Connector_exec + libs += DDS_ECT_Connector_stub DDS_ECT_Connector_lem_stub DDS_ECT_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = EVENT_CONNECTION_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_Connector_conn.cpp + } + + Header_Files { + Event_Connection_Test_Connector_conn.h + Event_Connection_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_ECT_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_ECT_Connector_lem_stub DDS_ECT_Connector_exec DDS_ECT_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_ECT_Connector_svnt + libs += DDS_ECT_Connector_stub \ + DDS_ECT_Connector_lem_stub \ + DDS_ECT_Base_stub \ + DDS_ECT_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = EVENT_CONNECTION_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ConnectorS.cpp + Event_Connection_Test_Connector_svnt.cpp + } + + Header_Files { + Event_Connection_Test_ConnectorS.h + Event_Connection_Test_Connector_svnt.h + Event_Connection_Test_Connector_svnt_export.h + } + + Inline_Files { + Event_Connection_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/README b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/README new file mode 100644 index 00000000000..02691d71506 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/README @@ -0,0 +1,25 @@ +# $Id$ + +This test tests all possible connections between +a Sender and a DDS Event connector and a Receiver and a +DDS Event connector. +The Sender requests the following connections: + * A writer + * A DDS writer + +The Receiver expects the following listeners to be created: + * A ConnectorStatusListener + * A PortStatusListener for the DDS_Listen port + * A PortStatusListener for the DDS_Get port + * A 'normal' listener + +The Receiver requests the following connections: + * A reader + * A getter + * A DDS reader + * A DataControlListener + +This test tests every single connection and reports an error when +a connections couldn't be esthablished. + +No actual read/write/listen operations are performed. diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.idl new file mode 100644 index 00000000000..548e06e7b25 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Event_Connection_Test_Connector.idl" + +module Event_Connection_Test +{ + component Receiver + { + port CCM_DDS::Event_ConnectionTest::DDS_Listen info_listen; + port CCM_DDS::Event_ConnectionTest::DDS_Get info_get; + provides CCM_DDS::ConnectorStatusListener status_listener; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.mpc new file mode 100644 index 00000000000..cf4b41fa0e0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_ECT_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_ECT_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 { + Event_Connection_Test_Receiver.idl + } +} + +project(DDS_ECT_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_ECT_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 { + Event_Connection_Test_ReceiverE.idl + } +} + +project(DDS_ECT_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_ECT_Receiver_lem_gen DDS_ECT_Receiver_stub DDS_ECT_Connector_stub DDS_ECT_Base_stub + libs += Receiver_stub DDS_ECT_Connector_stub DDS_ECT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ReceiverEC.cpp + } + + Header_Files { + Event_Connection_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Event_Connection_Test_ReceiverEC.inl + } +} + +project(DDS_ECT_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_ECT_Receiver_idl_gen DDS_ECT_Connector_stub DDS_ECT_Base_stub DDS_ECT_Connector_lem_gen + libs += DDS_ECT_Connector_stub DDS_ECT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ReceiverC.cpp + } + + Header_Files { + Event_Connection_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Event_Connection_Test_ReceiverC.inl + } +} + +project(DDS_ECT_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_ECT_Receiver_lem_stub DDS_ECT_Receiver_stub DDS_ECT_Base_stub DDS_ECT_Connector_stub DDS_ECT_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_ECT_Base_stub DDS_ECT_Connector_stub DDS_ECT_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_Receiver_exec.cpp + } + + Header_Files { + Event_Connection_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_ECT_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_ECT_Receiver_lem_stub DDS_ECT_Base_stub DDS_ECT_Connector_stub DDS_ECT_Connector_svnt DDS_ECT_Receiver_exec DDS_ECT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_ECT_Base_stub DDS_ECT_Connector_stub DDS_ECT_Connector_svnt Receiver_exec DDS_ECT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_ReceiverS.cpp + Event_Connection_Test_Receiver_svnt.cpp + } + + Header_Files { + Event_Connection_Test_ReceiverS.h + Event_Connection_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Event_Connection_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..0c6d1b8087f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.cpp @@ -0,0 +1,233 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Event_Connection_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +namespace CIAO_Event_Connection_Test_Receiver_Impl +{ + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : //DDS_Get + getter_ok_ (false), + getter_dds_data_reader_ok_ (false), + getter_reader_ok_ (false), + //DDS_Listen + listen_data_control_ok_ (false), + listen_reader_ok_ (false), + listen_dds_data_reader_ok_ (false), + //Provides + listen_port_status_created_ (false), + get_port_status_created_ (false), + get_status_listener_created_ (false), + raw_listener_created_ (false) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Port operations. + ::CCM_DDS::Event_ConnectionTest::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new Event_ConnectionTest RAW listener\n"))); + this->raw_listener_created_ = true; + return ::CCM_DDS::Event_ConnectionTest::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener for DDS_Listen\n"))); + this->listen_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_get_status (void) + { + this->get_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_status_listener(void) + { + this->get_status_listener_created_ = true; + return ::CCM_DDS::CCM_ConnectorStatusListener::_nil (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Event_Connection_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + //DDS_Get + this->getter_getter_ = + this->context_->get_connection_info_get_fresh_data (); + if (! ::CORBA::is_nil (this->getter_getter_)) + { + this->getter_ok_ = true; + } + this->getter_dds_data_reader_ = + this->context_->get_connection_info_get_dds_entity (); + if (! ::CORBA::is_nil (this->getter_dds_data_reader_)) + { + this->getter_dds_data_reader_ok_ = true; + } + this->getter_reader_ = + this->context_->get_connection_info_get_data (); + if (! ::CORBA::is_nil (this->getter_reader_)) + { + this->getter_reader_ok_ = true; + } + //DDS_Listen + this->listen_data_control_ = + this->context_->get_connection_info_listen_data_control (); + + if (! ::CORBA::is_nil (this->listen_data_control_)) + { + this->listen_data_control_ok_ = true; + } + this->listen_reader_ = + this->context_->get_connection_info_listen_data (); + if (! ::CORBA::is_nil (this->listen_reader_)) + { + this->listen_reader_ok_ = true; + } + this->listen_dds_data_reader_ = + this->context_->get_connection_info_listen_dds_entity (); + if (! ::CORBA::is_nil (this->listen_dds_data_reader_)) + { + this->listen_dds_data_reader_ok_ = true; + } + } + + void + Receiver_exec_i::ccm_activate (void) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + //DDS_Get + if (!this->getter_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get getter failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get getter passed\n"))); + } + if (!this->getter_dds_data_reader_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_Get failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_Get passed\n"))); + } + if (!this->getter_reader_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Get failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Get passed\n"))); + } + //DDS_Listen + if (!this->listen_data_control_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get data listen control of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get data listen control of DDS_Listen passed\n"))); + } + if (!this->listen_reader_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Listen passed\n"))); + } + if (!this->listen_dds_data_reader_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get dds reader of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get dds reader of DDS_Listen passed\n"))); + } + //Provides + if (!this->raw_listener_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : listener not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Listener was created\n"))); + } + if (!this->listen_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Listen not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Listen was created\n"))); + } + if (!this->get_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Get not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Get was created\n"))); + } + if (!this->get_status_listener_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : ConnectorStatusListener not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : ConnectorStatusListener was created\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Event_Connection_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.h new file mode 100644 index 00000000000..7536df834d0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Receiver/Event_Connection_Test_Receiver_exec.h @@ -0,0 +1,87 @@ +// -*- C++ -*- +// $Id$ + +#ifndef EVENT_CONNECTION_RECEIVER_EXEC_H_ +#define EVENT_CONNECTION_RECEIVER_EXEC_H_ + +#include "Event_Connection_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" + +namespace CIAO_Event_Connection_Test_Receiver_Impl +{ + //============================================================ + // 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); + + // Port operations. + virtual ::CCM_DDS::Event_ConnectionTest::CCM_Listener_ptr + get_info_listen_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + + //DDS_Get + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_get_status (void); + + virtual CCM_DDS::CCM_ConnectorStatusListener_ptr + get_status_listener(void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::Event_Connection_Test::CCM_Receiver_Context_var context_; + //DDS_Get + ::CCM_DDS::Event_ConnectionTest::Getter_var getter_getter_; + ::DDS::DataReader_var getter_dds_data_reader_; + ::CCM_DDS::Event_ConnectionTest::Reader_var getter_reader_; + + bool getter_ok_; + bool getter_dds_data_reader_ok_; + bool getter_reader_ok_; + + //DDS_Listen + ::CCM_DDS::DataListenerControl_var listen_data_control_; + ::CCM_DDS::Event_ConnectionTest::Reader_var listen_reader_; + ::DDS::DataReader_var listen_dds_data_reader_; + + bool listen_data_control_ok_; + bool listen_reader_ok_; + bool listen_dds_data_reader_ok_; + + //Provide checks + bool listen_port_status_created_; + bool get_port_status_created_; + bool get_status_listener_created_; + bool raw_listener_created_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Event_Connection_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.idl new file mode 100644 index 00000000000..8ab214b9256 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_EVENT_CONNECTION_TEST_SENDER_IDL +#define DDS_EVENT_CONNECTION_TEST_SENDER_IDL + +#include "Connector/Event_Connection_Test_Connector.idl" + +module Event_Connection_Test +{ + component Sender + { + port CCM_DDS::Event_ConnectionTest::DDS_Write info_write; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.mpc new file mode 100644 index 00000000000..8258674efe6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_ECT_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_ECT_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_ECT_Connector_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 { + Event_Connection_Test_Sender.idl + } +} + +project(DDS_ECT_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_ECT_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 { + Event_Connection_Test_SenderE.idl + } +} + +project(DDS_ECT_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_ECT_Sender_lem_gen DDS_ECT_Sender_stub DDS_ECT_Base_stub + libs += DDS_ECT_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_SenderEC.cpp + } + + Header_Files { + Event_Connection_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Event_Connection_Test_SenderEC.inl + } +} + +project(DDS_ECT_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_ECT_Sender_idl_gen DDS_ECT_Base_stub DDS_ECT_Connector_stub + libs += DDS_ECT_Base_stub DDS_ECT_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_SenderC.cpp + } + + Header_Files { + Event_Connection_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Event_Connection_Test_SenderC.inl + } +} + +project(DDS_ECT_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_ECT_Sender_lem_stub DDS_ECT_Sender_stub DDS_ECT_Connector_lem_stub DDS_ECT_Connector_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_ECT_Base_stub DDS_ECT_Connector_lem_stub DDS_ECT_Connector_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_Sender_exec.cpp + } + + Header_Files { + Event_Connection_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_ECT_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_ECT_Base_stub DDS_ECT_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_ECT_Connector_stub DDS_ECT_Connector_svnt DDS_ECT_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_ECT_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_ECT_Connector_stub DDS_ECT_Connector_svnt DDS_ECT_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Event_Connection_Test_SenderS.cpp + Event_Connection_Test_Sender_svnt.cpp + } + + Header_Files { + Event_Connection_Test_SenderS.h + Event_Connection_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Event_Connection_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.cpp new file mode 100644 index 00000000000..1fb938bcf5e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.cpp @@ -0,0 +1,93 @@ +// -*- C++ -*- +// $Id$ + +#include "Event_Connection_Test_Sender_exec.h" + +namespace CIAO_Event_Connection_Test_Sender_Impl +{ + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : writer_ok_ (false), + writer_dds_datawriter_ok_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Event_Connection_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = + this->context_->get_connection_info_write_data (); + if (! ::CORBA::is_nil (this->writer_)) + { + this->writer_ok_ = true; + } + this->writer_dds_datawriter_ = + this->context_->get_connection_info_write_dds_entity (); + if (! ::CORBA::is_nil (this->writer_dds_datawriter_)) + { + this->writer_dds_datawriter_ok_ = true; + } + } + + void + Sender_exec_i::ccm_activate (void) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (!this->writer_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : get writer failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender : Get writer passed\n"))); + } + if (!this->writer_dds_datawriter_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : get dds writer failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender : Get dds writer passed\n"))); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Event_Connection_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.h new file mode 100644 index 00000000000..6a6e8f31f46 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/Sender/Event_Connection_Test_Sender_exec.h @@ -0,0 +1,53 @@ +// -*- C++ -*- +// $Id$ + +#ifndef EVENT_CONNECTION_SENDER_EXEC_H_ +#define EVENT_CONNECTION_SENDER_EXEC_H_ + + +#include "Event_Connection_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_Event_Connection_Test_Sender_Impl +{ + //============================================================ + // 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 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: + ::Event_Connection_Test::CCM_Sender_Context_var context_; + CCM_DDS::Event_ConnectionTest::Writer_var writer_; + DDS::DataWriter_var writer_dds_datawriter_; + + bool writer_ok_; + bool writer_dds_datawriter_ok_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Event_Connection_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/descriptors/Plan.cdp new file mode 100644 index 00000000000..5d3530866a5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/descriptors/Plan.cdp @@ -0,0 +1,508 @@ +<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>Event_Connection_Test_Depl_1</label> + <UUID>Event_Connection_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_Event_Connection_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_Event_Connection_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="Event_Connection_Test_ConnectorComponentImplementation"> + <name>Event_Connection_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Event_Connection_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Event_Connection_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_Event_Connection_Test_Event_Connection_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Event_Connection_Test_Event_Connection_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Event_Connection_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Event_Connection_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_Event_Connection_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_Event_Connection_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="Event_Connection_Test_ConnectorComponentInstance"> + <name>Event_Connection_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Event_Connection_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Event_Connection_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Event_Connection_Test_ConnectorComponentInstance2"> + <name>Event_Connection_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Event_Connection_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Event_Connection_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>listen_data</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="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_rawlistener</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="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_datacontrol</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="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_dds_reader</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>getter_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>getter_fresh_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_fresh_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>getter_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>getter_dds_reader</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>status_listener</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Event_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_data</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="Event_Connection_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_dds_writer</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_write_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Event_Connection_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="Event_Connection_Test_Connector_ExecArtifact"> + <name>Event_Connection_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_ECT_Connector_exec</location> + </artifact> + <artifact xmi:id="Event_Connection_Test_Connector_SvntArtifact"> + <name>Event_Connection_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_ECT_Connector_svnt</location> + </artifact> + <artifact xmi:id="Event_Connection_Test_Connector_StubArtifact"> + <name>Event_Connection_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_ECT_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/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/descriptors/run_test.pl new file mode 100755 index 00000000000..b2a5229d554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Event_Connection_Test/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.idl new file mode 100644 index 00000000000..3a38fd77ea0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file FSS_Event_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef FIXED_SIZE_STRUCT_EVENT_BASE_IDL +#define FIXED_SIZE_STRUCT_EVENT_BASE_IDL + +#pragma ndds typesupport "Base/FSS_Event_BaseSupport.h" + +struct FixedStructSizeTest { + long one; + long two; +}; + +typedef sequence<FixedStructSizeTest> FixedStructSizeTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.mpc new file mode 100755 index 00000000000..ce3dc9811aa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Base/FSS_Event_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_FSS_Event_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_FSS_Event_Base_stub + dynamicflags += FIXED_SIZE_STRUCT_EVENT_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=FIXED_SIZE_STRUCT_EVENT_BASE_STUB_Export \ + -Wb,stub_export_include=FSS_Event_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + FSS_Event_Base.idl + } + + opendds_ts_flags += --export=FIXED_SIZE_STRUCT_EVENT_BASE_STUB_Export + + DDSGenerator_Files { + FSS_Event_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.idl new file mode 100644 index 00000000000..a6f5a4197fd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file FSS_Event_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef FIXED_SIZE_STRUCT_EVENT_CONNECTOR_IDL_ +#define FIXED_SIZE_STRUCT_EVENT_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/FSS_Event_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/FSS_Event_ConnectorE.idl" +#pragma ndds typesupport "Base/FSS_Event_BaseSupport.h" + +module FSS_Event +{ + module ::CCM_DDS::Typed < ::FixedStructSizeTest, ::FixedStructSizeTestSeq> FixedStructSizeTestConn; + connector FSS_Event_Connector : FixedStructSizeTestConn::DDS_Event + { + }; +}; + +#endif /* FSS_Event_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.mpc new file mode 100755 index 00000000000..6e4dde9f70a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/EventConnector/Connector/FSS_Event_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_FSS_Event_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=FIXED_SIZE_STRUCT_EVENT_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=FSS_Event_Connector_stub_export.h \ + -Wb,skel_export_macro=FIXED_SIZE_STRUCT_EVENT_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=FSS_Event_Connector_svnt_export.h \ + -Wb,svnt_export_macro=FIXED_SIZE_STRUCT_EVENT_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=FSS_Event_Connector_svnt_export.h \ + -Wb,conn_export_macro=FIXED_SIZE_STRUCT_EVENT_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=FSS_Event_Connector_conn_export.h \ + -I .. + + IDL_Files { + FSS_Event_Connector.idl + } +} + +project(DDS_FSS_Event_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_FSS_Event_Connector_idl_gen + idlflags += -Wb,stub_export_macro=FIXED_SIZE_STRUCT_EVENT_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=FSS_Event_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + FSS_Event_ConnectorE.idl + } +} + +project(DDS_FSS_Event_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_FSS_Event_Connector_lem_gen DDS_FSS_Event_Connector_stub DDS_FSS_Event_Base_stub DDS4CCM_lem_stub + libs += DDS_FSS_Event_Base_stub DDS_FSS_Event_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_FSS_Event_Connector_lem_stub + dynamicflags = FIXED_SIZE_STRUCT_EVENT_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_Event_ConnectorEC.cpp + } + + Header_Files { + FSS_Event_ConnectorEC.h + FSS_Event_Connector_lem_stub_export.h + } + + Inline_Files { + FSS_Event_ConnectorEC.inl + } +} + +project(DDS_FSS_Event_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_FSS_Event_Connector_idl_gen DDS_FSS_Event_Base_stub + libs += DDS_FSS_Event_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_FSS_Event_Connector_stub + dynamicflags = FIXED_SIZE_STRUCT_EVENT_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_Event_ConnectorC.cpp + } + + Header_Files { + FSS_Event_ConnectorC.h + FSS_Event_Connector_stub_export.h + } + + Inline_Files { + FSS_Event_ConnectorC.inl + } +} + +project(DDS_FSS_Event_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_FSS_Event_Connector_lem_stub DDS_FSS_Event_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_FSS_Event_Connector_exec + libs += DDS_FSS_Event_Connector_stub DDS_FSS_Event_Connector_lem_stub DDS_FSS_Event_Base_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = FIXED_SIZE_STRUCT_EVENT_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_Event_Connector_conn.cpp + } + + Header_Files { + FSS_Event_Connector_conn.h + FSS_Event_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_FSS_Event_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_FSS_Event_Connector_lem_stub DDS_FSS_Event_Connector_exec DDS_FSS_Event_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_FSS_Event_Connector_svnt + libs += DDS_FSS_Event_Connector_stub \ + DDS_FSS_Event_Connector_lem_stub \ + DDS_FSS_Event_Base_stub \ + DDS_FSS_Event_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = FIXED_SIZE_STRUCT_EVENT_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_Event_ConnectorS.cpp + FSS_Event_Connector_svnt.cpp + } + + Header_Files { + FSS_Event_ConnectorS.h + FSS_Event_Connector_svnt.h + FSS_Event_Connector_svnt_export.h + } + + Inline_Files { + FSS_Event_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.idl new file mode 100644 index 00000000000..754b6320aea --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file FSS_State_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef FIXED_SIZE_STRUCT_STATE_BASE_IDL +#define FIXED_SIZE_STRUCT_STATE_BASE_IDL + +#pragma ndds typesupport "Base/FSS_State_BaseSupport.h" + +struct FixedStructSizeTest { + long one; + long two; +}; + +typedef sequence<FixedStructSizeTest> FixedStructSizeTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.mpc new file mode 100755 index 00000000000..ee553207732 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Base/FSS_State_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_FSS_State_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_FSS_State_Base_stub + dynamicflags += FIXED_SIZE_STRUCT_STATE_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=FIXED_SIZE_STRUCT_STATE_BASE_STUB_Export \ + -Wb,stub_export_include=FSS_State_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + FSS_State_Base.idl + } + + opendds_ts_flags += --export=FIXED_SIZE_STRUCT_STATE_BASE_STUB_Export + + DDSGenerator_Files { + FSS_State_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.idl new file mode 100644 index 00000000000..c6d030b7ba4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file FSS_State_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef FIXED_SIZE_STRUCT_STATE_CONNECTOR_IDL_ +#define FIXED_SIZE_STRUCT_STATE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/FSS_State_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/FSS_State_ConnectorE.idl" +#pragma ndds typesupport "Base/FSS_State_BaseSupport.h" + +module FSS_State +{ + module ::CCM_DDS::Typed < ::FixedStructSizeTest, ::FixedStructSizeTestSeq> FixedStructSizeTestConn; + connector FSS_State_Connector : FixedStructSizeTestConn::DDS_Event + { + }; +}; + +#endif /* FSS_State_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.mpc new file mode 100755 index 00000000000..12bf238e623 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/FixedSizeStruct/StateConnector/Connector/FSS_State_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_FSS_State_Base -l .. -o ../lib -u DDS FSS_State_Connector" + +project(DDS_FSS_State_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=FIXED_SIZE_STRUCT_STATE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=FSS_State_Connector_stub_export.h \ + -Wb,skel_export_macro=FIXED_SIZE_STRUCT_STATE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=FSS_State_Connector_svnt_export.h \ + -Wb,svnt_export_macro=FIXED_SIZE_STRUCT_STATE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=FSS_State_Connector_svnt_export.h \ + -Wb,conn_export_macro=FIXED_SIZE_STRUCT_STATE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=FSS_State_Connector_conn_export.h \ + -I .. + + IDL_Files { + FSS_State_Connector.idl + } +} + +project(DDS_FSS_State_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_FSS_State_Connector_idl_gen + idlflags += -Wb,stub_export_macro=FIXED_SIZE_STRUCT_STATE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=FSS_State_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + FSS_State_ConnectorE.idl + } +} + +project(DDS_FSS_State_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_FSS_State_Connector_lem_gen DDS_FSS_State_Connector_stub DDS_FSS_State_Base_stub DDS4CCM_lem_stub + libs += DDS_FSS_State_Base_stub DDS_FSS_State_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_FSS_State_Connector_lem_stub + dynamicflags = FIXED_SIZE_STRUCT_STATE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_State_ConnectorEC.cpp + } + + Header_Files { + FSS_State_ConnectorEC.h + FSS_State_Connector_lem_stub_export.h + } + + Inline_Files { + FSS_State_ConnectorEC.inl + } +} + +project(DDS_FSS_State_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_FSS_State_Connector_idl_gen DDS_FSS_State_Base_stub + libs += DDS_FSS_State_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_FSS_State_Connector_stub + dynamicflags = FIXED_SIZE_STRUCT_STATE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_State_ConnectorC.cpp + } + + Header_Files { + FSS_State_ConnectorC.h + FSS_State_Connector_stub_export.h + } + + Inline_Files { + FSS_State_ConnectorC.inl + } +} + +project(DDS_FSS_State_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_FSS_State_Connector_lem_stub DDS_FSS_State_Connector_stub DDS4CCM_lem_stub DDS_FSS_State_Base_stub + sharedname = DDS_FSS_State_Connector_exec + libs += DDS_FSS_State_Connector_stub DDS_FSS_State_Connector_lem_stub DDS_FSS_State_Base_stub DDS4CCM_lem_stub DDS_FSS_State_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = FIXED_SIZE_STRUCT_STATE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_State_Connector_conn.cpp + } + + Header_Files { + FSS_State_Connector_conn.h + FSS_State_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_FSS_State_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_FSS_State_Connector_lem_stub DDS_FSS_State_Connector_exec DDS_FSS_State_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_FSS_State_Connector_svnt + libs += DDS_FSS_State_Connector_stub \ + DDS_FSS_State_Connector_lem_stub \ + DDS_FSS_State_Base_stub \ + DDS_FSS_State_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = FIXED_SIZE_STRUCT_STATE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + FSS_State_ConnectorS.cpp + FSS_State_Connector_svnt.cpp + } + + Header_Files { + FSS_State_ConnectorS.h + FSS_State_Connector_svnt.h + FSS_State_Connector_svnt_export.h + } + + Inline_Files { + FSS_State_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.idl b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.idl new file mode 100644 index 00000000000..5709fe39c20 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file Get_Invoker.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef GETTER_INVOKER_IDL +#define GETTER_INVOKER_IDL + +#pragma ciao lem "Base/Get_InvokerE.idl" + +interface GetInvoker +{ + void start_timeout_get_one (); + void start_timeout_get_many (); + void start_get_one (in string key, in long fixed_key, in long iteration); + void start_get_many (in short keys, in long iterations); +}; + +#endif /* SAMPLE_INFO_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.mpc b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.mpc new file mode 100755 index 00000000000..41f85b50ae1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Get_Invoker.mpc @@ -0,0 +1,115 @@ +// $Id$ + +project(DDS_Get_Invoker_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += + idlflags += -Wb,stub_export_macro=GET_INVOKER_STUB_Export \ + -Wb,stub_export_include=Get_Invoker_stub_export.h \ + -Wb,skel_export_macro=GET_INVOKER_SVNT_Export \ + -Wb,skel_export_include=Get_Invoker_svnt_export.h \ + -Wb,svnt_export_macro=GET_INVOKER_SVNT_Export \ + -Wb,svnt_export_include=Get_Invoker_svnt_export.h \ + -Wb,exec_export_macro=GET_INVOKER_EXEC_Export \ + -Wb,exec_export_include=Get_Invoker_exec_export.h -I.. + + IDL_Files { + Get_Invoker.idl + } +} + +project(DDS_Get_Invoker_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Get_Invoker_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=GET_INVOKER_LEM_STUB_Export \ + -Wb,stub_export_include=Get_Invoker_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + Get_InvokerE.idl + } +} + +project(DDS_Get_Invoker_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Get_Invoker_lem_gen DDS_Get_Invoker_stub + libs += Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Get_Invoker_lem_stub + dynamicflags = GET_INVOKER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Get_InvokerEC.cpp + } + + Header_Files { + Get_InvokerEC.h + Get_Invoker_lem_stub_export.h + } + + Inline_Files { + Get_InvokerEC.inl + } +} + +project(DDS_Get_Invoker_stub) : ccm_stub, dds4ccm_base { + after += DDS_Get_Invoker_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Get_Invoker_stub + dynamicflags = GET_INVOKER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Get_InvokerC.cpp + } + + Header_Files { + Get_InvokerC.h + Get_Invoker_stub_export.h + } + + Inline_Files { + Get_InvokerC.inl + } +} + + +project(DDS_Get_Invoker_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Get_Invoker_lem_stub DDS_Get_Invoker_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Get_Invoker_idl_gen + sharedname = Get_Invoker_svnt + libs += Get_Invoker_stub Get_Invoker_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = GET_INVOKER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Get_InvokerS.cpp + Get_Invoker_svnt.cpp + } + + Header_Files { + Get_InvokerS.h + Get_Invoker_svnt.h + Get_Invoker_svnt_export.h + } + + Inline_Files { + Get_InvokerS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.idl new file mode 100644 index 00000000000..16be11dfb20 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.idl @@ -0,0 +1,30 @@ +// $Id$ + +/** + * @file Getter_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef GETTER_TEST_BASE_IDL +#define GETTER_TEST_BASE_IDL + +#pragma ndds typesupport "Base/Getter_Test_BaseSupport.h" +#pragma opendds typesupport "Base/Getter_Test_BaseTypeSupportC.h" + +#pragma DCPS_DATA_TYPE "GetterTest" + +struct GetterTest { + string key; + long iteration; +}; +typedef sequence<GetterTest> GetterTestSeq; + +#pragma DCPS_DATA_TYPE "GetterFixed" + +struct GetterFixed { + long key; + long iteration; +}; +typedef sequence<GetterFixed> GetterFixedSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.mpc new file mode 100755 index 00000000000..fa70eb16af0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Base/Getter_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Getter_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Getter_Test_Base_stub + dynamicflags += GETTER_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=GETTER_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=Getter_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Getter_Test_Base.idl + } + + opendds_ts_flags += --export=GETTER_TEST_BASE_STUB_Export + + DDSGenerator_Files { + Getter_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.idl new file mode 100644 index 00000000000..62b25c82de0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.idl @@ -0,0 +1,30 @@ +// $Id$ + +/** + * @file Getter_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef GETTER_TEST_CONNECTOR_IDL_ +#define GETTER_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Getter_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Getter_Test_ConnectorE.idl" + +module Getter_Test +{ + module ::CCM_DDS::Typed < ::GetterTest, ::GetterTestSeq> GetterTestConn; + connector Getter_Test_Connector : GetterTestConn::DDS_Event + { + }; + + module ::CCM_DDS::Typed < ::GetterFixed, ::GetterFixedSeq> GetterFixedConn; + connector Getter_Fixed_Connector : GetterFixedConn::DDS_Event + { + }; +}; + +#endif /* GETTER_TEST_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.mpc new file mode 100755 index 00000000000..4aeb2ae819f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Connector/Getter_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Getter_Test_Base -l .. -o ../lib -u DDS Getter_Test_Connector" + +project(DDS_Getter_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=GETTER_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Getter_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=GETTER_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Getter_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=GETTER_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Getter_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=GETTER_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Getter_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + Getter_Test_Connector.idl + } +} + +project(DDS_Getter_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Getter_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=GETTER_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Getter_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Getter_Test_ConnectorE.idl + } +} + +project(DDS_Getter_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Getter_Test_Connector_lem_gen DDS_Getter_Test_Connector_stub DDS_Getter_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_Getter_Test_Base_stub DDS_Getter_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Getter_Test_Connector_lem_stub + dynamicflags = GETTER_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ConnectorEC.cpp + } + + Header_Files { + Getter_Test_ConnectorEC.h + Getter_Test_Connector_lem_stub_export.h + } + + Inline_Files { + Getter_Test_ConnectorEC.inl + } +} + +project(DDS_Getter_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_Getter_Test_Connector_idl_gen DDS_Getter_Test_Base_stub + libs += DDS_Getter_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Getter_Test_Connector_stub + dynamicflags = GETTER_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ConnectorC.cpp + } + + Header_Files { + Getter_Test_ConnectorC.h + Getter_Test_Connector_stub_export.h + } + + Inline_Files { + Getter_Test_ConnectorC.inl + } +} + +project(DDS_Getter_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_Getter_Test_Connector_lem_stub DDS_Getter_Test_Connector_stub DDS4CCM_lem_stub DDS_Getter_Test_Base_stub + sharedname = DDS_Getter_Test_Connector_exec + libs += DDS_Getter_Test_Connector_stub DDS_Getter_Test_Connector_lem_stub DDS_Getter_Test_Base_stub DDS4CCM_lem_stub DDS_Getter_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = GETTER_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_Connector_conn.cpp + } + + Header_Files { + Getter_Test_Connector_conn.h + Getter_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_Getter_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_Getter_Test_Connector_lem_stub DDS_Getter_Test_Connector_exec DDS_Getter_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Getter_Test_Connector_svnt + libs += DDS_Getter_Test_Connector_stub \ + DDS_Getter_Test_Connector_lem_stub \ + DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = GETTER_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ConnectorS.cpp + Getter_Test_Connector_svnt.cpp + } + + Header_Files { + Getter_Test_ConnectorS.h + Getter_Test_Connector_svnt.h + Getter_Test_Connector_svnt_export.h + } + + Inline_Files { + Getter_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/README b/modules/CIAO/connectors/dds4ccm/tests/Getter/README new file mode 100644 index 00000000000..00bcdbee833 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/README @@ -0,0 +1,15 @@ +# $Id$ + +This test tests the Getter. + +Before the Sender starts writing samples to DDS, he informs the +Receiver (via a 'normal' CCM interface) about how many keys and +iterations to get from DDS. The receiver starts waiting on those +samples by calling get_one or get_many, using a timeout. +In the meantime the Sender will sleep for half a second before actual +writing the samples to DDS. +Once the DDS connector on the receiver side receives the written samples, +he should wake up and should return the samples to the user code. + +To prevent deadlocks, both getting and writing takes place on the +ORB reactor thread.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.idl new file mode 100644 index 00000000000..a034cfa12cf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Getter_Test_Connector.idl" +#include "Base/Get_Invoker.idl" + +module Getter_Test +{ + component Receiver + { + port GetterTestConn::DDS_Get info_get; + port GetterFixedConn::DDS_Get info_fixed; + + provides GetInvoker getter_invoke; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.mpc new file mode 100755 index 00000000000..a6751e40f22 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(DDS_Getter_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Getter_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 { + Getter_Test_Receiver.idl + } +} + +project(DDS_Getter_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Getter_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 { + Getter_Test_ReceiverE.idl + } +} + +project(DDS_Getter_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Getter_Test_Receiver_lem_gen DDS_Getter_Test_Receiver_stub \ + DDS_Getter_Test_Connector_stub DDS_Getter_Test_Base_stub \ + DDS_Get_Invoker_stub + libs += Receiver_stub DDS_Getter_Test_Connector_stub \ + DDS_Getter_Test_Base_stub Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ReceiverEC.cpp + } + + Header_Files { + Getter_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Getter_Test_ReceiverEC.inl + } +} + +project(DDS_Getter_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_Getter_Test_Receiver_idl_gen DDS_Getter_Test_Connector_stub \ + DDS_Getter_Test_Base_stub DDS_Getter_Test_Connector_lem_gen \ + DDS_Get_Invoker_stub DDS_Get_Invoker_lem_stub + libs += DDS_Getter_Test_Connector_stub DDS_Getter_Test_Base_stub \ + Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ReceiverC.cpp + } + + Header_Files { + Getter_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Getter_Test_ReceiverC.inl + } +} + +project(DDS_Getter_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_Getter_Test_Receiver_lem_stub DDS_Getter_Test_Receiver_stub \ + DDS_Getter_Test_Base_stub DDS_Getter_Test_Connector_stub \ + DDS_Getter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_Get_Invoker_lem_stub DDS_Get_Invoker_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_stub DDS_Getter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub Get_Invoker_lem_stub Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_Receiver_exec.cpp + } + + Header_Files { + Getter_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Getter_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Getter_Test_Receiver_lem_stub DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_stub DDS_Getter_Test_Connector_svnt \ + DDS_Getter_Test_Receiver_exec DDS_Getter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Get_Invoker_stub \ + DDS_Get_Invoker_svnt DDS_Get_Invoker_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_stub DDS_Getter_Test_Connector_svnt \ + Receiver_exec DDS_Getter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel Get_Invoker_stub Get_Invoker_svnt \ + Get_Invoker_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_ReceiverS.cpp + Getter_Test_Receiver_svnt.cpp + } + + Header_Files { + Getter_Test_ReceiverS.h + Getter_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Getter_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..90aa43a5aab --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.cpp @@ -0,0 +1,549 @@ +// // -*- C++ -*- +// +// $Id$ + +#include "Getter_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/OS_NS_sys_time.h" + +namespace CIAO_Getter_Test_Receiver_Impl +{ + //============================================================ + // Invoker_exec_i + //============================================================ + Invoker_exec_i::Invoker_exec_i (Receiver_exec_i & callback) + : callback_ (callback) + { + } + + Invoker_exec_i::~Invoker_exec_i (void) + { + } + + void + Invoker_exec_i::start_timeout_get_one () + { + this->callback_.timeout_get_one (); + } + + void + Invoker_exec_i::start_timeout_get_many () + { + this->callback_.timeout_get_many (); + } + + void + Invoker_exec_i::start_get_one (const char * key, + ::CORBA::Long fixed_key, + ::CORBA::Long iteration) + { + this->callback_.start_get_one (key, fixed_key, iteration); + } + + void + Invoker_exec_i::start_get_many (::CORBA::Short keys, ::CORBA::Long iterations) + { + this->callback_.start_get_many (keys, iterations); + } + + //============================================================ + // GetOneHandler + //============================================================ + GetOneHandler::GetOneHandler (Receiver_exec_i &callback, + const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration) + : callback_ (callback), + key_ (key), + fixed_key_ (fixed_key), + iteration_ (iteration) + { + } + + GetOneHandler::~GetOneHandler () + { + } + + int + GetOneHandler::handle_exception (ACE_HANDLE) + { + this->callback_.get_one (this->key_, this->fixed_key_, this->iteration_); + return 0; + } + + //============================================================ + // GetManyHandler + //============================================================ + GetManyHandler::GetManyHandler (Receiver_exec_i &callback, + CORBA::UShort keys, + CORBA::Long iterations) + : callback_ (callback), + keys_ (keys), + iterations_ (iterations) + { + } + + GetManyHandler::~GetManyHandler () + { + } + + int + GetManyHandler::handle_exception (ACE_HANDLE) + { + this->callback_.get_many (this->keys_, this->iterations_); + return 0; + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + void + Receiver_exec_i::start_get_one (const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration) + { + GetOneHandler* rh = new GetOneHandler (*this, + CORBA::string_dup (key), + fixed_key, + iteration); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->notify (rh); + } + + void + Receiver_exec_i::start_get_many (CORBA::Short keys, + CORBA::Long iterations) + { + GetManyHandler* rh = new GetManyHandler (*this, keys, iterations); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->notify (rh); + } + + void + Receiver_exec_i::get_many (CORBA::Short keys , CORBA::Long iterations) + { + // this is very hard to test in a controlled environment. + // When data arrives in DDS, the waiting ends and the + // Getter starts to read the data. The number of samples + // read wil (almost) always be one. + // On the other hand, when the user want to have all the + // samples in DDS, one shouldn't use the wait method. + // Since the spec is not clear about this, the test will + // pass when at least one sample is returned. + // Also, max_delivered_data cannot be tested since only + // one sample is returned. + DDS::Duration_t to; + to.sec = 10; + to.nanosec = 0; + this->getter_->time_out (to); + this->getter_->max_delivered_data (40); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_many: " + "Start getting data from DDS: " + "#keys <%d> - #iterations <%d> with timeout: " + "sec <%d> - nanosec <%u>\n", + keys, iterations, + this->getter_->time_out ().sec, + this->getter_->time_out ().nanosec)); + + GetterTestSeq *gettertest_seq = 0; + ::CCM_DDS::ReadInfoSeq *readinfo = 0; + bool result = this->getter_->get_many (gettertest_seq, readinfo); + if (result) + { + if (gettertest_seq->length () == 0) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::get_many: " + "No data returned. " + "number of samples: " + "expected at least one - received <0>\n")); + } + for (CORBA::ULong i = 0; i < gettertest_seq->length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_many: " + "Returned data : key <%C> - iteration <%d>\n", + (*gettertest_seq)[i].key.in (), + (*gettertest_seq)[i].iteration)); + } + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: GET MANY: " + "Time out occurred\n")); + } + } + + void + Receiver_exec_i::get_one_fixed (CORBA::Long fixed_key, CORBA::Long iteration) + { + DDS::Duration_t to; + to.sec = 5; + to.nanosec = 0; + this->fixed_->time_out (to); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_fixed: " + "Start getting data from DDS: " + "key <%u> - iteration <%d> " + " with timeout: " + "sec <%u> - nanosec <%u>\n", + fixed_key, iteration, + this->getter_->time_out ().sec, + this->getter_->time_out ().nanosec)); + GetterFixed gettertest_info; + ::CCM_DDS::ReadInfo readinfo; + ACE_Time_Value tv = ACE_OS::gettimeofday (); + bool result = this->fixed_->get_one (gettertest_info, readinfo); + if (result) + { + ACE_Time_Value dur = ACE_OS::gettimeofday () - tv; + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_fixed: " + "get_one took <%#T>\n", + &dur)); + if (gettertest_info.key != fixed_key) + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: GET ONE: " + "Expected key does " + "not match received key: " + "expected <%u> - received <%C>\n", + fixed_key, + gettertest_info.key)); + } + if (gettertest_info.iteration != iteration) + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: GET ONE: " + "Expected iteration does " + "not match received iteration: " + "expected <%d> - received <%d>\n", + iteration, + gettertest_info.iteration)); + } + // check readinfo struct. + if (readinfo.instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR FIXED: GET MANY: ") + ACE_TEXT ("received instance handle should be invalid ") + ACE_TEXT ("for unkeyed data: ") + ACE_TEXT ("key <%u> - iteration <%u>\n"), + gettertest_info.key, + gettertest_info.iteration)); + } + if (readinfo.source_timestamp.sec == 0 && + readinfo.source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: READ ONE LAST: " + "source timestamp seems to be invalid (nil) " + "key <%u> - iteration <%d>\n", + gettertest_info.key, + gettertest_info.iteration)); + } + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_fixed: " + "Returned data : key <%u> - iteration <%d>\n", + gettertest_info.key, + gettertest_info.iteration)); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: GET ONE: " + "Time out while waiting for " + "key <%u> - iteration <%d>\n", + fixed_key, + iteration)); + } + } + + void + Receiver_exec_i::get_one_variable (const char * key, CORBA::Long iteration) + { + DDS::Duration_t to; + to.sec = 5; + to.nanosec = 0; + this->getter_->time_out (to); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_variable: " + "Start getting data from DDS: " + "key <%C> - iteration <%d> " + " with timeout: " + "sec <%d> - nanosec <%u>\n", + key, iteration, + this->getter_->time_out ().sec, + this->getter_->time_out ().nanosec)); + GetterTest *gettertest_info = new GetterTest; + ::CCM_DDS::ReadInfo readinfo; + ACE_Time_Value tv = ACE_OS::gettimeofday (); + bool result = this->getter_->get_one (gettertest_info, readinfo); + if (result) + { + ACE_Time_Value dur = ACE_OS::gettimeofday () - tv; + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_variable: " + "get_one took <%#T>\n", + &dur)); + if (ACE_OS::strcmp (gettertest_info->key, key) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: GET ONE: " + "Expected key does " + "not match received key: " + "expected <%C> - received <%C>\n", + key, + gettertest_info->key.in ())); + } + if (gettertest_info->iteration != iteration) + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: GET ONE: " + "Expected iteration does " + "not match received iteration: " + "expected <%d> - received <%d>\n", + iteration, + gettertest_info->iteration)); + } + // check readinfo struct. + if (readinfo.instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR VARIABLE: GET MANY: ") + ACE_TEXT ("received instance handle should be invalid ") + ACE_TEXT ("for unkeyed data: ") + ACE_TEXT ("key <%C> - iteration <%u>\n"), + gettertest_info->key.in (), + gettertest_info->iteration)); + } + if (readinfo.source_timestamp.sec == 0 && + readinfo.source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: READ ONE LAST: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + gettertest_info->key.in (), + gettertest_info->iteration)); + } + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::get_one_variable: " + "Returned data : key <%C> - iteration <%d>\n", + gettertest_info->key.in (), + gettertest_info->iteration)); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: GET ONE: " + "Time out while waiting for " + "key <%C> - iteration <%d>\n", + key, + iteration)); + } + } + + void + Receiver_exec_i::get_one (const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration) + { + this->get_one_variable (key, iteration); + this->get_one_fixed (fixed_key, iteration); + } + + void + Receiver_exec_i::timeout_get_one_fixed () + { + try + { + DDS::Duration_t to; + to.sec = 1; + to.nanosec = 0; + this->fixed_->time_out (to); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_one_fixed: " + "Start getting data from DDS: timeout: " + "sec <%d> - nanosec <%u>\n", + this->fixed_->time_out ().sec, + this->fixed_->time_out ().nanosec)); + GetterFixed gettertest_info; + ::CCM_DDS::ReadInfo readinfo; + bool result = this->fixed_->get_one (gettertest_info, readinfo); + if (result) + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: TIMEOUT GET ONE: " + "Returning true when get no data.\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_one_fixed: " + "Expected to return no data.\n")); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, "ERROR FIXED: TIMEOUT GET ONE: " + "Caught unexcepted InternalError " + "exception\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR FIXED: TIMEOUT GET ONE:"); + ACE_ERROR ((LM_ERROR, + "ERROR: Receiver_exec_i::timeout_get_one_fixed : Exception caught\n")); + } + } + + void + Receiver_exec_i::timeout_get_one_variable () + { + try + { + DDS::Duration_t to; + to.sec = 1; + to.nanosec = 0; + this->getter_->time_out (to); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_one_variable: " + "Start getting data from DDS: timeout: " + "sec <%d> - nanosec <%u>\n", + this->getter_->time_out ().sec, + this->getter_->time_out ().nanosec)); + GetterTest *gettertest_info = new GetterTest; + ::CCM_DDS::ReadInfo readinfo; + bool result = this->getter_->get_one (gettertest_info, readinfo); + if (result) + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: TIMEOUT GET ONE: " + "Returning true when get no data.\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_one_variable: " + "Expected to return no data.\n")); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, "ERROR VARIABLE: TIMEOUT GET ONE: " + "Caught unexcepted InternalError " + "exception\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR VARIABLE: TIMEOUT GET ONE:"); + ACE_ERROR ((LM_ERROR, + "ERROR: Receiver_exec_i::timeout_get_one_variable : Exception caught\n")); + } + } + + void + Receiver_exec_i::timeout_get_one () + { + this->timeout_get_one_variable (); + this->timeout_get_one_fixed (); + } + + void + Receiver_exec_i::timeout_get_many () + { + try + { + DDS::Duration_t to; + to.sec = 1; + to.nanosec = 0; + this->getter_->time_out (to); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_many: " + "Start getting data from DDS: timeout: " + "sec <%d> - nanosec <%u>\n", + this->getter_->time_out ().sec, + this->getter_->time_out ().nanosec)); + GetterTestSeq *gettertest_seq; + ::CCM_DDS::ReadInfoSeq *readinfo; + bool result = this->getter_->get_many (gettertest_seq, readinfo); + if (result) + { + ACE_ERROR ((LM_ERROR, "ERROR: TIMEOUT GET MANY: " + "Returning true when get no data.\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::timeout_get_many: " + "Expected to return no data.\n")); + } + } + catch (const CCM_DDS::InternalError&) + { + ACE_ERROR ((LM_ERROR, "ERROR: TIMEOUT GET MANY: " + "Caught unexcepted InternalError " + "exception\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: TIMEOUT GET MANY:"); + ACE_ERROR ((LM_ERROR, + "ERROR: Receiver_exec_i::timeout_get_many : Exception caught\n")); + } + } + + ::Getter_Test::GetterTestConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return ::Getter_Test::GetterTestConn::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_get_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_fixed_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_GetInvoker_ptr + Receiver_exec_i::get_getter_invoke () + { + return new Invoker_exec_i (*this); + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Getter_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + this->getter_ = this->context_->get_connection_info_get_fresh_data (); + this->fixed_ = this->context_->get_connection_info_fixed_fresh_data (); + } + + void + Receiver_exec_i::ccm_activate (void) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Getter_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.h new file mode 100644 index 00000000000..f23118c7b86 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Receiver/Getter_Test_Receiver_exec.h @@ -0,0 +1,153 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Getter_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" + +namespace CIAO_Getter_Test_Receiver_Impl +{ + class Receiver_exec_i; + + //============================================================ + // GetOneHandler + //============================================================ + class GetOneHandler + : public ACE_Event_Handler + { + public: + GetOneHandler (Receiver_exec_i &, + const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration); + virtual ~GetOneHandler (); + + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + + private: + Receiver_exec_i &callback_; + const char * key_; + CORBA::Long fixed_key_; + CORBA::Long iteration_; + }; + + //============================================================ + // GetManyHandler + //============================================================ + class GetManyHandler + : public ACE_Event_Handler + { + public: + GetManyHandler (Receiver_exec_i &, + CORBA::UShort keys, + CORBA::Long iterations); + virtual ~GetManyHandler (); + + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + + private: + Receiver_exec_i &callback_; + CORBA::UShort keys_; + CORBA::Long iterations_; + }; + + //============================================================ + // Invoker_exec_i + //============================================================ + class Invoker_exec_i + : public virtual ::CCM_GetInvoker, + public virtual ::CORBA::LocalObject + { + public: + Invoker_exec_i (Receiver_exec_i & callback); + virtual ~Invoker_exec_i (void); + + virtual void start_timeout_get_one (); + virtual void start_timeout_get_many (); + + virtual void start_get_one (const char * key, + ::CORBA::Long fixed_key, + ::CORBA::Long iteration); + virtual void start_get_many (::CORBA::Short keys , ::CORBA::Long iterations); + + 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); + + virtual ::Getter_Test::GetterTestConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_get_status (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_fixed_status (void); + + virtual ::CCM_GetInvoker_ptr + get_getter_invoke (); + + + void start_get_one (const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration); + void timeout_get_one (); + void timeout_get_many (); + void get_one (const char * key, + CORBA::Long fixed_key, + CORBA::Long iteration); + + void start_get_many (CORBA::Short keys, + CORBA::Long iterations); + + void get_many (CORBA::Short keys, + CORBA::Long iterations); + + 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: + ::Getter_Test::CCM_Receiver_Context_var context_; + ::Getter_Test::GetterTestConn::Getter_var getter_; + ::Getter_Test::GetterFixedConn::Getter_var fixed_; + + void timeout_get_one_fixed (); + void timeout_get_one_variable (); + + void get_one_fixed (CORBA::Long fixed_key, + CORBA::Long iteration); + void get_one_variable (const char * key, + CORBA::Long iteration); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Getter_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.idl new file mode 100644 index 00000000000..fa49687b75c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.idl @@ -0,0 +1,32 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_GETTER_TEST_SENDER_IDL +#define DDS_GETTER_TEST_SENDER_IDL + +#include "Connector/Getter_Test_Connector.idl" +#include "Base/Get_Invoker.idl" + +module Getter_Test +{ + component Sender + { + port GetterTestConn::DDS_Write info_write; + port GetterFixedConn::DDS_Write info_fixed; + + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + + uses GetInvoker invoke_getter; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.mpc new file mode 100755 index 00000000000..821ecd7deb8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender.mpc @@ -0,0 +1,152 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Getter_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_Getter_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_Getter_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 { + Getter_Test_Sender.idl + } +} + +project(DDS_Getter_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Getter_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 { + Getter_Test_SenderE.idl + } +} + +project(DDS_Getter_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Getter_Test_Sender_lem_gen DDS_Getter_Test_Sender_stub \ + DDS_Getter_Test_Base_stub DDS_Get_Invoker_stub + libs += DDS_Getter_Test_Base_stub Sender_stub Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_SenderEC.cpp + } + + Header_Files { + Getter_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Getter_Test_SenderEC.inl + } +} + +project(DDS_Getter_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_Getter_Test_Sender_idl_gen DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_stub DDS_Get_Invoker_stub \ + DDS_Get_Invoker_lem_stub + libs += DDS_Getter_Test_Base_stub DDS_Getter_Test_Connector_stub \ + Get_Invoker_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_SenderC.cpp + } + + Header_Files { + Getter_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Getter_Test_SenderC.inl + } +} + +project(DDS_Getter_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_Getter_Test_Sender_lem_stub DDS_Getter_Test_Sender_stub \ + DDS_Getter_Test_Connector_lem_stub DDS_Getter_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_Getter_Test_Base_stub \ + DDS_Getter_Test_Connector_lem_stub DDS_Getter_Test_Connector_stub \ + Get_Invoker_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_Sender_exec.cpp + } + + Header_Files { + Getter_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Getter_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Getter_Test_Base_stub DDS_Getter_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Getter_Test_Connector_stub \ + DDS_Getter_Test_Connector_svnt DDS_Getter_Test_Connector_lem_stub \ + DDS_Get_Invoker_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_Getter_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_Getter_Test_Connector_stub DDS_Getter_Test_Connector_svnt \ + DDS_Getter_Test_Connector_lem_stub Get_Invoker_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Getter_Test_SenderS.cpp + Getter_Test_Sender_svnt.cpp + } + + Header_Files { + Getter_Test_SenderS.h + Getter_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Getter_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.cpp new file mode 100644 index 00000000000..3988d462683 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.cpp @@ -0,0 +1,287 @@ +// -*- C++ -*- +// $Id$ + +#include "Getter_Test_Sender_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Getter_Test_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Sender_exec_i &callback) + : callback_ (callback) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr , + const DDS::InconsistentTopicStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr , + const DDS::RequestedIncompatibleQosStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr , + const DDS::SampleRejectedStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr , + const DDS::OfferedDeadlineMissedStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr , + const DDS::OfferedIncompatibleQosStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr , + ::DDS::StatusKind status_kind) + { + if (status_kind == ::DDS::PUBLICATION_MATCHED_STATUS) + { + this->callback_.start (); + } + } + + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (10), + keys_ (5), + done_ (false), + ccm_activated_ (false), + last_iter_ (1) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::start_timeout_tests (void) + { + this->invoker_->start_timeout_get_one (); + this->invoker_->start_timeout_get_many (); + } + + void + Sender_exec_i::write_many (void) + { + GetterTestSeq write_many; + write_many.length (this->keys_ * this->iterations_); + for (CORBA::UShort key = 1; key < this->keys_ + 1; ++key) + { + GetterTest new_key; + char tmp[7]; + ACE_OS::sprintf (tmp, "KEY_%d", key); + new_key.key = CORBA::string_dup(tmp); + for (CORBA::UShort iter = 1; iter < this->iterations_ + 1; ++iter) + { + new_key.iteration = iter; + write_many[key + iter - 2] = new_key; + } + } + try + { + this->invoker_->start_get_many (this->keys_, this->iterations_); + ACE_Time_Value tv (1, 0); + ACE_OS::sleep (tv); + this->writer_->write_many (write_many); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("write_many : written <%u> samples\n"), + write_many.length ())); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("while write many writer info: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + } + } + + + void + Sender_exec_i::start (void) + { + //start can be called more than once... + if (!this->done_ && this->ccm_activated_) + { + this->done_ = true; + start_timeout_tests (); + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, 500000), + ACE_Time_Value (0, 500000)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + } + + void + Sender_exec_i::tick (void) + { + if (this->last_iter_ <= this->iterations_) + { + GetterFixed fixed_key; + GetterTest *new_key = new GetterTest; + new_key->key = CORBA::string_dup("KEY_1"); + fixed_key.key = 1; + this->invoker_->start_get_one ( + CORBA::string_dup("KEY_1"), + 1, + last_iter_); + new_key->iteration = last_iter_; + fixed_key.iteration = last_iter_; + + ACE_Time_Value tv (0, 50000); + ACE_OS::sleep (tv); + + this->writer_->write_one (*new_key, ::DDS::HANDLE_NIL); + this->fixed_->write_one (fixed_key, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Written keys <%C> and <%u> with <%d>\n", + new_key->key.in (), fixed_key.key, last_iter_)); + + ++last_iter_; + } + else + { + write_many (); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + } + } + + ::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; + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (*this); + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Getter_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->fixed_ = this->context_->get_connection_info_fixed_data (); + this->invoker_ = this->context_->get_connection_invoke_getter (); + this->ccm_activated_ = true; + } + 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) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Getter_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.h new file mode 100644 index 00000000000..8d7cde811e6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/Sender/Getter_Test_Sender_exec.h @@ -0,0 +1,125 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Getter_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_Getter_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_callback_; + }; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Sender_exec_i &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic( ::DDS::Topic_ptr , + const DDS::InconsistentTopicStatus & ); + virtual + void on_requested_incompatible_qos( ::DDS::DataReader_ptr , + const DDS::RequestedIncompatibleQosStatus & ); + virtual + void on_sample_rejected( ::DDS::DataReader_ptr , + const DDS::SampleRejectedStatus & ); + virtual + void on_offered_deadline_missed( ::DDS::DataWriter_ptr , + const DDS::OfferedDeadlineMissedStatus & ); + virtual + void on_offered_incompatible_qos( ::DDS::DataWriter_ptr , + const DDS::OfferedIncompatibleQosStatus & ); + virtual + void on_unexpected_status( ::DDS::Entity_ptr , + ::DDS::StatusKind ); + 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 iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_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); + + void start (void); + void tick (void); + + private: + ::Getter_Test::CCM_Sender_Context_var context_; + ::Getter_Test::GetterTestConn::Writer_var writer_; + ::Getter_Test::GetterFixedConn::Writer_var fixed_; + GetInvoker_var invoker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + bool done_; + bool ccm_activated_; + CORBA::ULong last_iter_; + + void start_timeout_tests (void); + void write_many (void); + + pulse_Generator * ticker_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Getter_Test_Sender_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/Plan.cdp new file mode 100644 index 00000000000..610f946887b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/Plan.cdp @@ -0,0 +1,499 @@ +<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>Getter_Test_Depl_1</label> + <UUID>Getter_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_Getter_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_Getter_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="Getter_Fixed_ConnectorComponentImplementation"> + <name>Getter_Fixed_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Getter_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Getter_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_Getter_Test_Getter_Fixed_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Getter_Test_Getter_Fixed_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Getter_Test_ConnectorComponentImplementation"> + <name>Getter_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Getter_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Getter_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_Getter_Test_Getter_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Getter_Test_Getter_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_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_Getter_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_Getter_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="Getter_Test_ConnectorComponentInstance"> + <name>Getter_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Getter_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Getter_Test_ConnectorComponentInstance2"> + <name>Getter_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Getter_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- FIXED --> + <instance xmi:id="Getter_Fixed_ConnectorComponentInstance"> + <name>Getter_Fixed_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Getter_Fixed_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Fixed</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Getter_Fixed_ConnectorComponentInstance2"> + <name>Getter_Fixed_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Getter_Fixed_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Getter_Fixed</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_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>10</ulong> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_get_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_fresh_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Getter_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_fixed_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_fixed_fresh_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Getter_Fixed_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_out_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Getter_Test_ConnectorComponentInstance" /> + </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="Getter_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>fixed_writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_fixed_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="Getter_Fixed_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>reader_starter</name> + <internalEndpoint> + <portName>invoke_getter</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>getter_invoke</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </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="Getter_Test_Connector_ExecArtifact"> + <name>Getter_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_Getter_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="Getter_Test_Connector_SvntArtifact"> + <name>Getter_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Getter_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="Getter_Test_Connector_StubArtifact"> + <name>Getter_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_Getter_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/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/run_test.pl new file mode 100755 index 00000000000..d897a3911e9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Getter/descriptors/run_test.pl @@ -0,0 +1,250 @@ +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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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; +} + +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/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.idl new file mode 100644 index 00000000000..fe3da7521ff --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file Writer_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_BASE_IDL +#define WRITER_BASE_IDL + +#pragma ndds typesupport "Base/Writer_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "WriterTest" +#pragma DCPS_DATA_KEY "WriterTest key" + +struct WriterTest { + string key; //@key +}; + +typedef sequence<WriterTest> WriterTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.mpc new file mode 100644 index 00000000000..dc020d1f5a5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Base/Writer_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_DDSInstanceHandleBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_DDSInstanceHandleBase_stub + dynamicflags += WRITER_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=WRITER_BASE_STUB_Export \ + -Wb,stub_export_include=Writer_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Writer_Base.idl + } + + opendds_ts_flags += --export=WRITER_BASE_STUB_Export + + DDSGenerator_Files { + Writer_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.idl new file mode 100644 index 00000000000..a5894738606 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Writer_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_CONNECTOR_IDL_ +#define WRITER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Writer_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Writer_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::WriterTest, ::WriterTestSeq> WriterTest; +}; + +module Writer +{ + connector Writer_Connector : ::CCM_DDS::WriterTest::DDS_Event + { + }; +}; + +#endif /* Writer_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.mpc new file mode 100644 index 00000000000..30334e43706 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Connector/Writer_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_DDSInstanceHandleBase -l .. -o ../lib -u DDS Writer_Connector" + +project(DDS_InstanceHandleConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_stub_export.h \ + -Wb,skel_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Writer_Connector_svnt_export.h \ + -Wb,svnt_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Writer_Connector_svnt_export.h \ + -Wb,conn_export_macro=WRITER_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Writer_Connector_conn_export.h \ + -I .. + + IDL_Files { + Writer_Connector.idl + } +} + +project(DDS_InstanceHandleConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_InstanceHandleConnector_idl_gen + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Writer_ConnectorE.idl + } +} + +project(DDS_InstanceHandleConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_InstanceHandleConnector_lem_gen DDS_InstanceHandleConnector_stub DDS_DDSInstanceHandleBase_stub DDS4CCM_lem_stub + libs += DDS_DDSInstanceHandleBase_stub DDS_InstanceHandleConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_InstanceHandleConnector_lem_stub + dynamicflags = WRITER_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorEC.cpp + } + + Header_Files { + Writer_ConnectorEC.h + Writer_Connector_lem_stub_export.h + } + + Inline_Files { + Writer_ConnectorEC.inl + } +} + +project(DDS_InstanceHandleConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_InstanceHandleConnector_idl_gen DDS_DDSInstanceHandleBase_stub + libs += DDS_DDSInstanceHandleBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_InstanceHandleConnector_stub + dynamicflags = WRITER_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorC.cpp + } + + Header_Files { + Writer_ConnectorC.h + Writer_Connector_stub_export.h + } + + Inline_Files { + Writer_ConnectorC.inl + } +} + +project(DDS_InstanceHandleConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_InstanceHandleConnector_lem_stub DDS_InstanceHandleConnector_stub DDS4CCM_lem_stub DDS_DDSInstanceHandleBase_stub + sharedname = DDS_InstanceHandleConnector_exec + libs += DDS_InstanceHandleConnector_stub DDS_InstanceHandleConnector_lem_stub DDS_DDSInstanceHandleBase_stub DDS4CCM_lem_stub DDS_DDSInstanceHandleBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Connector_conn.cpp + } + + Header_Files { + Writer_Connector_conn.h + Writer_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_InstanceHandleConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_InstanceHandleConnector_lem_stub DDS_InstanceHandleConnector_exec DDS_InstanceHandleConnector_stub DDS4CCM_lem_stub + sharedname = DDS_InstanceHandleConnector_svnt + libs += DDS_InstanceHandleConnector_stub \ + DDS_InstanceHandleConnector_lem_stub \ + DDS_DDSInstanceHandleBase_stub \ + DDS_InstanceHandleConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorS.cpp + Writer_Connector_svnt.cpp + } + + Header_Files { + Writer_ConnectorS.h + Writer_Connector_svnt.h + Writer_Connector_svnt_export.h + } + + Inline_Files { + Writer_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/README b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/README new file mode 100644 index 00000000000..38242380f34 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/README @@ -0,0 +1,6 @@ +# $Id$ + +Test which shows how to use the DDSDataWriter directly. + +We use the Datawriter from the DDS4CCM library. After typecasting +it can be used to perform operations on DDS directly. diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.idl new file mode 100644 index 00000000000..c39a2e21252 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_WRITER_ENTITY_SENDER_IDL +#define DDS_WRITER_ENTITY_SENDER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Sender + { + port CCM_DDS::WriterTest::DDS_Write info_write; + attribute unsigned short keys; + }; +}; + +#endif /* DDS_WRITER_ENTITY_SENDER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.mpc new file mode 100644 index 00000000000..df9ba2d3f54 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_DDSInstanceHandleBase -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_DDSInstanceHandleSender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_InstanceHandleConnector_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 { + Writer_Sender.idl + } +} + +project(DDS_DDSInstanceHandleSender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_DDSInstanceHandleSender_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 { + Writer_SenderE.idl + } +} + +project(DDS_DDSInstanceHandleSender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_DDSInstanceHandleSender_lem_gen DDS_DDSInstanceHandleSender_stub \ + DDS_DDSInstanceHandleBase_stub + libs += DDS_DDSInstanceHandleBase_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderEC.cpp + } + + Header_Files { + Writer_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Writer_SenderEC.inl + } +} + +project(DDS_DDSInstanceHandleSender_stub) : ccm_stub, dds4ccm_base { + after += DDS_DDSInstanceHandleSender_idl_gen DDS_DDSInstanceHandleBase_stub \ + DDS_InstanceHandleConnector_stub + libs += DDS_DDSInstanceHandleBase_stub DDS_InstanceHandleConnector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderC.cpp + } + + Header_Files { + Writer_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Writer_SenderC.inl + } +} + +project(DDS_DDSInstanceHandleSender_exec) : ciao_executor, dds4ccm_base, dds4ccm_impl { + after += DDS_DDSInstanceHandleSender_lem_stub DDS_DDSInstanceHandleSender_stub \ + DDS_InstanceHandleConnector_lem_stub DDS_InstanceHandleConnector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_DDSInstanceHandleBase_stub \ + DDS_InstanceHandleConnector_lem_stub DDS_InstanceHandleConnector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Sender_exec.cpp + } + + Header_Files { + Writer_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_DDSInstanceHandleSender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_DDSInstanceHandleBase_stub DDS_DDSInstanceHandleSender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_InstanceHandleConnector_stub \ + DDS_InstanceHandleConnector_svnt DDS_InstanceHandleConnector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_DDSInstanceHandleBase_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_InstanceHandleConnector_stub DDS_InstanceHandleConnector_svnt \ + DDS_InstanceHandleConnector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderS.cpp + Writer_Sender_svnt.cpp + } + + Header_Files { + Writer_SenderS.h + Writer_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Writer_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.cpp new file mode 100644 index 00000000000..6a9ba2a69bd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.cpp @@ -0,0 +1,271 @@ +// -*- C++ -*- +// $Id$ + +#include "Writer_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#include "Base/Writer_BaseSupport.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/ndds/InstanceHandle_t.h" + +#include "ace/Log_Msg.h" + +namespace CIAO_Writer_Sender_Impl +{ + //============================================================ + // StartHandler + //============================================================ + StartHandler::StartHandler(Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + StartHandler::handle_exception (ACE_HANDLE) + { + this->callback_.run (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : keys_ (5) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::unregister_handles () + { + for (Writer_Table::iterator i = this->ktests_.begin (); + i != this->ktests_.end (); + ++i) + { + try + { + ::DDS::InstanceHandle_t hnd = this->handles_[i->first.c_str ()]; + this->ccm_writer_->unregister_instance (i->second, hnd); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Unregistered <%C> - valid handle <%d>\n"), + i->first.c_str (), + hnd.isValid)); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("unknown exception caught during unregister_instance.\n"))); + } + } + } + + void + Sender_exec_i::register_handles () + { + Writer_Table::iterator i = this->ktests_.begin (); + for (i = this->ktests_.begin(); i != this->ktests_.end(); ++i) + { + DDS::InstanceHandle_t hnd = this->ccm_writer_->register_instance (i->second); + if (!hnd.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to register handle for <%C>\n"), + i->first.c_str ())); + } + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Registering instance for <%C>\n"), + i->second->key.in ())); + this->handles_[i->first.c_str ()] = hnd; + } + } + + void + Sender_exec_i::test_equality () + { + Writer_Table::iterator i = this->ktests_.begin (); + for (i = this->ktests_.begin(); i != this->ktests_.end(); ++i) + { + ::DDS::InstanceHandle_t ccm_hnd = + this->handles_[i->first.c_str ()]; + + DDS_InstanceHandle_t dds_hnd = + this->dds_writer_->lookup_instance (i->second); + if (dds_hnd == ccm_hnd) + { + ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::test_equality - " + "== operator seems to work for DDS and " + "CCM handles for key <%C>\n", + i->first.c_str ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Sender_exec_i::test_equality - " + "== operator doesn't seem to work for DDS and " + "CCM handles for key <%C>\n", + i->first.c_str ())); + } + DDS::InstanceHandle_t ccm_dds_hnd; + ccm_dds_hnd <<= dds_hnd; + if (ccm_hnd == ccm_dds_hnd) + { + ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::test_equality - " + "== operator seems to work for CCM handles " + "for key <%C>\n", + i->first.c_str ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Sender_exec_i::test_equality - " + "== operator doesn't seem to work for CCM " + "handles for key <%C>\n", + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::test_non_equality () + { + Writer_Table::iterator i = this->ktests_.begin (); + for (i = this->ktests_.begin(); i != this->ktests_.end(); ++i) + { + ::DDS::InstanceHandle_t ccm_hnd = + this->handles_[i->first.c_str ()]; + + Writer_Table::iterator unequal = i; + ++unequal; + if (unequal == this->ktests_.end ()) + unequal = this->ktests_.begin (); + + DDS_InstanceHandle_t dds_hnd = + this->dds_writer_->lookup_instance (unequal->second); + //compare + if (dds_hnd != ccm_hnd) + { + ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::test_equality - " + "!= operator seems to work for DDS and " + "CCM handles for key <%C>\n", + i->first.c_str ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Sender_exec_i::test_equality - " + "!= operator doesn't seem to work for DDS and " + "CCM handles for key <%C>\n", + i->first.c_str ())); + } + DDS::InstanceHandle_t ccm_dds_hnd; + ccm_dds_hnd <<= dds_hnd; + if (ccm_dds_hnd != ccm_hnd) + { + ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::test_equality - " + "!= operator seems to work for CCM " + "handles for key <%C>\n", + i->first.c_str ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Sender_exec_i::test_equality - " + "!= operator doesn't seem to work for CCM " + "handles for key <%C>\n", + i->first.c_str ())); + } + } + unregister_handles (); + } + + void + Sender_exec_i::run () + { + test_equality (); + test_non_equality (); + } + + 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::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_ = + ::Writer::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + DDS::DataWriter_var dds_dw = + this->context_->get_connection_info_write_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dds_dw.in ()); + DDSDataWriter * p = ccm_dds_rd->get_impl (); + this->dds_writer_ = dynamic_cast <WriterTestDataWriter *> (p); + this->ccm_writer_ = this->context_->get_connection_info_write_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->start (); + + 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]; + WriterTest *new_key = new WriterTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + + this->ktests_[key] = new_key; + } + register_handles (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.h new file mode 100644 index 00000000000..b56d98c153b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/Sender/Writer_Sender_exec.h @@ -0,0 +1,93 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Writer_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 "dds4ccm/impl/dds/DataWriter.h" + +#include <map> + +class WriterTestDataWriter; + +namespace CIAO_Writer_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_; + }; + + //============================================================ + // 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 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 run (); + + private: + void start (void); + + WriterTestDataWriter * dds_writer_; + CCM_DDS::WriterTest::Writer_var ccm_writer_; + + ::Writer::CCM_Sender_Context_var context_; + CORBA::UShort keys_; + + void register_handles (); + void unregister_handles (); + void test_equality (); + void test_non_equality (); + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, WriterTest_var> Writer_Table; + Writer_Table ktests_; + + typedef std::map<ACE_CString, ::DDS::InstanceHandle_t> CCM_Handles; + CCM_Handles handles_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/Plan.cdp new file mode 100644 index 00000000000..10ad51c564a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/Plan.cdp @@ -0,0 +1,224 @@ +<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>DDSWriterEntity_Depl_1</label> + <UUID>DDSWriterEntity_Depl_1</UUID> + + <implementation xmi:id="Writer_ConnectorComponentImplementation"> + <name>Writer_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Writer_Connector_ExecArtifact" /> + <artifact xmi:idref="Writer_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_Writer_Writer_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_Writer_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_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_Writer_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentInstance"> + <name>Writer_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDSWriterEntity</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> + </instance> + + <connection> + <name>dds_writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_write_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Writer_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>ccm_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="Writer_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="Writer_Connector_ExecArtifact"> + <name>Writer_Connector_exec</name> + <source/> + <node/> + <location>DDS_InstanceHandleConnector_exec</location> + </artifact> + <artifact xmi:id="Writer_Connector_SvntArtifact"> + <name>Writer_Connector_svnt</name> + <source/> + <node/> + <location>DDS_InstanceHandleConnector_svnt</location> + </artifact> + <artifact xmi:id="Writer_Connector_StubArtifact"> + <name>Writer_Connector_stub</name> + <source/> + <node/> + <location>DDS_InstanceHandleConnector_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/run_test.pl new file mode 100755 index 00000000000..e39d6647174 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/InstanceHandle/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 5 seconds to allow task to complete\n"; +sleep (5); + +# 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/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.idl new file mode 100644 index 00000000000..19d714f4c12 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Keyed_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef KEYED_TEST_BASE_IDL +#define KEYED_TEST_BASE_IDL + +#pragma ndds typesupport "Base/Keyed_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "KeyedTest" +#pragma DCPS_DATA_KEY "KeyedTest key" + +struct KeyedTest { + string key; //@key + long iteration; +}; + +typedef sequence<KeyedTest> KeyedTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.mpc new file mode 100644 index 00000000000..d1c5b16759b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Base/Keyed_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Keyed_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Keyed_Test_Base_stub + dynamicflags += KEYED_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=KEYED_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=Keyed_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Keyed_Test_Base.idl + } + + opendds_ts_flags += --export=KEYED_TEST_BASE_STUB_Export + + DDSGenerator_Files { + Keyed_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.idl new file mode 100644 index 00000000000..844d3ac7e53 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Keyed_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef KEYED_TEST_CONNECTOR_IDL_ +#define KEYED_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Keyed_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Keyed_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::KeyedTest, ::KeyedTestSeq> KeyedTest; +}; + +module Keyed_Test +{ + connector Keyed_Test_Connector : ::CCM_DDS::KeyedTest::DDS_Event + { + }; +}; + +#endif /* Keyed_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.mpc new file mode 100644 index 00000000000..e6b7ac4140b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Connector/Keyed_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Keyed_Test_Base -l .. -o ../lib -u DDS Keyed_Test_Connector" + +project(DDS_Keyed_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=KEYED_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Keyed_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=KEYED_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Keyed_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=KEYED_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Keyed_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=KEYED_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Keyed_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + Keyed_Test_Connector.idl + } +} + +project(DDS_Keyed_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Keyed_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=KEYED_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Keyed_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Keyed_Test_ConnectorE.idl + } +} + +project(DDS_Keyed_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Keyed_Test_Connector_lem_gen DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Keyed_Test_Connector_lem_stub + dynamicflags = KEYED_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ConnectorEC.cpp + } + + Header_Files { + Keyed_Test_ConnectorEC.h + Keyed_Test_Connector_lem_stub_export.h + } + + Inline_Files { + Keyed_Test_ConnectorEC.inl + } +} + +project(DDS_Keyed_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_Keyed_Test_Connector_idl_gen DDS_Keyed_Test_Base_stub + libs += DDS_Keyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Keyed_Test_Connector_stub + dynamicflags = KEYED_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ConnectorC.cpp + } + + Header_Files { + Keyed_Test_ConnectorC.h + Keyed_Test_Connector_stub_export.h + } + + Inline_Files { + Keyed_Test_ConnectorC.inl + } +} + +project(DDS_Keyed_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_Keyed_Test_Connector_lem_stub DDS_Keyed_Test_Connector_stub DDS4CCM_lem_stub DDS_Keyed_Test_Base_stub + sharedname = DDS_Keyed_Test_Connector_exec + libs += DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_lem_stub DDS_Keyed_Test_Base_stub DDS4CCM_lem_stub DDS_Keyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = KEYED_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_Connector_conn.cpp + } + + Header_Files { + Keyed_Test_Connector_conn.h + Keyed_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_Keyed_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_Keyed_Test_Connector_lem_stub DDS_Keyed_Test_Connector_exec DDS_Keyed_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Keyed_Test_Connector_svnt + libs += DDS_Keyed_Test_Connector_stub \ + DDS_Keyed_Test_Connector_lem_stub \ + DDS_Keyed_Test_Base_stub \ + DDS_Keyed_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = KEYED_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ConnectorS.cpp + Keyed_Test_Connector_svnt.cpp + } + + Header_Files { + Keyed_Test_ConnectorS.h + Keyed_Test_Connector_svnt.h + Keyed_Test_Connector_svnt_export.h + } + + Inline_Files { + Keyed_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/README b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/README new file mode 100644 index 00000000000..8bc6dae4a7e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/README @@ -0,0 +1,16 @@ +# $Id$ + +This test creates instances in DDS by using the +updater port. After that, every instance is updated. +The number of instances (keys) and the number of +updates (iterations) per key can be defined in +the deployment plan. + +The Receiver checks whether the keys were updated +correctly by using the read_one method on the reader. +The Receiver should know the number of instances (keys) and +the number of iterations per key. These should be configured +in the deployment plan. + +An error is reported when the receiver did not receive +the correct number of samples.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.idl new file mode 100644 index 00000000000..faf8ee41bfb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Keyed_Test_Connector.idl" + +module Keyed_Test +{ + component Receiver + { + port CCM_DDS::KeyedTest::DDS_Listen info_out; + attribute unsigned long rate; + attribute unsigned short iterations; + attribute unsigned short keys; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.mpc new file mode 100644 index 00000000000..39b660fe6db --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_Keyed_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Keyed_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 { + Keyed_Test_Receiver.idl + } +} + +project(DDS_Keyed_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Keyed_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 { + Keyed_Test_ReceiverE.idl + } +} + +project(DDS_Keyed_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Keyed_Test_Receiver_lem_gen DDS_Keyed_Test_Receiver_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Base_stub + libs += Receiver_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ReceiverEC.cpp + } + + Header_Files { + Keyed_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Keyed_Test_ReceiverEC.inl + } +} + +project(DDS_Keyed_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_Keyed_Test_Receiver_idl_gen DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_lem_gen + libs += DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ReceiverC.cpp + } + + Header_Files { + Keyed_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Keyed_Test_ReceiverC.inl + } +} + +project(DDS_Keyed_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_Keyed_Test_Receiver_lem_stub DDS_Keyed_Test_Receiver_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_Receiver_exec.cpp + } + + Header_Files { + Keyed_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Keyed_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Keyed_Test_Receiver_lem_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_svnt DDS_Keyed_Test_Receiver_exec DDS_Keyed_Test_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_svnt Receiver_exec DDS_Keyed_Test_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_ReceiverS.cpp + Keyed_Test_Receiver_svnt.cpp + } + + Header_Files { + Keyed_Test_ReceiverS.h + Keyed_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Keyed_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..6a23fe57d69 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.cpp @@ -0,0 +1,233 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Keyed_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +namespace CIAO_Keyed_Test_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + this->pulse_callback_.read (); + return 0; + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (1), + iterations_ (10), + keys_ (5), + expected_ (50) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + void + Receiver_exec_i::check_received_samples () + { + bool all_received = true; + for (Last_Iteration_Table::iterator iter = this->last_iters_.begin (); + iter != this->last_iters_.end () && all_received; + ++iter) + { + all_received = iter->second == this->iterations_; + } + if (all_received) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("All samples received. Stop the timer\n"))); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + } + } + + void + Receiver_exec_i::read (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + try + { + for (CORBA::UShort i = 1; i < this->keys_ + 1; ++i) + { + KeyedTest keyedtest_info; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", i); + keyedtest_info.key = CORBA::string_dup (key); + ::CCM_DDS::ReadInfo readinfo; + this->reader_->read_one_last (keyedtest_info, readinfo, ::DDS::HANDLE_NIL); + + ACE_Time_Value tv; + tv <<= readinfo.source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ONE Read_Info ") + ACE_TEXT (" -> date =%#T\n"), + &tv)); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ONE keyed test info : ") + ACE_TEXT ("received keyedtest_info for <%C> at %u\n"), + keyedtest_info.key.in (), + keyedtest_info.iteration)); + this->last_iters_[key] = keyedtest_info.iteration; + check_received_samples (); + } + } + catch(const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: KeyedTest_Read: ") + ACE_TEXT ("Unexpected NonExistent exception received\n"))); + } + catch(const CCM_DDS::NonExistent& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("KeyedTest_Read: ") + ACE_TEXT ("Expected NonExistent received\n"))); + } + } + + ::CORBA::ULong + Receiver_exec_i::rate (void) + { + return this->rate_; + } + + void + Receiver_exec_i::rate ( + ::CORBA::ULong rate) + { + this->rate_ = rate; + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + this->expected_ = this->iterations_ * this->keys_; + } + + ::CORBA::UShort + Receiver_exec_i::keys (void) + { + return this->keys_; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + this->expected_ = this->iterations_ * this->keys_; + } + + ::CCM_DDS::KeyedTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return 0; + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Keyed_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_out_data(); + } + + void + Receiver_exec_i::ccm_activate (void) + { + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(0, usec), + ACE_Time_Value(0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + CORBA::UShort received_ = 0; + for (Last_Iteration_Table::iterator iter = this->last_iters_.begin (); + iter != this->last_iters_.end (); + ++iter) + { + ACE_DEBUG ((LM_INFO, "Receiver_exec_i summary for <%C>: last sample <%u> - expected <%u>\n", + iter->first.c_str(), + iter->second, + this->iterations_)); + received_ += iter->second; + } + + if (received_ < this->expected_) + { + ACE_ERROR ((LM_ERROR, "ERROR : Expected to receive %u samples, actually got %u\n", + this->expected_, received_)); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Keyed_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.h new file mode 100644 index 00000000000..250f25cc256 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Receiver/Keyed_Test_Receiver_exec.h @@ -0,0 +1,104 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Keyed_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/Reactor.h" + +#include <map> + +namespace CIAO_Keyed_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); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Receiver_exec_i &pulse_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); + + void read (void); + + virtual ::CORBA::ULong rate (void); + + virtual void rate (::CORBA::ULong rate); + + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + virtual ::CORBA::UShort keys (void); + + virtual void keys (::CORBA::UShort keys); + + virtual ::CCM_DDS::KeyedTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_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: + ::Keyed_Test::CCM_Receiver_Context_var context_; + ::CCM_DDS::KeyedTest::Reader_var reader_; + + read_action_Generator * ticker_; + CORBA::ULong rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + CORBA::ULong expected_; + + typedef std::map<ACE_CString, CORBA::UShort> Last_Iteration_Table; + Last_Iteration_Table last_iters_; + + void + check_received_samples (); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Keyed_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.idl new file mode 100644 index 00000000000..4fab21b4c1c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_KEYED_TEST_SENDER_IDL +#define DDS_KEYED_TEST_SENDER_IDL + +#include "Connector/Keyed_Test_Connector.idl" + +module Keyed_Test +{ + component Sender + { + port CCM_DDS::KeyedTest::DDS_Write info_write; + attribute unsigned long rate; + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.mpc new file mode 100644 index 00000000000..ba7ec3f4b2a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Keyed_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_Keyed_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_Keyed_Test_Connector_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 { + Keyed_Test_Sender.idl + } +} + +project(DDS_Keyed_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Keyed_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 { + Keyed_Test_SenderE.idl + } +} + +project(DDS_Keyed_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Keyed_Test_Sender_lem_gen DDS_Keyed_Test_Sender_stub DDS_Keyed_Test_Base_stub + libs += DDS_Keyed_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_SenderEC.cpp + } + + Header_Files { + Keyed_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Keyed_Test_SenderEC.inl + } +} + +project(DDS_Keyed_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_Keyed_Test_Sender_idl_gen DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub + libs += DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_SenderC.cpp + } + + Header_Files { + Keyed_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Keyed_Test_SenderC.inl + } +} + +project(DDS_Keyed_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_Keyed_Test_Sender_lem_stub DDS_Keyed_Test_Sender_stub DDS_Keyed_Test_Connector_lem_stub DDS_Keyed_Test_Connector_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Connector_lem_stub DDS_Keyed_Test_Connector_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_Sender_exec.cpp + } + + Header_Files { + Keyed_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Keyed_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Keyed_Test_Base_stub DDS_Keyed_Test_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_svnt DDS_Keyed_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_Keyed_Test_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Keyed_Test_Connector_stub DDS_Keyed_Test_Connector_svnt DDS_Keyed_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Keyed_Test_SenderS.cpp + Keyed_Test_Sender_svnt.cpp + } + + Header_Files { + Keyed_Test_SenderS.h + Keyed_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Keyed_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.cpp new file mode 100644 index 00000000000..ab690178770 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.cpp @@ -0,0 +1,202 @@ +// -*- C++ -*- +// $Id$ + +#include "Keyed_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Keyed_Test_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : rate_ (1), + iterations_ (10), + keys_ (5) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::tick () + { + if (this->last_key != this->ktests_.end ()) + { + try + { + ++this->last_key->second->iteration; + this->writer_->write_one (this->last_key->second, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written key <%C> with <%d>\n"), + this->last_key->first.c_str (), + this->last_key->second->iteration)); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, "ERROR: Internal Error while writing KeyedTest info for <%C>.\n", + this->last_key->first.c_str ())); + } + ++this->last_key; + } + else + { + //onto the next iteration + this->last_key = this->ktests_.begin (); + while (this->last_key != this->ktests_.end ()) + { + if (this->last_key->second->iteration == this->iterations_) + { + ++this->last_key; + } + else + { + break; + } + } + } + } + + void + Sender_exec_i::start (void) + { + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + ::CORBA::ULong + Sender_exec_i::rate (void) + { + return this->rate_; + } + + void + Sender_exec_i::rate (::CORBA::ULong rate) + { + this->rate_ = rate; + } + + ::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_ = + ::Keyed_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_info_write_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->start (); + + 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]; + KeyedTest *new_key = new KeyedTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 0; + + this->ktests_[key] = new_key; + } + this->last_key = this->ktests_.begin (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Keyed_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.h new file mode 100644 index 00000000000..4c519576bd7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/Sender/Keyed_Test_Sender_exec.h @@ -0,0 +1,93 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Keyed_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_Keyed_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_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::ULong rate (void); + + virtual void rate (::CORBA::ULong rate); + + 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 tick (); + + private: + void start (void); + void stop (void); + + CCM_DDS::KeyedTest::Writer_var writer_; + + pulse_Generator * ticker_; + ::Keyed_Test::CCM_Sender_Context_var context_; + CORBA::ULong rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, KeyedTest_var> Keyed_Test_Table; + Keyed_Test_Table ktests_; + Keyed_Test_Table::iterator last_key; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Keyed_Test_Sender_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/descriptors/Plan.cdp new file mode 100644 index 00000000000..1b0f0ce9d95 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/descriptors/Plan.cdp @@ -0,0 +1,431 @@ +<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>Keyed_Test_Depl_1</label> + <UUID>Keyed_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_Keyed_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_Keyed_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="Keyed_Test_ConnectorComponentImplementation"> + <name>Keyed_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Keyed_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Keyed_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_Keyed_Test_Keyed_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Keyed_Test_Keyed_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Keyed_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Keyed_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_Keyed_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_Keyed_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>rate</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>10</long> + </value> + </value> + </configProperty> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>9</ulong> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Keyed_Test_ConnectorComponentInstance"> + <name>Keyed_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Keyed_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Keyed_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Keyed_Test_ConnectorComponentInstance2"> + <name>Keyed_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Keyed_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Keyed_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>rate</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1</long> + </value> + </value> + </configProperty> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>9</ulong> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Keyed_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Keyed_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_rawlistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Keyed_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Keyed_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="Keyed_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="Keyed_Test_Connector_ExecArtifact"> + <name>Keyed_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_Keyed_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="Keyed_Test_Connector_SvntArtifact"> + <name>Keyed_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Keyed_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="Keyed_Test_Connector_StubArtifact"> + <name>Keyed_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_Keyed_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/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/descriptors/run_test.pl new file mode 100755 index 00000000000..3ca8a0ee149 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedSamples/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (60); + +# 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/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.idl new file mode 100644 index 00000000000..882902a3e65 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Writer_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_BASE_IDL +#define WRITER_BASE_IDL + +#pragma ndds typesupport "Base/Writer_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "WriterTest" +#pragma DCPS_DATA_KEY "WriterTest key" + +struct WriterTest { + string key; //@key + long iteration; +}; + +typedef sequence<WriterTest> WriterTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.mpc new file mode 100644 index 00000000000..9c3fcac7283 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Base/Writer_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_KeyedWriterBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_KeyedWriterBase_stub + dynamicflags += WRITER_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=WRITER_BASE_STUB_Export \ + -Wb,stub_export_include=Writer_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Writer_Base.idl + } + + opendds_ts_flags += --export=WRITER_BASE_STUB_Export + + DDSGenerator_Files { + Writer_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.idl new file mode 100644 index 00000000000..a5894738606 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Writer_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_CONNECTOR_IDL_ +#define WRITER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Writer_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Writer_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::WriterTest, ::WriterTestSeq> WriterTest; +}; + +module Writer +{ + connector Writer_Connector : ::CCM_DDS::WriterTest::DDS_Event + { + }; +}; + +#endif /* Writer_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.mpc new file mode 100644 index 00000000000..69710098f04 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Connector/Writer_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_KeyedWriterBase -l .. -o ../lib -u DDS Writer_Connector" + +project(DDS_KeyedWriterConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_stub_export.h \ + -Wb,skel_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Writer_Connector_svnt_export.h \ + -Wb,svnt_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Writer_Connector_svnt_export.h \ + -Wb,conn_export_macro=WRITER_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Writer_Connector_conn_export.h \ + -I .. + + IDL_Files { + Writer_Connector.idl + } +} + +project(DDS_KeyedWriterConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_KeyedWriterConnector_idl_gen + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Writer_ConnectorE.idl + } +} + +project(DDS_KeyedWriterConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_KeyedWriterConnector_lem_gen DDS_KeyedWriterConnector_stub DDS_KeyedWriterBase_stub DDS4CCM_lem_stub + libs += DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_KeyedWriterConnector_lem_stub + dynamicflags = WRITER_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorEC.cpp + } + + Header_Files { + Writer_ConnectorEC.h + Writer_Connector_lem_stub_export.h + } + + Inline_Files { + Writer_ConnectorEC.inl + } +} + +project(DDS_KeyedWriterConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_KeyedWriterConnector_idl_gen DDS_KeyedWriterBase_stub + libs += DDS_KeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_KeyedWriterConnector_stub + dynamicflags = WRITER_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorC.cpp + } + + Header_Files { + Writer_ConnectorC.h + Writer_Connector_stub_export.h + } + + Inline_Files { + Writer_ConnectorC.inl + } +} + +project(DDS_KeyedWriterConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_KeyedWriterConnector_lem_stub DDS_KeyedWriterConnector_stub DDS4CCM_lem_stub DDS_KeyedWriterBase_stub + sharedname = DDS_KeyedWriterConnector_exec + libs += DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_lem_stub DDS_KeyedWriterBase_stub DDS4CCM_lem_stub DDS_KeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Connector_conn.cpp + } + + Header_Files { + Writer_Connector_conn.h + Writer_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_KeyedWriterConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_KeyedWriterConnector_lem_stub DDS_KeyedWriterConnector_exec DDS_KeyedWriterConnector_stub DDS4CCM_lem_stub + sharedname = DDS_KeyedWriterConnector_svnt + libs += DDS_KeyedWriterConnector_stub \ + DDS_KeyedWriterConnector_lem_stub \ + DDS_KeyedWriterBase_stub \ + DDS_KeyedWriterConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorS.cpp + Writer_Connector_svnt.cpp + } + + Header_Files { + Writer_ConnectorS.h + Writer_Connector_svnt.h + Writer_Connector_svnt_export.h + } + + Inline_Files { + Writer_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/README b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/README new file mode 100644 index 00000000000..2e2e55625dd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/README @@ -0,0 +1,12 @@ +# $Id$ + +KeyedWriter tests the DDS_Writer. It tests write_one +and write_many, in combination with register_instance. + +In descriptors/USER_QOS_PROFILE.xml, max_instances is +set to one. An exception should be thrown when the second +instance is registered. Every subsequent write of +unregistered keys, should result in an error. + +When invoking write_many, writing the first sample should succeed. +Writing every subsequent sample should fail. diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.idl new file mode 100644 index 00000000000..959d6ded63e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Receiver + { + port CCM_DDS::WriterTest::DDS_Listen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.mpc new file mode 100644 index 00000000000..e26c2300be0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_KeyedWriterReceiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_KeyedWriterConnector_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 { + Writer_Receiver.idl + } +} + +project(DDS_KeyedWriterReceiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_KeyedWriterReceiver_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 { + Writer_ReceiverE.idl + } +} + +project(DDS_KeyedWriterReceiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_KeyedWriterReceiver_lem_gen DDS_KeyedWriterReceiver_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterBase_stub + libs += Receiver_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverEC.cpp + } + + Header_Files { + Writer_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Writer_ReceiverEC.inl + } +} + +project(DDS_KeyedWriterReceiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_KeyedWriterReceiver_idl_gen DDS_KeyedWriterConnector_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_lem_gen + libs += DDS_KeyedWriterConnector_stub DDS_KeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverC.cpp + } + + Header_Files { + Writer_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Writer_ReceiverC.inl + } +} + +project(DDS_KeyedWriterReceiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_KeyedWriterReceiver_lem_stub DDS_KeyedWriterReceiver_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Receiver_exec.cpp + } + + Header_Files { + Writer_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_KeyedWriterReceiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_KeyedWriterReceiver_lem_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_svnt DDS_KeyedWriterReceiver_exec DDS_KeyedWriterConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_svnt Receiver_exec DDS_KeyedWriterConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverS.cpp + Writer_Receiver_svnt.cpp + } + + Header_Files { + Writer_ReceiverS.h + Writer_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Writer_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.cpp new file mode 100644 index 00000000000..cae3ee568e3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.cpp @@ -0,0 +1,125 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Writer_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" + +namespace CIAO_Writer_Receiver_Impl +{ + //============================================================ + // WriterTest_Listener_exec_i + //============================================================ + WriterTest_Listener_exec_i::WriterTest_Listener_exec_i () + { + } + + WriterTest_Listener_exec_i::~WriterTest_Listener_exec_i (void) + { + } + + void + WriterTest_Listener_exec_i::on_one_data ( + const WriterTest & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("WriterTest_Listener: ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.iteration)); + } + + void + WriterTest_Listener_exec_i::on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + for (unsigned int i = 0; i < an_instance.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("WriterTest_Listener: ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance[i].key.in (), + an_instance[i].iteration)); + } + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CCM_DDS::WriterTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new WriterTest RAW listener\n"))); + return new WriterTest_Listener_exec_i (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Writer::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) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::ONE_BY_ONE); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.h new file mode 100644 index 00000000000..a6dd0077a1c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Receiver/Writer_Receiver_exec.h @@ -0,0 +1,75 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Writer_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_Writer_Receiver_Impl +{ + //============================================================ + // WriterTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export WriterTest_Listener_exec_i + : public virtual ::CCM_DDS::WriterTest::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + WriterTest_Listener_exec_i (); + virtual ~WriterTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const WriterTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + }; + + //============================================================ + // 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); + + virtual ::CCM_DDS::WriterTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_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: + ::Writer::CCM_Receiver_Context_var context_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.idl new file mode 100644 index 00000000000..eebc31419e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_KEYED_TEST_SENDER_IDL +#define DDS_KEYED_TEST_SENDER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Sender + { + port CCM_DDS::WriterTest::DDS_Write info_write; + attribute unsigned short rate; + attribute unsigned short iterations; + attribute unsigned short keys; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.mpc new file mode 100644 index 00000000000..66be0dfb9a9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_KeyedWriterBase -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_KeyedWriterSender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_KeyedWriterConnector_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 { + Writer_Sender.idl + } +} + +project(DDS_KeyedWriterSender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_KeyedWriterSender_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 { + Writer_SenderE.idl + } +} + +project(DDS_KeyedWriterSender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_KeyedWriterSender_lem_gen DDS_KeyedWriterSender_stub DDS_KeyedWriterBase_stub + libs += DDS_KeyedWriterBase_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderEC.cpp + } + + Header_Files { + Writer_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Writer_SenderEC.inl + } +} + +project(DDS_KeyedWriterSender_stub) : ccm_stub, dds4ccm_base { + after += DDS_KeyedWriterSender_idl_gen DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub + libs += DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderC.cpp + } + + Header_Files { + Writer_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Writer_SenderC.inl + } +} + +project(DDS_KeyedWriterSender_exec) : ciao_executor, dds4ccm_base { + after += DDS_KeyedWriterSender_lem_stub DDS_KeyedWriterSender_stub DDS_KeyedWriterConnector_lem_stub DDS_KeyedWriterConnector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_KeyedWriterBase_stub DDS_KeyedWriterConnector_lem_stub DDS_KeyedWriterConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Sender_exec.cpp + } + + Header_Files { + Writer_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_KeyedWriterSender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_KeyedWriterBase_stub DDS_KeyedWriterSender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_svnt DDS_KeyedWriterConnector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_KeyedWriterBase_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_KeyedWriterConnector_stub DDS_KeyedWriterConnector_svnt DDS_KeyedWriterConnector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderS.cpp + Writer_Sender_svnt.cpp + } + + Header_Files { + Writer_SenderS.h + Writer_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Writer_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.cpp new file mode 100644 index 00000000000..091f299e2af --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.cpp @@ -0,0 +1,368 @@ +// -*- C++ -*- +// $Id$ + +#include "Writer_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Writer_Sender_Impl +{ + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : rate_ (1), + iterations_ (10), + keys_ (5), + assignment_ (WRITE_KEYED), + last_iteration_ (0) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::reset_iterations () + { + for (Writer_Table::iterator i = this->ktests_.begin (); + i != this->ktests_.end (); + ++i) + { + i->second->iteration = 0; + } + } + + void + Sender_exec_i::unregister_handles () + { + for (Writer_Table::iterator i = this->ktests_.begin (); + i != this->ktests_.end (); + ++i) + { + try + { + ::DDS::InstanceHandle_t hnd = this->handles_[i->first.c_str ()]; + this->writer_->unregister_instance (i->second, hnd); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Unregistered <%C> - iteration <%d> - valid handle <%d>\n"), + i->first.c_str (), + i->second->iteration, + hnd.isValid)); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("unknown exception caught during unregister_instance.\n"))); + } + } + } + + void + Sender_exec_i::register_handles() + { + Writer_Table::iterator i = this->ktests_.begin (); + ::DDS::InstanceHandle_t hnd = this->writer_->register_instance (i->second); + if (!hnd.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to register handle for <%C> - iteration <%d>\n"), + i->first.c_str (), i->second->iteration)); + } + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Registering instance with <%C> - iteration <%d> - valid handle <%d>\n"), + i->second->key.in (), + i->second->iteration, + hnd.isValid)); + this->handles_[i->first.c_str ()] = hnd; + ++i; + //test exception. In Qos, max_instances is set to 1 + //so only one instance may be registered. + hnd = this->writer_->register_instance (i->second); + if (hnd.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Shouldn't be able to register instance for <%C> - iteration <%d>\n"), + i->first.c_str (), i->second->iteration)); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Registering second key not succeeded.\n"), + i->first.c_str (), i->second->iteration)); + } + } + + void + Sender_exec_i::start_new_assignment (WRITER_ASSIGNMENT assignment) + { + this->last_key_ = this->ktests_.begin (); + this->assignment_ = assignment; + reset_iterations (); + } + + void + Sender_exec_i::write_keyed () + { + if (this->last_key_ != this->ktests_.end ()) + { + bool exception_caught = false; + try + { + ++this->last_key_->second->iteration; + ::DDS::InstanceHandle_t hnd = this->handles_[this->last_key_->first.c_str ()]; + this->writer_->write_one (this->last_key_->second, hnd); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written keyed <%C> - iteration <%d> - valid handle <%d>\n"), + this->last_key_->first.c_str (), + this->last_key_->second->iteration, + hnd.isValid)); + } + catch (const CCM_DDS::InternalError& ) + { + exception_caught = true; + if (this->last_key_ == this->ktests_.begin ()) + { // the first key should throw this exception; all others + // shouldn't + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("while updating writer info for <%C>.\n"), + this->last_key_->first.c_str ())); + } + } + //only the first iterations are registered. + if (this->last_key_ != this->ktests_.begin () && !exception_caught) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: No exception caught ") + ACE_TEXT ("while writing unregistered data\n"))); + } + ++this->last_key_; + } + else + { + //onto the next iteration + this->last_key_ = this->ktests_.begin (); + while (this->last_key_ != this->ktests_.end ()) + { + if (this->last_key_->second->iteration == this->iterations_) + { + //next key + ++this->last_key_; + } + else + { + break; + } + } + if (this->last_key_ == this->ktests_.end ()) + { + unregister_handles (); + start_new_assignment (WRITE_MULTI); + } + } + } + + void + Sender_exec_i::write_many () + { + bool expected_exception_thrown = false; + + WriterTestSeq write_many_seq; + write_many_seq.length (this->keys_ * this->iterations_); + int iter_key = 0; + for (Writer_Table::iterator iter = this->ktests_.begin (); + iter != this->ktests_.end (); + ++iter) + { + ++iter_key; + for (int i = 1; i < this->iterations_ + 1; ++i) + { + char key[7]; + WriterTest new_key; + ACE_OS::sprintf (key, "KEY_%d", iter_key); + new_key.key = CORBA::string_dup(key); + new_key.iteration = i; + write_many_seq[iter_key + i - 2] = new_key; + } + } + try + { + this->writer_->write_many (write_many_seq); + } + catch (const CCM_DDS::InternalError& ex) + { + if (ex.index == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal excep ") + ACE_TEXT ("while write many for first instance : index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + } + else + { + expected_exception_thrown = true; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected Internal excep ") + ACE_TEXT ("while write many writer info: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + } + } + if (!expected_exception_thrown) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Expected Internal excep ") + ACE_TEXT ("was not thrown\n"))); + } + + this->assignment_ = WRITE_NONE; + } + + void + Sender_exec_i::tick () + { + switch (this->assignment_) + { + case WRITE_KEYED: + write_keyed (); + break; + case WRITE_MULTI: + write_many (); + default: + break; + } + } + + void + Sender_exec_i::start (void) + { + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + ::CORBA::UShort + Sender_exec_i::rate (void) + { + return this->rate_; + } + + void + Sender_exec_i::rate (::CORBA::UShort rate) + { + this->rate_ = rate; + } + + ::CORBA::UShort + Sender_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Sender_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations + 2; //for extra tests. + } + + ::CORBA::UShort + Sender_exec_i::keys (void) + { + return this->keys_; + } + + void + Sender_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys + 1; //for extra tests. + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Writer::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_info_write_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->start (); + + 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]; + WriterTest *new_key = new WriterTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 1; + + this->ktests_[key] = new_key; + } + this->last_key_ = this->ktests_.begin (); + register_handles (); + reset_iterations (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.h new file mode 100644 index 00000000000..d3dc204e318 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/Sender/Writer_Sender_exec.h @@ -0,0 +1,116 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Writer_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_Writer_Sender_Impl +{ + class Sender_exec_i; + + enum WRITER_ASSIGNMENT { + WRITE_NONE, + WRITE_KEYED, + WRITE_MULTI + }; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_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 rate (void); + + virtual void rate (::CORBA::UShort rate); + + 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 tick (); + + private: + void start (void); + void stop (void); + + CCM_DDS::WriterTest::Writer_var writer_; + + pulse_Generator * ticker_; + ::Writer::CCM_Sender_Context_var context_; + CORBA::UShort rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + WRITER_ASSIGNMENT assignment_; + CORBA::Long last_iteration_; + + void reset_iterations (); + void register_handles (); + void unregister_handles (); + void start_new_assignment ( + WRITER_ASSIGNMENT assignment); + void write_keyed (); + void write_many (); + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, WriterTest_var> Writer_Table; + Writer_Table ktests_; + + typedef std::map<ACE_CString, ::DDS::InstanceHandle_t> Writer_Table_Handles; + Writer_Table_Handles handles_; + + Writer_Table::iterator last_key_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/Plan.cdp new file mode 100644 index 00000000000..f89eafe9e25 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/Plan.cdp @@ -0,0 +1,383 @@ +<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>KeyedWriter_Depl_1</label> + <UUID>KeyedWriter_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_Writer_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentImplementation"> + <name>Writer_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Writer_Connector_ExecArtifact" /> + <artifact xmi:idref="Writer_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_Writer_Writer_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_Writer_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_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_Writer_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentInstance"> + <name>Writer_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>KeyedWriter</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>KeyedWriter_Library#KeyedWriter_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Writer_ConnectorComponentInstance2"> + <name>Writer_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>KeyedWriter</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>KeyedWriter_Library#KeyedWriter_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>rate</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>1</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>3</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>2</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>_datacontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_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="Writer_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="Writer_Connector_ExecArtifact"> + <name>Writer_Connector_exec</name> + <source/> + <node/> + <location>DDS_KeyedWriterConnector_exec</location> + </artifact> + <artifact xmi:id="Writer_Connector_SvntArtifact"> + <name>Writer_Connector_svnt</name> + <source/> + <node/> + <location>DDS_KeyedWriterConnector_svnt</location> + </artifact> + <artifact xmi:id="Writer_Connector_StubArtifact"> + <name>Writer_Connector_stub</name> + <source/> + <node/> + <location>DDS_KeyedWriterConnector_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/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..2cf94303049 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,70 @@ +<?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="KeyedWriter_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="KeyedWriter_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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <resource_limits> + <max_instances>1</max_instances> + <initial_instances>1</initial_instances> + </resource_limits> + <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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/descriptors/run_test.pl new file mode 100755 index 00000000000..3ca8a0ee149 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/KeyedWriter/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (60); + +# 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/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.idl new file mode 100644 index 00000000000..8fe5f77064d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file LMBM_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_MANY_BY_MANY_TEST_BASE_IDL +#define LISTEN_MANY_BY_MANY_TEST_BASE_IDL + +#pragma ndds typesupport "Base/LMBM_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "ListenManyByManyTest" +#pragma DCPS_DATA_KEY "ListenManyByManyTest key" + +struct ListenManyByManyTest { + string key; //@key + long iteration; +}; + +typedef sequence<ListenManyByManyTest> ListenManyByManyTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.mpc new file mode 100755 index 00000000000..ffb29178624 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Base/LMBM_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_LMBM_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_LMBM_Test_Base_stub + dynamicflags += LISTEN_MANY_BY_MANY_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=LISTEN_MANY_BY_MANY_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=LMBM_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + LMBM_Test_Base.idl + } + + opendds_ts_flags += --export=LISTEN_MANY_BY_MANY_TEST_BASE_STUB_Export + + DDSGenerator_Files { + LMBM_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.idl new file mode 100644 index 00000000000..e92d52e46c0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file LMBM_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_MANY_BY_MANY_TEST_CONNECTOR_IDL_ +#define LISTEN_MANY_BY_MANY_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/LMBM_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/LMBM_Test_ConnectorE.idl" + +module LMBM_Test +{ + module ::CCM_DDS::Typed + < ::ListenManyByManyTest, ::ListenManyByManyTestSeq> + ListenManyByManyTestConn; + connector LMBM_Test_Connector : ListenManyByManyTestConn::DDS_Event + { + }; +}; + +#endif /* LMBM_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.mpc new file mode 100755 index 00000000000..bd0e8ad78fd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Connector/LMBM_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LMBM_Test_Base -l .. -o ../lib -u DDS LMBM_Test_Connector" + +project(DDS_LMBM_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=LISTEN_MANY_BY_MANY_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=LMBM_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=LISTEN_MANY_BY_MANY_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=LMBM_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=LISTEN_MANY_BY_MANY_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=LMBM_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=LISTEN_MANY_BY_MANY_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=LMBM_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + LMBM_Test_Connector.idl + } +} + +project(DDS_LMBM_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LMBM_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=LISTEN_MANY_BY_MANY_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=LMBM_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + LMBM_Test_ConnectorE.idl + } +} + +project(DDS_LMBM_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LMBM_Test_Connector_lem_gen DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_LMBM_Test_Base_stub DDS_LMBM_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LMBM_Test_Connector_lem_stub + dynamicflags = LISTEN_MANY_BY_MANY_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ConnectorEC.cpp + } + + Header_Files { + LMBM_Test_ConnectorEC.h + LMBM_Test_Connector_lem_stub_export.h + } + + Inline_Files { + LMBM_Test_ConnectorEC.inl + } +} + +project(DDS_LMBM_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_LMBM_Test_Connector_idl_gen DDS_LMBM_Test_Base_stub + libs += DDS_LMBM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LMBM_Test_Connector_stub + dynamicflags = LISTEN_MANY_BY_MANY_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ConnectorC.cpp + } + + Header_Files { + LMBM_Test_ConnectorC.h + LMBM_Test_Connector_stub_export.h + } + + Inline_Files { + LMBM_Test_ConnectorC.inl + } +} + +project(DDS_LMBM_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_LMBM_Test_Connector_lem_stub DDS_LMBM_Test_Connector_stub DDS4CCM_lem_stub DDS_LMBM_Test_Base_stub + sharedname = DDS_LMBM_Test_Connector_exec + libs += DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Connector_lem_stub DDS_LMBM_Test_Base_stub DDS4CCM_lem_stub DDS_LMBM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_MANY_BY_MANY_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_Connector_conn.cpp + } + + Header_Files { + LMBM_Test_Connector_conn.h + LMBM_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_LMBM_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_LMBM_Test_Connector_lem_stub DDS_LMBM_Test_Connector_exec DDS_LMBM_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_LMBM_Test_Connector_svnt + libs += DDS_LMBM_Test_Connector_stub \ + DDS_LMBM_Test_Connector_lem_stub \ + DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_MANY_BY_MANY_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ConnectorS.cpp + LMBM_Test_Connector_svnt.cpp + } + + Header_Files { + LMBM_Test_ConnectorS.h + LMBM_Test_Connector_svnt.h + LMBM_Test_Connector_svnt_export.h + } + + Inline_Files { + LMBM_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/README b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/README new file mode 100644 index 00000000000..f622af6a71d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/README @@ -0,0 +1,3 @@ +# $Id$ + +This test tests the listener.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.idl new file mode 100644 index 00000000000..71f1f8ed89d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/LMBM_Test_Connector.idl" + +module LMBM_Test +{ + component Receiver + { + port ListenManyByManyTestConn::DDS_Listen info_listen; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.mpc new file mode 100755 index 00000000000..525a82ca292 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_LMBM_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LMBM_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 { + LMBM_Test_Receiver.idl + } +} + +project(DDS_LMBM_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LMBM_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 { + LMBM_Test_ReceiverE.idl + } +} + +project(DDS_LMBM_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LMBM_Test_Receiver_lem_gen DDS_LMBM_Test_Receiver_stub \ + DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Base_stub + libs += Receiver_stub DDS_LMBM_Test_Connector_stub \ + DDS_LMBM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ReceiverEC.cpp + } + + Header_Files { + LMBM_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + LMBM_Test_ReceiverEC.inl + } +} + +project(DDS_LMBM_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_LMBM_Test_Receiver_idl_gen DDS_LMBM_Test_Connector_stub \ + DDS_LMBM_Test_Base_stub DDS_LMBM_Test_Connector_lem_gen + libs += DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ReceiverC.cpp + } + + Header_Files { + LMBM_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + LMBM_Test_ReceiverC.inl + } +} + +project(DDS_LMBM_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_LMBM_Test_Receiver_lem_stub DDS_LMBM_Test_Receiver_stub \ + DDS_LMBM_Test_Base_stub DDS_LMBM_Test_Connector_stub \ + DDS_LMBM_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_Receiver_exec.cpp + } + + Header_Files { + LMBM_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LMBM_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LMBM_Test_Receiver_lem_stub DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Connector_svnt \ + DDS_LMBM_Test_Receiver_exec DDS_LMBM_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Connector_svnt \ + Receiver_exec DDS_LMBM_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_ReceiverS.cpp + LMBM_Test_Receiver_svnt.cpp + } + + Header_Files { + LMBM_Test_ReceiverS.h + LMBM_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + LMBM_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..5c87ba07158 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.cpp @@ -0,0 +1,221 @@ +// -*- C++ -*- +// +// $Id$ + +#include "LMBM_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +namespace CIAO_LMBM_Test_Receiver_Impl +{ + //============================================================ + // ListenManyByManyTest_Listener_exec_i + //============================================================ + ListenManyByManyTest_Listener_exec_i::ListenManyByManyTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many) + : received_one_by_one_ (received_one_by_one), + received_many_by_many_ (received_many_by_many) + { + } + + ListenManyByManyTest_Listener_exec_i::~ListenManyByManyTest_Listener_exec_i (void) + { + } + + void + ListenManyByManyTest_Listener_exec_i::on_one_data ( + const ListenManyByManyTest & /*an_instance*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + //just count; this value is checked on ccm_remove. + ++this->received_one_by_one_; + } + + void + ListenManyByManyTest_Listener_exec_i::on_many_data ( + const ListenManyByManyTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info) + { + if (an_instance.length () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ListenManyByManyTest_Listener_exec_i::on_many_data:" + "instance sequence length is nil\n")); + return; + } + for (CORBA::ULong i = 0 ; i < info.length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, "ListenManyByManyTest_Listener_exec_i::on_many_data:" + "key <%C> - iteration <%d>\n", + an_instance[i].key.in (), + an_instance[i].iteration)); + if (!info[i].instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, "ERROR: ListenManyByManyTest_Listener_exec_i::on_many_data:" + "instance handle %d seems to be invalid" + "key <%C> - iteration <%d>\n", + i, + an_instance[i].key.in (), + an_instance[i].iteration)); + } + if (info[i].source_timestamp.sec == 0 && + info[i].source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ListenManyByManyTest_Listener_exec_i::on_one_data: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + an_instance[i].key.in (), + an_instance[i].iteration)); + } + } + this->received_many_by_many_ += an_instance.length (); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : received_one_by_one_ (0), + received_many_by_many_ (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::MANY_BY_MANY); + } + + ::LMBM_Test::ListenManyByManyTestConn::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + return new ListenManyByManyTest_Listener_exec_i ( + this->received_one_by_one_, + this->received_many_by_many_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_listen_connector_status (void) + { + return::CCM_DDS::CCM_ConnectorStatusListener::_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_ = + ::LMBM_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) + { + start (); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + CORBA::ULong expected = this->keys_ * this->iterations_; + if (this->received_many_by_many_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: MANY_BY_MANY: " + "Didn't receive samples on many_by_many " + "callback while mode is MANY_BY_MANY " + "expected <%u> - received <%u>\n", + expected, + this->received_many_by_many_.value ())); + } + else if (expected != this->received_many_by_many_.value ()) + { + ACE_ERROR ((LM_ERROR, "ERROR: MANY_BY_MANY: " + "Didn't receive the expected " + "number of samples on many_by_many " + "callback while mode is MANY_BY_MANY " + "expected <%u> - received <%u>\n", + expected, + this->received_many_by_many_.value ())); + } + if (this->received_one_by_one_.value () > 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: MANY_BY_MANY: " + "Received samples on one_by_one " + "callback while mode is MANY_BY_MANY " + "expected <0> - received <%u>\n", + this->received_one_by_one_.value ())); + } + if (this->received_one_by_one_.value () == 0 && + this->received_many_by_many_.value () > 0) + { + ACE_DEBUG ((LM_DEBUG, "MANY_BY_MANY: " + "Received only data on " + "many_by_many callback. " + "Test passed!\n")); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LMBM_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.h new file mode 100644 index 00000000000..07b9175734a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Receiver/LMBM_Test_Receiver_exec.h @@ -0,0 +1,104 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "LMBM_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" + +namespace CIAO_LMBM_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, bool> Atomic_Bool; + + //============================================================ + // ListenManyByManyTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ListenManyByManyTest_Listener_exec_i + : public virtual ::LMBM_Test::ListenManyByManyTestConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + ListenManyByManyTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many); + virtual ~ListenManyByManyTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const ListenManyByManyTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const ListenManyByManyTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ULong &received_one_by_one_; + Atomic_ULong &received_many_by_many_; + }; + + //============================================================ + // 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 ::LMBM_Test::ListenManyByManyTestConn::CCM_Listener_ptr + get_info_listen_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_listen_connector_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: + ::LMBM_Test::CCM_Receiver_Context_var context_; + + Atomic_ULong received_one_by_one_; + Atomic_ULong received_many_by_many_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LMBM_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.idl new file mode 100644 index 00000000000..38fc751dc0b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_LISTEN_MANY_BY_MANY_TEST_SENDER_IDL +#define DDS_LISTEN_MANY_BY_MANY_TEST_SENDER_IDL + +#include "Connector/LMBM_Test_Connector.idl" + +module LMBM_Test +{ + component Sender + { + port ListenManyByManyTestConn::DDS_Write info_write; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.mpc new file mode 100755 index 00000000000..a83b428a029 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LMBM_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_LMBM_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_LMBM_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 { + LMBM_Test_Sender.idl + } +} + +project(DDS_LMBM_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LMBM_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 { + LMBM_Test_SenderE.idl + } +} + +project(DDS_LMBM_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LMBM_Test_Sender_lem_gen DDS_LMBM_Test_Sender_stub \ + DDS_LMBM_Test_Base_stub + libs += DDS_LMBM_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_SenderEC.cpp + } + + Header_Files { + LMBM_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + LMBM_Test_SenderEC.inl + } +} + +project(DDS_LMBM_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_LMBM_Test_Sender_idl_gen DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_stub + libs += DDS_LMBM_Test_Base_stub DDS_LMBM_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_SenderC.cpp + } + + Header_Files { + LMBM_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + LMBM_Test_SenderC.inl + } +} + +project(DDS_LMBM_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_LMBM_Test_Sender_lem_stub DDS_LMBM_Test_Sender_stub \ + DDS_LMBM_Test_Connector_lem_stub DDS_LMBM_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_LMBM_Test_Base_stub \ + DDS_LMBM_Test_Connector_lem_stub DDS_LMBM_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_Sender_exec.cpp + } + + Header_Files { + LMBM_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LMBM_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LMBM_Test_Base_stub DDS_LMBM_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_LMBM_Test_Connector_stub \ + DDS_LMBM_Test_Connector_svnt DDS_LMBM_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_LMBM_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_LMBM_Test_Connector_stub DDS_LMBM_Test_Connector_svnt \ + DDS_LMBM_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LMBM_Test_SenderS.cpp + LMBM_Test_Sender_svnt.cpp + } + + Header_Files { + LMBM_Test_SenderS.h + LMBM_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + LMBM_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.cpp new file mode 100644 index 00000000000..4e712e29294 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.cpp @@ -0,0 +1,217 @@ +// -*- C++ -*- +// $Id$ + +#include "LMBM_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_LMBM_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; + } + + //============================================================ + // WriteManyHandler + //============================================================ + WriteManyHandler::WriteManyHandler (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteManyHandler::handle_exception (ACE_HANDLE) + { + this->callback_.write_one (); + return 0; + } + + + //============================================================ + // 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]; + ListenManyByManyTest *new_key = new ListenManyByManyTest; + 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_ = + ::LMBM_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_LMBM_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.h new file mode 100644 index 00000000000..82b86350114 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/Sender/LMBM_Test_Sender_exec.h @@ -0,0 +1,98 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "LMBM_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_LMBM_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: + Sender_exec_i &callback_; + }; + + //============================================================ + // WriteManyHandler + //============================================================ + class WriteManyHandler : + public ACE_Event_Handler + { + public: + WriteManyHandler (Sender_exec_i &callback); + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + private: + 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: + ::LMBM_Test::CCM_Sender_Context_var context_; + ::LMBM_Test::ListenManyByManyTestConn::Writer_var writer_; + + WriteTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, ListenManyByManyTest_var> Writer_Table; + Writer_Table samples_; + + Writer_Table::iterator last_key_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LMBM_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/Plan.cdp new file mode 100644 index 00000000000..b8323b7fe93 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/Plan.cdp @@ -0,0 +1,394 @@ +<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>LMBM_Test_Depl_1</label> + <UUID>LMBM_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_LMBM_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_LMBM_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="LMBM_Test_ConnectorComponentImplementation"> + <name>LMBM_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="LMBM_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="LMBM_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_LMBM_Test_LMBM_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_LMBM_Test_LMBM_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LMBM_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LMBM_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_LMBM_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_LMBM_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="LMBM_Test_ConnectorComponentInstance"> + <name>LMBM_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LMBM_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ListenManyByMany_Library#ListenManyByMany_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LMBM_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="LMBM_Test_ConnectorComponentInstance2"> + <name>LMBM_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LMBM_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ListenManyByMany_Library#ListenManyByMany_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LMBM_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_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="LMBM_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="LMBM_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="LMBM_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="LMBM_Test_Connector_ExecArtifact"> + <name>LMBM_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_LMBM_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="LMBM_Test_Connector_SvntArtifact"> + <name>LMBM_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_LMBM_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="LMBM_Test_Connector_StubArtifact"> + <name>LMBM_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_LMBM_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/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..13300496572 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/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="ListenManyByMany_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="ListenManyByMany_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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/descriptors/run_test.pl new file mode 100755 index 00000000000..ddeee753cf7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenManyByMany/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.idl new file mode 100644 index 00000000000..7baa8318a0b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file LNE_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_NOT_ENABLED_TEST_BASE_IDL +#define LISTEN_NOT_ENABLED_TEST_BASE_IDL + +#pragma ndds typesupport "Base/LNE_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "ListenNotEnabledTest" +#pragma DCPS_DATA_KEY "ListenNotEnabledTest key" + +struct ListenNotEnabledTest { + string key; //@key + long iteration; +}; + +typedef sequence<ListenNotEnabledTest> ListenNotEnabledTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.mpc new file mode 100755 index 00000000000..12bbf8ff16d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Base/LNE_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_LNE_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_LNE_Test_Base_stub + dynamicflags += LISTEN_NOT_ENABLED_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=LISTEN_NOT_ENABLED_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=LNE_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + LNE_Test_Base.idl + } + + opendds_ts_flags += --export=LISTEN_NOT_ENABLED_TEST_BASE_STUB_Export + + DDSGenerator_Files { + LNE_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.idl new file mode 100644 index 00000000000..ca42ae7c2c4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file LNE_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_NOT_ENABLED_TEST_CONNECTOR_IDL_ +#define LISTEN_NOT_ENABLED_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/LNE_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/LNE_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::ListenNotEnabledTest, ::ListenNotEnabledTestSeq> ListenNotEnabledTest; +}; + +module LNE_Test +{ + connector LNE_Test_Connector : ::CCM_DDS::ListenNotEnabledTest::DDS_Event + { + }; +}; + +#endif /* LNE_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.mpc new file mode 100755 index 00000000000..e9da9237f41 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Connector/LNE_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LNE_Test_Base -l .. -o ../lib -u DDS LNE_Test_Connector" + +project(DDS_LNE_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=LISTEN_NOT_ENABLED_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=LNE_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=LISTEN_NOT_ENABLED_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=LNE_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=LISTEN_NOT_ENABLED_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=LNE_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=LISTEN_NOT_ENABLED_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=LNE_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + LNE_Test_Connector.idl + } +} + +project(DDS_LNE_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LNE_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=LISTEN_NOT_ENABLED_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=LNE_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + LNE_Test_ConnectorE.idl + } +} + +project(DDS_LNE_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LNE_Test_Connector_lem_gen DDS_LNE_Test_Connector_stub DDS_LNE_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_LNE_Test_Base_stub DDS_LNE_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LNE_Test_Connector_lem_stub + dynamicflags = LISTEN_NOT_ENABLED_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ConnectorEC.cpp + } + + Header_Files { + LNE_Test_ConnectorEC.h + LNE_Test_Connector_lem_stub_export.h + } + + Inline_Files { + LNE_Test_ConnectorEC.inl + } +} + +project(DDS_LNE_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_LNE_Test_Connector_idl_gen DDS_LNE_Test_Base_stub + libs += DDS_LNE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LNE_Test_Connector_stub + dynamicflags = LISTEN_NOT_ENABLED_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ConnectorC.cpp + } + + Header_Files { + LNE_Test_ConnectorC.h + LNE_Test_Connector_stub_export.h + } + + Inline_Files { + LNE_Test_ConnectorC.inl + } +} + +project(DDS_LNE_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_LNE_Test_Connector_lem_stub DDS_LNE_Test_Connector_stub DDS4CCM_lem_stub DDS_LNE_Test_Base_stub + sharedname = DDS_LNE_Test_Connector_exec + libs += DDS_LNE_Test_Connector_stub DDS_LNE_Test_Connector_lem_stub DDS_LNE_Test_Base_stub DDS4CCM_lem_stub DDS_LNE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_NOT_ENABLED_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_Connector_conn.cpp + } + + Header_Files { + LNE_Test_Connector_conn.h + LNE_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_LNE_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_LNE_Test_Connector_lem_stub DDS_LNE_Test_Connector_exec DDS_LNE_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_LNE_Test_Connector_svnt + libs += DDS_LNE_Test_Connector_stub \ + DDS_LNE_Test_Connector_lem_stub \ + DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_NOT_ENABLED_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ConnectorS.cpp + LNE_Test_Connector_svnt.cpp + } + + Header_Files { + LNE_Test_ConnectorS.h + LNE_Test_Connector_svnt.h + LNE_Test_Connector_svnt_export.h + } + + Inline_Files { + LNE_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/README b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/README new file mode 100644 index 00000000000..f622af6a71d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/README @@ -0,0 +1,3 @@ +# $Id$ + +This test tests the listener.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.idl new file mode 100644 index 00000000000..dcc35279c4b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/LNE_Test_Connector.idl" + +module LNE_Test +{ + component Receiver + { + port CCM_DDS::ListenNotEnabledTest::DDS_Listen info_listen; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.mpc new file mode 100755 index 00000000000..7cdc3ba7d08 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_LNE_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LNE_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 { + LNE_Test_Receiver.idl + } +} + +project(DDS_LNE_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LNE_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 { + LNE_Test_ReceiverE.idl + } +} + +project(DDS_LNE_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LNE_Test_Receiver_lem_gen DDS_LNE_Test_Receiver_stub \ + DDS_LNE_Test_Connector_stub DDS_LNE_Test_Base_stub + libs += Receiver_stub DDS_LNE_Test_Connector_stub \ + DDS_LNE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ReceiverEC.cpp + } + + Header_Files { + LNE_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + LNE_Test_ReceiverEC.inl + } +} + +project(DDS_LNE_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_LNE_Test_Receiver_idl_gen DDS_LNE_Test_Connector_stub \ + DDS_LNE_Test_Base_stub DDS_LNE_Test_Connector_lem_gen + libs += DDS_LNE_Test_Connector_stub DDS_LNE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ReceiverC.cpp + } + + Header_Files { + LNE_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + LNE_Test_ReceiverC.inl + } +} + +project(DDS_LNE_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_LNE_Test_Receiver_lem_stub DDS_LNE_Test_Receiver_stub \ + DDS_LNE_Test_Base_stub DDS_LNE_Test_Connector_stub \ + DDS_LNE_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_stub DDS_LNE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_Receiver_exec.cpp + } + + Header_Files { + LNE_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LNE_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LNE_Test_Receiver_lem_stub DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_stub DDS_LNE_Test_Connector_svnt \ + DDS_LNE_Test_Receiver_exec DDS_LNE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_stub DDS_LNE_Test_Connector_svnt \ + Receiver_exec DDS_LNE_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_ReceiverS.cpp + LNE_Test_Receiver_svnt.cpp + } + + Header_Files { + LNE_Test_ReceiverS.h + LNE_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + LNE_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..b947842ccca --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.cpp @@ -0,0 +1,146 @@ +// -*- C++ -*- +// +// $Id$ + +#include "LNE_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +namespace CIAO_LNE_Test_Receiver_Impl +{ + //============================================================ + // ListenNotEnabledTest_Listener_exec_i + //============================================================ + ListenNotEnabledTest_Listener_exec_i::ListenNotEnabledTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many) + : received_one_by_one_ (received_one_by_one), + received_many_by_many_ (received_many_by_many) + { + } + + ListenNotEnabledTest_Listener_exec_i::~ListenNotEnabledTest_Listener_exec_i (void) + { + } + + void + ListenNotEnabledTest_Listener_exec_i::on_one_data ( + const ListenNotEnabledTest & /*an_instance*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + //just count; this value is checked on ccm_remove. + ++this->received_one_by_one_; + } + + void + ListenNotEnabledTest_Listener_exec_i::on_many_data ( + const ListenNotEnabledTestSeq & /*an_instance*/, + const ::CCM_DDS::ReadInfoSeq & /*info*/) + { + //just count; this value is checked on ccm_remove. + ++this->received_many_by_many_; + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : received_one_by_one_ (0), + received_many_by_many_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CCM_DDS::ListenNotEnabledTest::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + return new ListenNotEnabledTest_Listener_exec_i ( + this->received_one_by_one_, + this->received_many_by_many_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_listen_connector_status (void) + { + return ::CCM_DDS::CCM_ConnectorStatusListener::_nil (); + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::LNE_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) + { + ::CCM_DDS::DataListenerControl_var dlc = + this->context_->get_connection_info_listen_data_control (); + dlc->mode (::CCM_DDS::NOT_ENABLED); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->received_one_by_one_.value () > 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: NOT ENABLED: " + "Received samples on one_by_one " + "callback while mode is NOT_ENABLED " + "expected <0> - received <%u>\n", + this->received_one_by_one_.value ())); + } + if (this->received_many_by_many_.value () > 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: NOT ENABLED: " + "Received samples on many_by_many " + "callback while mode is NOT_ENABLED " + "expected <0> - received <%u>\n", + this->received_many_by_many_.value ())); + } + if (this->received_one_by_one_.value () == 0 && + this->received_many_by_many_.value () == 0) + { + ACE_DEBUG ((LM_DEBUG, "NOT ENABLED: " + "Received no data at all." + "Test passed!\n")); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LNE_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.h new file mode 100644 index 00000000000..a3fc938ccaf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Receiver/LNE_Test_Receiver_exec.h @@ -0,0 +1,90 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "LNE_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" + +namespace CIAO_LNE_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + + //============================================================ + // ListenNotEnabledTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ListenNotEnabledTest_Listener_exec_i + : public virtual ::CCM_DDS::ListenNotEnabledTest::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + ListenNotEnabledTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many); + virtual ~ListenNotEnabledTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const ListenNotEnabledTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const ListenNotEnabledTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ULong &received_one_by_one_; + Atomic_ULong &received_many_by_many_; + }; + + //============================================================ + // 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); + + virtual ::CCM_DDS::ListenNotEnabledTest::CCM_Listener_ptr + get_info_listen_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_listen_connector_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: + ::LNE_Test::CCM_Receiver_Context_var context_; + + Atomic_ULong received_one_by_one_; + Atomic_ULong received_many_by_many_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LNE_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl new file mode 100644 index 00000000000..a090fab06a4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_LISTEN_NOT_ENABLED_TEST_SENDER_IDL +#define DDS_LISTEN_NOT_ENABLED_TEST_SENDER_IDL + +#include "Connector/LNE_Test_Connector.idl" + +module LNE_Test +{ + component Sender + { + port CCM_DDS::ListenNotEnabledTest::DDS_Write info_write; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.mpc new file mode 100755 index 00000000000..bc9340eac60 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LNE_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_LNE_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_LNE_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 { + LNE_Test_Sender.idl + } +} + +project(DDS_LNE_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LNE_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 { + LNE_Test_SenderE.idl + } +} + +project(DDS_LNE_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LNE_Test_Sender_lem_gen DDS_LNE_Test_Sender_stub \ + DDS_LNE_Test_Base_stub + libs += DDS_LNE_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_SenderEC.cpp + } + + Header_Files { + LNE_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + LNE_Test_SenderEC.inl + } +} + +project(DDS_LNE_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_LNE_Test_Sender_idl_gen DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_stub + libs += DDS_LNE_Test_Base_stub DDS_LNE_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_SenderC.cpp + } + + Header_Files { + LNE_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + LNE_Test_SenderC.inl + } +} + +project(DDS_LNE_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_LNE_Test_Sender_lem_stub DDS_LNE_Test_Sender_stub \ + DDS_LNE_Test_Connector_lem_stub DDS_LNE_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_LNE_Test_Base_stub \ + DDS_LNE_Test_Connector_lem_stub DDS_LNE_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_Sender_exec.cpp + } + + Header_Files { + LNE_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LNE_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LNE_Test_Base_stub DDS_LNE_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_LNE_Test_Connector_stub \ + DDS_LNE_Test_Connector_svnt DDS_LNE_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_LNE_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_LNE_Test_Connector_stub DDS_LNE_Test_Connector_svnt \ + DDS_LNE_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LNE_Test_SenderS.cpp + LNE_Test_Sender_svnt.cpp + } + + Header_Files { + LNE_Test_SenderS.h + LNE_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + LNE_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp new file mode 100644 index 00000000000..5336eb191b5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.cpp @@ -0,0 +1,165 @@ +// -*- C++ -*- +// $Id$ + +#include "LNE_Test_Sender_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_LNE_Test_Sender_Impl +{ + //============================================================ + // WriteManyHandler + //============================================================ + WriteManyHandler::WriteManyHandler (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteManyHandler::handle_exception (ACE_HANDLE) + { + this->callback_.write_many (); + return 0; + } + + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (10), + keys_ (5) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::write_many (void) + { + ListenNotEnabledTestSeq write_many; + write_many.length (this->keys_ * this->iterations_); + for (CORBA::UShort key = 1; key < this->keys_ + 1; ++key) + { + ListenNotEnabledTest new_key; + char tmp[7]; + ACE_OS::sprintf (tmp, "KEY_%d", key); + new_key.key = CORBA::string_dup(tmp); + for (CORBA::UShort iter = 1; iter < this->iterations_ + 1; ++iter) + { + new_key.iteration = iter; + write_many[key + iter - 2] = new_key; + } + } + try + { + ACE_Time_Value tv (1, 0); + ACE_OS::sleep (tv); + this->writer_->write_many (write_many); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("write_many : written <%u> samples\n"), + write_many.length ())); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("while write many writer info: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + } + } + + + void + Sender_exec_i::start (void) + { + WriteManyHandler *rh = new WriteManyHandler (*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_ = + ::LNE_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_LNE_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h new file mode 100644 index 00000000000..360525014a8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/Sender/LNE_Test_Sender_exec.h @@ -0,0 +1,75 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "LNE_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_LNE_Test_Sender_Impl +{ + class Sender_exec_i; + + //============================================================ + // WriteManyHandler + //============================================================ + class WriteManyHandler : + public ACE_Event_Handler + { + public: + WriteManyHandler (Sender_exec_i &callback); + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + private: + 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_many (void); + + private: + ::LNE_Test::CCM_Sender_Context_var context_; + CCM_DDS::ListenNotEnabledTest::Writer_var writer_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LNE_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp new file mode 100644 index 00000000000..6676e2fa543 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/Plan.cdp @@ -0,0 +1,350 @@ +<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>LNE_Test_Depl_1</label> + <UUID>LNE_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_LNE_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_LNE_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="LNE_Test_ConnectorComponentImplementation"> + <name>LNE_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="LNE_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="LNE_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_LNE_Test_LNE_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_LNE_Test_LNE_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LNE_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LNE_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_LNE_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_LNE_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="LNE_Test_ConnectorComponentInstance"> + <name>LNE_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LNE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LNE_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="LNE_Test_ConnectorComponentInstance2"> + <name>LNE_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LNE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LNE_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_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>10</ulong> + </value> + </value> + </configProperty> + </instance> + + <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="LNE_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="LNE_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="LNE_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="LNE_Test_Connector_ExecArtifact"> + <name>LNE_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_LNE_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="LNE_Test_Connector_SvntArtifact"> + <name>LNE_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_LNE_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="LNE_Test_Connector_StubArtifact"> + <name>LNE_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_LNE_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/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/descriptors/run_test.pl new file mode 100755 index 00000000000..b2a5229d554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenNotEnabled/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.idl new file mode 100644 index 00000000000..337f5e315aa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file LOBO_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_ONE_BY_ONE_TEST_BASE_IDL +#define LISTEN_ONE_BY_ONE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/LOBO_Test_BaseSupport.h" + +struct ListenOneByOneTest { + string key; //@key + long iteration; +}; + +typedef sequence<ListenOneByOneTest> ListenOneByOneTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.mpc new file mode 100755 index 00000000000..63a63895730 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Base/LOBO_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_LOBO_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_LOBO_Test_Base_stub + dynamicflags += LISTEN_ONE_BY_ONE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=LISTEN_ONE_BY_ONE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=LOBO_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + LOBO_Test_Base.idl + } + + opendds_ts_flags += --export=LISTEN_ONE_BY_ONE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + LOBO_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.idl new file mode 100644 index 00000000000..e9d5300262c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file LOBO_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef LISTEN_ONE_BY_ONE_TEST_CONNECTOR_IDL_ +#define LISTEN_ONE_BY_ONE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/LOBO_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/LOBO_Test_ConnectorE.idl" + +module LOBO_Test +{ + module ::CCM_DDS::Typed + < ::ListenOneByOneTest, ::ListenOneByOneTestSeq> + ListenOneByOneTestConn; + connector LOBO_Test_Connector : ListenOneByOneTestConn::DDS_Event + { + }; +}; + +#endif /* LOBO_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.mpc new file mode 100755 index 00000000000..170148e5fbf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Connector/LOBO_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LOBO_Test_Base -l .. -o ../lib -u DDS LOBO_Test_Connector" + +project(DDS_LOBO_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=LISTEN_ONE_BY_ONE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=LOBO_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=LISTEN_ONE_BY_ONE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=LOBO_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=LISTEN_ONE_BY_ONE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=LOBO_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=LISTEN_ONE_BY_ONE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=LOBO_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + LOBO_Test_Connector.idl + } +} + +project(DDS_LOBO_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LOBO_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=LISTEN_ONE_BY_ONE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=LOBO_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + LOBO_Test_ConnectorE.idl + } +} + +project(DDS_LOBO_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LOBO_Test_Connector_lem_gen DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_LOBO_Test_Base_stub DDS_LOBO_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LOBO_Test_Connector_lem_stub + dynamicflags = LISTEN_ONE_BY_ONE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ConnectorEC.cpp + } + + Header_Files { + LOBO_Test_ConnectorEC.h + LOBO_Test_Connector_lem_stub_export.h + } + + Inline_Files { + LOBO_Test_ConnectorEC.inl + } +} + +project(DDS_LOBO_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_LOBO_Test_Connector_idl_gen DDS_LOBO_Test_Base_stub + libs += DDS_LOBO_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_LOBO_Test_Connector_stub + dynamicflags = LISTEN_ONE_BY_ONE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ConnectorC.cpp + } + + Header_Files { + LOBO_Test_ConnectorC.h + LOBO_Test_Connector_stub_export.h + } + + Inline_Files { + LOBO_Test_ConnectorC.inl + } +} + +project(DDS_LOBO_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_LOBO_Test_Connector_lem_stub DDS_LOBO_Test_Connector_stub DDS4CCM_lem_stub DDS_LOBO_Test_Base_stub + sharedname = DDS_LOBO_Test_Connector_exec + libs += DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Connector_lem_stub DDS_LOBO_Test_Base_stub DDS4CCM_lem_stub DDS_LOBO_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_ONE_BY_ONE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_Connector_conn.cpp + } + + Header_Files { + LOBO_Test_Connector_conn.h + LOBO_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_LOBO_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_LOBO_Test_Connector_lem_stub DDS_LOBO_Test_Connector_exec DDS_LOBO_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_LOBO_Test_Connector_svnt + libs += DDS_LOBO_Test_Connector_stub \ + DDS_LOBO_Test_Connector_lem_stub \ + DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = LISTEN_ONE_BY_ONE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ConnectorS.cpp + LOBO_Test_Connector_svnt.cpp + } + + Header_Files { + LOBO_Test_ConnectorS.h + LOBO_Test_Connector_svnt.h + LOBO_Test_Connector_svnt_export.h + } + + Inline_Files { + LOBO_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/README b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/README new file mode 100644 index 00000000000..f622af6a71d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/README @@ -0,0 +1,3 @@ +# $Id$ + +This test tests the listener.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.idl new file mode 100644 index 00000000000..d5b736d443f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/LOBO_Test_Connector.idl" + +module LOBO_Test +{ + component Receiver + { + port ListenOneByOneTestConn::DDS_Listen info_listen; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.mpc new file mode 100755 index 00000000000..e0c085aa363 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_LOBO_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_LOBO_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 { + LOBO_Test_Receiver.idl + } +} + +project(DDS_LOBO_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LOBO_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 { + LOBO_Test_ReceiverE.idl + } +} + +project(DDS_LOBO_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LOBO_Test_Receiver_lem_gen DDS_LOBO_Test_Receiver_stub \ + DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Base_stub + libs += Receiver_stub DDS_LOBO_Test_Connector_stub \ + DDS_LOBO_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ReceiverEC.cpp + } + + Header_Files { + LOBO_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + LOBO_Test_ReceiverEC.inl + } +} + +project(DDS_LOBO_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_LOBO_Test_Receiver_idl_gen DDS_LOBO_Test_Connector_stub \ + DDS_LOBO_Test_Base_stub DDS_LOBO_Test_Connector_lem_gen + libs += DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ReceiverC.cpp + } + + Header_Files { + LOBO_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + LOBO_Test_ReceiverC.inl + } +} + +project(DDS_LOBO_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_LOBO_Test_Receiver_lem_stub DDS_LOBO_Test_Receiver_stub \ + DDS_LOBO_Test_Base_stub DDS_LOBO_Test_Connector_stub \ + DDS_LOBO_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_Receiver_exec.cpp + } + + Header_Files { + LOBO_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LOBO_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LOBO_Test_Receiver_lem_stub DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Connector_svnt \ + DDS_LOBO_Test_Receiver_exec DDS_LOBO_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Connector_svnt \ + Receiver_exec DDS_LOBO_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_ReceiverS.cpp + LOBO_Test_Receiver_svnt.cpp + } + + Header_Files { + LOBO_Test_ReceiverS.h + LOBO_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + LOBO_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..cbbf0cf4a5a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.cpp @@ -0,0 +1,262 @@ +// -*- C++ -*- +// +// $Id$ + +#include "LOBO_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_LOBO_Test_Receiver_Impl +{ + //============================================================ + // ListenOneByOneTest_Listener_exec_i + //============================================================ + ListenOneByOneTest_Listener_exec_i::ListenOneByOneTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many, + Atomic_ThreadId &thread_id) + : received_one_by_one_ (received_one_by_one), + received_many_by_many_ (received_many_by_many), + thread_id_ (thread_id) + { + } + + ListenOneByOneTest_Listener_exec_i::~ListenOneByOneTest_Listener_exec_i (void) + { + } + + void + ListenOneByOneTest_Listener_exec_i::on_one_data ( + const ListenOneByOneTest & an_instance, + const ::CCM_DDS::ReadInfo & info) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "ListenOneByOneTest_Listener_exec_i::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: ListenOneByOneTest_Listener_exec_i::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: ListenOneByOneTest_Listener_exec_i::on_one_data: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + } + ++this->received_one_by_one_; + } + + void + ListenOneByOneTest_Listener_exec_i::on_many_data ( + const ListenOneByOneTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & /*info*/) + { + //just count. Is checked on ccm_remove. + this->received_many_by_many_ += an_instance.length (); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : received_one_by_one_ (0), + received_many_by_many_ (0), + 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); + } + + ::LOBO_Test::ListenOneByOneTestConn::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + return new ListenOneByOneTest_Listener_exec_i ( + this->received_one_by_one_, + this->received_many_by_many_, + this->thread_id_listener_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_listen_connector_status (void) + { + return ::CCM_DDS::CCM_ConnectorStatusListener::_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_ = + ::LOBO_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) + { + start (); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + CORBA::ULong expected = this->keys_ * this->iterations_; + if (this->received_one_by_one_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ONE_BY_ONE: " + "Didn't receive samples on one_by_one " + "callback while mode is ONE_BY_ONE " + "expected <%u> - received <%u>\n", + expected, + this->received_one_by_one_.value ())); + } + else if (expected != this->received_one_by_one_.value ()) + { + ACE_ERROR ((LM_ERROR, "ERROR: ONE_BY_ONE: " + "Didn't receive the expected " + "number of samples on one_by_one " + "callback while mode is ONE_BY_ONE " + "expected <%u> - received <%u>\n", + expected, + this->received_one_by_one_.value ())); + } + if (this->received_many_by_many_.value () > 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ONE_BY_ONE: " + "Received samples on many_by_many " + "callback while mode is ONE_BY_ONE " + "expected <0> - received <%u>\n", + this->received_many_by_many_.value ())); + } + if (this->received_one_by_one_.value () > 0 && + this->received_many_by_many_.value () == 0) + { + ACE_DEBUG ((LM_DEBUG, "ONE_BY_ONE: " + "Received only data on " + "one_by_one callback. " + "Test passed!\n")); + } + 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, "ONE_BY_ONE: " + "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: ONE_BY_ONE: " + "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: ONE_BY_ONE: 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, "ONE_BY_ONE: 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_LOBO_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.h new file mode 100644 index 00000000000..c14608c024a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Receiver/LOBO_Test_Receiver_exec.h @@ -0,0 +1,113 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "LOBO_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_LOBO_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, bool> Atomic_Bool; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ListenOneByOneTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ListenOneByOneTest_Listener_exec_i + : public virtual ::LOBO_Test::ListenOneByOneTestConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + ListenOneByOneTest_Listener_exec_i ( + Atomic_ULong &received_one_by_one, + Atomic_ULong &received_many_by_many, + Atomic_ThreadId &thread_id); + virtual ~ListenOneByOneTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const ListenOneByOneTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const ListenOneByOneTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ULong &received_one_by_one_; + Atomic_ULong &received_many_by_many_; + 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 ::LOBO_Test::ListenOneByOneTestConn::CCM_Listener_ptr + get_info_listen_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_listen_connector_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: + ::LOBO_Test::CCM_Receiver_Context_var context_; + + Atomic_ULong received_one_by_one_; + Atomic_ULong received_many_by_many_; + Atomic_ThreadId thread_id_listener_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LOBO_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.idl new file mode 100644 index 00000000000..1dc822487ec --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_LISTEN_ONE_BY_ONE_TEST_SENDER_IDL +#define DDS_LISTEN_ONE_BY_ONE_TEST_SENDER_IDL + +#include "Connector/LOBO_Test_Connector.idl" + +module LOBO_Test +{ + component Sender + { + port ListenOneByOneTestConn::DDS_Write info_write; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.mpc new file mode 100755 index 00000000000..65f91ced2eb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_LOBO_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_LOBO_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_LOBO_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 { + LOBO_Test_Sender.idl + } +} + +project(DDS_LOBO_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_LOBO_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 { + LOBO_Test_SenderE.idl + } +} + +project(DDS_LOBO_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_LOBO_Test_Sender_lem_gen DDS_LOBO_Test_Sender_stub \ + DDS_LOBO_Test_Base_stub + libs += DDS_LOBO_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_SenderEC.cpp + } + + Header_Files { + LOBO_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + LOBO_Test_SenderEC.inl + } +} + +project(DDS_LOBO_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_LOBO_Test_Sender_idl_gen DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_stub + libs += DDS_LOBO_Test_Base_stub DDS_LOBO_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_SenderC.cpp + } + + Header_Files { + LOBO_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + LOBO_Test_SenderC.inl + } +} + +project(DDS_LOBO_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_LOBO_Test_Sender_lem_stub DDS_LOBO_Test_Sender_stub \ + DDS_LOBO_Test_Connector_lem_stub DDS_LOBO_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_LOBO_Test_Base_stub \ + DDS_LOBO_Test_Connector_lem_stub DDS_LOBO_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_Sender_exec.cpp + } + + Header_Files { + LOBO_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_LOBO_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_LOBO_Test_Base_stub DDS_LOBO_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_LOBO_Test_Connector_stub \ + DDS_LOBO_Test_Connector_svnt DDS_LOBO_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_LOBO_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_LOBO_Test_Connector_stub DDS_LOBO_Test_Connector_svnt \ + DDS_LOBO_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + LOBO_Test_SenderS.cpp + LOBO_Test_Sender_svnt.cpp + } + + Header_Files { + LOBO_Test_SenderS.h + LOBO_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + LOBO_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.cpp new file mode 100644 index 00000000000..9a407e84c04 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.cpp @@ -0,0 +1,216 @@ +// -*- C++ -*- +// $Id$ + +#include "LOBO_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_LOBO_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; + } + + //============================================================ + // WriteManyHandler + //============================================================ + WriteManyHandler::WriteManyHandler (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteManyHandler::handle_exception (ACE_HANDLE) + { + 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]; + ListenOneByOneTest *new_key = new ListenOneByOneTest; + 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_ = + ::LOBO_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_LOBO_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.h new file mode 100644 index 00000000000..fc2593a5bda --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/Sender/LOBO_Test_Sender_exec.h @@ -0,0 +1,100 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "LOBO_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_LOBO_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_; + }; + + //============================================================ + // WriteManyHandler + //============================================================ + class WriteManyHandler : + public ACE_Event_Handler + { + public: + WriteManyHandler (Sender_exec_i &callback); + virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE); + 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: + ::LOBO_Test::CCM_Sender_Context_var context_; + ::LOBO_Test::ListenOneByOneTestConn::Writer_var writer_; + + WriteTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, ListenOneByOneTest_var> Writer_Table; + Writer_Table samples_; + + Writer_Table::iterator last_key_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_LOBO_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/descriptors/Plan.cdp new file mode 100644 index 00000000000..be97bb9b3e5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/descriptors/Plan.cdp @@ -0,0 +1,372 @@ +<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>LOBO_Test_Depl_1</label> + <UUID>LOBO_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_LOBO_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_LOBO_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="LOBO_Test_ConnectorComponentImplementation"> + <name>LOBO_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="LOBO_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="LOBO_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_LOBO_Test_LOBO_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_LOBO_Test_LOBO_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LOBO_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LOBO_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_LOBO_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_LOBO_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="LOBO_Test_ConnectorComponentInstance"> + <name>LOBO_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LOBO_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LOBO_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="LOBO_Test_ConnectorComponentInstance2"> + <name>LOBO_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="LOBO_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LOBO_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_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="LOBO_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="LOBO_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="LOBO_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="LOBO_Test_Connector_ExecArtifact"> + <name>LOBO_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_LOBO_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="LOBO_Test_Connector_SvntArtifact"> + <name>LOBO_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_LOBO_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="LOBO_Test_Connector_StubArtifact"> + <name>LOBO_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_LOBO_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/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/descriptors/run_test.pl new file mode 100755 index 00000000000..ddeee753cf7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/ListenOneByOne/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.idl b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.idl new file mode 100644 index 00000000000..5feeb350b2b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.idl @@ -0,0 +1,14 @@ +// $Id$ + +#ifndef NOMODULE_IDL +#define NOMODULE_IDL + +#pragma ndds typesupport "NoModuleSupport.h" + +struct NoModuleType { + string value; //@key +}; + +typedef sequence<NoModuleType> NoModuleTypeSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.mpc b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.mpc new file mode 100644 index 00000000000..30ea2964de5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule.mpc @@ -0,0 +1,24 @@ +// $Id$ + +project (NoModule_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = NoModule_stub + dynamicflags += NOMODULE_COMMON_STUB_BUILD_DLL + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=NOMODULE_COMMON_STUB_Export \ + -Wb,stub_export_include=NoModule_Common_stub_export.h + + IDL_Files { + idlflags += -Gxhst + NoModule.idl + } + + opendds_ts_flags += --export=NOMODULE_COMMON_STUB_Export + + DDSGenerator_Files { + NoModule.idl + } + + Source_Files { + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.idl new file mode 100644 index 00000000000..6bb6aebdd10 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.idl @@ -0,0 +1,17 @@ +// $Id$ + +#ifndef NOMODULE_CONNECTOR_IDL +#define NOMODULE_CONNECTOR_IDL + +#include <Components.idl> +#include "NoModule.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "NoModule_ConnectorE.idl" + +module ::CCM_DDS::Typed < ::NoModuleType, ::NoModuleTypeSeq> NoModuleTypeConn; +connector NoModule_Connector : NoModuleTypeConn::DDS_Event +{ +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.mpc new file mode 100644 index 00000000000..53bae25af9c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NoModule/NoModule_Connector.mpc @@ -0,0 +1,131 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -b dds4ccm_base NoModule_Connector" + +project(NoModule_Connector_idl_gen) : connectoridldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=NOMODULE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=NoModule_Connector_stub_export.h \ + -Wb,skel_export_macro=NOMODULE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=NoModule_Connector_svnt_export.h \ + -Wb,conn_export_macro=NOMODULE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=NoModule_Connector_conn_export.h \ + -Gxhex -Gxhsk -Gxhst + IDL_Files { + NoModule_Connector.idl + } +} + +project(NoModule_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + after += NoModule_Connector_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=NOMODULE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=NoModule_Connector_lem_stub_export.h \ + -SS -Gxhst + + IDL_Files { + NoModule_ConnectorE.idl + } +} + +project(NoModule_Connector_lem_stub) : ccm_svnt, dds4ccm_lem_stub { + after += NoModule_Connector_lem_gen NoModule_Connector_stub + libs += NoModule_Connector_stub + + + sharedname = NoModule_Connector_lem_stub + dynamicflags = NOMODULE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NoModule_ConnectorEC.cpp + } + + Header_Files { + NoModule_ConnectorEC.h + NoModule_Connector_lem_stub_export.h + } + + Inline_Files { + NoModule_ConnectorEC.inl + } +} + +project(NoModule_Connector_stub) : ccm_stub, dds4ccm_base { + after += NoModule_Connector_idl_gen NoModule_stub + libs += NoModule_stub + + + sharedname = NoModule_Connector_stub + dynamicflags = NOMODULE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NoModule_ConnectorC.cpp + } + + Header_Files { + NoModule_ConnectorC.h + NoModule_Connector_stub_export.h + } + + Inline_Files { + NoModule_ConnectorC.inl + } +} + +project(NoModule_Connector_exec) : ciao_executor, dds4ccm_impl, dds4ccm_lem_stub { + after += NoModule_Connector_lem_stub NoModule_Connector_stub + sharedname = NoModule_Connector_exec + libs += NoModule_Connector_stub NoModule_Connector_lem_stub NoModule_stub + + dynamicflags = NOMODULE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NoModule_Connector_conn.cpp + } + + Header_Files { + NoModule_Connector_conn.h + NoModule_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(NoModule_Connector_svnt) : ciao_servant, dds4ccm_impl, dds4ccm_lem_stub { + after += NoModule_Connector_lem_stub + sharedname = NoModule_Connector_svnt + libs += NoModule_Connector_stub NoModule_Connector_lem_stub NoModule_stub + + + dynamicflags = NOMODULE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NoModule_ConnectorS.cpp + NoModule_Connector_svnt.cpp + } + + Header_Files { + NoModule_ConnectorS.h + NoModule_Connector_svnt.h + NoModule_Connector_svnt_export.h + } + + Inline_Files { + NoModule_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.idl new file mode 100644 index 00000000000..ba286782860 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file NonChangeable_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef NONCHANGEABLE_BASE_IDL +#define NONCHANGEABLE_BASE_IDL + +#pragma ndds typesupport "Base/NonChangeable_BaseSupport.h" + +struct NonChangeableTest { + string key; + long iteration; +}; + +typedef sequence<NonChangeableTest> NonChangeableTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.mpc new file mode 100644 index 00000000000..209d9203b92 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Base/NonChangeable_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_NonChangeableBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_NonChangeableBase_stub + dynamicflags += NONCHANGEABLE_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=NONCHANGEABLE_BASE_STUB_Export \ + -Wb,stub_export_include=NonChangeable_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + NonChangeable_Base.idl + } + + opendds_ts_flags += --export=NONCHANGEABLE_BASE_STUB_Export + + DDSGenerator_Files { + NonChangeable_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.idl new file mode 100644 index 00000000000..b6ccf1a0aa2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file NonChangeable_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef NONCHANGEABLE_CONNECTOR_IDL_ +#define NONCHANGEABLE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/NonChangeable_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/NonChangeable_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::NonChangeableTest, ::NonChangeableTestSeq> NonChangeableTest; +}; + +module NonChangeable +{ + connector NonChangeable_Connector : ::CCM_DDS::NonChangeableTest::DDS_Event + { + }; +}; + +#endif /* NonChangeable_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.mpc new file mode 100644 index 00000000000..5d2d62fdf80 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/Connector/NonChangeable_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_NonChangeableBase -l .. -o ../lib -u DDS NonChangeable_Connector" + +project(DDS_NonChangeableConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=NONCHANGEABLE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=NonChangeable_Connector_stub_export.h \ + -Wb,skel_export_macro=NONCHANGEABLE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=NonChangeable_Connector_svnt_export.h \ + -Wb,svnt_export_macro=NONCHANGEABLE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=NonChangeable_Connector_svnt_export.h \ + -Wb,conn_export_macro=NONCHANGEABLE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=NonChangeable_Connector_conn_export.h \ + -I .. + + IDL_Files { + NonChangeable_Connector.idl + } +} + +project(DDS_NonChangeableConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_NonChangeableConnector_idl_gen + idlflags += -Wb,stub_export_macro=NONCHANGEABLE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=NonChangeable_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + NonChangeable_ConnectorE.idl + } +} + +project(DDS_NonChangeableConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_NonChangeableConnector_lem_gen DDS_NonChangeableConnector_stub DDS_NonChangeableBase_stub DDS4CCM_lem_stub + libs += DDS_NonChangeableBase_stub DDS_NonChangeableConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_NonChangeableConnector_lem_stub + dynamicflags = NONCHANGEABLE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NonChangeable_ConnectorEC.cpp + } + + Header_Files { + NonChangeable_ConnectorEC.h + NonChangeable_Connector_lem_stub_export.h + } + + Inline_Files { + NonChangeable_ConnectorEC.inl + } +} + +project(DDS_NonChangeableConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_NonChangeableConnector_idl_gen DDS_NonChangeableBase_stub + libs += DDS_NonChangeableBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_NonChangeableConnector_stub + dynamicflags = NONCHANGEABLE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NonChangeable_ConnectorC.cpp + } + + Header_Files { + NonChangeable_ConnectorC.h + NonChangeable_Connector_stub_export.h + } + + Inline_Files { + NonChangeable_ConnectorC.inl + } +} + +project(DDS_NonChangeableConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_NonChangeableConnector_lem_stub DDS_NonChangeableConnector_stub DDS4CCM_lem_stub DDS_NonChangeableBase_stub + sharedname = DDS_NonChangeableConnector_exec + libs += DDS_NonChangeableConnector_stub DDS_NonChangeableConnector_lem_stub DDS_NonChangeableBase_stub DDS4CCM_lem_stub DDS_NonChangeableBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = NONCHANGEABLE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NonChangeable_Connector_conn.cpp + } + + Header_Files { + NonChangeable_Connector_conn.h + NonChangeable_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_NonChangeableConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_NonChangeableConnector_lem_stub DDS_NonChangeableConnector_exec DDS_NonChangeableConnector_stub DDS4CCM_lem_stub + sharedname = DDS_NonChangeableConnector_svnt + libs += DDS_NonChangeableConnector_stub \ + DDS_NonChangeableConnector_lem_stub \ + DDS_NonChangeableBase_stub \ + DDS_NonChangeableConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = NONCHANGEABLE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NonChangeable_ConnectorS.cpp + NonChangeable_Connector_svnt.cpp + } + + Header_Files { + NonChangeable_ConnectorS.h + NonChangeable_Connector_svnt.h + NonChangeable_Connector_svnt_export.h + } + + Inline_Files { + NonChangeable_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/README b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/README new file mode 100644 index 00000000000..575f11fbb77 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/README @@ -0,0 +1,15 @@ +# $Id$ + +This test tests whether the connection attributes +can be set once the configuration is complete. +This shouldn't be allowed and therefore a +NonChangeable exception must be thrown. + +The following attributes are tested: + * key_fields + * domain_id + * qos_profile + * topic_name + +An error is reported for every attribute where +no NonChangeable exception was catched. diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/descriptors/Plan.cdp new file mode 100644 index 00000000000..9a762f94f81 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/descriptors/Plan.cdp @@ -0,0 +1,98 @@ +<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>NonChangeableAttribute_Depl_1</label> + <UUID>NonChangeableAttribute_Depl_1</UUID> + + + <implementation xmi:id="NonChangeableConnectorComponentImplementation"> + <name>NonChangeableConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="NonChangeableConnector_ExecArtifact" /> + <artifact xmi:idref="NonChangeableConnector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_NonChangeable_NonChangeable_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_NonChangeable_NonChangeable_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>NonChangeableConnector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>NonChangeableConnector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="NonChangeableConnectorComponentInstance"> + <name>NonChangeableConnectorComponent</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="NonChangeableConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>NonChangeable</string> + </value> + </value> + </configProperty> + </instance> + + <artifact xmi:id="NonChangeableConnector_ExecArtifact"> + <name>NonChangeableConnector_exec</name> + <source/> + <node/> + <location>DDS_NonChangeableConnector_exec</location> + </artifact> + <artifact xmi:id="NonChangeableConnector_SvntArtifact"> + <name>NonChangeableConnector_svnt</name> + <source/> + <node/> + <location>DDS_NonChangeableConnector_svnt</location> + </artifact> + <artifact xmi:id="NonChangeableConnector_StubArtifact"> + <name>NonChangeableConnector_stub</name> + <source/> + <node/> + <location>DDS_NonChangeableConnector_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/descriptors/run_test.pl new file mode 100755 index 00000000000..b51ae16243d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/NonChangeableAttribute/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 = 1; +@ports = ( 60001); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode"); + +# 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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 5 seconds to allow task to complete\n"; +sleep (5); + +# 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/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.idl new file mode 100644 index 00000000000..b3a78e5f357 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.idl @@ -0,0 +1,33 @@ +// $Id$ + +/** + * @file OIT_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef ON_INCONSISTENT_TOPIC_TEST_BASE_IDL +#define ON_INCONSISTENT_TOPIC_TEST_BASE_IDL + +#pragma ndds typesupport "Base/OIT_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "OIT_Receiver_Topic" +#pragma DCPS_DATA_KEY "OIT_Receiver_Topic symbol" + +struct OIT_Receiver_Topic { + string symbol; //@key + long x; + long y; +}; + +typedef sequence<OIT_Receiver_Topic> OIT_Receiver_TopicSeq; + +struct OIT_Sender_Topic { + string symbol; //@key + long x; + long y; + long z; +}; + +typedef sequence<OIT_Sender_Topic> OIT_Sender_TopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.mpc new file mode 100644 index 00000000000..95ff3562b7a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Base/OIT_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (OIT_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = OIT_Test_Base_stub + dynamicflags += ON_INCONSISTENT_TOPIC_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=ON_INCONSISTENT_TOPIC_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=OIT_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + OIT_Test_Base.idl + } + + opendds_ts_flags += --export=ON_INCONSISTENT_TOPIC_TEST_BASE_STUB_Export + + DDSGenerator_Files { + OIT_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.idl new file mode 100644 index 00000000000..55fb3090c3e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "ReceiverConnector/OIT_Receiver_Connector.idl" + +module OIT_Test +{ + component Receiver + { + port OIT_Receiver_TopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.mpc new file mode 100644 index 00000000000..1f0a6fbd85f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(OIT_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += OIT_Receiver_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 { + OIT_Test_Receiver.idl + } +} + +project(OIT_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += OIT_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 { + OIT_Test_ReceiverE.idl + } +} + +project(OIT_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += OIT_Test_Receiver_lem_gen OIT_Test_Receiver_stub \ + OIT_Receiver_Connector_stub OIT_Test_Base_stub + libs += Receiver_stub OIT_Receiver_Connector_stub \ + OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_ReceiverEC.cpp + } + + Header_Files { + OIT_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + OIT_Test_ReceiverEC.inl + } +} + +project(OIT_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += OIT_Test_Receiver_idl_gen OIT_Receiver_Connector_stub \ + OIT_Test_Base_stub OIT_Receiver_Connector_lem_gen + libs += OIT_Receiver_Connector_stub OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_ReceiverC.cpp + } + + Header_Files { + OIT_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + OIT_Test_ReceiverC.inl + } +} + +project(OIT_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += OIT_Test_Receiver_lem_stub OIT_Test_Receiver_stub \ + OIT_Test_Base_stub OIT_Receiver_Connector_stub \ + OIT_Receiver_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub OIT_Test_Base_stub \ + OIT_Receiver_Connector_stub OIT_Receiver_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_Receiver_exec.cpp + } + + Header_Files { + OIT_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(OIT_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += OIT_Test_Receiver_lem_stub OIT_Test_Base_stub \ + OIT_Receiver_Connector_stub OIT_Receiver_Connector_svnt \ + OIT_Test_Receiver_exec OIT_Receiver_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub OIT_Test_Base_stub \ + OIT_Receiver_Connector_stub OIT_Receiver_Connector_svnt \ + Receiver_exec OIT_Receiver_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_ReceiverS.cpp + OIT_Test_Receiver_svnt.cpp + } + + Header_Files { + OIT_Test_ReceiverS.h + OIT_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + OIT_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..7be8ea7758a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.cpp @@ -0,0 +1,199 @@ +// -*- C++ -*- +// +// $Id$ + +#include "OIT_Test_Receiver_exec.h" + +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_OIT_Test_Receiver_Impl +{ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &inconsistent, + Atomic_ThreadId &thread_id) + : inconsistent_ (inconsistent), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /* the_topic */, + const DDS::InconsistentTopicStatus & /* status */) + { + this->thread_id_ = ACE_Thread::self (); + this->inconsistent_ = true; + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : inconsistent_ (false) , + thread_id_listener_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->inconsistent_, + this->thread_id_listener_); + } + + ::OIT_Test::OIT_Receiver_TopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return ::OIT_Test::OIT_Receiver_TopicConn::CCM_Listener::_nil (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::OIT_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) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->inconsistent_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_inconsistent_topic'\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Received the expected ") + ACE_TEXT ("'on_inconsistent_topic'\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " + "Thread ID for ConnectorStatusListener 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, "RECEIVER OK: " + "Thread switch for ConnectorStatusListener 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, "RECEIVER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "RECEIVER ERROR: ConnectorStatusListener: " + "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, "RECEIVER OK: ConnectorStatusListener: " + "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_OIT_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.h new file mode 100644 index 00000000000..0e735864a08 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Receiver/OIT_Test_Receiver_exec.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "OIT_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_OIT_Test_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &inconsistent_; + 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); + + // Supported operations and attributes. + // Component attributes. + + // Port operations. + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); + + virtual ::OIT_Test::OIT_Receiver_TopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::OIT_Test::CCM_Receiver_Context_var context_; + + Atomic_Boolean inconsistent_; + Atomic_ThreadId thread_id_listener_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_OIT_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.idl new file mode 100644 index 00000000000..24fc8e7905e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file OIT_Receiver_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef ON_INCONSISTENT_TOPIC_TEST_RECEIVER_CONNECTOR_IDL_ +#define ON_INCONSISTENT_TOPIC_TEST_RECEIVER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/OIT_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "ReceiverConnector/OIT_Receiver_ConnectorE.idl" + +module OIT_Test +{ + module ::CCM_DDS::Typed < ::OIT_Receiver_Topic, ::OIT_Receiver_TopicSeq> OIT_Receiver_TopicConn; + connector OIT_Receiver_Connector : OIT_Receiver_TopicConn::DDS_Event + { + }; +}; + +#endif /* ON_INCONSISTENT_TOPIC_TEST_RECEIVER_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.mpc new file mode 100644 index 00000000000..2a285c3c87f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/ReceiverConnector/OIT_Receiver_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p OIT_Test_Base -l .. -o ../lib -u DDS OIT_Receiver_Connector" + +project(OIT_Receiver_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=OIT_Receiver_Connector_stub_export.h \ + -Wb,skel_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=OIT_Receiver_Connector_svnt_export.h \ + -Wb,svnt_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=OIT_Receiver_Connector_svnt_export.h \ + -Wb,conn_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=OIT_Receiver_Connector_conn_export.h \ + -I .. + + IDL_Files { + OIT_Receiver_Connector.idl + } +} + +project(OIT_Receiver_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += OIT_Receiver_Connector_idl_gen + idlflags += -Wb,stub_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=OIT_Receiver_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + OIT_Receiver_ConnectorE.idl + } +} + +project(OIT_Receiver_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += OIT_Receiver_Connector_lem_gen OIT_Receiver_Connector_stub OIT_Test_Base_stub DDS4CCM_lem_stub + libs += OIT_Test_Base_stub OIT_Receiver_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = OIT_Receiver_Connector_lem_stub + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Receiver_ConnectorEC.cpp + } + + Header_Files { + OIT_Receiver_ConnectorEC.h + OIT_Receiver_Connector_lem_stub_export.h + } + + Inline_Files { + OIT_Receiver_ConnectorEC.inl + } +} + +project(OIT_Receiver_Connector_stub) : ccm_stub, dds4ccm_base { + after += OIT_Receiver_Connector_idl_gen OIT_Test_Base_stub + libs += OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = OIT_Receiver_Connector_stub + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Receiver_ConnectorC.cpp + } + + Header_Files { + OIT_Receiver_ConnectorC.h + OIT_Receiver_Connector_stub_export.h + } + + Inline_Files { + OIT_Receiver_ConnectorC.inl + } +} + +project(OIT_Receiver_Connector_exec) : ciao_executor, dds4ccm_impl { + after += OIT_Receiver_Connector_lem_stub OIT_Receiver_Connector_stub DDS4CCM_lem_stub OIT_Test_Base_stub + sharedname = OIT_Receiver_Connector_exec + libs += OIT_Receiver_Connector_stub OIT_Receiver_Connector_lem_stub OIT_Test_Base_stub DDS4CCM_lem_stub OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Receiver_Connector_conn.cpp + } + + Header_Files { + OIT_Receiver_Connector_conn.h + OIT_Receiver_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(OIT_Receiver_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += OIT_Receiver_Connector_lem_stub OIT_Receiver_Connector_exec OIT_Receiver_Connector_stub DDS4CCM_lem_stub + sharedname = OIT_Receiver_Connector_svnt + libs += OIT_Receiver_Connector_stub \ + OIT_Receiver_Connector_lem_stub \ + OIT_Test_Base_stub \ + OIT_Receiver_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Receiver_ConnectorS.cpp + OIT_Receiver_Connector_svnt.cpp + } + + Header_Files { + OIT_Receiver_ConnectorS.h + OIT_Receiver_Connector_svnt.h + OIT_Receiver_Connector_svnt_export.h + } + + Inline_Files { + OIT_Receiver_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.idl new file mode 100644 index 00000000000..c8b3ff6b86d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef ON_INCONSISTENT_TOPIC_TEST_SENDER_IDL +#define ON_INCONSISTENT_TOPIC_TEST_SENDER_IDL + +#include "SenderConnector/OIT_Sender_Connector.idl" + +module OIT_Test +{ + component Sender + { + port OIT_Sender_TopicConn::DDS_Write topic_write; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.mpc new file mode 100644 index 00000000000..40e7edbc497 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p OIT_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(OIT_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += OIT_Sender_Connector_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 { + OIT_Test_Sender.idl + } +} + +project(OIT_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += OIT_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 { + OIT_Test_SenderE.idl + } +} + +project(OIT_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += OIT_Test_Sender_lem_gen OIT_Test_Sender_stub \ + OIT_Test_Base_stub + libs += OIT_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_SenderEC.cpp + } + + Header_Files { + OIT_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + OIT_Test_SenderEC.inl + } +} + +project(OIT_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += OIT_Test_Sender_idl_gen OIT_Test_Base_stub \ + OIT_Sender_Connector_stub + libs += OIT_Test_Base_stub OIT_Sender_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_SenderC.cpp + } + + Header_Files { + OIT_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + OIT_Test_SenderC.inl + } +} + +project(OIT_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += OIT_Test_Sender_lem_stub OIT_Test_Sender_stub \ + OIT_Sender_Connector_lem_stub OIT_Sender_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub OIT_Test_Base_stub \ + OIT_Sender_Connector_lem_stub OIT_Sender_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_Sender_exec.cpp + } + + Header_Files { + OIT_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(OIT_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += OIT_Test_Base_stub OIT_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel OIT_Sender_Connector_stub \ + OIT_Sender_Connector_svnt OIT_Sender_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub OIT_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel OIT_Sender_Connector_stub OIT_Sender_Connector_svnt \ + OIT_Sender_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Test_SenderS.cpp + OIT_Test_Sender_svnt.cpp + } + + Header_Files { + OIT_Test_SenderS.h + OIT_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + OIT_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.cpp new file mode 100644 index 00000000000..bd4cecda90f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.cpp @@ -0,0 +1,185 @@ +// -*- C++ -*- +// $Id$ + +#include "OIT_Test_Sender_exec.h" + +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_OIT_Test_Sender_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &inconsistent, + Atomic_ThreadId &thread_id) + : inconsistent_ (inconsistent), + thread_id_ (thread_id) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + this->thread_id_ = ACE_Thread::self (); + this->inconsistent_ = true; + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : inconsistent_ (false), + thread_id_listener_ (0) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->inconsistent_, + this->thread_id_listener_); + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::OIT_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) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (this->inconsistent_.value ()) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SENDER OK: Received the expected ") + ACE_TEXT ("'on_inconsistent_topic'\n") + )); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("SENDER ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_inconsistent_topic'\n") + )); + } + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "SENDER ERROR: " + "Thread ID for ConnectorStatusListener 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, "SENDER OK: " + "Thread switch for ConnectorStatusListener 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, "SENDER ERROR: " + "Thread switch for ConnectorStatusListener " + "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, "SENDER ERROR: ConnectorStatusListener: " + "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, "SENDER OK: ConnectorStatusListener: " + "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" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_OIT_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.h new file mode 100644 index 00000000000..d0e6de9c2b5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/Sender/OIT_Test_Sender_exec.h @@ -0,0 +1,91 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "OIT_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_OIT_Test_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &inconsistent_; + Atomic_ThreadId &thread_id_; + }; + + //============================================================ + // 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 void set_session_context (::Components::SessionContext_ptr ctx); + + virtual CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + private: + ::OIT_Test::CCM_Sender_Context_var context_; + + Atomic_Boolean inconsistent_; + Atomic_ThreadId thread_id_listener_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_OIT_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.idl new file mode 100644 index 00000000000..76ea4612f67 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file OIT_Sender_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef ON_INCONSISTENT_TOPIC_TEST_SENDER_CONNECTOR_IDL_ +#define ON_INCONSISTENT_TOPIC_TEST_SENDER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/OIT_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "SenderConnector/OIT_Sender_ConnectorE.idl" + +module OIT_Test +{ + module ::CCM_DDS::Typed < ::OIT_Sender_Topic, ::OIT_Sender_TopicSeq> OIT_Sender_TopicConn; + connector OIT_Sender_Connector : OIT_Sender_TopicConn::DDS_Event + { + }; +}; + +#endif /* ON_INCONSISTENT_TOPIC_TEST_SENDER_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.mpc new file mode 100644 index 00000000000..6c7558c21d5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/SenderConnector/OIT_Sender_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p OIT_Test_Base -l .. -o ../lib -u DDS OIT_Sender_Connector" + +project(OIT_Sender_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=OIT_Sender_Connector_stub_export.h \ + -Wb,skel_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=OIT_Sender_Connector_svnt_export.h \ + -Wb,svnt_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=OIT_Sender_Connector_svnt_export.h \ + -Wb,conn_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=OIT_Sender_Connector_conn_export.h \ + -I .. + + IDL_Files { + OIT_Sender_Connector.idl + } +} + +project(OIT_Sender_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += OIT_Sender_Connector_idl_gen + idlflags += -Wb,stub_export_macro=ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=OIT_Sender_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + OIT_Sender_ConnectorE.idl + } +} + +project(OIT_Sender_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += OIT_Sender_Connector_lem_gen OIT_Sender_Connector_stub OIT_Test_Base_stub DDS4CCM_lem_stub + libs += OIT_Test_Base_stub OIT_Sender_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = OIT_Sender_Connector_lem_stub + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Sender_ConnectorEC.cpp + } + + Header_Files { + OIT_Sender_ConnectorEC.h + OIT_Sender_Connector_lem_stub_export.h + } + + Inline_Files { + OIT_Sender_ConnectorEC.inl + } +} + +project(OIT_Sender_Connector_stub) : ccm_stub, dds4ccm_base { + after += OIT_Sender_Connector_idl_gen OIT_Test_Base_stub + libs += OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = OIT_Sender_Connector_stub + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Sender_ConnectorC.cpp + } + + Header_Files { + OIT_Sender_ConnectorC.h + OIT_Sender_Connector_stub_export.h + } + + Inline_Files { + OIT_Sender_ConnectorC.inl + } +} + +project(OIT_Sender_Connector_exec) : ciao_executor, dds4ccm_impl { + after += OIT_Sender_Connector_lem_stub OIT_Sender_Connector_stub DDS4CCM_lem_stub OIT_Test_Base_stub + sharedname = OIT_Sender_Connector_exec + libs += OIT_Sender_Connector_stub OIT_Sender_Connector_lem_stub OIT_Test_Base_stub DDS4CCM_lem_stub OIT_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Sender_Connector_conn.cpp + } + + Header_Files { + OIT_Sender_Connector_conn.h + OIT_Sender_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(OIT_Sender_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += OIT_Sender_Connector_lem_stub OIT_Sender_Connector_exec OIT_Sender_Connector_stub DDS4CCM_lem_stub + sharedname = OIT_Sender_Connector_svnt + libs += OIT_Sender_Connector_stub \ + OIT_Sender_Connector_lem_stub \ + OIT_Test_Base_stub \ + OIT_Sender_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = ON_INCONSISTENT_TOPIC_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + OIT_Sender_ConnectorS.cpp + OIT_Sender_Connector_svnt.cpp + } + + Header_Files { + OIT_Sender_ConnectorS.h + OIT_Sender_Connector_svnt.h + OIT_Sender_Connector_svnt_export.h + } + + Inline_Files { + OIT_Sender_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/Plan.cdp new file mode 100644 index 00000000000..6b57d240187 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/Plan.cdp @@ -0,0 +1,402 @@ +<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>On_Inconsistent_Topic_Depl</label> + <UUID>On_Inconsistent_Topic_Depl</UUID> + + <implementation xmi:id="ReceiverImplementation"> + <name>ReceiverImplementation</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_OIT_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_OIT_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="Sender_ConnectorImplementation"> + <name>Sender_ConnectorImplementation</name> + <source/> + <artifact xmi:idref="Sender_Connector_ExecArtifact" /> + <artifact xmi:idref="Sender_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_OIT_Test_OIT_Sender_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_OIT_Test_OIT_Sender_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Receiver_ConnectorImplementation"> + <name>Receiver_ConnectorImplementation</name> + <source/> + <artifact xmi:idref="Receiver_Connector_ExecArtifact" /> + <artifact xmi:idref="Receiver_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_OIT_Test_OIT_Receiver_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_OIT_Test_OIT_Receiver_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SenderImplementation"> + <name>SenderImplementation</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_OIT_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_OIT_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="ReceiverInstance"> + <name>ReceiverComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ReceiverImplementation" /> + </instance> + + <instance xmi:id="Receiver_ConnectorInstance"> + <name>Receiver_ConnectorComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Receiver_ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestOIT</string> + </value> + </value> + </configProperty> + </instance> + + + <instance xmi:id="SenderInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderImplementation" /> + </instance> + + <instance xmi:id="Sender_ConnectorInstance"> + <name>Sender_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Sender_ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestOIT</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_out_reader</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Receiver_ConnectorInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Receiver_ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>topic_write_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>topic_write_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Sender_ConnectorInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>test_sec_topic_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Sender_ConnectorInstance" /> + </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_Connector_ExecArtifact"> + <name>Sender_Connector_exec</name> + <source/> + <node/> + <location>OIT_Sender_Connector_exec</location> + </artifact> + <artifact xmi:id="Sender_Connector_SvntArtifact"> + <name>Sender_Connector_svnt</name> + <source/> + <node/> + <location>OIT_Sender_Connector_svnt</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_Connector_ExecArtifact"> + <name>Receiver_Connector_exec</name> + <source/> + <node/> + <location>OIT_Receiver_Connector_exec</location> + </artifact> + <artifact xmi:id="Receiver_Connector_SvntArtifact"> + <name>Receiver_Connector_svnt</name> + <source/> + <node/> + <location>OIT_Receiver_Connector_svnt</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/run_test.pl new file mode 100755 index 00000000000..9734de1093a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/On_Inconsistent_Topic/descriptors/run_test.pl @@ -0,0 +1,238 @@ +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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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"); +$E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.idl new file mode 100644 index 00000000000..ca16d20201b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file PSL_DeadlineTest_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef PSL_DEADLINETEST_BASE_IDL +#define PSL_DEADLINETEST_BASE_IDL + +#pragma ndds typesupport "Base/PSL_DeadlineTest_BaseSupport.h" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.mpc new file mode 100644 index 00000000000..ea3bdebc233 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Base/PSL_DeadlineTest_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_PSL_DeadlineTest_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_PSL_DeadlineTest_Base_stub + dynamicflags += PSL_DEADLINETEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=PSL_DEADLINETEST_BASE_STUB_Export \ + -Wb,stub_export_include=PSL_DeadlineTest_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + PSL_DeadlineTest_Base.idl + } + + opendds_ts_flags += --export=PSL_DEADLINETEST_BASE_STUB_Export + + DDSGenerator_Files { + PSL_DeadlineTest_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.idl new file mode 100644 index 00000000000..6a9625ca2e3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file PSL_DeadlineTest_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef PSL_DeadlineTest_CONNECTOR_IDL_ +#define PSL_DeadlineTest_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/PSL_DeadlineTest_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/PSL_DeadlineTest_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module PSL_DeadlineTest +{ + connector PSL_DeadlineTest_Connector : ::CCM_DDS::TestTopic::DDS_Event + { + }; +}; + +#endif /* PSL_DeadlineTest_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.mpc new file mode 100644 index 00000000000..c9c99037a5c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Connector/PSL_DeadlineTest_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_PSL_DeadlineTest_Base -l .. -o ../lib -u DDS PSL_DeadlineTest_Connector" + +project(DDS_PSL_DT_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=PSL_DEADLINETEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=PSL_DeadlineTest_Connector_stub_export.h \ + -Wb,skel_export_macro=PSL_DEADLINETEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=PSL_DeadlineTest_Connector_svnt_export.h \ + -Wb,svnt_export_macro=PSL_DEADLINETEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=PSL_DeadlineTest_Connector_svnt_export.h \ + -Wb,conn_export_macro=PSL_DEADLINETEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=PSL_DeadlineTest_Connector_conn_export.h \ + -I .. + + IDL_Files { + PSL_DeadlineTest_Connector.idl + } +} + +project(DDS_PSL_DT_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_PSL_DT_Connector_idl_gen + idlflags += -Wb,stub_export_macro=PSL_DEADLINETEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=PSL_DeadlineTest_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + PSL_DeadlineTest_ConnectorE.idl + } +} + +project(DDS_PSL_DT_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_DT_Connector_lem_gen DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Base_stub DDS4CCM_lem_stub + libs += DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_PSL_DT_Connector_lem_stub + dynamicflags = PSL_DEADLINETEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ConnectorEC.cpp + } + + Header_Files { + PSL_DeadlineTest_ConnectorEC.h + PSL_DeadlineTest_Connector_lem_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_ConnectorEC.inl + } +} + +project(DDS_PSL_DeadlineTest_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_DT_Connector_idl_gen DDS_PSL_DeadlineTest_Base_stub + libs += DDS_PSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_PSL_DeadlineTest_Connector_stub + dynamicflags = PSL_DEADLINETEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ConnectorC.cpp + } + + Header_Files { + PSL_DeadlineTest_ConnectorC.h + PSL_DeadlineTest_Connector_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_ConnectorC.inl + } +} + +project(DDS_PSL_DeadlineTest_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_PSL_DT_Connector_lem_stub DDS_PSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub DDS_PSL_DeadlineTest_Base_stub + sharedname = DDS_PSL_DeadlineTest_Connector_exec + libs += DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DT_Connector_lem_stub DDS_PSL_DeadlineTest_Base_stub DDS4CCM_lem_stub DDS_PSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PSL_DEADLINETEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_Connector_conn.cpp + } + + Header_Files { + PSL_DeadlineTest_Connector_conn.h + PSL_DeadlineTest_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_DeadlineTest_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_PSL_DT_Connector_lem_stub DDS_PSL_DeadlineTest_Connector_exec DDS_PSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_PSL_DeadlineTest_Connector_svnt + libs += DDS_PSL_DeadlineTest_Connector_stub \ + DDS_PSL_DT_Connector_lem_stub \ + DDS_PSL_DeadlineTest_Base_stub \ + DDS_PSL_DeadlineTest_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PSL_DEADLINETEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ConnectorS.cpp + PSL_DeadlineTest_Connector_svnt.cpp + } + + Header_Files { + PSL_DeadlineTest_ConnectorS.h + PSL_DeadlineTest_Connector_svnt.h + PSL_DeadlineTest_Connector_svnt_export.h + } + + Inline_Files { + PSL_DeadlineTest_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.idl new file mode 100644 index 00000000000..c849128c8e5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/PSL_DeadlineTest_Connector.idl" + +module PSL_DeadlineTest +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_Get info_get; + port CCM_DDS::TestTopic::DDS_Listen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.mpc new file mode 100644 index 00000000000..d29641cbb5b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_PSL_DeadlineTest_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_PSL_DT_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 { + PSL_DeadlineTest_Receiver.idl + } +} + +project(DDS_PSL_DeadlineTest_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_PSL_DeadlineTest_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 { + PSL_DeadlineTest_ReceiverE.idl + } +} + +project(DDS_PSL_DT_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Receiver_lem_gen DDS_PSL_DeadlineTest_Receiver_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Base_stub + libs += Receiver_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ReceiverEC.cpp + } + + Header_Files { + PSL_DeadlineTest_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_ReceiverEC.inl + } +} + +project(DDS_PSL_DeadlineTest_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Receiver_idl_gen DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DT_Connector_lem_gen + libs += DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ReceiverC.cpp + } + + Header_Files { + PSL_DeadlineTest_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_ReceiverC.inl + } +} + +project(DDS_PSL_DeadlineTest_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_PSL_DT_Receiver_lem_stub DDS_PSL_DeadlineTest_Receiver_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DT_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DT_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_Receiver_exec.cpp + } + + Header_Files { + PSL_DeadlineTest_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_DeadlineTest_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_PSL_DT_Receiver_lem_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Connector_svnt DDS_PSL_DeadlineTest_Receiver_exec DDS_PSL_DT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Connector_svnt Receiver_exec DDS_PSL_DT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_ReceiverS.cpp + PSL_DeadlineTest_Receiver_svnt.cpp + } + + Header_Files { + PSL_DeadlineTest_ReceiverS.h + PSL_DeadlineTest_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + PSL_DeadlineTest_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.cpp new file mode 100644 index 00000000000..3c627a906f8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.cpp @@ -0,0 +1,388 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for PORTSTUSLISTENER in DDS_LISTEN and DDS_Get port: on_requested_deadline_missed. +// Writer writes every sec, Reader starts reading after 2 sec and try to read every 1,1 sec, but has a minimum seperation time of 1.5 sec (QoS) +// and a deadline of 2 sec (QoS), so periodically the deadline will be missed. + +#include "PSL_DeadlineTest_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_PSL_DeadlineTest_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + try + { + this->pulse_callback_.read_all(); + } + catch (...) + { + // @todo + } + return 0; + } + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + TestTopic_RawListener_exec_i::TestTopic_RawListener_exec_i (void) + { + } + + TestTopic_RawListener_exec_i::~TestTopic_RawListener_exec_i (void) + { + } + + void + TestTopic_RawListener_exec_i::on_one_data ( + const TestTopic & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestTopic_RawListener: ") + ACE_TEXT ("received test_topic_info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.x)); + } + + void + TestTopic_RawListener_exec_i::on_many_data ( + const TestTopicSeq & /*an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + //============================================================ + // PortStatusListener_exec_i + //============================================================ + PortStatusListener_exec_i::PortStatusListener_exec_i (Atomic_Boolean &deadline_port_1, + Atomic_Boolean &deadline_port_2, + Atomic_ThreadId &thread_id_1, + Atomic_ThreadId &thread_id_2, + int port_nr) + : deadline_port_1_ (deadline_port_1), + deadline_port_2_ (deadline_port_2), + thread_id_1_ (thread_id_1), + thread_id_2_ (thread_id_2), + port_nr_ (port_nr) + { + } + + PortStatusListener_exec_i::~PortStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::PortStatusListener + void + PortStatusListener_exec_i::on_requested_deadline_missed ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::RequestedDeadlineMissedStatus & status) + { + if (this->port_nr_ == 1 && ! ::CORBA::is_nil( the_reader) && status.total_count!= 0) + { + this->deadline_port_1_ = true; + this->thread_id_1_ = ACE_Thread::self (); + } + if (this->port_nr_ == 2 && ! ::CORBA::is_nil (the_reader) && status.total_count!= 0) + { + this->deadline_port_2_ = true; + this->thread_id_2_ = ACE_Thread::self (); + } + } + + void + PortStatusListener_exec_i::on_sample_lost ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::SampleLostStatus & /* status */) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (10), + deadline_port_1_ (false), + deadline_port_2_ (false), + thread_id_listener_1_ (0), + thread_id_listener_2_ (0) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + TestTopicSeq_var TestTopic_infos; + ::CCM_DDS::ReadInfoSeq_var readinfoseq; + try + { + this->reader_->read_all(TestTopic_infos.out(), readinfoseq.out()); + for(CORBA::ULong i = 0; i < readinfoseq->length(); ++i) + { + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for(CORBA::ULong i = 0; i < TestTopic_infos->length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + TestTopic_infos[i].key.in (), + TestTopic_infos[i].x)); + } + } + catch( const CCM_DDS::InternalError& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("internal error or no data\n"))); + } + } + + // Port operations. + ::CCM_DDS::TestTopic::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return new TestTopic_RawListener_exec_i (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); + return new PortStatusListener_exec_i (this->deadline_port_1_, + this->deadline_port_2_, + this->thread_id_listener_1_, + this->thread_id_listener_2_, + 1); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_get_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); + return new PortStatusListener_exec_i (this->deadline_port_1_, + this->deadline_port_2_, + this->thread_id_listener_1_, + this->thread_id_listener_2_, + 2); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::PSL_DeadlineTest::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_out_data(); + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::NOT_ENABLED); + + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(2, usec), + ACE_Time_Value(1, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->deadline_port_1_.value ()) + { + + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT (" error 'on_requested_deadline_missed' on PortStatusListener I in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Have received the expected ") + ACE_TEXT ("'on_requested_deadline_missed' in PortStatusListener I in Receiver\n") + )); + } + if (!this->deadline_port_2_.value ()) + { + + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT (" error 'on_requested_deadline_missed' on PortStatusListener II in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Have received the expected ") + ACE_TEXT ("'on_requested_deadline_missed' in PortStatusListener II in Receiver\n") + )); + } + //check thread switch for listener 1 + if (this->thread_id_listener_1_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for PortStatusListener I not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_1_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "OK : " + "Thread switch for PortStatusListener I seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread switch for PortStatusListener I " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_1_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: PortStatusListener I: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "OK : PortStatusListener I: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + #endif + + //check thread switch for listener 2 + if (this->thread_id_listener_2_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for PortStatusListener II not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_2_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "OK : " + "Thread switch for PortStatusListener II seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread switch for PortStatusListener II " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_2_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: PortStatusListener II: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "OK : PortStatusListener II: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_DeadlineTest_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.h new file mode 100644 index 00000000000..bbb5bff1010 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.h @@ -0,0 +1,150 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "PSL_DeadlineTest_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" + +namespace CIAO_PSL_DeadlineTest_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export TestTopic_RawListener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + TestTopic_RawListener_exec_i (void); + virtual ~TestTopic_RawListener_exec_i (void); + + virtual void + on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info); + + virtual void + on_many_data ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & info ); + }; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + private: + Receiver_exec_i &pulse_callback_; + + }; + + //============================================================ + // PortStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export PortStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_PortStatusListener, + public virtual ::CORBA::LocalObject + { + public: + PortStatusListener_exec_i (Atomic_Boolean &, + Atomic_Boolean &, + Atomic_ThreadId &, + Atomic_ThreadId &, + int ); + virtual ~PortStatusListener_exec_i (void); + + virtual void + on_requested_deadline_missed ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::RequestedDeadlineMissedStatus & status); + + virtual void + on_sample_lost ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::SampleLostStatus & status); + + private: + Atomic_Boolean &deadline_port_1_; + Atomic_Boolean &deadline_port_2_; + Atomic_ThreadId &thread_id_1_; + Atomic_ThreadId &thread_id_2_; + int port_nr_; + }; + + //============================================================ + // 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_get_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + void read_all(void); + + private: + ::PSL_DeadlineTest::CCM_Receiver_Context_var context_; + ::CCM_DDS::TestTopic::Reader_var reader_; + read_action_Generator * ticker_; + CORBA::ULong rate_; + + Atomic_Boolean deadline_port_1_; + Atomic_Boolean deadline_port_2_; + Atomic_ThreadId thread_id_listener_1_; + Atomic_ThreadId thread_id_listener_2_; +}; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_DeadlineTest_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.idl new file mode 100644 index 00000000000..5479b290315 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_PSL_DEADLINETEST_SENDER_IDL +#define DDS_PSL_DEADLINETEST_SENDER_IDL + +#include "Connector/PSL_DeadlineTest_Connector.idl" + +module PSL_DeadlineTest +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Write test_topic_write; + provides CCM_DDS::ConnectorStatusListener test_topic_connector_status; + + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.mpc new file mode 100644 index 00000000000..39b3145ac3e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_PSL_DeadlineTest_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_PSL_DeadlineTest_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_PSL_DT_Connector_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 { + PSL_DeadlineTest_Sender.idl + } +} + +project(DDS_PSL_DeadlineTest_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_PSL_DeadlineTest_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 { + PSL_DeadlineTest_SenderE.idl + } +} + +project(DDS_PSL_DeadlineTest_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Sender_lem_gen DDS_PSL_DeadlineTest_Sender_stub DDS_PSL_DeadlineTest_Base_stub + libs += DDS_PSL_DeadlineTest_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_SenderEC.cpp + } + + Header_Files { + PSL_DeadlineTest_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_SenderEC.inl + } +} + +project(DDS_PSL_DeadlineTest_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Sender_idl_gen DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub + libs += DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_SenderC.cpp + } + + Header_Files { + PSL_DeadlineTest_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + PSL_DeadlineTest_SenderC.inl + } +} + +project(DDS_PSL_DeadlineTest_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Sender_lem_stub DDS_PSL_DeadlineTest_Sender_stub DDS_PSL_DT_Connector_lem_stub DDS_PSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DT_Connector_lem_stub DDS_PSL_DeadlineTest_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_Sender_exec.cpp + } + + Header_Files { + PSL_DeadlineTest_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_DeadlineTest_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_PSL_DeadlineTest_Base_stub DDS_PSL_DeadlineTest_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Connector_svnt DDS_PSL_DT_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_PSL_DeadlineTest_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_PSL_DeadlineTest_Connector_stub DDS_PSL_DeadlineTest_Connector_svnt DDS_PSL_DT_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_DeadlineTest_SenderS.cpp + PSL_DeadlineTest_Sender_svnt.cpp + } + + Header_Files { + PSL_DeadlineTest_SenderS.h + PSL_DeadlineTest_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + PSL_DeadlineTest_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.cpp new file mode 100644 index 00000000000..e3528d016b5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.cpp @@ -0,0 +1,203 @@ +// -*- C++ -*- +// $Id$ + + +// Test for PORTSTUSLISTENER Subscriber on_requested_deadline_missed : +// Writer writes every sec 2 instances. + +#include "PSL_DeadlineTest_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_PSL_DeadlineTest_Sender_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i () + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + } + + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_test_topic_connector_status (void) + { + return new ConnectorStatusListener_exec_i (); + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::PSL_DeadlineTest::CCM_Sender_Context::_narrow (ctx); + + if (::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_test_topic_write_data (); + } + + void + Sender_exec_i::tick () + { + for (PSL_DLTest_Table::iterator i = this->_ktests_.begin (); + i != this->_ktests_.end (); + ++i) + { + try + { + if (! ::CORBA::is_nil (this->writer_)) + { + this->writer_->write_one(i->second,::DDS::HANDLE_NIL); + i->second->x++; + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while creating topic for <%C>.\n"), + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::start (void) + { + long sec = 1L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::add_instance_of_topic (const char * key, int x) + { + TestTopic *new_key = new TestTopic; + new_key->key = CORBA::string_dup(key); + new_key->x = x; + this->_ktests_[key] = new_key; + } + + void + Sender_exec_i::ccm_activate (void) + { + //add 2 different instances of topic + this->add_instance_of_topic ("ONE",1); + this->add_instance_of_topic ("TWO",2); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_DeadlineTest_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.h new file mode 100644 index 00000000000..2738bafb8a6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/Sender/PSL_DeadlineTest_Sender_exec.h @@ -0,0 +1,117 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "PSL_DeadlineTest_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_PSL_DeadlineTest_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + //============================================================ + // pulse_Generator + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_callback_; + }; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (void); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + }; + + //============================================================ + // 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); + + void tick (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); + + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_test_topic_connector_status(void); + + private: + void start (void); + void stop (void); + + pulse_Generator * ticker_; + ::PSL_DeadlineTest::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Writer_var writer_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, TestTopic_var> PSL_DLTest_Table; + PSL_DLTest_Table _ktests_; + + void add_instance_of_topic (const char *, int x ); + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_DeadlineTest_Sender_Impl (void); + + + +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/Plan.cdp new file mode 100644 index 00000000000..47d26cd2da8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/Plan.cdp @@ -0,0 +1,430 @@ +<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>PSL_DeadlineTest_Depl_1</label> + <UUID>PSL_DeadlineTest_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_PSL_DeadlineTest_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_DeadlineTest_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="PSL_DeadlineTest_ConnectorComponentImplementation"> + <name>PSL_DeadlineTest_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="PSL_DeadlineTest_Connector_ExecArtifact" /> + <artifact xmi:idref="PSL_DeadlineTest_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_PSL_DeadlineTest_PSL_DeadlineTest_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_DeadlineTest_PSL_DeadlineTest_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PSL_DeadlineTest_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PSL_DeadlineTest_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_PSL_DeadlineTest_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_DeadlineTest_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="PSL_DeadlineTest_ConnectorComponentInstance"> + <name>PSL_DeadlineTest_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="PSL_DeadlineTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="PSL_DeadlineTest_ConnectorComponentInstance2"> + <name>PSL_DeadlineTest_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="PSL_DeadlineTest_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="PSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener2</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="PSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_DeadlineTest_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>test_topic_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="PSL_DeadlineTest_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="PSL_DeadlineTest_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="PSL_DeadlineTest_Connector_ExecArtifact"> + <name>PSL_DeadlineTest_Connector_exec</name> + <source/> + <node/> + <location>DDS_PSL_DeadlineTest_Connector_exec</location> + </artifact> + <artifact xmi:id="PSL_DeadlineTest_Connector_SvntArtifact"> + <name>PSL_DeadlineTest_Connector_svnt</name> + <source/> + <node/> + <location>DDS_PSL_DeadlineTest_Connector_svnt</location> + </artifact> + <artifact xmi:id="PSL_DeadlineTest_Connector_StubArtifact"> + <name>PSL_DeadlineTest_Connector_stub</name> + <source/> + <node/> + <location>DDS_PSL_DeadlineTest_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/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..509d006347f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,85 @@ +<?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="HelloTest_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="Hello_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>1</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + <depth>2</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + <deadline> + <period> + <sec>2</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </datawriter_qos> + <!-- QoS used to configure the data reader created in the example code --> + <datareader_qos> + <reliability> + <kind>BEST_EFFORT_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + <depth>1</depth> + </history> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <time_based_filter> + <minimum_separation> + <sec>1</sec> + <nanosec>50000000</nanosec> + </minimum_separation> + </time_based_filter> + <deadline> + <period> + <sec>2</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </datareader_qos> + + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/descriptors/run_test.pl new file mode 100755 index 00000000000..4ea0f211542 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLDeadline/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 20 seconds to allow task to complete\n"; +sleep (20); + +# 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/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.idl new file mode 100644 index 00000000000..17b6a4e3917 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file PSL_SampleLost_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef PSL_SAMPLELOST_BASE_IDL +#define PSL_SAMPLELOST_BASE_IDL + +#pragma ndds typesupport "Base/PSL_SampleLost_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.mpc new file mode 100644 index 00000000000..69803e22c42 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Base/PSL_SampleLost_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_PSL_SampleLost_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_PSL_SampleLost_Base_stub + dynamicflags += PSL_SAMPLELOST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=PSL_SAMPLELOST_BASE_STUB_Export \ + -Wb,stub_export_include=PSL_SampleLost_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + PSL_SampleLost_Base.idl + } + + opendds_ts_flags += --export=PSL_SAMPLELOST_BASE_STUB_Export + + DDSGenerator_Files { + PSL_SampleLost_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.idl new file mode 100644 index 00000000000..fcf6d5db3d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file PSL_SampleLost_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef PSL_SampleLost_CONNECTOR_IDL_ +#define PSL_SampleLost_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/PSL_SampleLost_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/PSL_SampleLost_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module PSL_SampleLost +{ + connector PSL_SampleLost_Connector : ::CCM_DDS::TestTopic::DDS_Event + { + }; +}; + +#endif /* PSL_SampleLost_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.mpc new file mode 100644 index 00000000000..8f19bdab3bc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Connector/PSL_SampleLost_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_PSL_SampleLost_Base -l .. -o ../lib -u DDS PSL_SampleLost_Connector" + +project(DDS_PSL_SL_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=PSL_SAMPLELOST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=PSL_SampleLost_Connector_stub_export.h \ + -Wb,skel_export_macro=PSL_SAMPLELOST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=PSL_SampleLost_Connector_svnt_export.h \ + -Wb,svnt_export_macro=PSL_SAMPLELOST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=PSL_SampleLost_Connector_svnt_export.h \ + -Wb,conn_export_macro=PSL_SAMPLELOST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=PSL_SampleLost_Connector_conn_export.h \ + -I .. + + IDL_Files { + PSL_SampleLost_Connector.idl + } +} + +project(DDS_PSL_SL_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_PSL_SL_Connector_idl_gen + idlflags += -Wb,stub_export_macro=PSL_SAMPLELOST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=PSL_SampleLost_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + PSL_SampleLost_ConnectorE.idl + } +} + +project(DDS_PSL_SL_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_SL_Connector_lem_gen DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Base_stub DDS4CCM_lem_stub + libs += DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_PSL_SL_Connector_lem_stub + dynamicflags = PSL_SAMPLELOST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ConnectorEC.cpp + } + + Header_Files { + PSL_SampleLost_ConnectorEC.h + PSL_SampleLost_Connector_lem_stub_export.h + } + + Inline_Files { + PSL_SampleLost_ConnectorEC.inl + } +} + +project(DDS_PSL_SampleLost_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_SL_Connector_idl_gen DDS_PSL_SampleLost_Base_stub + libs += DDS_PSL_SampleLost_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_PSL_SampleLost_Connector_stub + dynamicflags = PSL_SAMPLELOST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ConnectorC.cpp + } + + Header_Files { + PSL_SampleLost_ConnectorC.h + PSL_SampleLost_Connector_stub_export.h + } + + Inline_Files { + PSL_SampleLost_ConnectorC.inl + } +} + +project(DDS_PSL_SampleLost_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_PSL_SL_Connector_lem_stub DDS_PSL_SampleLost_Connector_stub DDS4CCM_lem_stub DDS_PSL_SampleLost_Base_stub + sharedname = DDS_PSL_SampleLost_Connector_exec + libs += DDS_PSL_SampleLost_Connector_stub DDS_PSL_SL_Connector_lem_stub DDS_PSL_SampleLost_Base_stub DDS4CCM_lem_stub DDS_PSL_SampleLost_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PSL_SAMPLELOST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_Connector_conn.cpp + } + + Header_Files { + PSL_SampleLost_Connector_conn.h + PSL_SampleLost_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_SampleLost_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_PSL_SL_Connector_lem_stub DDS_PSL_SampleLost_Connector_exec DDS_PSL_SampleLost_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_PSL_SampleLost_Connector_svnt + libs += DDS_PSL_SampleLost_Connector_stub \ + DDS_PSL_SL_Connector_lem_stub \ + DDS_PSL_SampleLost_Base_stub \ + DDS_PSL_SampleLost_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PSL_SAMPLELOST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ConnectorS.cpp + PSL_SampleLost_Connector_svnt.cpp + } + + Header_Files { + PSL_SampleLost_ConnectorS.h + PSL_SampleLost_Connector_svnt.h + PSL_SampleLost_Connector_svnt_export.h + } + + Inline_Files { + PSL_SampleLost_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.idl new file mode 100644 index 00000000000..4479966031b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/PSL_SampleLost_Connector.idl" + +module PSL_SampleLost +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_Get info_get; + port CCM_DDS::TestTopic::DDS_Listen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.mpc new file mode 100644 index 00000000000..b4ab3eaecfd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_PSL_SampleLost_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_PSL_SL_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 { + PSL_SampleLost_Receiver.idl + } +} + +project(DDS_PSL_SampleLost_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_PSL_SampleLost_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 { + PSL_SampleLost_ReceiverE.idl + } +} + +project(DDS_PSL_SL_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_SampleLost_Receiver_lem_gen DDS_PSL_SampleLost_Receiver_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Base_stub + libs += Receiver_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ReceiverEC.cpp + } + + Header_Files { + PSL_SampleLost_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + PSL_SampleLost_ReceiverEC.inl + } +} + +project(DDS_PSL_SampleLost_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_SampleLost_Receiver_idl_gen DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SL_Connector_lem_gen + libs += DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ReceiverC.cpp + } + + Header_Files { + PSL_SampleLost_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + PSL_SampleLost_ReceiverC.inl + } +} + +project(DDS_PSL_SampleLost_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_PSL_SL_Receiver_lem_stub DDS_PSL_SampleLost_Receiver_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SL_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SL_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_Receiver_exec.cpp + } + + Header_Files { + PSL_SampleLost_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_SampleLost_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_PSL_SL_Receiver_lem_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Connector_svnt DDS_PSL_SampleLost_Receiver_exec DDS_PSL_SL_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Connector_svnt Receiver_exec DDS_PSL_SL_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_ReceiverS.cpp + PSL_SampleLost_Receiver_svnt.cpp + } + + Header_Files { + PSL_SampleLost_ReceiverS.h + PSL_SampleLost_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + PSL_SampleLost_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.cpp new file mode 100644 index 00000000000..1cfbe497381 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.cpp @@ -0,0 +1,405 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for SAMPLE_LOST status of the subscriber + +#include "PSL_SampleLost_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_PSL_SampleLost_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + try + { + this->pulse_callback_.read_all(); + } + catch (...) + { + // @todo + } + return 0; + } + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + TestTopic_RawListener_exec_i::TestTopic_RawListener_exec_i (void) + { + } + + TestTopic_RawListener_exec_i::~TestTopic_RawListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::TestTopic_RawListener + void + TestTopic_RawListener_exec_i::on_one_data ( + const TestTopic & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestTopic_RawListener: ") + ACE_TEXT ("received test_topic_info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.x)); + } + + void + TestTopic_RawListener_exec_i::on_many_data ( + const TestTopicSeq & /*an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + //============================================================ + // PortStatusListener_exec_i + //============================================================ + PortStatusListener_exec_i::PortStatusListener_exec_i (Atomic_Boolean &sample_port_1, + Atomic_Boolean &sample_port_2, + Atomic_ThreadId &thread_id_1, + Atomic_ThreadId &thread_id_2, + int port_nr) + : sample_port_1_(sample_port_1), + sample_port_2_(sample_port_2), + thread_id_1_ (thread_id_1), + thread_id_2_ (thread_id_2), + port_nr_(port_nr) + { + } + + PortStatusListener_exec_i::~PortStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::PortStatusListener + void + PortStatusListener_exec_i::on_requested_deadline_missed ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::RequestedDeadlineMissedStatus & /* status */) + { + } + + void + PortStatusListener_exec_i::on_sample_lost ( + ::DDS::DataReader_ptr /*the_reader*/, + const ::DDS::SampleLostStatus & status) + { + if (this->port_nr_ == 1) + { + this->thread_id_1_ = ACE_Thread::self (); + } + if (this->port_nr_ == 2) + { + this->thread_id_2_ = ACE_Thread::self (); + } + + if (this->port_nr_ == 1 && + status.total_count > 0) + { + this->sample_port_1_ = true; + } + + if (this->port_nr_ == 2 && + status.total_count > 0) + { + this->sample_port_2_ = true; + } + } + + //============================================================ + // Receiver_exec_i + //============================================================ + + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (10), + sample_port_1_ (false), + sample_port_2_ (false), + thread_id_listener_1_ (0), + thread_id_listener_2_ (0) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + TestTopicSeq_var TestTopic_infos; + ::CCM_DDS::ReadInfoSeq_var readinfoseq; + try + { + this->reader_->read_all(TestTopic_infos.out(), readinfoseq.out()); + for(CORBA::ULong i = 0; i < readinfoseq->length(); ++i) + { + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for(CORBA::ULong i = 0; i < TestTopic_infos->length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + TestTopic_infos[i].key.in (), + TestTopic_infos[i].x)); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("internal error or no data\n"))); + } + } + + // Component attributes. + // Port operations. + ::CCM_DDS::TestTopic::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); + return new TestTopic_RawListener_exec_i (/*this->received_*/); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener get_info_out_status\n"))); + return new PortStatusListener_exec_i (this->sample_port_1_, + this->sample_port_2_, + this->thread_id_listener_1_, + this->thread_id_listener_2_, + 1); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_get_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener get_info_get_status\n"))); + + return new PortStatusListener_exec_i (this->sample_port_1_, + this->sample_port_2_, + this->thread_id_listener_1_, + this->thread_id_listener_2_, + 2); + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + return ::CCM_DDS::CCM_ConnectorStatusListener::_nil (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::PSL_SampleLost::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_out_data(); + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::NOT_ENABLED); + + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(3, usec), + ACE_Time_Value(3, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + if(!this->sample_port_1_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_sample_lost' on DDS_Listen port in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Have received the expected ") + ACE_TEXT ("'on_sample_lost' in on DDS_Listen port Receiver\n") + )); + } + if (!this->sample_port_2_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("error 'on_sample_lost' on DDS_Get port in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Have received the expected ") + ACE_TEXT ("'on_sample_lost' in on DDS_GET port Receiver\n") + )); + } + //check thread switch for listener 1 + if (this->thread_id_listener_1_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for PortStatusListener I not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_1_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "OK : " + "Thread switch for PortStatusListener I seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread switch for PortStatusListener I " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_1_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: PortStatusListener I: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "OK : PortStatusListener I: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_1_.value (), + ACE_Thread::self ())); + } + #endif + + //check thread switch for listener 2 + if (this->thread_id_listener_2_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for PortStatusListener II not set!\n")); + } + #if (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) + else if (ACE_OS::thr_equal (this->thread_id_listener_2_.value (), + ACE_Thread::self ())) + { + ACE_DEBUG ((LM_DEBUG, "OK : " + "Thread switch for PortStatusListener II seems OK. " + "(DDS uses the CCM thread for its callback) " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread switch for PortStatusListener II " + "doesn't seem to work! " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + #else + else if (ACE_OS::thr_equal (this->thread_id_listener_2_.value (), + ACE_Thread::self ())) + { + ACE_ERROR ((LM_ERROR, "ERROR: PortStatusListener II: " + "DDS seems to use a CCM thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "OK : PortStatusListener II: " + "DDS seems to use its own thread for its callback: " + "listener <%u> - component <%u>\n", + this->thread_id_listener_2_.value (), + ACE_Thread::self ())); + } + #endif + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_SampleLost_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.h new file mode 100644 index 00000000000..3f10fc8d576 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Receiver/PSL_SampleLost_Receiver_exec.h @@ -0,0 +1,156 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "PSL_SampleLost_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" + +namespace CIAO_PSL_SampleLost_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean> Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // TestTopic_RawListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export TestTopic_RawListener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + TestTopic_RawListener_exec_i (void); + virtual ~TestTopic_RawListener_exec_i (void); + + + virtual void + on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info); + + + virtual void + on_many_data ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & info); + }; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback); + + ~read_action_Generator (); + + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + private: + /// Maintains a handle that actually process the event + Receiver_exec_i &pulse_callback_; + }; + + //============================================================ + // PortStatusListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export PortStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_PortStatusListener, + public virtual ::CORBA::LocalObject + { + public: + PortStatusListener_exec_i (Atomic_Boolean &, + Atomic_Boolean &, + Atomic_ThreadId &, + Atomic_ThreadId &, + int port_nr); + virtual ~PortStatusListener_exec_i (void); + + virtual void + on_requested_deadline_missed ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::RequestedDeadlineMissedStatus & status); + + virtual void + on_sample_lost ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::SampleLostStatus & status); + + private: + Atomic_Boolean &sample_port_1_; + Atomic_Boolean &sample_port_2_; + Atomic_ThreadId &thread_id_1_; + Atomic_ThreadId &thread_id_2_; + int port_nr_; + + }; + + //============================================================ + // 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_get_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + void read_all (void); + + private: + ::PSL_SampleLost::CCM_Receiver_Context_var context_; + ::CCM_DDS::TestTopic::Reader_var reader_; + read_action_Generator * ticker_; + CORBA::ULong rate_; + Atomic_Boolean sample_port_1_; + Atomic_Boolean sample_port_2_; + Atomic_ThreadId thread_id_listener_1_; + Atomic_ThreadId thread_id_listener_2_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_SampleLost_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.idl new file mode 100644 index 00000000000..236e3ec4c26 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_PSL_SAMPLELOST_SENDER_IDL +#define DDS_PSL_SAMPLELOST_SENDER_IDL + +#include "Connector/PSL_SampleLost_Connector.idl" + +module PSL_SampleLost +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Write test_topic_write; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.mpc new file mode 100644 index 00000000000..4ddaf76560c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_PSL_SampleLost_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_PSL_SampleLost_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_PSL_SL_Connector_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 { + PSL_SampleLost_Sender.idl + } +} + +project(DDS_PSL_SampleLost_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_PSL_SampleLost_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 { + PSL_SampleLost_SenderE.idl + } +} + +project(DDS_PSL_SampleLost_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_PSL_SampleLost_Sender_lem_gen DDS_PSL_SampleLost_Sender_stub DDS_PSL_SampleLost_Base_stub + libs += DDS_PSL_SampleLost_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_SenderEC.cpp + } + + Header_Files { + PSL_SampleLost_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + PSL_SampleLost_SenderEC.inl + } +} + +project(DDS_PSL_SampleLost_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_PSL_SampleLost_Sender_idl_gen DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub + libs += DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_SenderC.cpp + } + + Header_Files { + PSL_SampleLost_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + PSL_SampleLost_SenderC.inl + } +} + +project(DDS_PSL_SampleLost_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_PSL_SampleLost_Sender_lem_stub DDS_PSL_SampleLost_Sender_stub DDS_PSL_SL_Connector_lem_stub DDS_PSL_SampleLost_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_PSL_SampleLost_Base_stub DDS_PSL_SL_Connector_lem_stub DDS_PSL_SampleLost_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_Sender_exec.cpp + } + + Header_Files { + PSL_SampleLost_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_PSL_SampleLost_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_PSL_SampleLost_Base_stub DDS_PSL_SampleLost_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Connector_svnt DDS_PSL_SL_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_PSL_SampleLost_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_PSL_SampleLost_Connector_stub DDS_PSL_SampleLost_Connector_svnt DDS_PSL_SL_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PSL_SampleLost_SenderS.cpp + PSL_SampleLost_Sender_svnt.cpp + } + + Header_Files { + PSL_SampleLost_SenderS.h + PSL_SampleLost_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + PSL_SampleLost_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.cpp new file mode 100644 index 00000000000..20174f1a06d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.cpp @@ -0,0 +1,151 @@ +// -*- C++ -*- +// $Id$ + +#include "PSL_SampleLost_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_PSL_SampleLost_Sender_Impl +{ + //============================================================ + // pulse_Generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_test_topic_connector_status (void) + { + return ::CCM_DDS::CCM_ConnectorStatusListener::_nil (); + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::PSL_SampleLost::CCM_Sender_Context::_narrow (ctx); + + if (::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_test_topic_write_data (); + } + + void + Sender_exec_i::tick () + { + for (PSL_DLTest_Table::iterator i = this->_ktests_.begin (); + i != this->_ktests_.end (); + ++i) + { + try + { + if (! ::CORBA::is_nil (this->writer_) ) + { + this->writer_->write_one(i->second,::DDS::HANDLE_NIL); + i->second->x++; + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while creating topic for <%C>.\n"), + i->first.c_str ())); + } + } + } + + void + Sender_exec_i::start (void) + { + long sec = 1L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::add_instance_of_topic (const char * key, int x) + { + TestTopic *new_key = new TestTopic; + new_key->key = CORBA::string_dup(key); + new_key->x = x; + this->_ktests_[key] = new_key; + } + + void + Sender_exec_i::ccm_activate (void) + { + //add 2 different instances of topic + this->add_instance_of_topic ("ONE",1); + this->add_instance_of_topic ("TWO",2); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_SampleLost_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.h new file mode 100644 index 00000000000..0dfa22906e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/Sender/PSL_SampleLost_Sender_exec.h @@ -0,0 +1,83 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "PSL_SampleLost_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_PSL_SampleLost_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + //============================================================ + // Sender_exec_i + //============================================================ + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Sender_exec_i &pulse_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); + + void tick (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); + + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_test_topic_connector_status(void); + + private: + void start (void); + void stop (void); + + pulse_Generator * ticker_; + ::PSL_SampleLost::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Writer_var writer_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, TestTopic_var> PSL_DLTest_Table; + PSL_DLTest_Table _ktests_; + + void add_instance_of_topic (const char *, int x ); + }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PSL_SampleLost_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/Plan.cdp new file mode 100644 index 00000000000..93739e73192 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/Plan.cdp @@ -0,0 +1,410 @@ +<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>PSL_SampleLost_Depl_1</label> + <UUID>PSL_SampleLost_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_PSL_SampleLost_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_SampleLost_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="PSL_SampleLost_ConnectorComponentImplementation"> + <name>PSL_SampleLost_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="PSL_SampleLost_Connector_ExecArtifact" /> + <artifact xmi:idref="PSL_SampleLost_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_PSL_SampleLost_PSL_SampleLost_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_SampleLost_PSL_SampleLost_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PSL_SampleLost_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PSL_SampleLost_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_PSL_SampleLost_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PSL_SampleLost_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="PSL_SampleLost_ConnectorComponentInstance"> + <name>PSL_SampleLost_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="PSL_SampleLost_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="PSL_SampleLost_ConnectorComponentInstance2"> + <name>PSL_SampleLost_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="PSL_SampleLost_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>HelloTest_Library#Hello_Profile</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_SampleLost_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="PSL_SampleLost_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener2</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="PSL_SampleLost_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_SampleLost_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="PSL_SampleLost_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>writer_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="PSL_SampleLost_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="PSL_SampleLost_Connector_ExecArtifact"> + <name>PSL_SampleLost_Connector_exec</name> + <source/> + <node/> + <location>DDS_PSL_SampleLost_Connector_exec</location> + </artifact> + <artifact xmi:id="PSL_SampleLost_Connector_SvntArtifact"> + <name>PSL_SampleLost_Connector_svnt</name> + <source/> + <node/> + <location>DDS_PSL_SampleLost_Connector_svnt</location> + </artifact> + <artifact xmi:id="PSL_SampleLost_Connector_StubArtifact"> + <name>PSL_SampleLost_Connector_stub</name> + <source/> + <node/> + <location>DDS_PSL_SampleLost_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/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..d263487191a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,89 @@ +<?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="HelloTest_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="Hello_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>2</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <durability_service> + <history_kind>KEEP_LAST_HISTORY_QOS</history_kind> + <history_depth>10</history_depth> + <max_samples>10</max_samples> + <max_samples_per_instance>5</max_samples_per_instance> + <max_instances>2</max_instances> + </durability_service> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + <deadline> + <period> + <sec>3</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </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_LAST_HISTORY_QOS</kind> + <depth>10</depth> + </history> + <resource_limits> + <initial_samples>1</initial_samples> + <initial_instances>1</initial_instances> + <max_samples>10</max_samples> + <max_instances>1</max_instances> + <max_samples_per_instance>10</max_samples_per_instance> + </resource_limits> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <deadline> + <period> + <sec>3</sec> + <nanosec>0</nanosec> + </period> + </deadline> + </datareader_qos> + + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/descriptors/run_test.pl new file mode 100755 index 00000000000..b2a5229d554 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PSLSampleLost/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.cpp new file mode 100644 index 00000000000..6ee8d9e1b80 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.cpp @@ -0,0 +1,16 @@ +// $Id$ + +#include "deadline_qos_test.h" + +#include "duration.h" + +DeadlinePolicyTest::DeadlinePolicyTest () +{ +} + +bool +DeadlinePolicyTest::check (const ::DDS_DeadlineQosPolicy & dds_qos, + const ::DDS::DeadlineQosPolicy & qos) +{ + return Duration::check (dds_qos.period, qos.period); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.h new file mode 100644 index 00000000000..3713165c665 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/deadline_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef DEADLINE_QOS_TEST_H_ +#define DEADLINE_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DeadlineQosPolicy.h" + +class DeadlinePolicyTest +{ +public: + DeadlinePolicyTest (); + + static bool check (const ::DDS_DeadlineQosPolicy & dds_qos, + const ::DDS::DeadlineQosPolicy & qos); +}; + +#endif /* DEADLINE_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.cpp new file mode 100644 index 00000000000..6a35c8dd228 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.cpp @@ -0,0 +1,14 @@ +// $Id$ + +#include "dest_order_qos_test.h" + +DestinationOrderPolicyTest::DestinationOrderPolicyTest () +{ +} + +bool +DestinationOrderPolicyTest::check (const ::DDS_DestinationOrderQosPolicy & dds_qos, + const ::DDS::DestinationOrderQosPolicy & qos) +{ + return dds_qos.kind == static_cast <DDS_DestinationOrderQosPolicyKind> (qos.kind); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.h new file mode 100644 index 00000000000..58887bc0311 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dest_order_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef DEST_ORDER_QOS_TEST_H_ +#define DEST_ORDER_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DestinationOrderQosPolicy.h" + +class DestinationOrderPolicyTest +{ +public: + DestinationOrderPolicyTest (); + + static bool check (const ::DDS_DestinationOrderQosPolicy & dds_qos, + const ::DDS::DestinationOrderQosPolicy & qos); +}; + +#endif /* DEST_ORDER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.cpp new file mode 100644 index 00000000000..2152a2a4dfa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.cpp @@ -0,0 +1,9 @@ +// $Id$ + +#include "dp_factory_qos_test.h" + +#include "entity_factory_qos_test.h" + +DomainParticipantFactoryPolicyTest::DomainParticipantFactoryPolicyTest () +{ +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.h new file mode 100644 index 00000000000..84a3582c7fa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_factory_qos_test.h @@ -0,0 +1,17 @@ +//$Id$ + +#ifndef DP_FACTORY_QOS_TEST_H_ +#define DP_FACTORY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DomainParticipantFactoryQos.h" + +class DomainParticipantFactoryPolicyTest +{ +public: + DomainParticipantFactoryPolicyTest (); + +}; + +#endif /* DP_FACTORY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.cpp new file mode 100644 index 00000000000..9418d83ceb1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.cpp @@ -0,0 +1,46 @@ +// $Id$ + +#include "dp_qos_test.h" + +#include "entity_factory_qos_test.h" +#include "user_data_qos_test.h" + +DomainParticipantPolicyTest::DomainParticipantPolicyTest () +{ +} + +int +DomainParticipantPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::DomainParticipantQos policy; + DDS_DomainParticipantQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_PARTICIPANT_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + if (!EntityFactoryPolicyTest::check (dds_policy.entity_factory, policy.entity_factory)) + { + ACE_ERROR ((LM_ERROR, "ERROR DOMAIN PARTICIPANT : " + "Error in EntityFactoryQosPolicy.\n")); + ++ret; + } + + if (!UserDataPolicyTest::check (dds_policy.user_data, policy.user_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR DOMAIN PARTICIPANT : " + "Error in UserDataQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR DOMAIN PARTICIPANT: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.h new file mode 100644 index 00000000000..9694f56b2b7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dp_qos_test.h @@ -0,0 +1,18 @@ +//$Id$ + +#ifndef DOMAINPARTICIPANT_QOS_TEST_H_ +#define DOMAINPARTICIPANT_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DomainParticipantQos.h" + +class DomainParticipantPolicyTest +{ +public: + DomainParticipantPolicyTest (); + + int run (); +}; + +#endif /* DOMAINPARTICIPANT_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.cpp new file mode 100644 index 00000000000..dab0f245666 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.cpp @@ -0,0 +1,137 @@ +// $Id$ + +#include "dr_qos_test.h" + +#include "dur_qos_test.h" +#include "deadline_qos_test.h" +#include "lat_budget_qos_test.h" +#include "liveliness_qos_test.h" +#include "reliability_qos_test.h" +#include "dest_order_qos_test.h" +#include "hist_qos_test.h" +#include "resource_limits_qos_test.h" +#include "user_data_qos_test.h" +#include "ownership_qos_test.h" +#include "tbf_qos_test.h" +#include "rd_lifecycle_qos_test.h" + +DatareaderPolicyTest::DatareaderPolicyTest () +{ +} + +int +DatareaderPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::DataReaderQos policy; + DDS_DataReaderQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_DATAREADER_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + if (!DurabilityPolicyTest::check (dds_policy.durability, + policy.durability)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in DurabilityQosPolicy.\n")); + ++ret; + } + + if (!DeadlinePolicyTest::check (dds_policy.deadline, + policy.deadline)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in DeadlineQosPolicy.\n")); + ++ret; + } + + if (!LatencyBudgetPolicyTest::check (dds_policy.latency_budget, + policy.latency_budget)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in LatencyBudgetQosPolicy.\n")); + ++ret; + } + + if (!LivelinessPolicyTest::check (dds_policy.liveliness, + policy.liveliness)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in LivelinessQosPolicy.\n")); + ++ret; + } + + if (!ReliabilityPolicyTest::check (dds_policy.reliability, + policy.reliability)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in ReliabilityQosPolicy.\n")); + ++ret; + } + + if (!DestinationOrderPolicyTest::check (dds_policy.destination_order, + policy.destination_order)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in DestinationOrderQosPolicy.\n")); + ++ret; + } + + if (!HistoryPolicyTest::check (dds_policy.history, + policy.history)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in HistoryQosPolicy.\n")); + ++ret; + } + + if (!ResourceLimitsPolicyTest::check (dds_policy.resource_limits, + policy.resource_limits)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in ResourceLimitsQosPolicy.\n")); + ++ret; + } + + if (!UserDataPolicyTest::check (dds_policy.user_data, policy.user_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in UserDataQosPolicy.\n")); + ++ret; + } + + if (!OwnershipPolicyTest::check (dds_policy.ownership, + policy.ownership)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in OwnershipQosPolicy.\n")); + ++ret; + } + + if (!TimeBasedFilterPolicyTest::check (dds_policy.time_based_filter, + policy.time_based_filter)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in TimeBasedFilterQosPolicy.\n")); + ++ret; + } + + if (!ReaderDataLifecyclePolicyTest::check (dds_policy.reader_data_lifecycle, + policy.reader_data_lifecycle)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER : " + "Error in ReaderDataLifecycleQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAREADER: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.h new file mode 100644 index 00000000000..ab276d80429 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dr_qos_test.h @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef DATAREADER_QOS_TEST_H_ +#define DATAREADER_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DataReaderQos.h" + +class DatareaderPolicyTest +{ +public: + DatareaderPolicyTest (); + + int run (); +}; + +#endif /* DATAREADER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.cpp new file mode 100644 index 00000000000..3a85ace802b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.cpp @@ -0,0 +1,15 @@ +// $Id$ + +#include "dur_qos_test.h" + +DurabilityPolicyTest::DurabilityPolicyTest () +{ +} + + +bool +DurabilityPolicyTest::check (const ::DDS_DurabilityQosPolicy & dds_qos, + const ::DDS::DurabilityQosPolicy & qos) +{ + return dds_qos.kind == static_cast <DDS_DurabilityQosPolicyKind> (qos.kind); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.h new file mode 100644 index 00000000000..e2ec969df10 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef DURABILITY_QOS_TEST_H_ +#define DURABILITY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DurabilityQosPolicy.h" + +class DurabilityPolicyTest +{ +public: + DurabilityPolicyTest (); + + static bool check (const ::DDS_DurabilityQosPolicy & dds_qos, + const ::DDS::DurabilityQosPolicy & qos); +}; + +#endif /* DURABILITY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.cpp new file mode 100644 index 00000000000..eabe851a291 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.cpp @@ -0,0 +1,19 @@ +// $Id$ + +#include "dur_service_qos_test.h" + +DurabilityServicePolicyTest::DurabilityServicePolicyTest () +{ +} + +bool +DurabilityServicePolicyTest::check (const ::DDS_DurabilityServiceQosPolicy & dds_qos, + const ::DDS::DurabilityServiceQosPolicy & qos) +{ + return dds_qos.service_cleanup_delay.sec == qos.service_cleanup_delay.sec && + dds_qos.history_kind == static_cast <DDS_HistoryQosPolicyKind> (qos.history_kind) && + dds_qos.history_depth == qos.history_depth && + dds_qos.max_samples == qos.max_samples && + dds_qos.max_instances == qos.max_instances && + dds_qos.max_samples_per_instance == qos.max_samples_per_instance; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.h new file mode 100644 index 00000000000..4b212a2745a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dur_service_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef DURABILITY_SERVICE_QOS_TEST_H_ +#define DURABILITY_SERVICE_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DurabilityServiceQosPolicy.h" + +class DurabilityServicePolicyTest +{ +public: + DurabilityServicePolicyTest (); + + static bool check (const ::DDS_DurabilityServiceQosPolicy & dds_qos, + const ::DDS::DurabilityServiceQosPolicy & qos); +}; + +#endif /* DURABILITY_SERVICE_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.cpp new file mode 100644 index 00000000000..83d0483c909 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.cpp @@ -0,0 +1,16 @@ +//$Id$ + +#include "duration.h" + +Duration::Duration () +{ +} + + +bool +Duration::check (const ::DDS_Duration_t & dds_dur, + const ::DDS::Duration_t & dur) +{ + return dds_dur.sec == dur.sec && + dds_dur.nanosec == dur.nanosec; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.h new file mode 100644 index 00000000000..dae8057bfb4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/duration.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef DURATION_H_ +#define DURATION_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/Duration_t.h" + +class Duration +{ +public: + Duration (); + + static bool check (const ::DDS_Duration_t & dds_dur, + const ::DDS::Duration_t & dur); +}; + +#endif /* DURATION_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.cpp new file mode 100644 index 00000000000..6e4278e1b04 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.cpp @@ -0,0 +1,164 @@ +// $Id$ + +#include "dw_qos_test.h" + +#include "dur_qos_test.h" +#include "dur_service_qos_test.h" +#include "deadline_qos_test.h" +#include "lat_budget_qos_test.h" +#include "liveliness_qos_test.h" +#include "reliability_qos_test.h" +#include "dest_order_qos_test.h" +#include "hist_qos_test.h" +#include "resource_limits_qos_test.h" +#include "transport_prio_qos_test.h" +#include "lifespan_qos_test.h" +#include "user_data_qos_test.h" +#include "ownership_qos_test.h" +#include "ownership_strength_qos_test.h" +#include "wr_lifecycle_qos_test.h" + +DatawriterPolicyTest::DatawriterPolicyTest () +{ +} + +int +DatawriterPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::DataWriterQos policy; + DDS_DataWriterQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_DATAWRITER_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + if (!DurabilityPolicyTest::check (dds_policy.durability, + policy.durability)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in DurabilityQosPolicy.\n")); + ++ret; + } + + if (!DurabilityServicePolicyTest::check (dds_policy.durability_service, + policy.durability_service)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in DurabilityServiceQosPolicy.\n")); + ++ret; + } + + if (!DeadlinePolicyTest::check (dds_policy.deadline, + policy.deadline)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in DeadlineQosPolicy.\n")); + ++ret; + } + + if (!LatencyBudgetPolicyTest::check (dds_policy.latency_budget, + policy.latency_budget)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in LatencyBudgetQosPolicy.\n")); + ++ret; + } + + if (!LivelinessPolicyTest::check (dds_policy.liveliness, + policy.liveliness)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in LivelinessQosPolicy.\n")); + ++ret; + } + + if (!ReliabilityPolicyTest::check (dds_policy.reliability, + policy.reliability)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in ReliabilityQosPolicy.\n")); + ++ret; + } + + if (!DestinationOrderPolicyTest::check (dds_policy.destination_order, + policy.destination_order)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in DestinationOrderQosPolicy.\n")); + ++ret; + } + + if (!HistoryPolicyTest::check (dds_policy.history, + policy.history)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in HistoryQosPolicy.\n")); + ++ret; + } + + if (!ResourceLimitsPolicyTest::check (dds_policy.resource_limits, + policy.resource_limits)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in ResourceLimitsQosPolicy.\n")); + ++ret; + } + + if (!TransportPriorityPolicyTest::check (dds_policy.transport_priority, + policy.transport_priority)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in TransportPriorityQosPolicy.\n")); + ++ret; + } + + if (!LifespanPolicyTest::check (dds_policy.lifespan, + policy.lifespan)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in LifespanQosPolicy.\n")); + ++ret; + } + + if (!UserDataPolicyTest::check (dds_policy.user_data, policy.user_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in UserDataQosPolicy.\n")); + ++ret; + } + + if (!OwnershipPolicyTest::check (dds_policy.ownership, + policy.ownership)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in OwnershipQosPolicy.\n")); + ++ret; + } + + if (!OwnershipStrengthPolicyTest::check (dds_policy.ownership_strength, + policy.ownership_strength)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in OwnershipStrengthQosPolicy.\n")); + ++ret; + } + + if (!WriterDataLifecyclePolicyTest::check (dds_policy.writer_data_lifecycle, + policy.writer_data_lifecycle)) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER : " + "Error in WriterDataLifecycleQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR DATAWRITER: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.h new file mode 100644 index 00000000000..23bf760321b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/dw_qos_test.h @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef DATAWRITER_QOS_TEST_H_ +#define DATAWRITER_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/DataWriterQos.h" + +class DatawriterPolicyTest +{ +public: + DatawriterPolicyTest (); + + int run (); +}; + +#endif /* DATAWRITER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.cpp new file mode 100644 index 00000000000..4bc00e2434f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.cpp @@ -0,0 +1,15 @@ +// $Id$ + +#include "entity_factory_qos_test.h" + +EntityFactoryPolicyTest::EntityFactoryPolicyTest () +{ +} + +bool +EntityFactoryPolicyTest::check (const ::DDS_EntityFactoryQosPolicy & dds_qos, + const ::DDS::EntityFactoryQosPolicy & qos) +{ + return dds_qos.autoenable_created_entities == + static_cast <DDS_Boolean> (qos.autoenable_created_entities); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.h new file mode 100644 index 00000000000..ef53fb43aea --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/entity_factory_qos_test.h @@ -0,0 +1,19 @@ +// $Id$ + +#ifndef ENTITY_FACTORY_QOS_TEST_H_ +#define ENTITY_FACTORY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/EntityFactoryQosPolicy.h" + +class EntityFactoryPolicyTest +{ +public: + EntityFactoryPolicyTest (); + + static bool check (const ::DDS_EntityFactoryQosPolicy & dds_qos, + const ::DDS::EntityFactoryQosPolicy & qos); +}; + +#endif /* ENTITY_FACTORY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.cpp new file mode 100644 index 00000000000..e1100e04cc2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.cpp @@ -0,0 +1,18 @@ +// $Id$ + +#include "group_data_qos_test.h" + +#include "octet_seq.h" + +GroupDataPolicyTest::GroupDataPolicyTest () +{ +} + +bool +GroupDataPolicyTest::check (const ::DDS_GroupDataQosPolicy & dds_qos, + const ::DDS::GroupDataQosPolicy & qos) +{ + return OctetSequence::check (dds_qos.value, + qos.value, + "GroupDataPolicyTest"); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.h new file mode 100644 index 00000000000..ba5347e505e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/group_data_qos_test.h @@ -0,0 +1,19 @@ +// $Id$ + +#ifndef GROUP_DATA_QOS_TEST_H_ +#define GROUP_DATA_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/GroupDataQosPolicy.h" + +class GroupDataPolicyTest +{ +public: + GroupDataPolicyTest (); + + static bool check (const ::DDS_GroupDataQosPolicy & dds_qos, + const ::DDS::GroupDataQosPolicy & qos); +}; + +#endif /* GROUP_DATA_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.cpp new file mode 100644 index 00000000000..e65aa5ff338 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.cpp @@ -0,0 +1,16 @@ +// $Id$ + +#include "hist_qos_test.h" + +HistoryPolicyTest::HistoryPolicyTest () +{ +} + +bool +HistoryPolicyTest::check (const ::DDS_HistoryQosPolicy & dds_qos, + const ::DDS::HistoryQosPolicy & qos) +{ + + return dds_qos.kind == static_cast <DDS_HistoryQosPolicyKind> (qos.kind) && + dds_qos.depth == qos.depth; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.h new file mode 100644 index 00000000000..0290a8bd519 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/hist_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef HISTORY_QOS_TEST_H_ +#define HISTORY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/HistoryQosPolicy.h" + +class HistoryPolicyTest +{ +public: + HistoryPolicyTest (); + + static bool check (const ::DDS_HistoryQosPolicy & dds_qos, + const ::DDS::HistoryQosPolicy & qos); +}; + +#endif /* HISTORY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.cpp new file mode 100644 index 00000000000..5a530caa2cc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.cpp @@ -0,0 +1,16 @@ +// $Id$ + +#include "lat_budget_qos_test.h" + +#include "duration.h" + +LatencyBudgetPolicyTest::LatencyBudgetPolicyTest () +{ +} + +bool +LatencyBudgetPolicyTest::check (const ::DDS_LatencyBudgetQosPolicy & dds_qos, + const ::DDS::LatencyBudgetQosPolicy & qos) +{ + return Duration::check (dds_qos.duration, qos.duration); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.h new file mode 100644 index 00000000000..be70a034310 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/lat_budget_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef LATENCY_BUDGET_QOS_TEST_H_ +#define LATENCY_BUDGET_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/LatencyBudgetQosPolicy.h" + +class LatencyBudgetPolicyTest +{ +public: + LatencyBudgetPolicyTest (); + + static bool check (const ::DDS_LatencyBudgetQosPolicy & dds_qos, + const ::DDS::LatencyBudgetQosPolicy & qos); +}; + +#endif /* LATENCY_BUDGET_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.cpp new file mode 100644 index 00000000000..ee02d9aa09c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.cpp @@ -0,0 +1,16 @@ +// $Id$ + +#include "lifespan_qos_test.h" + +#include "duration.h" + +LifespanPolicyTest::LifespanPolicyTest () +{ +} + +bool +LifespanPolicyTest::check (const ::DDS_LifespanQosPolicy & dds_qos, + const ::DDS::LifespanQosPolicy & qos) +{ + return Duration::check (dds_qos.duration, qos.duration); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.h new file mode 100644 index 00000000000..482a2927450 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/lifespan_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef LIFESPAN_QOS_TEST_H_ +#define LIFESPAN_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/LifespanQosPolicy.h" + +class LifespanPolicyTest +{ +public: + LifespanPolicyTest (); + + static bool check (const ::DDS_LifespanQosPolicy & dds_qos, + const ::DDS::LifespanQosPolicy & qos); +}; + +#endif /* LIFESPAN_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.cpp new file mode 100644 index 00000000000..b9f364a703f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.cpp @@ -0,0 +1,17 @@ +// $Id$ + +#include "liveliness_qos_test.h" + +#include "duration.h" + +LivelinessPolicyTest::LivelinessPolicyTest () +{ +} + +bool +LivelinessPolicyTest::check (const ::DDS_LivelinessQosPolicy & dds_qos, + const ::DDS::LivelinessQosPolicy & qos) +{ + return dds_qos.kind == static_cast <DDS_LivelinessQosPolicyKind> (qos.kind) && + Duration::check (dds_qos.lease_duration, qos.lease_duration); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.h new file mode 100644 index 00000000000..a1d9208879c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/liveliness_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef LIVELINESS_QOS_TEST_H_ +#define LIVELINESS_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/LivelinessQosPolicy.h" + +class LivelinessPolicyTest +{ +public: + LivelinessPolicyTest (); + + static bool check (const ::DDS_LivelinessQosPolicy & dds_qos, + const ::DDS::LivelinessQosPolicy & qos); +}; + +#endif /* LIVELINESS_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/main.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/main.cpp new file mode 100644 index 00000000000..985081f29ae --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/main.cpp @@ -0,0 +1,73 @@ +// $Id$ + +#include "ace/OS_main.h" +#include "ace/Log_Msg.h" + +#include "pub_qos_test.h" +#include "sub_qos_test.h" +#include "dw_qos_test.h" +#include "dr_qos_test.h" +#include "tp_qos_test.h" +#include "dp_qos_test.h" + +int handle_result (const int & result, + const char * test) +{ + int ret = 0; + if (result == -1) + { + ACE_ERROR ((LM_ERROR, "ERROR POLICIES : " + "Exception caught while testing " + "%C QoS\n", + test)); + } + else if (result > 0) + { + ret = result; + ACE_ERROR ((LM_ERROR, "ERROR POLICIES : " + "<%d> errors found while testing " + "%C QoS\n", + result, test)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "%C QoS test passed!\n", + test)); + } + return ret; +} + +int +ACE_TMAIN (int , ACE_TCHAR **) +{ + PublisherPolicyTest publisher; + SubscriberPolicyTest subscriber; + DatawriterPolicyTest datawriter; + DatareaderPolicyTest datareader; + TopicPolicyTest topic; + DomainParticipantPolicyTest domainparticipant; + + int ret = 0; + int test = 0; + try + { + test = publisher.run (); + ret += handle_result (test, "Publisher"); + test = subscriber.run (); + ret += handle_result (test, "Subscriber"); + test = datawriter.run (); + ret += handle_result (test, "Datawriter"); + test = datareader.run (); + ret += handle_result (test, "DataReader"); + test = topic.run (); + ret += handle_result (test, "Topic"); + test = domainparticipant.run (); + ret += handle_result (test, "DomainParticipant"); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unexpected exception caught.")); + return -1; + } + return 0; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.cpp new file mode 100644 index 00000000000..9912b6f1eee --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.cpp @@ -0,0 +1,34 @@ +//$Id$ + +#include "octet_seq.h" + +OctetSequence::OctetSequence () +{ +} + +bool +OctetSequence::check (const ::DDS_OctetSeq & dds_seq, + const ::DDS::OctetSeq & seq, + const char * test) +{ + if (static_cast < ::CORBA::ULong> (dds_seq.length ()) != + seq.length ()) + { + ACE_ERROR ((LM_ERROR, "ERROR %C : " + "Length group_data is not equal to original length.\n", + test)); + return false; + } + + for (::DDS_Long i = 0; i < dds_seq.length (); ++i) + { + if (seq[i] != dds_seq[i]) + { + ACE_ERROR ((LM_ERROR, "ERROR %C : " + "Item %d of group_data is not equal to original.\n", + test, i)); + return false; + } + } + return true; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.h new file mode 100644 index 00000000000..62401a7630d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/octet_seq.h @@ -0,0 +1,20 @@ +//$Id$ + +#ifndef OCTET_SEQ_H_ +#define OCTET_SEQ_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/OctetSeq.h" + +class OctetSequence +{ +public: + OctetSequence (); + + static bool check (const ::DDS_OctetSeq & dds_seq, + const ::DDS::OctetSeq & seq, + const char * test); +}; + +#endif /* OCTET_SEQ_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.cpp new file mode 100644 index 00000000000..b439bfe1b74 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.cpp @@ -0,0 +1,15 @@ +// $Id$ + +#include "ownership_qos_test.h" + +OwnershipPolicyTest::OwnershipPolicyTest () +{ +} + +bool +OwnershipPolicyTest::check (const ::DDS_OwnershipQosPolicy & dds_qos, + const ::DDS::OwnershipQosPolicy & qos) +{ + return dds_qos.kind == + static_cast <DDS_OwnershipQosPolicyKind> (qos.kind); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.h new file mode 100644 index 00000000000..1307c7f6037 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef OWNERSHIP_QOS_TEST_H_ +#define OWNERSHIP_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/OwnershipQosPolicy.h" + +class OwnershipPolicyTest +{ +public: + OwnershipPolicyTest (); + + static bool check (const ::DDS_OwnershipQosPolicy & dds_qos, + const ::DDS::OwnershipQosPolicy & qos); +}; + +#endif /* OWNERSHIP_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.cpp new file mode 100644 index 00000000000..d65bd7f725a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.cpp @@ -0,0 +1,14 @@ +// $Id$ + +#include "ownership_strength_qos_test.h" + +OwnershipStrengthPolicyTest::OwnershipStrengthPolicyTest () +{ +} + +bool +OwnershipStrengthPolicyTest::check (const ::DDS_OwnershipStrengthQosPolicy & dds_qos, + const ::DDS::OwnershipStrengthQosPolicy & qos) +{ + return dds_qos.value == qos.value; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.h new file mode 100644 index 00000000000..36e3169b594 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/ownership_strength_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef OWNERSHIP_STRENGTH_QOS_TEST_H_ +#define OWNERSHIP_STRENGTH_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/OwnershipStrengthQosPolicy.h" + +class OwnershipStrengthPolicyTest +{ +public: + OwnershipStrengthPolicyTest (); + + static bool check (const ::DDS_OwnershipStrengthQosPolicy & dds_qos, + const ::DDS::OwnershipStrengthQosPolicy & qos); +}; + +#endif /* OWNERSHIP_STRENGTH_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.cpp new file mode 100644 index 00000000000..f0f56774186 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.cpp @@ -0,0 +1,33 @@ +// $Id$ + +#include "partition_qos_test.h" + +PartitionPolicyTest::PartitionPolicyTest () +{ +} + +bool +PartitionPolicyTest::check (const ::DDS_PartitionQosPolicy & dds_qos, + const ::DDS::PartitionQosPolicy & qos) +{ + if (static_cast <CORBA::ULong> (dds_qos.name.length ()) != + qos.name.length ()) + { + ACE_ERROR ((LM_ERROR, "ERROR PartitionPolicyTest : " + "Length name sequence is not equal " + "to original length.\n")); + return false; + } + for (DDS_Long i = 0; i < dds_qos.name.length (); ++i) + { + if (ACE_OS::strcmp (dds_qos.name[i], qos.name[i]) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR PartitionPolicyTest : " + "Item %d of name sequence is not equal " + "to original.\n", + i)); + return false; + } + } + return true; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.h new file mode 100644 index 00000000000..6fef89f535d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/partition_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef PARTITION_QOS_TEST_H_ +#define PARTITION_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/PartitionQosPolicy.h" + +class PartitionPolicyTest +{ +public: + PartitionPolicyTest (); + + static bool check (const ::DDS_PartitionQosPolicy & dds_qos, + const ::DDS::PartitionQosPolicy & qos); +}; + +#endif /* PARTITION_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/policies.mpc b/modules/CIAO/connectors/dds4ccm/tests/Policies/policies.mpc new file mode 100644 index 00000000000..02e68929f89 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/policies.mpc @@ -0,0 +1,46 @@ +// $Id$ + +project(DDS_Policies_Test) : taoexe, dds4ccm_base { + includes += $(CIAO_ROOT) + exename = policies_test + requires += dds4ccm_ndds + + Source_Files { + deadline_qos_test.cpp + dest_order_qos_test.cpp + dp_factory_qos_test.cpp + dp_qos_test.cpp + dr_qos_test.cpp + dur_qos_test.cpp + dur_service_qos_test.cpp + dw_qos_test.cpp + entity_factory_qos_test.cpp + group_data_qos_test.cpp + hist_qos_test.cpp + lat_budget_qos_test.cpp + lifespan_qos_test.cpp + liveliness_qos_test.cpp + main.cpp + ownership_qos_test.cpp + partition_qos_test.cpp + presentation_qos_test.cpp + pub_qos_test.cpp + reliability_qos_test.cpp + resource_limits_qos_test.cpp + sub_qos_test.cpp + tp_data_qos_test.cpp + tp_qos_test.cpp + transport_prio_qos_test.cpp + user_data_qos_test.cpp + rd_lifecycle_qos_test.cpp + tbf_qos_test.cpp + ownership_strength_qos_test.cpp + wr_lifecycle_qos_test.cpp + duration.cpp + octet_seq.cpp + } + + Header_Files { + *.h + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.cpp new file mode 100644 index 00000000000..540bf6e1315 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.cpp @@ -0,0 +1,19 @@ +// $Id$ + +#include "presentation_qos_test.h" + +PresentationPolicyTest::PresentationPolicyTest () +{ +} + +bool +PresentationPolicyTest::check (const ::DDS_PresentationQosPolicy & dds_qos, + const ::DDS::PresentationQosPolicy & qos) +{ + return dds_qos.access_scope == + static_cast <DDS_PresentationQosPolicyAccessScopeKind>(qos.access_scope) && + dds_qos.coherent_access == + static_cast <DDS_Boolean> (qos.coherent_access) && + dds_qos.ordered_access == + static_cast <DDS_Boolean> (qos.ordered_access); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.h new file mode 100644 index 00000000000..4359e25632c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/presentation_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef PRESENTATION_QOS_TEST_H_ +#define PRESENTATION_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/PresentationQosPolicy.h" + +class PresentationPolicyTest +{ +public: + PresentationPolicyTest (); + + static bool check (const ::DDS_PresentationQosPolicy & dds_qos, + const ::DDS::PresentationQosPolicy & qos); +}; + +#endif /* PRESENTATION_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.cpp new file mode 100644 index 00000000000..7a3c0cb7737 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.cpp @@ -0,0 +1,58 @@ +// $Id$ + +#include "pub_qos_test.h" +#include "group_data_qos_test.h" +#include "entity_factory_qos_test.h" +#include "presentation_qos_test.h" +#include "partition_qos_test.h" + +PublisherPolicyTest::PublisherPolicyTest () +{ +} + +int +PublisherPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::PublisherQos policy; + DDS_PublisherQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_PUBLISHER_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + if (!PresentationPolicyTest::check (dds_policy.presentation, policy.presentation)) + { + ACE_ERROR ((LM_ERROR, "ERROR PUBLISHER : " + "Error in PresentationQosPolicy.\n")); + ++ret; + } + if (!PartitionPolicyTest::check (dds_policy.partition, policy.partition)) + { + ACE_ERROR ((LM_ERROR, "ERROR PUBLISHER : " + "Error in PartitionQosPolicy.\n")); + ++ret; + } + if (!GroupDataPolicyTest::check (dds_policy.group_data, policy.group_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR PUBLISHER : " + "Error in GroupDataQosPolicy.\n")); + ++ret; + } + if (!EntityFactoryPolicyTest::check (dds_policy.entity_factory, policy.entity_factory)) + { + ACE_ERROR ((LM_ERROR, "ERROR PUBLISHER : " + "Error in EntityFactoryQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR PUBLISHER: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.h new file mode 100644 index 00000000000..c2d022aff88 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/pub_qos_test.h @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef PUBLISHER_QOS_TEST_H_ +#define PUBLISHER_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/PublisherQos.h" + +class PublisherPolicyTest +{ +public: + PublisherPolicyTest (); + + int run (); +}; + +#endif /* PUBLISHER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.cpp new file mode 100644 index 00000000000..11574a4abfe --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.cpp @@ -0,0 +1,19 @@ +// $Id$ + +#include "rd_lifecycle_qos_test.h" + +#include "duration.h" + +ReaderDataLifecyclePolicyTest::ReaderDataLifecyclePolicyTest () +{ +} + +bool +ReaderDataLifecyclePolicyTest::check (const ::DDS_ReaderDataLifecycleQosPolicy & dds_qos, + const ::DDS::ReaderDataLifecycleQosPolicy & qos) +{ + return Duration::check (dds_qos.autopurge_nowriter_samples_delay, + qos.autopurge_nowriter_samples_delay) && + Duration::check (dds_qos.autopurge_disposed_samples_delay, + qos.autopurge_disposed_samples_delay); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.h new file mode 100644 index 00000000000..314704e1e96 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/rd_lifecycle_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef READER_DATA_LIFECYCLE_QOS_TEST_H_ +#define READER_DATA_LIFECYCLE_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/ReaderDataLifecycleQosPolicy.h" + +class ReaderDataLifecyclePolicyTest +{ +public: + ReaderDataLifecyclePolicyTest (); + + static bool check (const ::DDS_ReaderDataLifecycleQosPolicy & dds_qos, + const ::DDS::ReaderDataLifecycleQosPolicy & qos); +}; + +#endif /* READER_DATA_LIFECYCLE_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.cpp new file mode 100644 index 00000000000..e4e405fdfc0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.cpp @@ -0,0 +1,17 @@ +// $Id$ + +#include "reliability_qos_test.h" + +#include "duration.h" + +ReliabilityPolicyTest::ReliabilityPolicyTest () +{ +} + +bool +ReliabilityPolicyTest::check (const ::DDS_ReliabilityQosPolicy & dds_qos, + const ::DDS::ReliabilityQosPolicy & qos) +{ + return dds_qos.kind == static_cast <DDS_ReliabilityQosPolicyKind> (qos.kind) && + Duration::check (dds_qos.max_blocking_time, qos.max_blocking_time); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.h new file mode 100644 index 00000000000..d325f489c90 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/reliability_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef RELIABILITY_QOS_TEST_H_ +#define RELIABILITY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/ReliabilityQosPolicy.h" + +class ReliabilityPolicyTest +{ +public: + ReliabilityPolicyTest (); + + static bool check (const ::DDS_ReliabilityQosPolicy & dds_qos, + const ::DDS::ReliabilityQosPolicy & qos); +}; + +#endif /* RELIABILITY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.cpp new file mode 100644 index 00000000000..46a1adc0327 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.cpp @@ -0,0 +1,17 @@ +// $Id$ + +#include "resource_limits_qos_test.h" + +ResourceLimitsPolicyTest::ResourceLimitsPolicyTest () +{ +} + + +bool +ResourceLimitsPolicyTest::check (const ::DDS_ResourceLimitsQosPolicy & dds_qos, + const ::DDS::ResourceLimitsQosPolicy & qos) +{ + return dds_qos.max_samples == qos.max_samples && + dds_qos.max_instances == qos.max_instances && + dds_qos.max_samples_per_instance == qos.max_samples_per_instance; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.h new file mode 100644 index 00000000000..a430ee30034 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/resource_limits_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef RESOURCE_LIMITS_QOS_TEST_H_ +#define RESOURCE_LIMITS_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/ResourceLimitsQosPolicy.h" + +class ResourceLimitsPolicyTest +{ +public: + ResourceLimitsPolicyTest (); + + static bool check (const ::DDS_ResourceLimitsQosPolicy & dds_qos, + const ::DDS::ResourceLimitsQosPolicy & qos); +}; + +#endif /* RESOURCE_LIMITS_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/Policies/run_test.pl new file mode 100755 index 00000000000..87048af071f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/run_test.pl @@ -0,0 +1,25 @@ +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; + +my $program = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; + +$PROG = $program->CreateProcess ("policies_test", ""); +$program_status = $PROG->Spawn (); + +if ($program_status != 0) { + print STDERR "ERROR: GroupDataPolicy returned $program_status\n"; + exit 1; +} + +sleep ($program->ProcessStartWaitInterval()); + +$program_status = $PROG->Kill (); + +exit 0; diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.cpp new file mode 100644 index 00000000000..15950dc88b4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.cpp @@ -0,0 +1,59 @@ +// $Id$ + +#include "sub_qos_test.h" + +#include "group_data_qos_test.h" +#include "entity_factory_qos_test.h" +#include "presentation_qos_test.h" +#include "partition_qos_test.h" + +SubscriberPolicyTest::SubscriberPolicyTest () +{ +} + +int +SubscriberPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::SubscriberQos policy; + DDS_SubscriberQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_SUBSCRIBER_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + if (!PresentationPolicyTest::check (dds_policy.presentation, policy.presentation)) + { + ACE_ERROR ((LM_ERROR, "ERROR SUBSCRIBER : " + "Error in PresentationQosPolicy.\n")); + ++ret; + } + if (!PartitionPolicyTest::check (dds_policy.partition, policy.partition)) + { + ACE_ERROR ((LM_ERROR, "ERROR SUBSCRIBER : " + "Error in PartitionQosPolicy.\n")); + ++ret; + } + if (!GroupDataPolicyTest::check (dds_policy.group_data, policy.group_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR SUBSCRIBER : " + "Error in GroupDataQosPolicy.\n")); + ++ret; + } + if (!EntityFactoryPolicyTest::check (dds_policy.entity_factory, policy.entity_factory)) + { + ACE_ERROR ((LM_ERROR, "ERROR SUBSCRIBER : " + "Error in EntityFactoryQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR SUBSCRIBER: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.h new file mode 100644 index 00000000000..dc85ffdd582 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/sub_qos_test.h @@ -0,0 +1,19 @@ +// $Id$ + +#ifndef SUBSCRIBER_QOS_TEST_H_ +#define SUBSCRIBER_QOS_TEST_H_ + + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/SubscriberQos.h" + +class SubscriberPolicyTest +{ +public: + SubscriberPolicyTest (); + + int run (); +}; + +#endif /* SUBSCRIBER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.cpp new file mode 100644 index 00000000000..c300174e7f7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.cpp @@ -0,0 +1,15 @@ +// $Id$ + +#include "tbf_qos_test.h" +#include "duration.h" + +TimeBasedFilterPolicyTest::TimeBasedFilterPolicyTest () +{ +} + +bool +TimeBasedFilterPolicyTest::check (const ::DDS_TimeBasedFilterQosPolicy & dds_qos, + const ::DDS::TimeBasedFilterQosPolicy & qos) +{ + return Duration::check (dds_qos.minimum_separation, qos.minimum_separation); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.h new file mode 100644 index 00000000000..f42d8aaf7e0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tbf_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef TIME_BASED_FILTER_QOS_TEST_H_ +#define TIME_BASED_FILTER_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/TimeBasedFilterQosPolicy.h" + +class TimeBasedFilterPolicyTest +{ +public: + TimeBasedFilterPolicyTest (); + + static bool check (const ::DDS_TimeBasedFilterQosPolicy & dds_qos, + const ::DDS::TimeBasedFilterQosPolicy & qos); +}; + +#endif /* TIME_BASED_FILTER_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.cpp new file mode 100644 index 00000000000..c9377c996b7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.cpp @@ -0,0 +1,18 @@ +// $Id$ + +#include "tp_data_qos_test.h" + +#include "octet_seq.h" + +TopicDataPolicyTest::TopicDataPolicyTest () +{ +} + +bool +TopicDataPolicyTest::check (const ::DDS_TopicDataQosPolicy & dds_qos, + const ::DDS::TopicDataQosPolicy & qos) +{ + return OctetSequence::check (dds_qos.value, + qos.value, + "TopicDataPolicyTest"); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.h new file mode 100644 index 00000000000..2ccb36be118 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_data_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef TOPIC_DATA_QOS_TEST_H_ +#define TOPIC_DATA_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/TopicDataQosPolicy.h" + +class TopicDataPolicyTest +{ +public: + TopicDataPolicyTest (); + + static bool check (const ::DDS_TopicDataQosPolicy & dds_qos, + const ::DDS::TopicDataQosPolicy & qos); +}; + +#endif /* TOPIC_DATA_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.cpp new file mode 100644 index 00000000000..65a338ae499 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.cpp @@ -0,0 +1,148 @@ +// $Id$ + +#include "tp_qos_test.h" + +#include "tp_data_qos_test.h" +#include "dur_qos_test.h" +#include "dur_service_qos_test.h" +#include "deadline_qos_test.h" +#include "lat_budget_qos_test.h" +#include "liveliness_qos_test.h" +#include "reliability_qos_test.h" +#include "dest_order_qos_test.h" +#include "hist_qos_test.h" +#include "resource_limits_qos_test.h" +#include "transport_prio_qos_test.h" +#include "lifespan_qos_test.h" +#include "ownership_qos_test.h" + +TopicPolicyTest::TopicPolicyTest () +{ +} + +int +TopicPolicyTest::run () +{ + int ret = 0; + try + { + ::DDS::TopicQos policy; + DDS_TopicQos dds_policy_org, dds_policy; + + dds_policy_org = DDS_TOPIC_QOS_DEFAULT; + + policy <<= dds_policy_org; + dds_policy <<= policy; + + + if (!TopicDataPolicyTest::check (dds_policy.topic_data, + policy.topic_data)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in TopicDataQosPolicy.\n")); + ++ret; + } + + if (!DurabilityPolicyTest::check (dds_policy.durability, + policy.durability)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in DurabilityQosPolicy.\n")); + ++ret; + } + + if (!DurabilityServicePolicyTest::check (dds_policy.durability_service, + policy.durability_service)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in DurabilityServiceQosPolicy.\n")); + ++ret; + } + + if (!DeadlinePolicyTest::check (dds_policy.deadline, + policy.deadline)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in DeadlineQosPolicy.\n")); + ++ret; + } + + if (!LatencyBudgetPolicyTest::check (dds_policy.latency_budget, + policy.latency_budget)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in LatencyBudgetQosPolicy.\n")); + ++ret; + } + + if (!LivelinessPolicyTest::check (dds_policy.liveliness, + policy.liveliness)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in LivelinessQosPolicy.\n")); + ++ret; + } + + if (!ReliabilityPolicyTest::check (dds_policy.reliability, + policy.reliability)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in ReliabilityQosPolicy.\n")); + ++ret; + } + + if (!DestinationOrderPolicyTest::check (dds_policy.destination_order, + policy.destination_order)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in DestinationOrderQosPolicy.\n")); + ++ret; + } + + if (!HistoryPolicyTest::check (dds_policy.history, + policy.history)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in HistoryQosPolicy.\n")); + ++ret; + } + + if (!ResourceLimitsPolicyTest::check (dds_policy.resource_limits, + policy.resource_limits)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in ResourceLimitsQosPolicy.\n")); + ++ret; + } + + if (!TransportPriorityPolicyTest::check (dds_policy.transport_priority, + policy.transport_priority)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in TransportPriorityQosPolicy.\n")); + ++ret; + } + + if (!LifespanPolicyTest::check (dds_policy.lifespan, + policy.lifespan)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in LifespanQosPolicy.\n")); + ++ret; + } + + if (!OwnershipPolicyTest::check (dds_policy.ownership, + policy.ownership)) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC : " + "Error in OwnershipQosPolicy.\n")); + ++ret; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR TOPIC: Unexpected exception caught.")); + return -1; + } + return ret; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.h new file mode 100644 index 00000000000..0508102b8e3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/tp_qos_test.h @@ -0,0 +1,18 @@ +// $Id$ + +#ifndef TOPIC_QOS_TEST_H_ +#define TOPIC_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/TopicQos.h" + +class TopicPolicyTest +{ +public: + TopicPolicyTest (); + + int run (); +}; + +#endif /* TOPIC_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.cpp new file mode 100644 index 00000000000..d4aaa7d74ad --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.cpp @@ -0,0 +1,14 @@ +// $Id$ + +#include "transport_prio_qos_test.h" + +TransportPriorityPolicyTest::TransportPriorityPolicyTest () +{ +} + +bool +TransportPriorityPolicyTest::check (const ::DDS_TransportPriorityQosPolicy & dds_qos, + const ::DDS::TransportPriorityQosPolicy & qos) +{ + return dds_qos.value == qos.value; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.h new file mode 100644 index 00000000000..358dd62388f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/transport_prio_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef TRANSPORT_PRIORITY_QOS_TEST_H_ +#define TRANSPORT_PRIORITY_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/TransportPriorityQosPolicy.h" + +class TransportPriorityPolicyTest +{ +public: + TransportPriorityPolicyTest (); + + static bool check (const ::DDS_TransportPriorityQosPolicy & dds_qos, + const ::DDS::TransportPriorityQosPolicy & qos); +}; + +#endif /* TRANSPORT_PRIORITY_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.cpp new file mode 100644 index 00000000000..48ee76b0e20 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.cpp @@ -0,0 +1,18 @@ +// $Id$ + +#include "user_data_qos_test.h" + +#include "octet_seq.h" + +UserDataPolicyTest::UserDataPolicyTest () +{ +} + +bool +UserDataPolicyTest::check (const ::DDS_UserDataQosPolicy & dds_qos, + const ::DDS::UserDataQosPolicy & qos) +{ + return OctetSequence::check (dds_qos.value, + qos.value, + "UserDataPolicyTest"); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.h new file mode 100644 index 00000000000..c56c94f48f9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/user_data_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef USER_DATA_QOS_TEST_H_ +#define USER_DATA_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/UserDataQosPolicy.h" + +class UserDataPolicyTest +{ +public: + UserDataPolicyTest (); + + static bool check (const ::DDS_UserDataQosPolicy & dds_qos, + const ::DDS::UserDataQosPolicy & qos); +}; + +#endif /* USER_DATA_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.cpp b/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.cpp new file mode 100644 index 00000000000..6a8da1b9103 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.cpp @@ -0,0 +1,15 @@ +// $Id$ + +#include "wr_lifecycle_qos_test.h" + +WriterDataLifecyclePolicyTest::WriterDataLifecyclePolicyTest () +{ +} + +bool +WriterDataLifecyclePolicyTest::check (const ::DDS_WriterDataLifecycleQosPolicy & dds_qos, + const ::DDS::WriterDataLifecycleQosPolicy & qos) +{ + return dds_qos.autodispose_unregistered_instances == + static_cast <DDS_Boolean> (qos.autodispose_unregistered_instances); +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.h b/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.h new file mode 100644 index 00000000000..ac8674525f0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Policies/wr_lifecycle_qos_test.h @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef WRITER_DATA_LIFECYCLE_QOS_TEST_H_ +#define WRITER_DATA_LIFECYCLE_QOS_TEST_H_ + +#include "dds4ccm/idl/dds_rtf2_dcpsC.h" +#include "ndds/ndds_cpp.h" +#include "dds4ccm/impl/dds/ndds/WriterDataLifecycleQosPolicy.h" + +class WriterDataLifecyclePolicyTest +{ +public: + WriterDataLifecyclePolicyTest (); + + static bool check (const ::DDS_WriterDataLifecycleQosPolicy & dds_qos, + const ::DDS::WriterDataLifecycleQosPolicy & qos); +}; + +#endif /* WRITER_DATA_LIFECYCLE_QOS_TEST_H_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.idl new file mode 100644 index 00000000000..d7a42a8a2ea --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.idl @@ -0,0 +1,36 @@ +// $Id$ + +/** + * @file PortUsage_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef PORTUSAGE_EVENT_TEST_BASE_IDL +#define PORTUSAGE_EVENT_TEST_BASE_IDL + +#pragma ndds typesupport "Base/PortUsage_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "PortUsageTest" +#pragma DCPS_DATA_KEY "PortUsageTest symbol" + +struct PortUsageTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<PortUsageTest> PortUsageTestSeq; + +enum PortUsageAssignment { + //event ports + PORTUSAGE_ASSIGNMENT_WRITE, + //event and state ports + PORTUSAGE_ASSIGNMENT_GET, + PORTUSAGE_ASSIGNMENT_LISTEN, + //state ports + PORTUSAGE_ASSIGNMENT_UPDATE, + PORTUSAGE_ASSIGNMENT_READ, + PORTUSAGE_ASSIGNMENT_STATELISTEN +}; + + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.mpc new file mode 100755 index 00000000000..d8125682fb4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/Base/PortUsage_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (PortUsage_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = PortUsage_Test_Base_stub + dynamicflags += PORTUSAGE_EVENT_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=PORTUSAGE_EVENT_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=PortUsage_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + PortUsage_Test_Base.idl + } + + opendds_ts_flags += --export=PORTUSAGE_EVENT_TEST_BASE_STUB_Export + + DDSGenerator_Files { + PortUsage_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.idl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.idl new file mode 100644 index 00000000000..f74ce0c0306 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef EVENT_COMPONENT_IDL +#define EVENT_COMPONENT_IDL + +#include "EventConnector/PortUsageEvent_Connector.idl" + +module PortUsageEvent_Test +{ + component PortUsageEventComponent + { + port PortUsageTestConn::DDS_Write write_port; + port PortUsageTestConn::DDS_Get get_port; + port PortUsageTestConn::DDS_Listen listen_port; + + provides CCM_DDS::ConnectorStatusListener connector_status; + + attribute PortUsageAssignment portusage_assignment; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.mpc b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.mpc new file mode 100755 index 00000000000..7b483c5ec20 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(PortUsageEvent_Component_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += PortUsageEvent_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COMPONENT_STUB_Export \ + -Wb,stub_export_include=Component_stub_export.h \ + -Wb,skel_export_macro=COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Component_svnt_export.h \ + -Wb,svnt_export_macro=COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Component_svnt_export.h \ + -Wb,exec_export_macro=COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Component_exec_export.h -I.. + + IDL_Files { + PortUsageEvent_Component.idl + } +} + +project(PortUsageEvent_Component_lem_gen) : ciaoidldefaults, dds4ccm { + after += PortUsageEvent_Component_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Component_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + PortUsageEvent_ComponentE.idl + } +} + +project(PortUsageEvent_Component_lem_stub) : ccm_svnt, dds4ccm_base { + after += PortUsageEvent_Component_lem_gen PortUsageEvent_Component_stub \ + PortUsageEvent_Connector_stub PortUsage_Test_Base_stub + libs += EventComponent_stub PortUsageEvent_Connector_stub \ + PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = EventComponent_lem_stub + dynamicflags = COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ComponentEC.cpp + } + + Header_Files { + PortUsageEvent_ComponentEC.h + Component_lem_stub_export.h + } + + Inline_Files { + PortUsageEvent_ComponentEC.inl + } +} + +project(PortUsageEvent_Component_stub) : ccm_stub, dds4ccm_base { + after += PortUsageEvent_Component_idl_gen PortUsageEvent_Connector_stub \ + PortUsage_Test_Base_stub PortUsageEvent_Connector_lem_gen + libs += PortUsageEvent_Connector_stub PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = EventComponent_stub + dynamicflags = COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ComponentC.cpp + } + + Header_Files { + PortUsageEvent_ComponentC.h + Component_stub_export.h + } + + Inline_Files { + PortUsageEvent_ComponentC.inl + } +} + +project(PortUsageEvent_Component_exec) : ciao_executor, dds4ccm_base { + after += PortUsageEvent_Component_lem_stub PortUsageEvent_Component_stub \ + PortUsage_Test_Base_stub PortUsageEvent_Connector_stub \ + PortUsageEvent_Connector_lem_stub DDS4CCM_lem_stub + sharedname = EventComponent_exec + libs += EventComponent_stub EventComponent_lem_stub PortUsage_Test_Base_stub \ + PortUsageEvent_Connector_stub PortUsageEvent_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_Component_exec.cpp + } + + Header_Files { + PortUsageEvent_Component_exec.h + Component_exec_export.h + } + + Inline_Files { + } +} + + +project(PortUsageEvent_Component_svnt) : ciao_servant, dds4ccm_base { + after += PortUsageEvent_Component_lem_stub PortUsage_Test_Base_stub \ + PortUsageEvent_Connector_stub PortUsageEvent_Connector_svnt \ + PortUsageEvent_Component_exec PortUsageEvent_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = EventComponent_svnt + libs += EventComponent_stub EventComponent_lem_stub PortUsage_Test_Base_stub \ + PortUsageEvent_Connector_stub PortUsageEvent_Connector_svnt \ + EventComponent_exec PortUsageEvent_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ComponentS.cpp + PortUsageEvent_Component_svnt.cpp + } + + Header_Files { + PortUsageEvent_ComponentS.h + PortUsageEvent_Component_svnt.h + Component_svnt_export.h + } + + Inline_Files { + PortUsageEvent_ComponentS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.cpp new file mode 100644 index 00000000000..4f2a1ff666e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.cpp @@ -0,0 +1,296 @@ +// -*- C++ -*- +// +// $Id$ + +#include "PortUsageEvent_Component_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "ace/Log_Msg.h" +#include "ciao/Logger/Log_Macros.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_PortUsageEvent_Test_PortUsageEventComponent_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_ULong& datareaders_count, + Atomic_ULong& datawriters_count) + : datareaders_count_ (datareaders_count), + datawriters_count_ (datawriters_count) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + ACE_DEBUG ((LM_DEBUG, + "ConnectorStatusListener_exec_i::on_unexpected_status <%C>\n", + CIAO::DDS4CCM::translate_statuskind (status_kind))); + if (status_kind == DDS::PUBLICATION_MATCHED_STATUS) + { + DDS::DataWriter_var dw = DDS::DataWriter::_narrow (the_entity); + if (! ::CORBA::is_nil (dw.in ())) + { + ++this->datawriters_count_; + ACE_DEBUG ((LM_DEBUG, "DataWriters found until now <%u>\n", + this->datawriters_count_.value ())); + } + else + { + DDS::DataReader_var dr = DDS::DataReader::_narrow (the_entity); + if (! ::CORBA::is_nil (dr.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR : DATAREADER isn't nil when receiving an " + "on_publication_matched status\n")); + } + } + } + if (status_kind == DDS::SUBSCRIPTION_MATCHED_STATUS) + { + DDS::DataReader_var dw = DDS::DataReader::_narrow (the_entity); + if (! ::CORBA::is_nil (dw.in ())) + { + ++this->datareaders_count_; + ACE_DEBUG ((LM_DEBUG, "DataReaders found until now <%u>\n", + this->datareaders_count_.value ())); + } + DDS::DataWriter_var dr = DDS::DataWriter::_narrow (the_entity); + if (! ::CORBA::is_nil (dr.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR : DATAREADER isn't nil when receiving an " + "on_subscription_matched status\n")); + } + } + } + + //============================================================ + // Component_exec_i + //============================================================ + Component_exec_i::Component_exec_i (void) + : assignment_ (PORTUSAGE_ASSIGNMENT_WRITE), + datareaders_count_ (0), + datawriters_count_ (0) + { + } + + Component_exec_i::~Component_exec_i (void) + { + } + + // Supported operations and attributes. + void + Component_exec_i::check_writer () + { + if (this->datawriters_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_writer - " + "ERROR : Unexpected number of DataWriters detected - " + "expected <1> - detected <%u>\n", + this->datawriters_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_writer - " + "OK : Detected the expected number of DataWriters - " + "expected <1> - detected <%u>\n", + this->datawriters_count_.value ())); + } + } + + void + Component_exec_i::check_getter () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_getter - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_getter - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + void + Component_exec_i::check_listener () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_listener - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_listener - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + // Component attributes. + PortUsageAssignment + Component_exec_i::portusage_assignment() + { + return this->assignment_; + } + + void + Component_exec_i::portusage_assignment(PortUsageAssignment assignment) + { + switch (assignment) + { + case PORTUSAGE_ASSIGNMENT_WRITE: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check writer port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_GET: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check getter port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_LISTEN: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check listener port'\n")); + break; + default: + ACE_ERROR ((LM_ERROR, "Component_exec_i::portusage_assignment - " + "ERROR : Unknown assignment\n")); + break; + + } + this->assignment_ = assignment; + } + + // Port operations. + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_get_port_status() + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + PortUsageEvent_Test::PortUsageTestConn::CCM_Listener_ptr + Component_exec_i::get_listen_port_data_listener() + { + return PortUsageEvent_Test::PortUsageTestConn::CCM_Listener::_nil (); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_listen_port_status() + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + CCM_DDS::CCM_ConnectorStatusListener_ptr + Component_exec_i::get_connector_status () + { + return new ConnectorStatusListener_exec_i ( + this->datareaders_count_, + this->datawriters_count_); + } + + // Operations from Components::SessionComponent. + void + Component_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::PortUsageEvent_Test::CCM_PortUsageEventComponent_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Component_exec_i::configuration_complete (void) + { + } + + void + Component_exec_i::ccm_activate (void) + { + } + + void + Component_exec_i::ccm_passivate (void) + { + } + + void + Component_exec_i::ccm_remove (void) + { + switch (this->assignment_) + { + case PORTUSAGE_ASSIGNMENT_WRITE: + this->check_writer (); + break; + case PORTUSAGE_ASSIGNMENT_GET: + this->check_getter (); + break; + case PORTUSAGE_ASSIGNMENT_LISTEN: + this->check_listener (); + break; + default: + ACE_ERROR ((LM_ERROR, "Component_exec_i::ccm_remove - " + "ERROR : Unknown assignment\n")); + break; + + } + } + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PortUsageEvent_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Component_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.h new file mode 100644 index 00000000000..d3cf4ff9b4f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventComponent/PortUsageEvent_Component_exec.h @@ -0,0 +1,125 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_COMPONENT_EXEC_H_ +#define CIAO_COMPONENT_EXEC_H_ + +#include "PortUsageEvent_ComponentEC.h" + +#include /**/ "Component_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_PortUsageEvent_Test_PortUsageEventComponent_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class COMPONENT_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_ULong&, + Atomic_ULong&); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_ULong& datareaders_count_; + Atomic_ULong& datawriters_count_; + }; + + //============================================================ + // Component_exec_i + //============================================================ + class COMPONENT_EXEC_Export Component_exec_i + : public virtual PortUsageEventComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + Component_exec_i (void); + virtual ~Component_exec_i (void); + + // Component attributes. + virtual PortUsageAssignment + portusage_assignment (void); + + virtual void + portusage_assignment (PortUsageAssignment assignment); + + // Port operations. + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_get_port_status (void); + + virtual PortUsageEvent_Test::PortUsageTestConn::CCM_Listener_ptr + get_listen_port_data_listener (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_listen_port_status (void); + + virtual CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (); + + // 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: + ::PortUsageEvent_Test::CCM_PortUsageEventComponent_Context_var context_; + ::PortUsageEvent_Test::PortUsageTestConn::Reader_var reader_; //Listener + ::PortUsageEvent_Test::PortUsageTestConn::Writer_var writer_; //Writer + ::PortUsageEvent_Test::PortUsageTestConn::Getter_var getter_; //Getter + + PortUsageAssignment assignment_; + + Atomic_ULong datareaders_count_; + Atomic_ULong datawriters_count_; + + // Supported operations and attributes. + void + check_writer (void); + + void + check_getter (void); + + void + check_listener (void); + }; + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PortUsageEvent_Component_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.idl new file mode 100644 index 00000000000..a1067b2be0f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file PortUsageEvent_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef PORTUSAGE_EVENT_TEST_CONNECTOR_IDL_ +#define PORTUSAGE_EVENT_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/PortUsage_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "EventConnector/PortUsageEvent_ConnectorE.idl" + +module PortUsageEvent_Test +{ + module ::CCM_DDS::Typed < ::PortUsageTest, ::PortUsageTestSeq> PortUsageTestConn; + connector PortUsageEvent_Connector : PortUsageTestConn::DDS_Event + { + }; +}; + +#endif /* PORTUSAGE_EVENT_TEST_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.mpc new file mode 100755 index 00000000000..d11121d36f6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/EventConnector/PortUsageEvent_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p PortUsage_Test_Base -l .. -o ../lib -u DDS PortUsageEvent_Connector" + +project(PortUsageEvent_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=PortUsageEvent_Connector_stub_export.h \ + -Wb,skel_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=PortUsageEvent_Connector_svnt_export.h \ + -Wb,svnt_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=PortUsageEvent_Connector_svnt_export.h \ + -Wb,conn_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=PortUsageEvent_Connector_conn_export.h \ + -I .. + + IDL_Files { + PortUsageEvent_Connector.idl + } +} + +project(PortUsageEvent_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += PortUsageEvent_Connector_idl_gen + idlflags += -Wb,stub_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=PortUsageEvent_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + PortUsageEvent_ConnectorE.idl + } +} + +project(PortUsageEvent_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += PortUsageEvent_Connector_lem_gen PortUsageEvent_Connector_stub PortUsage_Test_Base_stub DDS4CCM_lem_stub + libs += PortUsage_Test_Base_stub PortUsageEvent_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = PortUsageEvent_Connector_lem_stub + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ConnectorEC.cpp + } + + Header_Files { + PortUsageEvent_ConnectorEC.h + PortUsageEvent_Connector_lem_stub_export.h + } + + Inline_Files { + PortUsageEvent_ConnectorEC.inl + } +} + +project(PortUsageEvent_Connector_stub) : ccm_stub, dds4ccm_base { + after += PortUsageEvent_Connector_idl_gen PortUsage_Test_Base_stub + libs += PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = PortUsageEvent_Connector_stub + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ConnectorC.cpp + } + + Header_Files { + PortUsageEvent_ConnectorC.h + PortUsageEvent_Connector_stub_export.h + } + + Inline_Files { + PortUsageEvent_ConnectorC.inl + } +} + +project(PortUsageEvent_Connector_exec) : ciao_executor, dds4ccm_impl { + after += PortUsageEvent_Connector_lem_stub PortUsageEvent_Connector_stub DDS4CCM_lem_stub PortUsage_Test_Base_stub + sharedname = PortUsageEvent_Connector_exec + libs += PortUsageEvent_Connector_stub PortUsageEvent_Connector_lem_stub PortUsage_Test_Base_stub DDS4CCM_lem_stub PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_Connector_conn.cpp + } + + Header_Files { + PortUsageEvent_Connector_conn.h + PortUsageEvent_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(PortUsageEvent_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += PortUsageEvent_Connector_lem_stub PortUsageEvent_Connector_exec PortUsageEvent_Connector_stub DDS4CCM_lem_stub + sharedname = PortUsageEvent_Connector_svnt + libs += PortUsageEvent_Connector_stub \ + PortUsageEvent_Connector_lem_stub \ + PortUsage_Test_Base_stub \ + PortUsageEvent_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageEvent_ConnectorS.cpp + PortUsageEvent_Connector_svnt.cpp + } + + Header_Files { + PortUsageEvent_ConnectorS.h + PortUsageEvent_Connector_svnt.h + PortUsageEvent_Connector_svnt_export.h + } + + Inline_Files { + PortUsageEvent_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.idl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.idl new file mode 100644 index 00000000000..9c04651fe63 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef STATE_COMPONENT_IDL +#define STATE_COMPONENT_IDL + +#include "StateConnector/PortUsageState_Connector.idl" + +module PortUsageState_Test +{ + component PortUsageStateComponent + { + port PortUsageTestConn::DDS_Update update_port; + port PortUsageTestConn::DDS_Read read_port; + port PortUsageTestConn::DDS_Get get_port; + port PortUsageTestConn::DDS_Listen listen_port; + port PortUsageTestConn::DDS_StateListen state_listen_port; + + provides CCM_DDS::ConnectorStatusListener connector_status; + + attribute PortUsageAssignment portusage_assignment; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.mpc b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.mpc new file mode 100755 index 00000000000..cd3ede80694 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(PortUsageState_Component_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += PortUsageState_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COMPONENT_STUB_Export \ + -Wb,stub_export_include=Component_stub_export.h \ + -Wb,skel_export_macro=COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Component_svnt_export.h \ + -Wb,svnt_export_macro=COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Component_svnt_export.h \ + -Wb,exec_export_macro=COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Component_exec_export.h -I.. + + IDL_Files { + PortUsageState_Component.idl + } +} + +project(PortUsageState_Component_lem_gen) : ciaoidldefaults, dds4ccm { + after += PortUsageState_Component_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Component_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + PortUsageState_ComponentE.idl + } +} + +project(PortUsageState_Component_lem_stub) : ccm_svnt, dds4ccm_base { + after += PortUsageState_Component_lem_gen PortUsageState_Component_stub \ + PortUsageState_Connector_stub PortUsage_Test_Base_stub + libs += StateComponent_stub PortUsageState_Connector_stub \ + PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = StateComponent_lem_stub + dynamicflags = COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ComponentEC.cpp + } + + Header_Files { + PortUsageState_ComponentEC.h + Component_lem_stub_export.h + } + + Inline_Files { + PortUsageState_ComponentEC.inl + } +} + +project(PortUsageState_Component_stub) : ccm_stub, dds4ccm_base { + after += PortUsageState_Component_idl_gen PortUsageState_Connector_stub \ + PortUsage_Test_Base_stub PortUsageState_Connector_lem_gen + libs += PortUsageState_Connector_stub PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = StateComponent_stub + dynamicflags = COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ComponentC.cpp + } + + Header_Files { + PortUsageState_ComponentC.h + Component_stub_export.h + } + + Inline_Files { + PortUsageState_ComponentC.inl + } +} + +project(PortUsageState_Component_exec) : ciao_executor, dds4ccm_base { + after += PortUsageState_Component_lem_stub PortUsageState_Component_stub \ + PortUsage_Test_Base_stub PortUsageState_Connector_stub \ + PortUsageState_Connector_lem_stub DDS4CCM_lem_stub + sharedname = StateComponent_exec + libs += StateComponent_stub StateComponent_lem_stub PortUsage_Test_Base_stub \ + PortUsageState_Connector_stub PortUsageState_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_Component_exec.cpp + } + + Header_Files { + PortUsageState_Component_exec.h + Component_exec_export.h + } + + Inline_Files { + } +} + + +project(PortUsageState_Component_svnt) : ciao_servant, dds4ccm_base { + after += PortUsageState_Component_lem_stub PortUsage_Test_Base_stub \ + PortUsageState_Connector_stub PortUsageState_Connector_svnt \ + PortUsageState_Component_exec PortUsageState_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = StateComponent_svnt + libs += StateComponent_stub StateComponent_lem_stub PortUsage_Test_Base_stub \ + PortUsageState_Connector_stub PortUsageState_Connector_svnt \ + StateComponent_exec PortUsageState_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ComponentS.cpp + PortUsageState_Component_svnt.cpp + } + + Header_Files { + PortUsageState_ComponentS.h + PortUsageState_Component_svnt.h + Component_svnt_export.h + } + + Inline_Files { + PortUsageState_ComponentS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.cpp new file mode 100644 index 00000000000..1e546119b36 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.cpp @@ -0,0 +1,365 @@ +// -*- C++ -*- +// +// $Id$ + +#include "PortUsageState_Component_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "ace/Log_Msg.h" +#include "ciao/Logger/Log_Macros.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_PortUsageState_Test_PortUsageStateComponent_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_ULong& datareaders_count, + Atomic_ULong& datawriters_count) + : datareaders_count_ (datareaders_count), + datawriters_count_ (datawriters_count) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + ACE_DEBUG ((LM_DEBUG, + "ConnectorStatusListener_exec_i::on_unexpected_status <%C>\n", + CIAO::DDS4CCM::translate_statuskind (status_kind))); + if (status_kind == DDS::PUBLICATION_MATCHED_STATUS) + { + DDS::DataWriter_var dw = DDS::DataWriter::_narrow (the_entity); + if (! ::CORBA::is_nil (dw.in ())) + { + ++this->datawriters_count_; + ACE_DEBUG ((LM_DEBUG, "DataWriters found until now <%u>\n", + this->datawriters_count_.value ())); + } + else + { + DDS::DataReader_var dr = DDS::DataReader::_narrow (the_entity); + if (! ::CORBA::is_nil (dr.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR : DATAREADER isn't nil when receiving an " + "on_publication_matched status\n")); + } + } + } + if (status_kind == DDS::SUBSCRIPTION_MATCHED_STATUS) + { + DDS::DataReader_var dw = DDS::DataReader::_narrow (the_entity); + if (! ::CORBA::is_nil (dw.in ())) + { + ++this->datareaders_count_; + ACE_DEBUG ((LM_DEBUG, "DataReaders found until now <%u>\n", + this->datareaders_count_.value ())); + } + DDS::DataWriter_var dr = DDS::DataWriter::_narrow (the_entity); + if (! ::CORBA::is_nil (dr.in ())) + { + ACE_ERROR ((LM_ERROR, "ERROR : DATAREADER isn't nil when receiving an " + "on_subscription_matched status\n")); + } + } + } + + //============================================================ + // Component_exec_i + //============================================================ + Component_exec_i::Component_exec_i (void) + : assignment_ (PORTUSAGE_ASSIGNMENT_WRITE), + datareaders_count_ (0), + datawriters_count_ (0) + { + } + + Component_exec_i::~Component_exec_i (void) + { + } + + // Supported operations and attributes. + void + Component_exec_i::check_updater () + { + if (this->datawriters_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_writer - " + "ERROR : Unexpected number of DataWriters detected - " + "expected <1> - detected <%u>\n", + this->datawriters_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_writer - " + "OK : Detected the expect number of DataWriters - " + "expected <1> - detected <%u>\n", + this->datawriters_count_.value ())); + } + } + + void + Component_exec_i::check_getter () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_getter - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_getter - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + void + Component_exec_i::check_listener () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_listener - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_listener - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + void + Component_exec_i::check_reader () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_reader - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_reader - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + void + Component_exec_i::check_state_listen () + { + if (this->datareaders_count_.value () != 1) + { + ACE_ERROR ((LM_ERROR, "Component_exec_i::check_state_listen - " + "ERROR : Unexpected number of DataReaders detected - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Component_exec_i::check_state_listen - " + "OK : Detected the expected number of DataReaders - " + "expected <1> - detected <%u>\n", + this->datareaders_count_.value ())); + } + } + + // Component attributes. + PortUsageAssignment + Component_exec_i::portusage_assignment() + { + return this->assignment_; + } + + void + Component_exec_i::portusage_assignment(PortUsageAssignment assignment) + { + switch (assignment) + { + case PORTUSAGE_ASSIGNMENT_UPDATE: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check updater port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_GET: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check getter port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_LISTEN: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check listener port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_READ: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check reader port'\n")); + break; + case PORTUSAGE_ASSIGNMENT_STATELISTEN: + ACE_DEBUG ((LM_DEBUG, "New assigment: 'check state listen port'\n")); + break; + default: + ACE_ERROR ((LM_ERROR, "Component_exec_i::portusage_assignment - " + "ERROR : Unknown assignment\n")); + break; + + } + this->assignment_ = assignment; + } + + // Port operations. + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_read_port_status() + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + PortUsageState_Test::PortUsageTestConn::CCM_StateListener_ptr + Component_exec_i::get_state_listen_port_data_listener() + { + return PortUsageState_Test::PortUsageTestConn::CCM_StateListener::_nil (); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_state_listen_port_status() + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + CCM_DDS::CCM_ConnectorStatusListener_ptr + Component_exec_i::get_connector_status () + { + return new ConnectorStatusListener_exec_i ( + this->datareaders_count_, + this->datawriters_count_); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_get_port_status (void) + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + PortUsageState_Test::PortUsageTestConn::CCM_Listener_ptr + Component_exec_i::get_listen_port_data_listener (void) + { + return PortUsageState_Test::PortUsageTestConn::CCM_Listener::_nil (); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Component_exec_i::get_listen_port_status (void) + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + + // Operations from Components::SessionComponent. + void + Component_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::PortUsageState_Test::CCM_PortUsageStateComponent_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Component_exec_i::configuration_complete (void) + { + } + + void + Component_exec_i::ccm_activate (void) + { + } + + void + Component_exec_i::ccm_passivate (void) + { + } + + void + Component_exec_i::ccm_remove (void) + { + switch (this->assignment_) + { + case PORTUSAGE_ASSIGNMENT_UPDATE: + this->check_updater (); + break; + case PORTUSAGE_ASSIGNMENT_GET: + this->check_getter (); + break; + case PORTUSAGE_ASSIGNMENT_LISTEN: + this->check_listener (); + break; + case PORTUSAGE_ASSIGNMENT_READ: + this->check_reader (); + break; + case PORTUSAGE_ASSIGNMENT_STATELISTEN: + this->check_state_listen (); + break; + default: + ACE_ERROR ((LM_ERROR, "Component_exec_i::ccm_remove - " + "ERROR : Unknown assignment\n")); + break; + + } + } + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PortUsageState_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Component_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.h b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.h new file mode 100644 index 00000000000..fbc345bab50 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateComponent/PortUsageState_Component_exec.h @@ -0,0 +1,140 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_COMPONENT_EXEC_H_ +#define CIAO_COMPONENT_EXEC_H_ + +#include "PortUsageState_ComponentEC.h" + +#include /**/ "Component_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_PortUsageState_Test_PortUsageStateComponent_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong> Atomic_ULong; + + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + class COMPONENT_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_ULong&, + Atomic_ULong&); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_ULong& datareaders_count_; + Atomic_ULong& datawriters_count_; + }; + + //============================================================ + // Component_exec_i + //============================================================ + class COMPONENT_EXEC_Export Component_exec_i + : public virtual PortUsageStateComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + Component_exec_i (void); + virtual ~Component_exec_i (void); + + // Component attributes. + virtual PortUsageAssignment + portusage_assignment (void); + + virtual void + portusage_assignment (PortUsageAssignment assignment); + + // Port operations. + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_read_port_status (void); + + virtual PortUsageState_Test::PortUsageTestConn::CCM_StateListener_ptr + get_state_listen_port_data_listener (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_state_listen_port_status (void); + + virtual CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_get_port_status (void); + + virtual PortUsageState_Test::PortUsageTestConn::CCM_Listener_ptr + get_listen_port_data_listener (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_listen_port_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::PortUsageState_Test::CCM_PortUsageStateComponent_Context_var context_; + ::PortUsageState_Test::PortUsageTestConn::Reader_var reader_; //Listener + ::PortUsageState_Test::PortUsageTestConn::Writer_var writer_; //Writer + ::PortUsageState_Test::PortUsageTestConn::Getter_var getter_; //Getter + + PortUsageAssignment assignment_; + + Atomic_ULong datareaders_count_; + Atomic_ULong datawriters_count_; + + // Supported operations and attributes. + void + check_updater (void); + + void + check_getter (void); + + void + check_listener (void); + + void + check_reader (void); + + void + check_state_listen (void); + }; + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_PortUsageState_Component_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.idl new file mode 100644 index 00000000000..c136ac6978d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file PortUsageState_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef PORTUSAGE_STATE_CONNECTOR_IDL_ +#define PORTUSAGE_STATE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/PortUsage_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "StateConnector/PortUsageState_ConnectorE.idl" + +module PortUsageState_Test +{ + module ::CCM_DDS::Typed < ::PortUsageTest, ::PortUsageTestSeq> PortUsageTestConn; + connector PortUsageState_Connector : PortUsageTestConn::DDS_State + { + }; +}; + +#endif /* PORTUSAGE_STATE_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.mpc new file mode 100755 index 00000000000..759675786e4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/StateConnector/PortUsageState_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p PortUsage_Test_Base -l .. -o ../lib -u DDS PortUsageState_Connector" + +project(PortUsageState_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=PortUsageState_Connector_stub_export.h \ + -Wb,skel_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=PortUsageState_Connector_svnt_export.h \ + -Wb,svnt_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=PortUsageState_Connector_svnt_export.h \ + -Wb,conn_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=PortUsageState_Connector_conn_export.h \ + -I .. + + IDL_Files { + PortUsageState_Connector.idl + } +} + +project(PortUsageState_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += PortUsageState_Connector_idl_gen + idlflags += -Wb,stub_export_macro=PORTUSAGE_EVENT_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=PortUsageState_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + PortUsageState_ConnectorE.idl + } +} + +project(PortUsageState_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += PortUsageState_Connector_lem_gen PortUsageState_Connector_stub PortUsage_Test_Base_stub DDS4CCM_lem_stub + libs += PortUsage_Test_Base_stub PortUsageState_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = PortUsageState_Connector_lem_stub + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ConnectorEC.cpp + } + + Header_Files { + PortUsageState_ConnectorEC.h + PortUsageState_Connector_lem_stub_export.h + } + + Inline_Files { + PortUsageState_ConnectorEC.inl + } +} + +project(PortUsageState_Connector_stub) : ccm_stub, dds4ccm_base { + after += PortUsageState_Connector_idl_gen PortUsage_Test_Base_stub + libs += PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = PortUsageState_Connector_stub + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ConnectorC.cpp + } + + Header_Files { + PortUsageState_ConnectorC.h + PortUsageState_Connector_stub_export.h + } + + Inline_Files { + PortUsageState_ConnectorC.inl + } +} + +project(PortUsageState_Connector_exec) : ciao_executor, dds4ccm_impl { + after += PortUsageState_Connector_lem_stub PortUsageState_Connector_stub DDS4CCM_lem_stub PortUsage_Test_Base_stub + sharedname = PortUsageState_Connector_exec + libs += PortUsageState_Connector_stub PortUsageState_Connector_lem_stub PortUsage_Test_Base_stub DDS4CCM_lem_stub PortUsage_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_Connector_conn.cpp + } + + Header_Files { + PortUsageState_Connector_conn.h + PortUsageState_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(PortUsageState_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += PortUsageState_Connector_lem_stub PortUsageState_Connector_exec PortUsageState_Connector_stub DDS4CCM_lem_stub + sharedname = PortUsageState_Connector_svnt + libs += PortUsageState_Connector_stub \ + PortUsageState_Connector_lem_stub \ + PortUsage_Test_Base_stub \ + PortUsageState_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = PORTUSAGE_EVENT_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + PortUsageState_ConnectorS.cpp + PortUsageState_Connector_svnt.cpp + } + + Header_Files { + PortUsageState_ConnectorS.h + PortUsageState_Connector_svnt.h + PortUsageState_Connector_svnt_export.h + } + + Inline_Files { + PortUsageState_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Get.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Get.cdp new file mode 100644 index 00000000000..d91244f0f19 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Get.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEventComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageEvent_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageEvent_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_PortUsageEvent_Test_PortUsageEvent_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEvent_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_GET</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>write_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_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="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageEvent_Connector_ExecArtifact"> + <name>PortUsageEvent_Connector_exec</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_SvntArtifact"> + <name>PortUsageEvent_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_StubArtifact"> + <name>PortUsageEvent_Connector_stub</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>EventComponent_exec</name> + <source/> + <node/> + <location>EventComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>EventComponent_svnt</name> + <source/> + <node/> + <location>EventComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Listen.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Listen.cdp new file mode 100644 index 00000000000..50f58675996 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Listen.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEventComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageEvent_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageEvent_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_PortUsageEvent_Test_PortUsageEvent_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEvent_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_LISTEN</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>write_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>listen_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageEvent_Connector_ExecArtifact"> + <name>PortUsageEvent_Connector_exec</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_SvntArtifact"> + <name>PortUsageEvent_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_StubArtifact"> + <name>PortUsageEvent_Connector_stub</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>EventComponent_exec</name> + <source/> + <node/> + <location>EventComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>EventComponent_svnt</name> + <source/> + <node/> + <location>EventComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Write.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Write.cdp new file mode 100644 index 00000000000..ac29fa7f6a7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/Event_Write.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEventComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EventComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageEvent_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageEvent_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_PortUsageEvent_Test_PortUsageEvent_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageEvent_Test_PortUsageEvent_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageEvent_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_WRITE</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>write_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <!-- a writer is need to force an on_publication_matched --> + <connection> + <name>listen_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>listen_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageEvent_Connector_ExecArtifact"> + <name>PortUsageEvent_Connector_exec</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_SvntArtifact"> + <name>PortUsageEvent_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageEvent_Connector_StubArtifact"> + <name>PortUsageEvent_Connector_stub</name> + <source/> + <node/> + <location>PortUsageEvent_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>EventComponent_exec</name> + <source/> + <node/> + <location>EventComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>EventComponent_svnt</name> + <source/> + <node/> + <location>EventComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Get.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Get.cdp new file mode 100644 index 00000000000..0c254b0cde9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Get.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageStateComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageState_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageState_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_PortUsageState_Test_PortUsageState_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageState_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_GET</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>update_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>update_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_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="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageState_Connector_ExecArtifact"> + <name>PortUsageState_Connector_exec</name> + <source/> + <node/> + <location>PortUsageState_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_SvntArtifact"> + <name>PortUsageState_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageState_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_StubArtifact"> + <name>PortUsageState_Connector_stub</name> + <source/> + <node/> + <location>PortUsageState_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>StateComponent_exec</name> + <source/> + <node/> + <location>StateComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>StateComponent_svnt</name> + <source/> + <node/> + <location>StateComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>StateComponent_stub</name> + <source/> + <node/> + <location>StateComponent_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Listen.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Listen.cdp new file mode 100644 index 00000000000..7bd888143f3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Listen.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageStateComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageState_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageState_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_PortUsageState_Test_PortUsageState_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageState_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_LISTEN</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>update_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>update_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>listen_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>listen_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageState_Connector_ExecArtifact"> + <name>PortUsageState_Connector_exec</name> + <source/> + <node/> + <location>PortUsageState_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_SvntArtifact"> + <name>PortUsageState_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageState_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_StubArtifact"> + <name>PortUsageState_Connector_stub</name> + <source/> + <node/> + <location>PortUsageState_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>StateComponent_exec</name> + <source/> + <node/> + <location>StateComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>StateComponent_svnt</name> + <source/> + <node/> + <location>StateComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Read.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Read.cdp new file mode 100644 index 00000000000..518631c10c9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Read.cdp @@ -0,0 +1,246 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageStateComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageState_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageState_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_PortUsageState_Test_PortUsageState_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageState_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_READ</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>update_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>update_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>read_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="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageState_Connector_ExecArtifact"> + <name>PortUsageState_Connector_exec</name> + <source/> + <node/> + <location>PortUsageState_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_SvntArtifact"> + <name>PortUsageState_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageState_Connector_svnt</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>StateComponent_exec</name> + <source/> + <node/> + <location>StateComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>StateComponent_svnt</name> + <source/> + <node/> + <location>StateComponent_svnt</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_StateListen.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_StateListen.cdp new file mode 100644 index 00000000000..b8030168f8d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_StateListen.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageStateComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageState_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageState_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_PortUsageState_Test_PortUsageState_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageState_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_STATELISTEN</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <!-- a writer is need to force an on_subscription_matched --> + <connection> + <name>update_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>update_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>state_listen_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>state_listen_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageState_Connector_ExecArtifact"> + <name>PortUsageState_Connector_exec</name> + <source/> + <node/> + <location>PortUsageState_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_SvntArtifact"> + <name>PortUsageState_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageState_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_StubArtifact"> + <name>PortUsageState_Connector_stub</name> + <source/> + <node/> + <location>PortUsageState_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>StateComponent_exec</name> + <source/> + <node/> + <location>StateComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>StateComponent_svnt</name> + <source/> + <node/> + <location>StateComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Update.cdp b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Update.cdp new file mode 100644 index 00000000000..6479d943a3b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/State_Update.cdp @@ -0,0 +1,258 @@ +<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>PortUsage_Test_Depl</label> + <UUID>PortUsage_Test_Depl</UUID> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageStateComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StateComponent_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="PortUsageState_Connector_ExecArtifact" /> + <artifact xmi:idref="PortUsageState_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_PortUsageState_Test_PortUsageState_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_PortUsageState_Test_PortUsageState_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsageState_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="ComponentInstance"> + <name>ComponentInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>portusage_assignment</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>Assigment</name> + <typeId>IDL:Simple/Assignment:1.0</typeId> + <member>PORTUSAGE_ASSIGNMENT_WRITE</member> + <member>PORTUSAGE_ASSIGNMENT_GET</member> + <member>PORTUSAGE_ASSIGNMENT_LISTEN</member> + <member>PORTUSAGE_ASSIGNMENT_UPDATE</member> + <member>PORTUSAGE_ASSIGNMENT_READ</member> + <member>PORTUSAGE_ASSIGNMENT_STATELISTEN</member> + </enum> + </type> + <value> + <enum>PORTUSAGE_ASSIGNMENT_UPDATE</enum> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ConnectorInstance"> + <name>ConnectorInstance</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PortUsage_Test</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>update_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>update_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <!-- a reader is need to force an on_publication_matched --> + <connection> + <name>read_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="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>connector_status</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ConnectorInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="PortUsageState_Connector_ExecArtifact"> + <name>PortUsageState_Connector_exec</name> + <source/> + <node/> + <location>PortUsageState_Connector_exec</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_SvntArtifact"> + <name>PortUsageState_Connector_svnt</name> + <source/> + <node/> + <location>PortUsageState_Connector_svnt</location> + </artifact> + <artifact xmi:id="PortUsageState_Connector_StubArtifact"> + <name>PortUsageState_Connector_stub</name> + <source/> + <node/> + <location>PortUsageState_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>StateComponent_exec</name> + <source/> + <node/> + <location>StateComponent_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>StateComponent_svnt</name> + <source/> + <node/> + <location>StateComponent_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/run_test.pl new file mode 100755 index 00000000000..c26f639fb6d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/PortUsage/descriptors/run_test.pl @@ -0,0 +1,217 @@ +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 = 1; +@ports = ( 60001 ); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode" ); + +# 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; + +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 ('ciao_componentserver'); +} + + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 node daemon\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; +} + +if ($#ARGV == -1) { + opendir(DIR, "."); + @files = grep(/\.cdp$/,readdir(DIR)); + closedir(DIR); +} +else { + @files = @ARGV; +} + +create_targets (); +init_ior_files (); + +foreach $file (@files) { + print "*********** Starting test for deployment $file ***********\n"; + + print STDERR "Starting Naming Service\n"; + + $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 1 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + $NS->Spawn (); + + 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 daemons\n"; + kill_open_processes (); + exit 1; + } + + $daemons_running = 1; + + # Invoke execution manager. + print "Invoking execution manager\n"; + $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager", + "-e$ior_emfile --domain-nc corbaloc:rir:/NameService"); + $EM->Spawn (); + + 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"; + $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $file -k file://$ior_emfile"); + $E->SpawnWaitKill (5 * $tg_executor->ProcessStartWaitInterval ()); + + print "Sleeping 5 seconds to allow task to complete\n"; + sleep (5); + + print "Teardown the application\n"; + $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $file -s"); + $E->SpawnWaitKill (5 * $tg_executor->ProcessStartWaitInterval ()); + print "Executor finished.\n"; + + delete_ior_files (); + kill_open_processes (); +} + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.idl new file mode 100644 index 00000000000..ac424ff2c3a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file QosProfile_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef COHERENT_WRITE_TEST_BASE_IDL +#define COHERENT_WRITE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/QosProfile_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "QosProfileTest" +#pragma DCPS_DATA_KEY "QosProfileTest symbol" + +struct QosProfileTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<QosProfileTest> QosProfileTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.mpc new file mode 100755 index 00000000000..9d9f07cf4d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Base/QosProfile_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (QosProfile_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = QosProfile_Test_Base_stub + dynamicflags += COHERENT_WRITE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=COHERENT_WRITE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=QosProfile_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + QosProfile_Test_Base.idl + } + + opendds_ts_flags += --export=COHERENT_WRITE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + QosProfile_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.idl b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.idl new file mode 100644 index 00000000000..ca0ced47bd1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QosProfile_Test_Connector.idl" + +module QosProfile_Test +{ + component QosProfileComponent + { + port QosProfileTestConn::DDS_Write info_write; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.mpc b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.mpc new file mode 100755 index 00000000000..0b454ea7df6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(QosProfile_Test_Component_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += QosProfile_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COMPONENT_STUB_Export \ + -Wb,stub_export_include=Component_stub_export.h \ + -Wb,skel_export_macro=COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Component_svnt_export.h \ + -Wb,svnt_export_macro=COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Component_svnt_export.h \ + -Wb,exec_export_macro=COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Component_exec_export.h -I.. + + IDL_Files { + QosProfile_Test_Component.idl + } +} + +project(QosProfile_Test_Component_lem_gen) : ciaoidldefaults, dds4ccm { + after += QosProfile_Test_Component_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Component_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + QosProfile_Test_ComponentE.idl + } +} + +project(QosProfile_Test_Component_lem_stub) : ccm_svnt, dds4ccm_base { + after += QosProfile_Test_Component_lem_gen QosProfile_Test_Component_stub \ + QosProfile_Test_Connector_stub QosProfile_Test_Base_stub + libs += Component_stub QosProfile_Test_Connector_stub \ + QosProfile_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Component_lem_stub + dynamicflags = COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ComponentEC.cpp + } + + Header_Files { + QosProfile_Test_ComponentEC.h + Component_lem_stub_export.h + } + + Inline_Files { + QosProfile_Test_ComponentEC.inl + } +} + +project(QosProfile_Test_Component_stub) : ccm_stub, dds4ccm_base { + after += QosProfile_Test_Component_idl_gen QosProfile_Test_Connector_stub \ + QosProfile_Test_Base_stub QosProfile_Test_Connector_lem_gen + libs += QosProfile_Test_Connector_stub QosProfile_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Component_stub + dynamicflags = COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ComponentC.cpp + } + + Header_Files { + QosProfile_Test_ComponentC.h + Component_stub_export.h + } + + Inline_Files { + QosProfile_Test_ComponentC.inl + } +} + +project(QosProfile_Test_Component_exec) : ciao_executor, dds4ccm_base { + after += QosProfile_Test_Component_lem_stub QosProfile_Test_Component_stub \ + QosProfile_Test_Base_stub QosProfile_Test_Connector_stub \ + QosProfile_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Component_exec + libs += Component_stub Component_lem_stub QosProfile_Test_Base_stub \ + QosProfile_Test_Connector_stub QosProfile_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_Component_exec.cpp + } + + Header_Files { + QosProfile_Test_Component_exec.h + Component_exec_export.h + } + + Inline_Files { + } +} + + +project(QosProfile_Test_Component_svnt) : ciao_servant, dds4ccm_base { + after += QosProfile_Test_Component_lem_stub QosProfile_Test_Base_stub \ + QosProfile_Test_Connector_stub QosProfile_Test_Connector_svnt \ + QosProfile_Test_Component_exec QosProfile_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Component_svnt + libs += Component_stub Component_lem_stub QosProfile_Test_Base_stub \ + QosProfile_Test_Connector_stub QosProfile_Test_Connector_svnt \ + Component_exec QosProfile_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ComponentS.cpp + QosProfile_Test_Component_svnt.cpp + } + + Header_Files { + QosProfile_Test_ComponentS.h + QosProfile_Test_Component_svnt.h + Component_svnt_export.h + } + + Inline_Files { + QosProfile_Test_ComponentS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.cpp new file mode 100644 index 00000000000..98fa5806980 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.cpp @@ -0,0 +1,67 @@ +// -*- C++ -*- +// +// $Id$ + +#include "QosProfile_Test_Component_exec.h" + +namespace CIAO_QosProfile_Test_QosProfileComponent_Impl +{ + //============================================================ + // Component_exec_i + //============================================================ + Component_exec_i::Component_exec_i (void) + { + } + + Component_exec_i::~Component_exec_i (void) + { + } + + // Operations from Components::SessionComponent. + void + Component_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::QosProfile_Test::CCM_QosProfileComponent_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Component_exec_i::configuration_complete (void) + { + } + + void + Component_exec_i::ccm_activate (void) + { + this->writer_ = this->context_->get_connection_info_write_data(); + } + + void + Component_exec_i::ccm_passivate (void) + { + } + + void + Component_exec_i::ccm_remove (void) + { + } + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QosProfile_Test_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Component_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.h new file mode 100644 index 00000000000..5db3b8868b3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Component/QosProfile_Test_Component_exec.h @@ -0,0 +1,53 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_COMPONENT_EXEC_H_ +#define CIAO_COMPONENT_EXEC_H_ + +#include "QosProfile_Test_ComponentEC.h" + +#include /**/ "Component_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_QosProfile_Test_QosProfileComponent_Impl +{ + //============================================================ + // Component_exec_i + //============================================================ + class COMPONENT_EXEC_Export Component_exec_i + : public virtual QosProfileComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + Component_exec_i (void); + virtual ~Component_exec_i (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::QosProfile_Test::CCM_QosProfileComponent_Context_var context_; + ::QosProfile_Test::QosProfileTestConn::Writer_var writer_; + }; + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QosProfile_Test_Component_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.idl new file mode 100644 index 00000000000..3d5412a78b8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QosProfile_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QOS_PROFILE_TEST_CONNECTOR_IDL_ +#define QOS_PROFILE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/QosProfile_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/QosProfile_Test_ConnectorE.idl" + +module QosProfile_Test +{ + module ::CCM_DDS::Typed < ::QosProfileTest, ::QosProfileTestSeq> QosProfileTestConn; + connector QosProfile_Test_Connector : QosProfileTestConn::DDS_Event + { + }; +}; + +#endif /* QOS_PROFILE_TEST_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.mpc new file mode 100755 index 00000000000..18aa43b522d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/Connector/QosProfile_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p QosProfile_Test_Base -l .. -o ../lib -u DDS QosProfile_Test_Connector" + +project(QosProfile_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COHERENT_WRITE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=QosProfile_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=COHERENT_WRITE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=QosProfile_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=COHERENT_WRITE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=QosProfile_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=COHERENT_WRITE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=QosProfile_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + QosProfile_Test_Connector.idl + } +} + +project(QosProfile_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += QosProfile_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=COHERENT_WRITE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=QosProfile_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + QosProfile_Test_ConnectorE.idl + } +} + +project(QosProfile_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += QosProfile_Test_Connector_lem_gen QosProfile_Test_Connector_stub QosProfile_Test_Base_stub DDS4CCM_lem_stub + libs += QosProfile_Test_Base_stub QosProfile_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QosProfile_Test_Connector_lem_stub + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ConnectorEC.cpp + } + + Header_Files { + QosProfile_Test_ConnectorEC.h + QosProfile_Test_Connector_lem_stub_export.h + } + + Inline_Files { + QosProfile_Test_ConnectorEC.inl + } +} + +project(QosProfile_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += QosProfile_Test_Connector_idl_gen QosProfile_Test_Base_stub + libs += QosProfile_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QosProfile_Test_Connector_stub + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ConnectorC.cpp + } + + Header_Files { + QosProfile_Test_ConnectorC.h + QosProfile_Test_Connector_stub_export.h + } + + Inline_Files { + QosProfile_Test_ConnectorC.inl + } +} + +project(QosProfile_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += QosProfile_Test_Connector_lem_stub QosProfile_Test_Connector_stub DDS4CCM_lem_stub QosProfile_Test_Base_stub + sharedname = QosProfile_Test_Connector_exec + libs += QosProfile_Test_Connector_stub QosProfile_Test_Connector_lem_stub QosProfile_Test_Base_stub DDS4CCM_lem_stub QosProfile_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_Connector_conn.cpp + } + + Header_Files { + QosProfile_Test_Connector_conn.h + QosProfile_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(QosProfile_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += QosProfile_Test_Connector_lem_stub QosProfile_Test_Connector_exec QosProfile_Test_Connector_stub DDS4CCM_lem_stub + sharedname = QosProfile_Test_Connector_svnt + libs += QosProfile_Test_Connector_stub \ + QosProfile_Test_Connector_lem_stub \ + QosProfile_Test_Base_stub \ + QosProfile_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COHERENT_WRITE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QosProfile_Test_ConnectorS.cpp + QosProfile_Test_Connector_svnt.cpp + } + + Header_Files { + QosProfile_Test_ConnectorS.h + QosProfile_Test_Connector_svnt.h + QosProfile_Test_Connector_svnt_export.h + } + + Inline_Files { + QosProfile_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/Plan.cdp new file mode 100644 index 00000000000..a03aa8911bd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/Plan.cdp @@ -0,0 +1,205 @@ +<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>QosProfile_Test_Depl_1</label> + <UUID>QosProfile_Test_Depl_1</UUID> + + <implementation xmi:id="ComponentComponentImplementation"> + <name>ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QosProfile_Test_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QosProfile_Test_QosProfileComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="QosProfile_Test_ConnectorComponentImplementation"> + <name>QosProfile_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="QosProfile_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QosProfile_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_QosProfile_Test_QosProfile_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QosProfile_Test_QosProfile_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QosProfile_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QosProfile_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="ComponentComponentInstance"> + <name>ComponentComponent</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ComponentComponentImplementation" /> + </instance> + <instance xmi:id="QosProfile_Test_ConnectorComponentInstance"> + <name>QosProfile_Test_ConnectorComponent</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QosProfile_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Wrong_Library#Wrong_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QosProfile_Test</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_write_data</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="ComponentComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="QosProfile_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="QosProfile_Test_Connector_ExecArtifact"> + <name>QosProfile_Test_Connector_exec</name> + <source/> + <node/> + <location>QosProfile_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="QosProfile_Test_Connector_SvntArtifact"> + <name>QosProfile_Test_Connector_svnt</name> + <source/> + <node/> + <location>QosProfile_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="QosProfile_Test_Connector_StubArtifact"> + <name>QosProfile_Test_Connector_stub</name> + <source/> + <node/> + <location>QosProfile_Test_Connector_stub</location> + </artifact> + <artifact xmi:id="Component_ExecArtifact"> + <name>Component_exec</name> + <source/> + <node/> + <location>Component_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>Component_svnt</name> + <source/> + <node/> + <location>Component_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..7ee62500559 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,37 @@ +<dds 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 name="QosProfile_Library"> + <qos_profile name="QosProfile_Profile" is_default_qos="true"> + <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> + <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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/run_test.pl new file mode 100755 index 00000000000..82e952240b7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QosProfile/descriptors/run_test.pl @@ -0,0 +1,245 @@ +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 = 1; +@ports = ( 60001 ); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode" ); + +# 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 ('ciao_componentserver'); + delete_ior_files (); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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", + "-ORBLogFile test.log -x $cdp_file -k file://$ior_emfile"); +$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "OK: dance_plan_launcher returned an error status ($pl_status)\n"; + kill_open_processes (); + unlink "test.log"; + exit 0; +} + +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 "ERROR : dance_plan_launcher didn't return with an error.\n"; + +# 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/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.idl new file mode 100644 index 00000000000..be30edc9ae6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QueryFilter_Starter.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERYFILTER_STARTER_IDL +#define QUERYFILTER_STARTER_IDL + +#pragma ciao lem "Base/QueryFilter_StarterE.idl" + +interface QueryFilterStarter +{ + void set_reader_properties (in unsigned short nr_keys, + in unsigned short nr_iterations); + void start_read (in unsigned short run); +}; + +interface QueryFilterRestarter +{ + void restart_write (); +}; + +#endif /* QUERYFILTER_STARTER_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.mpc new file mode 100755 index 00000000000..1dacde89666 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Starter.mpc @@ -0,0 +1,114 @@ +// $Id$ + +project(DDS_QueryFilter_Starter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=QueryFilter_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=QueryFilter_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=QueryFilter_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=QueryFilter_Starter_exec_export.h -I.. + + IDL_Files { + QueryFilter_Starter.idl + } +} + +project(DDS_QueryFilter_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_QueryFilter_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=QueryFilter_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + QueryFilter_StarterE.idl + } +} + +project(DDS_QueryFilter_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QueryFilter_Starter_lem_gen DDS_QueryFilter_Starter_stub + libs += QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QueryFilter_Starter_lem_stub + dynamicflags = READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_StarterEC.cpp + } + + Header_Files { + QueryFilter_StarterEC.h + QueryFilter_Starter_lem_stub_export.h + } + + Inline_Files { + QueryFilter_StarterEC.inl + } +} + +project(DDS_QueryFilter_Starter_stub) : ccm_stub, dds4ccm_base { + after += DDS_QueryFilter_Starter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QueryFilter_Starter_stub + dynamicflags = READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_StarterC.cpp + } + + Header_Files { + QueryFilter_StarterC.h + QueryFilter_Starter_stub_export.h + } + + Inline_Files { + QueryFilter_StarterC.inl + } +} + + +project(DDS_QueryFilter_Starter_svnt) : ciao_servant, dds4ccm_base { + after += DDS_QueryFilter_Starter_lem_stub DDS_QueryFilter_Starter_stub\ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = QueryFilter_Starter_svnt + libs += QueryFilter_Starter_stub QueryFilter_Starter_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_StarterS.cpp + QueryFilter_Starter_svnt.cpp + } + + Header_Files { + QueryFilter_StarterS.h + QueryFilter_Starter_svnt.h + QueryFilter_Starter_svnt_export.h + } + + Inline_Files { + QueryFilter_StarterS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.idl new file mode 100644 index 00000000000..dc6d2e6c800 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file QueryFilter_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_TEST_BASE_IDL +#define QUERY_FILTER_TEST_BASE_IDL + +#pragma ndds typesupport "Base/QueryFilter_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "QueryFilterTest" +#pragma DCPS_DATA_KEY "QueryFilterTest symbol" + +struct QueryFilterTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<QueryFilterTest> QueryFilterTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.mpc new file mode 100755 index 00000000000..080d970cb08 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Base/QueryFilter_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (QueryFilter_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = QueryFilter_Test_Base_stub + dynamicflags += QUERY_FILTER_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=QUERY_FILTER_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=QueryFilter_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + QueryFilter_Test_Base.idl + } + + opendds_ts_flags += --export=QUERY_FILTER_TEST_BASE_STUB_Export + + DDSGenerator_Files { + QueryFilter_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.idl new file mode 100644 index 00000000000..593fc21e8aa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QueryFilter_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_TEST_CONNECTOR_IDL_ +#define QUERY_FILTER_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/QueryFilter_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/QueryFilter_Test_ConnectorE.idl" + +module QueryFilter_Test +{ + module ::CCM_DDS::Typed < ::QueryFilterTest, ::QueryFilterTestSeq> QueryFilterTestConn; + connector QueryFilter_Test_Connector : QueryFilterTestConn::DDS_Event + { + }; +}; + +#endif /* QUERY_FILTER_TEST_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.mpc new file mode 100755 index 00000000000..babfda6364f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Connector/QueryFilter_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p QueryFilter_Test_Base -l .. -o ../lib -u DDS QueryFilter_Test_Connector" + +project(QueryFilter_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=QUERY_FILTER_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=QueryFilter_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=QUERY_FILTER_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=QueryFilter_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=QUERY_FILTER_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=QueryFilter_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=QUERY_FILTER_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=QueryFilter_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + QueryFilter_Test_Connector.idl + } +} + +project(QueryFilter_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += QueryFilter_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=QUERY_FILTER_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=QueryFilter_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + QueryFilter_Test_ConnectorE.idl + } +} + +project(QueryFilter_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += QueryFilter_Test_Connector_lem_gen QueryFilter_Test_Connector_stub QueryFilter_Test_Base_stub DDS4CCM_lem_stub + libs += QueryFilter_Test_Base_stub QueryFilter_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QueryFilter_Test_Connector_lem_stub + dynamicflags = QUERY_FILTER_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ConnectorEC.cpp + } + + Header_Files { + QueryFilter_Test_ConnectorEC.h + QueryFilter_Test_Connector_lem_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ConnectorEC.inl + } +} + +project(QueryFilter_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += QueryFilter_Test_Connector_idl_gen QueryFilter_Test_Base_stub + libs += QueryFilter_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QueryFilter_Test_Connector_stub + dynamicflags = QUERY_FILTER_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ConnectorC.cpp + } + + Header_Files { + QueryFilter_Test_ConnectorC.h + QueryFilter_Test_Connector_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ConnectorC.inl + } +} + +project(QueryFilter_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += QueryFilter_Test_Connector_lem_stub QueryFilter_Test_Connector_stub DDS4CCM_lem_stub QueryFilter_Test_Base_stub + sharedname = QueryFilter_Test_Connector_exec + libs += QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_lem_stub QueryFilter_Test_Base_stub DDS4CCM_lem_stub QueryFilter_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_Connector_conn.cpp + } + + Header_Files { + QueryFilter_Test_Connector_conn.h + QueryFilter_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(QueryFilter_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += QueryFilter_Test_Connector_lem_stub QueryFilter_Test_Connector_exec QueryFilter_Test_Connector_stub DDS4CCM_lem_stub + sharedname = QueryFilter_Test_Connector_svnt + libs += QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Connector_lem_stub \ + QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ConnectorS.cpp + QueryFilter_Test_Connector_svnt.cpp + } + + Header_Files { + QueryFilter_Test_ConnectorS.h + QueryFilter_Test_Connector_svnt.h + QueryFilter_Test_Connector_svnt_export.h + } + + Inline_Files { + QueryFilter_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/README b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/README new file mode 100644 index 00000000000..79dc0f2962d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/README @@ -0,0 +1,3 @@ +# $Id$ + +This test tests the QueryFilter on the Reader. diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl new file mode 100644 index 00000000000..4f5b973bc6d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QueryFilter_Test_Connector.idl" +#include "Base/QueryFilter_Starter.idl" + +module QueryFilter_Test +{ + component Receiver + { + port QueryFilterTestConn::DDS_Get get_port; + + provides QueryFilterStarter reader_start; + uses QueryFilterRestarter writer_restart; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc new file mode 100755 index 00000000000..9b80fe796a4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(QueryFilter_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += QueryFilter_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 { + QueryFilter_Test_Receiver.idl + } +} + +project(QueryFilter_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += QueryFilter_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 { + QueryFilter_Test_ReceiverE.idl + } +} + +project(QueryFilter_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_gen QueryFilter_Test_Receiver_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Base_stub \ + DDS_QueryFilter_Starter_stub + libs += Receiver_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Base_stub QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverEC.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverEC.inl + } +} + +project(QueryFilter_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += QueryFilter_Test_Receiver_idl_gen QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Base_stub QueryFilter_Test_Connector_lem_gen \ + DDS_QueryFilter_Starter_stub DDS_QueryFilter_Starter_lem_stub + libs += QueryFilter_Test_Connector_stub QueryFilter_Test_Base_stub \ + QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverC.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverC.inl + } +} + +project(QueryFilter_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_stub QueryFilter_Test_Receiver_stub \ + QueryFilter_Test_Base_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_QueryFilter_Starter_lem_stub DDS_QueryFilter_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub QueryFilter_Starter_lem_stub QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_Receiver_exec.cpp + } + + Header_Files { + QueryFilter_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(QueryFilter_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_svnt \ + QueryFilter_Test_Receiver_exec QueryFilter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_QueryFilter_Starter_stub \ + DDS_QueryFilter_Starter_svnt DDS_QueryFilter_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_svnt \ + Receiver_exec QueryFilter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel QueryFilter_Starter_stub QueryFilter_Starter_svnt \ + QueryFilter_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverS.cpp + QueryFilter_Test_Receiver_svnt.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverS.h + QueryFilter_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..a9992f030fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp @@ -0,0 +1,545 @@ +// -*- C++ -*- +// +// $Id$ + +#include "QueryFilter_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 "( (iteration > %0) AND (iteration < %1) )" + +#define MIN_ITERATION_1 "2" +#define MAX_ITERATION_1 "5" + +#define MIN_ITERATION_2 "12" +#define MAX_ITERATION_2 "25" + + +namespace CIAO_QueryFilter_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_min_iteration_ (ACE_OS::atoi (MIN_ITERATION_1)), + current_max_iteration_ (ACE_OS::atoi (MAX_ITERATION_1)), + ticker_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + QueryFilterTest 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->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_max_iteration_ - 1)); + return queryfiltertest_info.iteration >= this->current_max_iteration_ - 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 (const QueryFilterTest & sample, + const char * test) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%C ALL : ") + ACE_TEXT ("sample received for <%C>: iteration <%u>\n"), + test, + sample.symbol.in (), + sample.iteration)); + if (sample.iteration <= ACE_OS::atoi (MIN_ITERATION_1)) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL: " + "Didn't expect samples with iterations " + "<= %d\n", + test, + this->current_min_iteration_)); + } + if (sample.iteration > this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL: " + "Didn't expect samples with iterations " + "> %d\n", + test, + this->current_max_iteration_)); + } + } + + + void + Receiver_exec_i::read_all (void) + { + QueryFilterTestSeq *queryfiltertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->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 ((*queryfiltertest_info_seq)[it], "READ"); + } + } + + void + Receiver_exec_i::get_all (void) + { + if (::CORBA::is_nil (this->getter_)) + { + ACE_ERROR ((LM_ERROR, "ERROR: No Getter\n")); + } + QueryFilterTest * qf_info = new QueryFilterTest; + ::CCM_DDS::ReadInfo readinfo; + bool result = this->getter_->get_one (qf_info, readinfo); + this->check_iter (*qf_info, "GET"); + while (result) + { + result = this->getter_->get_one (qf_info, readinfo); + if (result) + { + this->check_iter (*qf_info, "GET"); + } + } + } + + void + Receiver_exec_i::test_all () + { + const char * test = "GET ALL"; + try + { + get_all (); + test = "READ ALL"; + read_all (); + } + 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::test_exception () + { + CCM_DDS::QueryFilter * filter = 0; + try + { + filter = this->reader_->filter (); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::test_excep - " + "Expected InternalErr excep caught : retval <%u>\n", + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::test_exception: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_exception - " + "Unexpected exception caught\n")); + return; + } + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_exception - " + "No exception caught while retrieving unset filter.\n")); + } + + void + Receiver_exec_i::check_filter () + { + CCM_DDS::QueryFilter * filter = 0; + try + { + filter = this->reader_->filter (); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "caught InternalError exception: retval <%u>\n", + 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 - " + "Exception caught\n")); + return; + } + + //check query + bool error = false; + if (ACE_OS::strcmp (filter->query, QUERY) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.in ())); + error = true; + } + //check current parameters. + if (filter->query_parameters.length () != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected number of parameters: " + "expected <%d> - received <%d>\n", + 2, filter->query_parameters.length ())); + error = true; + } + + if (filter->query_parameters.length () >= 1) + { + if (ACE_OS::atoi (filter->query_parameters[0]) != this->current_min_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.in ())); + error = true; + } + } + if (filter->query_parameters.length () >= 2) + { + if (ACE_OS::atoi (filter->query_parameters[1]) != this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.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 () + { + try + { + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup ("na"); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION_2); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION_2); + this->reader_->filter (filter); + this->current_min_iteration_ = ACE_OS::atoi (MIN_ITERATION_2); + this->current_max_iteration_ = ACE_OS::atoi (MAX_ITERATION_2); + } + 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; + } + } + + void + Receiver_exec_i::set_filter () + { + ACE_DEBUG ((LM_DEBUG, "Set filter\n")); + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup (QUERY); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION_1); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION_1); + this->reader_->filter (filter); + } + + 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: + { + test_exception (); + set_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. + ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener_ptr + Receiver_exec_i::get_read_port_data_listener (void) + { + return ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_read_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_get_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_QueryFilterStarter_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_ = + ::QueryFilter_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->reader_ = this->context_->get_connection_get_port_data (); + this->getter_ = this->context_->get_connection_get_port_fresh_data (); + DDS::Duration_t to; + to.sec = 5; + to.nanosec = 0; + if (! ::CORBA::is_nil (this->getter_)) + { + this->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_QueryFilter_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h new file mode 100644 index 00000000000..91f373abf67 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h @@ -0,0 +1,142 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "QueryFilter_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_QueryFilter_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_QueryFilterStarter, + 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 ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener_ptr + get_read_port_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_read_port_status (void); + + virtual ::CCM_QueryFilterStarter_ptr + get_reader_start (); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_get_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: + ::QueryFilter_Test::CCM_Receiver_Context_var context_; + ::QueryFilter_Test::QueryFilterTestConn::Reader_var reader_; + ::QueryFilter_Test::QueryFilterTestConn::Getter_var getter_; + QueryFilterRestarter_var restarter_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + bool has_run_; + + int current_min_iteration_; + int current_max_iteration_; + + read_action_Generator *ticker_; + + void test_all (void); + void read_all (void); + void get_all (void); + void check_iter (const QueryFilterTest & sample, + const char * test); + void check_filter (void); + void test_exception (void); + void test_set_query_parameters (void); + void set_filter (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QueryFilter_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender.idl new file mode 100644 index 00000000000..d30deb7c6b2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_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_FILTER_TEST_SENDER_IDL +#define DDS_QUERY_FILTER_TEST_SENDER_IDL + +#include "Connector/QueryFilter_Test_Connector.idl" +#include "Base/QueryFilter_Starter.idl" + +module QueryFilter_Test +{ + component Sender + { + port QueryFilter_Test::QueryFilterTestConn::DDS_Write info_write; + + uses QueryFilterStarter start_reader; + provides QueryFilterRestarter restart_writer; + + attribute unsigned short keys; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender.mpc new file mode 100755 index 00000000000..faa7da39896 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender.mpc @@ -0,0 +1,155 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p QueryFilter_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(QueryFilter_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += QueryFilter_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 { + QueryFilter_Test_Sender.idl + } +} + +project(QueryFilter_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += QueryFilter_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 { + QueryFilter_Test_SenderE.idl + } +} + +project(QueryFilter_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += QueryFilter_Test_Sender_lem_gen QueryFilter_Test_Sender_stub \ + QueryFilter_Test_Base_stub DDS_QueryFilter_Starter_stub + libs += QueryFilter_Test_Base_stub Sender_stub QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_SenderEC.cpp + } + + Header_Files { + QueryFilter_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + QueryFilter_Test_SenderEC.inl + } +} + +project(QueryFilter_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += QueryFilter_Test_Sender_idl_gen QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub DDS_QueryFilter_Starter_stub \ + DDS_QueryFilter_Starter_lem_stub + libs += QueryFilter_Test_Base_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_SenderC.cpp + } + + Header_Files { + QueryFilter_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + QueryFilter_Test_SenderC.inl + } +} + +project(QueryFilter_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += QueryFilter_Test_Sender_lem_stub QueryFilter_Test_Sender_stub \ + QueryFilter_Test_Connector_lem_stub QueryFilter_Test_Connector_stub \ + DDS4CCM_lem_stub DDS_QueryFilter_Starter_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_lem_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Starter_stub DDS4CCM_lem_stub QueryFilter_Starter_lem_stub \ + QueryFilter_Starter_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_Sender_exec.cpp + } + + Header_Files { + QueryFilter_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(QueryFilter_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += QueryFilter_Test_Base_stub QueryFilter_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Connector_svnt QueryFilter_Test_Connector_lem_stub \ + DDS_QueryFilter_Starter_stub DDS_QueryFilter_Starter_svnt \ + DDS_QueryFilter_Starter_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub QueryFilter_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_svnt \ + QueryFilter_Test_Connector_lem_stub QueryFilter_Starter_stub \ + QueryFilter_Starter_svnt QueryFilter_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_SenderS.cpp + QueryFilter_Test_Sender_svnt.cpp + } + + Header_Files { + QueryFilter_Test_SenderS.h + QueryFilter_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + QueryFilter_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.cpp new file mode 100644 index 00000000000..67c33e222d8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.cpp @@ -0,0 +1,182 @@ +// -*- C++ -*- +// $Id$ + +#include "QueryFilter_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +#define ITERATIONS 10 + +namespace CIAO_QueryFilter_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]; + QueryFilterTest *new_key = new QueryFilterTest; + 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_QueryFilterRestarter_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_ = + ::QueryFilter_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_QueryFilter_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.h new file mode 100644 index 00000000000..aaaf8b500f7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Sender/QueryFilter_Test_Sender_exec.h @@ -0,0 +1,96 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "QueryFilter_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_QueryFilter_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_QueryFilterRestarter, + 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_QueryFilterRestarter_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: + ::QueryFilter_Test::CCM_Sender_Context_var context_; + ::QueryFilter_Test::QueryFilterTestConn::Writer_var writer_; + QueryFilterStarter_var starter_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + CORBA::UShort run_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QueryFilter_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/Plan.cdp new file mode 100644 index 00000000000..05b925e0fcf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/Plan.cdp @@ -0,0 +1,393 @@ +<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>QueryFilter_Test_Depl_1</label> + <UUID>QueryFilter_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_QueryFilter_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_QueryFilter_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="QueryFilter_Test_ConnectorComponentImplementation"> + <name>QueryFilter_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="QueryFilter_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QueryFilter_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_QueryFilter_Test_QueryFilter_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QueryFilter_Test_QueryFilter_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_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_QueryFilter_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_QueryFilter_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="QueryFilter_Test_ConnectorComponentInstance"> + <name>QueryFilter_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QueryFilter_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_Library#QueryFilter_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="QueryFilter_Test_ConnectorComponentInstance2"> + <name>QueryFilter_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QueryFilter_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_Library#QueryFilter_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryFilter_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_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + </instance> + + <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_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="QueryFilter_Test_ConnectorComponentInstance2" /> + </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_consumer_fresh_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="QueryFilter_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="QueryFilter_Test_ConnectorComponentInstance" /> + </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="QueryFilter_Test_Connector_ExecArtifact"> + <name>QueryFilter_Test_Connector_exec</name> + <source/> + <node/> + <location>QueryFilter_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="QueryFilter_Test_Connector_SvntArtifact"> + <name>QueryFilter_Test_Connector_svnt</name> + <source/> + <node/> + <location>QueryFilter_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="QueryFilter_Test_Connector_StubArtifact"> + <name>QueryFilter_Test_Connector_stub</name> + <source/> + <node/> + <location>QueryFilter_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/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..571930e854d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/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="QueryFilter_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="QueryFilter_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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/run_test.pl new file mode 100755 index 00000000000..708c17b2051 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.idl new file mode 100644 index 00000000000..657e6c9650c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file QFLE_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_LISTEN_EVENT_TEST_BASE_IDL +#define QUERY_FILTER_LISTEN_EVENT_TEST_BASE_IDL + +#pragma ndds typesupport "Base/QFLE_Test_BaseSupport.h" + +struct QueryFilterListenEventTest { + string key; //@key + long iteration; +}; + +typedef sequence<QueryFilterListenEventTest> QueryFilterListenEventTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.mpc new file mode 100755 index 00000000000..96b322de121 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Base/QFLE_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_QFLE_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_QFLE_Test_Base_stub + dynamicflags += QUERY_FILTER_LISTEN_EVENT_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=QFLE_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + QFLE_Test_Base.idl + } + + opendds_ts_flags += --export=QUERY_FILTER_LISTEN_EVENT_TEST_BASE_STUB_Export + + DDSGenerator_Files { + QFLE_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.idl new file mode 100644 index 00000000000..59c46ddf3f7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QFLE_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_IDL_ +#define QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/QFLE_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/QFLE_Test_ConnectorE.idl" + +module QFLE_Test +{ + module ::CCM_DDS::Typed < ::QueryFilterListenEventTest, ::QueryFilterListenEventTestSeq> QueryFilterListenEventTestConn; + connector QFLE_Test_Connector : QueryFilterListenEventTestConn::DDS_Event + { + }; +}; + +#endif /* QFLE_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.mpc new file mode 100755 index 00000000000..78b5ffe9ceb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Connector/QFLE_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_QFLE_Test_Base -l .. -o ../lib -u DDS QFLE_Test_Connector" + +project(DDS_QFLE_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=QFLE_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=QFLE_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=QFLE_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=QFLE_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + QFLE_Test_Connector.idl + } +} + +project(DDS_QFLE_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_QFLE_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=QFLE_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + QFLE_Test_ConnectorE.idl + } +} + +project(DDS_QFLE_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLE_Test_Connector_lem_gen DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_QFLE_Test_Base_stub DDS_QFLE_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_QFLE_Test_Connector_lem_stub + dynamicflags = QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ConnectorEC.cpp + } + + Header_Files { + QFLE_Test_ConnectorEC.h + QFLE_Test_Connector_lem_stub_export.h + } + + Inline_Files { + QFLE_Test_ConnectorEC.inl + } +} + +project(DDS_QFLE_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLE_Test_Connector_idl_gen DDS_QFLE_Test_Base_stub + libs += DDS_QFLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_QFLE_Test_Connector_stub + dynamicflags = QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ConnectorC.cpp + } + + Header_Files { + QFLE_Test_ConnectorC.h + QFLE_Test_Connector_stub_export.h + } + + Inline_Files { + QFLE_Test_ConnectorC.inl + } +} + +project(DDS_QFLE_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_QFLE_Test_Connector_lem_stub DDS_QFLE_Test_Connector_stub DDS4CCM_lem_stub DDS_QFLE_Test_Base_stub + sharedname = DDS_QFLE_Test_Connector_exec + libs += DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Connector_lem_stub DDS_QFLE_Test_Base_stub DDS4CCM_lem_stub DDS_QFLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_Connector_conn.cpp + } + + Header_Files { + QFLE_Test_Connector_conn.h + QFLE_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLE_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_QFLE_Test_Connector_lem_stub DDS_QFLE_Test_Connector_exec DDS_QFLE_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_QFLE_Test_Connector_svnt + libs += DDS_QFLE_Test_Connector_stub \ + DDS_QFLE_Test_Connector_lem_stub \ + DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_LISTEN_EVENT_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ConnectorS.cpp + QFLE_Test_Connector_svnt.cpp + } + + Header_Files { + QFLE_Test_ConnectorS.h + QFLE_Test_Connector_svnt.h + QFLE_Test_Connector_svnt_export.h + } + + Inline_Files { + QFLE_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.idl new file mode 100644 index 00000000000..08f63d47833 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QFLE_Test_Connector.idl" + +module QFLE_Test +{ + component Receiver + { + port QueryFilterListenEventTestConn::DDS_Listen info_listen; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.mpc new file mode 100755 index 00000000000..107f30d18ea --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_QFLE_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_QFLE_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 { + QFLE_Test_Receiver.idl + } +} + +project(DDS_QFLE_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_QFLE_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 { + QFLE_Test_ReceiverE.idl + } +} + +project(DDS_QFLE_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLE_Test_Receiver_lem_gen DDS_QFLE_Test_Receiver_stub \ + DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Base_stub + libs += Receiver_stub DDS_QFLE_Test_Connector_stub \ + DDS_QFLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ReceiverEC.cpp + } + + Header_Files { + QFLE_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + QFLE_Test_ReceiverEC.inl + } +} + +project(DDS_QFLE_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLE_Test_Receiver_idl_gen DDS_QFLE_Test_Connector_stub \ + DDS_QFLE_Test_Base_stub DDS_QFLE_Test_Connector_lem_gen + libs += DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ReceiverC.cpp + } + + Header_Files { + QFLE_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + QFLE_Test_ReceiverC.inl + } +} + +project(DDS_QFLE_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_QFLE_Test_Receiver_lem_stub DDS_QFLE_Test_Receiver_stub \ + DDS_QFLE_Test_Base_stub DDS_QFLE_Test_Connector_stub \ + DDS_QFLE_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_Receiver_exec.cpp + } + + Header_Files { + QFLE_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLE_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_QFLE_Test_Receiver_lem_stub DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Connector_svnt \ + DDS_QFLE_Test_Receiver_exec DDS_QFLE_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Connector_svnt \ + Receiver_exec DDS_QFLE_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_ReceiverS.cpp + QFLE_Test_Receiver_svnt.cpp + } + + Header_Files { + QFLE_Test_ReceiverS.h + QFLE_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + QFLE_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..b5a8deebc94 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.cpp @@ -0,0 +1,238 @@ +// -*- C++ -*- +// +// $Id$ + +#include "QFLE_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_QFLE_Test_Receiver_Impl +{ + //============================================================ + // QueryFilterListenEventTest_Listener_exec_i + //============================================================ + QueryFilterListenEventTest_Listener::QueryFilterListenEventTest_Listener ( + Atomic_ThreadId &thread_id) + : thread_id_ (thread_id) + { + } + + QueryFilterListenEventTest_Listener::~QueryFilterListenEventTest_Listener (void) + { + } + + void + QueryFilterListenEventTest_Listener::on_one_data ( + const QueryFilterListenEventTest & an_instance, + const ::CCM_DDS::ReadInfo & info) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "QueryFilterListenEventTest_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: QueryFilterListenEventTest_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: QueryFilterListenEventTest_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 <= ACE_OS::atoi (MIN_ITERATION) || + an_instance.iteration > ACE_OS::atoi (MAX_ITERATION) ) + { + ACE_ERROR ((LM_ERROR, "QueryFilterListenEventTest_Listener::on_one_data: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + QueryFilterListenEventTest_Listener::on_many_data ( + const QueryFilterListenEventTestSeq & /* 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); + } + + ::QFLE_Test::QueryFilterListenEventTestConn::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener (void) + { + return new QueryFilterListenEventTest_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_ = + ::QFLE_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 - " + "Set filter.\n")); + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup (QUERY); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION); + this->reader_->filter (filter); + + 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_QFLE_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.h new file mode 100644 index 00000000000..c4a5a859a16 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Receiver/QFLE_Test_Receiver_exec.h @@ -0,0 +1,103 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "QFLE_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_QFLE_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // QueryFilterListenEventTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export QueryFilterListenEventTest_Listener + : public virtual ::QFLE_Test::QueryFilterListenEventTestConn::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + QueryFilterListenEventTest_Listener ( + Atomic_ThreadId &thread_id); + virtual ~QueryFilterListenEventTest_Listener (void); + + virtual void + on_one_data ( + const QueryFilterListenEventTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const QueryFilterListenEventTestSeq & 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 ::QFLE_Test::QueryFilterListenEventTestConn::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: + ::QFLE_Test::CCM_Receiver_Context_var context_; + ::QFLE_Test::QueryFilterListenEventTestConn::Reader_var reader_; + + Atomic_ThreadId thread_id_listener_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QFLE_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.idl new file mode 100644 index 00000000000..de94251344b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_QUERY_FILTER_LISTEN_EVENT_TEST_SENDER_IDL +#define DDS_QUERY_FILTER_LISTEN_EVENT_TEST_SENDER_IDL + +#include "Connector/QFLE_Test_Connector.idl" + +module QFLE_Test +{ + component Sender + { + port QueryFilterListenEventTestConn::DDS_Write info_write; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.mpc new file mode 100755 index 00000000000..47dd0051979 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_QFLE_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_QFLE_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_QFLE_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 { + QFLE_Test_Sender.idl + } +} + +project(DDS_QFLE_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_QFLE_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 { + QFLE_Test_SenderE.idl + } +} + +project(DDS_QFLE_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLE_Test_Sender_lem_gen DDS_QFLE_Test_Sender_stub \ + DDS_QFLE_Test_Base_stub + libs += DDS_QFLE_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_SenderEC.cpp + } + + Header_Files { + QFLE_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + QFLE_Test_SenderEC.inl + } +} + +project(DDS_QFLE_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLE_Test_Sender_idl_gen DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_stub + libs += DDS_QFLE_Test_Base_stub DDS_QFLE_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_SenderC.cpp + } + + Header_Files { + QFLE_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + QFLE_Test_SenderC.inl + } +} + +project(DDS_QFLE_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_QFLE_Test_Sender_lem_stub DDS_QFLE_Test_Sender_stub \ + DDS_QFLE_Test_Connector_lem_stub DDS_QFLE_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_QFLE_Test_Base_stub \ + DDS_QFLE_Test_Connector_lem_stub DDS_QFLE_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_Sender_exec.cpp + } + + Header_Files { + QFLE_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLE_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_QFLE_Test_Base_stub DDS_QFLE_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_QFLE_Test_Connector_stub \ + DDS_QFLE_Test_Connector_svnt DDS_QFLE_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_QFLE_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_QFLE_Test_Connector_stub DDS_QFLE_Test_Connector_svnt \ + DDS_QFLE_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLE_Test_SenderS.cpp + QFLE_Test_Sender_svnt.cpp + } + + Header_Files { + QFLE_Test_SenderS.h + QFLE_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + QFLE_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.cpp new file mode 100644 index 00000000000..d98e7480819 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.cpp @@ -0,0 +1,200 @@ +// -*- C++ -*- +// $Id$ + +#include "QFLE_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_QFLE_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]; + QueryFilterListenEventTest *new_key = new QueryFilterListenEventTest; + 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_ = + ::QFLE_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_QFLE_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.h new file mode 100644 index 00000000000..ff4e52ee95a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/Sender/QFLE_Test_Sender_exec.h @@ -0,0 +1,86 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "QFLE_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_QFLE_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: + ::QFLE_Test::CCM_Sender_Context_var context_; + ::QFLE_Test::QueryFilterListenEventTestConn::Writer_var writer_; + + WriteTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, QueryFilterListenEventTest_var> Writer_Table; + Writer_Table samples_; + + Writer_Table::iterator last_key_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QFLE_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/descriptors/Plan.cdp new file mode 100644 index 00000000000..f05284bed01 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/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>QFLE_Test_Depl_1</label> + <UUID>QFLE_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_QFLE_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_QFLE_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="QFLE_Test_ConnectorComponentImplementation"> + <name>QFLE_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="QFLE_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QFLE_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_QFLE_Test_QFLE_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QFLE_Test_QFLE_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLE_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLE_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_QFLE_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_QFLE_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="QFLE_Test_ConnectorComponentInstance"> + <name>QFLE_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QFLE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLE_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="QFLE_Test_ConnectorComponentInstance2"> + <name>QFLE_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QFLE_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLE_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_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="QFLE_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="QFLE_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="QFLE_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="QFLE_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="QFLE_Test_Connector_ExecArtifact"> + <name>QFLE_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_QFLE_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="QFLE_Test_Connector_SvntArtifact"> + <name>QFLE_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_QFLE_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="QFLE_Test_Connector_StubArtifact"> + <name>QFLE_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_QFLE_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/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/descriptors/run_test.pl new file mode 100755 index 00000000000..ddeee753cf7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenEvent/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.idl new file mode 100644 index 00000000000..c6321f54ebc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file QFLS_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_LISTEN_STATE_TEST_BASE_IDL +#define QUERY_FILTER_LISTEN_STATE_TEST_BASE_IDL + +#pragma ndds typesupport "Base/QFLS_Test_BaseSupport.h" + +struct QueryFilterListenStateTest { + string key; //@key + long iteration; +}; + +typedef sequence<QueryFilterListenStateTest> QueryFilterListenStateTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.mpc new file mode 100755 index 00000000000..df55be54498 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Base/QFLS_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_QFLS_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_QFLS_Test_Base_stub + dynamicflags += QUERY_FILTER_LISTEN_STATE_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=QFLS_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + QFLS_Test_Base.idl + } + + opendds_ts_flags += --export=QUERY_FILTER_LISTEN_STATE_TEST_BASE_STUB_Export + + DDSGenerator_Files { + QFLS_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.idl new file mode 100644 index 00000000000..37d5f4d05ba --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QFLS_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_IDL_ +#define QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/QFLS_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/QFLS_Test_ConnectorE.idl" + +module QFLS_Test +{ + module ::CCM_DDS::Typed < ::QueryFilterListenStateTest, ::QueryFilterListenStateTestSeq> QueryFilterListenStateTestConn; + connector QFLS_Test_Connector : QueryFilterListenStateTestConn::DDS_State + { + }; +}; + +#endif /* QFLS_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.mpc new file mode 100755 index 00000000000..86fc499ea48 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Connector/QFLS_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_QFLS_Test_Base -l .. -o ../lib -u DDS QFLS_Test_Connector" + +project(DDS_QFLS_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=QFLS_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=QFLS_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=QFLS_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=QFLS_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + QFLS_Test_Connector.idl + } +} + +project(DDS_QFLS_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_QFLS_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=QFLS_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + QFLS_Test_ConnectorE.idl + } +} + +project(DDS_QFLS_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLS_Test_Connector_lem_gen DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_QFLS_Test_Base_stub DDS_QFLS_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_QFLS_Test_Connector_lem_stub + dynamicflags = QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ConnectorEC.cpp + } + + Header_Files { + QFLS_Test_ConnectorEC.h + QFLS_Test_Connector_lem_stub_export.h + } + + Inline_Files { + QFLS_Test_ConnectorEC.inl + } +} + +project(DDS_QFLS_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLS_Test_Connector_idl_gen DDS_QFLS_Test_Base_stub + libs += DDS_QFLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_QFLS_Test_Connector_stub + dynamicflags = QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ConnectorC.cpp + } + + Header_Files { + QFLS_Test_ConnectorC.h + QFLS_Test_Connector_stub_export.h + } + + Inline_Files { + QFLS_Test_ConnectorC.inl + } +} + +project(DDS_QFLS_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_QFLS_Test_Connector_lem_stub DDS_QFLS_Test_Connector_stub DDS4CCM_lem_stub DDS_QFLS_Test_Base_stub + sharedname = DDS_QFLS_Test_Connector_exec + libs += DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Connector_lem_stub DDS_QFLS_Test_Base_stub DDS4CCM_lem_stub DDS_QFLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_Connector_conn.cpp + } + + Header_Files { + QFLS_Test_Connector_conn.h + QFLS_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLS_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_QFLS_Test_Connector_lem_stub DDS_QFLS_Test_Connector_exec DDS_QFLS_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_QFLS_Test_Connector_svnt + libs += DDS_QFLS_Test_Connector_stub \ + DDS_QFLS_Test_Connector_lem_stub \ + DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = QUERY_FILTER_LISTEN_STATE_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ConnectorS.cpp + QFLS_Test_Connector_svnt.cpp + } + + Header_Files { + QFLS_Test_ConnectorS.h + QFLS_Test_Connector_svnt.h + QFLS_Test_Connector_svnt_export.h + } + + Inline_Files { + QFLS_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.idl new file mode 100644 index 00000000000..a9b415db954 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QFLS_Test_Connector.idl" + +module QFLS_Test +{ + component Receiver + { + port QueryFilterListenStateTestConn::DDS_StateListen info_state; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.mpc new file mode 100755 index 00000000000..99925807e77 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver.mpc @@ -0,0 +1,151 @@ +// $Id$ + +project(DDS_QFLS_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_QFLS_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 { + QFLS_Test_Receiver.idl + } +} + +project(DDS_QFLS_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_QFLS_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 { + QFLS_Test_ReceiverE.idl + } +} + +project(DDS_QFLS_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLS_Test_Receiver_lem_gen DDS_QFLS_Test_Receiver_stub \ + DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Base_stub + libs += Receiver_stub DDS_QFLS_Test_Connector_stub \ + DDS_QFLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ReceiverEC.cpp + } + + Header_Files { + QFLS_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + QFLS_Test_ReceiverEC.inl + } +} + +project(DDS_QFLS_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLS_Test_Receiver_idl_gen DDS_QFLS_Test_Connector_stub \ + DDS_QFLS_Test_Base_stub DDS_QFLS_Test_Connector_lem_gen + libs += DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ReceiverC.cpp + } + + Header_Files { + QFLS_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + QFLS_Test_ReceiverC.inl + } +} + +project(DDS_QFLS_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_QFLS_Test_Receiver_lem_stub DDS_QFLS_Test_Receiver_stub \ + DDS_QFLS_Test_Base_stub DDS_QFLS_Test_Connector_stub \ + DDS_QFLS_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Connector_lem_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_Receiver_exec.cpp + } + + Header_Files { + QFLS_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLS_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_QFLS_Test_Receiver_lem_stub DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Connector_svnt \ + DDS_QFLS_Test_Receiver_exec DDS_QFLS_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Connector_svnt \ + Receiver_exec DDS_QFLS_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_ReceiverS.cpp + QFLS_Test_Receiver_svnt.cpp + } + + Header_Files { + QFLS_Test_ReceiverS.h + QFLS_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + QFLS_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..0233d59137e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.cpp @@ -0,0 +1,245 @@ +// -*- C++ -*- +// +// $Id$ + +#include "QFLS_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_QFLS_Test_Receiver_Impl +{ + //============================================================ + // QueryFilterListenStateTest_Listener_exec_i + //============================================================ + QueryFilterListenStateTest_Listener::QueryFilterListenStateTest_Listener ( + Atomic_ThreadId &thread_id) + : thread_id_ (thread_id) + { + } + + QueryFilterListenStateTest_Listener::~QueryFilterListenStateTest_Listener (void) + { + } + + void + QueryFilterListenStateTest_Listener::on_creation ( + const QueryFilterListenStateTest& an_instance, + const CCM_DDS::ReadInfo& /*read_info*/) + { + ACE_DEBUG ((LM_DEBUG, "QueryFilterListenStateTest_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, "QueryFilterListenStateTest_Listener::on_creation: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + QueryFilterListenStateTest_Listener::on_one_update ( + const QueryFilterListenStateTest& an_instance, + const CCM_DDS::ReadInfo& /*read_info*/) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "QueryFilterListenStateTest_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, "QueryFilterListenStateTest_Listener::on_one_update: " + "ERROR: Unexpected iteration received.\n")); + } + } + + void + QueryFilterListenStateTest_Listener::on_many_updates ( + const QueryFilterListenStateTestSeq& /*an_instance*/, + const CCM_DDS::ReadInfoSeq& /*read_info*/) + { + } + + void + QueryFilterListenStateTest_Listener::on_deletion ( + const QueryFilterListenStateTest& /*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); + } + + ::QFLS_Test::QueryFilterListenStateTestConn::CCM_StateListener_ptr + Receiver_exec_i::get_info_state_data_listener (void) + { + return new QueryFilterListenStateTest_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_ = + ::QFLS_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 - " + "Set filter.\n")); + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup (QUERY); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION); + this->reader_->filter (filter); + + 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_QFLS_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.h new file mode 100644 index 00000000000..36d348e0b6b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Receiver/QFLS_Test_Receiver_exec.h @@ -0,0 +1,111 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "QFLS_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_QFLS_Test_Receiver_Impl +{ + class Receiver_exec_i; + + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + //============================================================ + // QueryFilterListenStateTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export QueryFilterListenStateTest_Listener + : public virtual ::QFLS_Test::QueryFilterListenStateTestConn::CCM_StateListener, + public virtual ::CORBA::LocalObject + { + public: + QueryFilterListenStateTest_Listener ( + Atomic_ThreadId &thread_id); + virtual ~QueryFilterListenStateTest_Listener (void); + + virtual void + on_creation (const QueryFilterListenStateTest& an_instance, + const CCM_DDS::ReadInfo& read_info); + + virtual void + on_one_update (const QueryFilterListenStateTest& an_instance, + const CCM_DDS::ReadInfo& read_info); + + virtual void + on_many_updates (const QueryFilterListenStateTestSeq& an_instance, + const CCM_DDS::ReadInfoSeq& read_info); + + virtual void + on_deletion (const QueryFilterListenStateTest& 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 ::QFLS_Test::QueryFilterListenStateTestConn::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: + ::QFLS_Test::CCM_Receiver_Context_var context_; + ::QFLS_Test::QueryFilterListenStateTestConn::Reader_var reader_; + + Atomic_ThreadId thread_id_listener_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QFLS_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.idl new file mode 100644 index 00000000000..67d4cd36c64 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_QUERY_FILTER_LISTEN_STATE_TEST_SENDER_IDL +#define DDS_QUERY_FILTER_LISTEN_STATE_TEST_SENDER_IDL + +#include "Connector/QFLS_Test_Connector.idl" + +module QFLS_Test +{ + component Sender + { + port QueryFilterListenStateTestConn::DDS_Update info_update; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.mpc new file mode 100755 index 00000000000..cd24ca13bde --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_QFLS_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_QFLS_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_QFLS_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 { + QFLS_Test_Sender.idl + } +} + +project(DDS_QFLS_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_QFLS_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 { + QFLS_Test_SenderE.idl + } +} + +project(DDS_QFLS_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_QFLS_Test_Sender_lem_gen DDS_QFLS_Test_Sender_stub \ + DDS_QFLS_Test_Base_stub + libs += DDS_QFLS_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_SenderEC.cpp + } + + Header_Files { + QFLS_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + QFLS_Test_SenderEC.inl + } +} + +project(DDS_QFLS_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_QFLS_Test_Sender_idl_gen DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_stub + libs += DDS_QFLS_Test_Base_stub DDS_QFLS_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_SenderC.cpp + } + + Header_Files { + QFLS_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + QFLS_Test_SenderC.inl + } +} + +project(DDS_QFLS_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_QFLS_Test_Sender_lem_stub DDS_QFLS_Test_Sender_stub \ + DDS_QFLS_Test_Connector_lem_stub DDS_QFLS_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_QFLS_Test_Base_stub \ + DDS_QFLS_Test_Connector_lem_stub DDS_QFLS_Test_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_Sender_exec.cpp + } + + Header_Files { + QFLS_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_QFLS_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_QFLS_Test_Base_stub DDS_QFLS_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_QFLS_Test_Connector_stub \ + DDS_QFLS_Test_Connector_svnt DDS_QFLS_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_QFLS_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_QFLS_Test_Connector_stub DDS_QFLS_Test_Connector_svnt \ + DDS_QFLS_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QFLS_Test_SenderS.cpp + QFLS_Test_Sender_svnt.cpp + } + + Header_Files { + QFLS_Test_SenderS.h + QFLS_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + QFLS_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.cpp new file mode 100644 index 00000000000..117acacd338 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.cpp @@ -0,0 +1,203 @@ +// -*- C++ -*- +// $Id$ + +#include "QFLS_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_QFLS_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); + QueryFilterListenStateTest 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); + QueryFilterListenStateTest 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_ = + ::QFLS_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_QFLS_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.h new file mode 100644 index 00000000000..dbc2d8c0fbf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/Sender/QFLS_Test_Sender_exec.h @@ -0,0 +1,95 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "QFLS_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_QFLS_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: + ::QFLS_Test::CCM_Sender_Context_var context_; + ::QFLS_Test::QueryFilterListenStateTestConn::Updater_var updater_; + + UpdateTicker *ticker_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QFLS_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/descriptors/Plan.cdp new file mode 100644 index 00000000000..fac9b056e54 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/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>QFLS_Test_Depl_1</label> + <UUID>QFLS_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_QFLS_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_QFLS_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="QFLS_Test_ConnectorComponentImplementation"> + <name>QFLS_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="QFLS_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QFLS_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_QFLS_Test_QFLS_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QFLS_Test_QFLS_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLS_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLS_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_QFLS_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_QFLS_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="QFLS_Test_ConnectorComponentInstance"> + <name>QFLS_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QFLS_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLS_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="QFLS_Test_ConnectorComponentInstance2"> + <name>QFLS_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QFLS_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QFLS_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="QFLS_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="QFLS_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="QFLS_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="QFLS_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="QFLS_Test_Connector_ExecArtifact"> + <name>QFLS_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_QFLS_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="QFLS_Test_Connector_SvntArtifact"> + <name>QFLS_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_QFLS_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="QFLS_Test_Connector_StubArtifact"> + <name>QFLS_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_QFLS_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/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/descriptors/run_test.pl new file mode 100755 index 00000000000..ddeee753cf7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilterListenState/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.idl b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.idl new file mode 100644 index 00000000000..29903ba6b30 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file Reader_Starter.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef READER_STARTER_IDL +#define READER_STARTER_IDL + +#pragma ciao lem "Base/Reader_StarterE.idl" + +interface ReaderStarter +{ + void start_read (); + void read_no_data (); + void set_reader_properties (in unsigned short nr_keys, + in unsigned short nr_iterations); +}; + +#endif /* SAMPLE_INFO_IDL */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.mpc b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.mpc new file mode 100755 index 00000000000..e5e5ef8ea8e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Starter.mpc @@ -0,0 +1,115 @@ +// $Id$ + +project(DDS_Reader_Starter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=Reader_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=Reader_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=Reader_Starter_exec_export.h -I.. + + IDL_Files { + Reader_Starter.idl + } +} + +project(DDS_Reader_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Reader_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=Reader_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + Reader_StarterE.idl + } +} + +project(DDS_Reader_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Reader_Starter_lem_gen DDS_Reader_Starter_stub + libs += Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_lem_stub + dynamicflags = READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterEC.cpp + } + + Header_Files { + Reader_StarterEC.h + Reader_Starter_lem_stub_export.h + } + + Inline_Files { + Reader_StarterEC.inl + } +} + +project(DDS_Reader_Starter_stub) : ccm_stub, dds4ccm_base { + after += DDS_Reader_Starter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Reader_Starter_stub + dynamicflags = READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterC.cpp + } + + Header_Files { + Reader_StarterC.h + Reader_Starter_stub_export.h + } + + Inline_Files { + Reader_StarterC.inl + } +} + + +project(DDS_Reader_Starter_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Reader_Starter_lem_stub DDS_Reader_Starter_stub\ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Reader_Starter_svnt + libs += Reader_Starter_stub Reader_Starter_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_StarterS.cpp + Reader_Starter_svnt.cpp + } + + Header_Files { + Reader_StarterS.h + Reader_Starter_svnt.h + Reader_Starter_svnt_export.h + } + + Inline_Files { + Reader_StarterS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.idl new file mode 100644 index 00000000000..8d2c467acec --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Reader_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef READER_TEST_BASE_IDL +#define READER_TEST_BASE_IDL + +#pragma ndds typesupport "Base/Reader_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "ReaderTest" +#pragma DCPS_DATA_KEY "ReaderTest key" + +struct ReaderTest { + string key; //@key + long iteration; +}; + +typedef sequence<ReaderTest> ReaderTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.mpc new file mode 100755 index 00000000000..e8606e033d9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Base/Reader_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Reader_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Reader_Test_Base_stub + dynamicflags += READER_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=READER_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=Reader_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Reader_Test_Base.idl + } + + opendds_ts_flags += --export=READER_TEST_BASE_STUB_Export + + DDSGenerator_Files { + Reader_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.idl new file mode 100644 index 00000000000..53cf908ef44 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Reader_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef READER_TEST_CONNECTOR_IDL_ +#define READER_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Reader_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Reader_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::ReaderTest, ::ReaderTestSeq> ReaderTest; +}; + +module Reader_Test +{ + connector Reader_Test_Connector : ::CCM_DDS::ReaderTest::DDS_Event + { + }; +}; + +#endif /* Reader_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.mpc new file mode 100755 index 00000000000..bf511b1341b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Connector/Reader_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Reader_Test_Base -l .. -o ../lib -u DDS Reader_Test_Connector" + +project(DDS_Reader_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Reader_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=READER_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Reader_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=READER_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Reader_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=READER_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Reader_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + Reader_Test_Connector.idl + } +} + +project(DDS_Reader_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Reader_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=READER_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Reader_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Reader_Test_ConnectorE.idl + } +} + +project(DDS_Reader_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Reader_Test_Connector_lem_gen DDS_Reader_Test_Connector_stub DDS_Reader_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_Reader_Test_Base_stub DDS_Reader_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Reader_Test_Connector_lem_stub + dynamicflags = READER_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ConnectorEC.cpp + } + + Header_Files { + Reader_Test_ConnectorEC.h + Reader_Test_Connector_lem_stub_export.h + } + + Inline_Files { + Reader_Test_ConnectorEC.inl + } +} + +project(DDS_Reader_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_Reader_Test_Connector_idl_gen DDS_Reader_Test_Base_stub + libs += DDS_Reader_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Reader_Test_Connector_stub + dynamicflags = READER_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ConnectorC.cpp + } + + Header_Files { + Reader_Test_ConnectorC.h + Reader_Test_Connector_stub_export.h + } + + Inline_Files { + Reader_Test_ConnectorC.inl + } +} + +project(DDS_Reader_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_Reader_Test_Connector_lem_stub DDS_Reader_Test_Connector_stub DDS4CCM_lem_stub DDS_Reader_Test_Base_stub + sharedname = DDS_Reader_Test_Connector_exec + libs += DDS_Reader_Test_Connector_stub DDS_Reader_Test_Connector_lem_stub DDS_Reader_Test_Base_stub DDS4CCM_lem_stub DDS_Reader_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_Connector_conn.cpp + } + + Header_Files { + Reader_Test_Connector_conn.h + Reader_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_Reader_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_Reader_Test_Connector_lem_stub DDS_Reader_Test_Connector_exec DDS_Reader_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Reader_Test_Connector_svnt + libs += DDS_Reader_Test_Connector_stub \ + DDS_Reader_Test_Connector_lem_stub \ + DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = READER_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ConnectorS.cpp + Reader_Test_Connector_svnt.cpp + } + + Header_Files { + Reader_Test_ConnectorS.h + Reader_Test_Connector_svnt.h + Reader_Test_Connector_svnt_export.h + } + + Inline_Files { + Reader_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/README b/modules/CIAO/connectors/dds4ccm/tests/Reader/README new file mode 100644 index 00000000000..ec69fbb989d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/README @@ -0,0 +1,22 @@ +# $Id$ + +This test tests the reader. + +The following methods of the reader are tested: + +* read_one +* read_all +* read_one_last +* read_one_all + +First of all, the Sender writes a known number of samples to DDS. +After that the Sender informs the Receiver which test is about +to run and how many samples should be read from DDS. Before the +Receiver starts reading, he must find out that all samples resides +in DDS on the receiving side. He does that by calling read_last every +time a DATA_ON_READERS_STATUS comes in on the ConnectorStatusListener. +Once the very last sample is in DDS on the receiving side, the Receiver +starts to read the samples. Afterwards he checks wether all samples are +avaiable (thus are read correctly from DDS). + +The Receiver also test whether the correct exceptions are thrown. diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.idl new file mode 100644 index 00000000000..a1c6ccaa8d9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Reader_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module Reader_Test +{ + component Receiver + { + port CCM_DDS::ReaderTest::DDS_Listen info_out; + + provides ReaderStarter reader_start; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.mpc new file mode 100755 index 00000000000..a6a1aec6c05 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(DDS_Reader_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Reader_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 { + Reader_Test_Receiver.idl + } +} + +project(DDS_Reader_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Reader_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 { + Reader_Test_ReceiverE.idl + } +} + +project(DDS_Reader_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Reader_Test_Receiver_lem_gen DDS_Reader_Test_Receiver_stub \ + DDS_Reader_Test_Connector_stub DDS_Reader_Test_Base_stub \ + DDS_Reader_Starter_stub + libs += Receiver_stub DDS_Reader_Test_Connector_stub \ + DDS_Reader_Test_Base_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ReceiverEC.cpp + } + + Header_Files { + Reader_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Reader_Test_ReceiverEC.inl + } +} + +project(DDS_Reader_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_Reader_Test_Receiver_idl_gen DDS_Reader_Test_Connector_stub \ + DDS_Reader_Test_Base_stub DDS_Reader_Test_Connector_lem_gen \ + DDS_Reader_Starter_stub DDS_Reader_Starter_lem_stub + libs += DDS_Reader_Test_Connector_stub DDS_Reader_Test_Base_stub \ + Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ReceiverC.cpp + } + + Header_Files { + Reader_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Reader_Test_ReceiverC.inl + } +} + +project(DDS_Reader_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_Reader_Test_Receiver_lem_stub DDS_Reader_Test_Receiver_stub \ + DDS_Reader_Test_Base_stub DDS_Reader_Test_Connector_stub \ + DDS_Reader_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_Reader_Starter_lem_stub DDS_Reader_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_stub DDS_Reader_Test_Connector_lem_stub \ + DDS4CCM_lem_stub Reader_Starter_lem_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_Receiver_exec.cpp + } + + Header_Files { + Reader_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Reader_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Reader_Test_Receiver_lem_stub DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_stub DDS_Reader_Test_Connector_svnt \ + DDS_Reader_Test_Receiver_exec DDS_Reader_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Reader_Starter_stub \ + DDS_Reader_Starter_svnt DDS_Reader_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_stub DDS_Reader_Test_Connector_svnt \ + Receiver_exec DDS_Reader_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel Reader_Starter_stub Reader_Starter_svnt \ + Reader_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_ReceiverS.cpp + Reader_Test_Receiver_svnt.cpp + } + + Header_Files { + Reader_Test_ReceiverS.h + Reader_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Reader_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..beb5ad9d60b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.cpp @@ -0,0 +1,638 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Reader_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Reader_Test_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : callback_ (callback) + { + } + + 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->callback_.check_last ()) + this->callback_.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 () + { + this->callback_.start_read (); + } + + void + Starter_exec_i::read_no_data () + { + this->callback_.read_no_data (); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (10), + keys_ (5), + has_run_ (false) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + if (! ::CORBA::is_nil (this->reader_)) + { + ReaderTest readertest_info; + ::CCM_DDS::ReadInfo readinfo; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", this->keys_); + readertest_info.key = CORBA::string_dup (key); + this->reader_->read_one_last ( + readertest_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last: " + "key <%C> - iteration <%d>\n", + readertest_info.key.in (), + readertest_info.iteration)); + return readertest_info.iteration == this->iterations_; + } + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::check_last: " + "Unexpected exception caught\n")); + } + return false; + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_one_last (bool test_handles) + { + try + { + for (CORBA::UShort i = 1; i < this->keys_ + 1; ++i) + { + ReaderTest readertest_info; + ::CCM_DDS::ReadInfo readinfo; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", i); + readertest_info.key = CORBA::string_dup (key); + DDS::InstanceHandle_t hnd = test_handles + ? this->handles_[key] + : ::DDS::HANDLE_NIL; + this->reader_->read_one_last ( + readertest_info, + readinfo, + hnd); + if (readertest_info.iteration == this->iterations_) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ONE LAST: ") + ACE_TEXT ("last iteration received for <%C>: iteration <%u>\n"), + readertest_info.key.in (), + readertest_info.iteration)); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ONE LAST: ") + ACE_TEXT ("Didn't receive last iteration for <%C>: ") + ACE_TEXT ("expected <%u> - received <%u>\n"), + readertest_info.key.in (), + this->iterations_, + readertest_info.iteration)); + } + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("READ ONE LAST: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ONE LAST: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ONE LAST:"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_one_last : Exception caught\n"))); + } + } + + void + Receiver_exec_i::read_one_all (bool test_handles) + { + try + { + for (CORBA::UShort i = 1; i < this->keys_ + 1; ++i) + { + ReaderTest readertest_info; + ReaderTestSeq *readertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", i); + readertest_info.key = CORBA::string_dup (key); + DDS::InstanceHandle_t hnd = test_handles + ? this->handles_[key] + : ::DDS::HANDLE_NIL; + this->reader_->read_one_all ( + readertest_info, + readertest_info_seq, + readinfo_seq, + hnd); + + if (readertest_info_seq->length () != this->iterations_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ONE ALL: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("samples for <%C>: expected <%u> - received <%u>\n"), + key, + this->iterations_, + readertest_info_seq->length ())); + } + else + { + this->handles_[key] = (*readinfo_seq)[0].instance_handle; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ONE ALL: ") + ACE_TEXT ("All iterations received for <%C>: number of iterations <%u>\n"), + key, + readertest_info_seq->length ())); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ONE ALL: ") + ACE_TEXT ("Handle created for <%C>: length <%u> - isValid <%d>\n"), + key, + (*readinfo_seq)[0].instance_handle.length, + (*readinfo_seq)[0].instance_handle.isValid)); + } + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ONE ALL: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + if (ex.error_code == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ONE ALL: ") + ACE_TEXT ("caught InternalError exception: handles differ\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ONE ALL: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ONE ALL: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_one_all : Exception caught\n"))); + } + } + + void + Receiver_exec_i::read_last (void) + { + try + { + ReaderTestSeq *readertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_last ( + readertest_info_seq, + readinfo_seq); + + if (readertest_info_seq->length () != this->keys_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ LAST: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("instances : expected <%u> - received <%u>\n"), + this->keys_, + readertest_info_seq->length ())); + } + for (CORBA::ULong it = 0; it < readertest_info_seq->length (); ++it) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ LAST : ") + ACE_TEXT ("last iteration received for <%C>: iteration <%u>\n"), + (*readertest_info_seq)[it].key.in (), + (*readertest_info_seq)[it].iteration)); + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ LAST: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ LAST: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ LAST: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_last : Exception caught\n"))); + } + } + + void + Receiver_exec_i::read_all (void) + { + try + { + ReaderTestSeq *readertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_all ( + readertest_info_seq, + readinfo_seq); + + CORBA::ULong nr_samples = this->keys_ * this->iterations_; + if (readertest_info_seq->length () != nr_samples) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("samples : expected <%u> - received <%u>\n"), + nr_samples, + readertest_info_seq->length ())); + } + if (readertest_info_seq->length () > 0) + { + CORBA::UShort nr_keys_changed = 1; + CORBA::String_var last_key ((*readertest_info_seq)[0].key.in ()); + CORBA::UShort iterations = 0; + for (CORBA::ULong it = 0; it < readertest_info_seq->length (); ++it) + { + if (ACE_OS::strcmp (last_key, (*readertest_info_seq)[it].key.in ()) != 0) + { + ACE_OS::strcpy (last_key, (*readertest_info_seq)[it].key.in ()); + ++nr_keys_changed; + } + // check readinfo struct. + if (!(*readinfo_seq)[it].instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("received instance handle should be valid ") + ACE_TEXT ("for keyed data: ") + ACE_TEXT ("key <%C> - iteration <%u>\n"), + (*readertest_info_seq)[it].key.in (), + (*readertest_info_seq)[it].iteration)); + } + if ((*readinfo_seq)[it].source_timestamp.sec == 0 && + (*readinfo_seq)[it].source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + (*readertest_info_seq)[it].key.in (), + (*readertest_info_seq)[it].iteration)); + } + ++iterations; + } + if (nr_keys_changed != this->keys_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("instances : expected <%u> - received <%u>\n"), + this->keys_, + nr_keys_changed)); + } + if (iterations != (this->keys_ * this->iterations_)) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("samples : expected <%u> - received <%u>\n"), + nr_samples, + iterations)); + } + } + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ ALL: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ ALL: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ ALL: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_all : Exception caught\n"))); + } + } + + void + Receiver_exec_i::test_exception () + { + // test exception handling + bool except_caught = false; + try + { + ReaderTest readertest_info; + readertest_info.key = CORBA::string_dup ("KEY_0"); + ::CCM_DDS::ReadInfo readinfo; + this->reader_->read_one_last (readertest_info, readinfo, ::DDS::HANDLE_NIL); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Receiver_exec_i::test_exception: ") + ACE_TEXT ("Wrong exception caught while reading non existent instance\n"))); + } + catch (const CCM_DDS::NonExistent& ) + { + except_caught = true; + } + if (!except_caught) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Receiver_exec_i::test_exception: ") + ACE_TEXT ("no excep caught while reading non existent instance\n"))); + } + } + + void + Receiver_exec_i::test_exception_with_handles () + { + // test exception handling + bool except_caught = false; + try + { + ReaderTest readertest_info; + readertest_info.key = CORBA::string_dup ("KEY_1"); + ::CCM_DDS::ReadInfo readinfo; + DDS::InstanceHandle_t hnd = this->handles_["KEY_2"]; + this->reader_->read_one_last ( + readertest_info, + readinfo, + hnd); + } + catch (const CCM_DDS::InternalError& ) + { + except_caught = true; + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver_exec_i::test_exception_with_handles: ") + ACE_TEXT ("Expected exception caught while reading non existent instance\n"))); + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Receiver_exec_i::test_exception_with_handles: ") + ACE_TEXT ("Wrong exception caught while reading non existent instance\n"))); + } + if (!except_caught) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR : Receiver_exec_i::test_exception_with_handles: ") + ACE_TEXT ("no excep caught while reading non existent instance\n"))); + } + } + + void + Receiver_exec_i::read_no_data () + { + try + { + ReaderTestSeq *readertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_all ( + readertest_info_seq, + readinfo_seq); + + if (readertest_info_seq->length () > 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ NO DATA: ") + ACE_TEXT ("Didn't receive the expected number of ") + ACE_TEXT ("samples : expected <%u> - received <%u>\n"), + 0, + readertest_info_seq->length ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ NO DATA: ") + ACE_TEXT ("No data available.\n"))); + } + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ERROR: READ NO DATA: ") + ACE_TEXT ("Caught NonExistent exception"))); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: READ NO DATA: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: READ NO DATA: "); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::read_no_data : Exception caught\n"))); + } + } + + void + Receiver_exec_i::run () + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + + this->has_run_ = true; + read_all (); + read_last (); + read_one_all (); + read_one_last (); + test_exception (); + //now test with collected handles + read_one_all (true); + read_one_last (true); + test_exception_with_handles (); + } + + void + Receiver_exec_i::start_read () + { + 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")); + } + } + + ::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::ReaderTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return 0; + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + ::CCM_ReaderStarter_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_ = + ::Reader_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_out_data(); + } + + void + Receiver_exec_i::ccm_activate (void) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->ticker_) + { + ACE_ERROR ((LM_ERROR, "Still checking DDS upon exit\n")); + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + + 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 samples\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Reader_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.h new file mode 100644 index 00000000000..2d7a6251d7d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Receiver/Reader_Test_Receiver_exec.h @@ -0,0 +1,132 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Reader_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_Reader_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); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Receiver_exec_i &callback_; + + }; + + //============================================================ + // Starter_exec_i + //============================================================ + class Starter_exec_i + : public virtual ::CCM_ReaderStarter, + 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 read_no_data (); + virtual void start_read (); + + 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); + + // Port operations. + virtual ::CCM_DDS::ReaderTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_ReaderStarter_ptr + get_reader_start (); + + void read_no_data (); + void start_read (); + bool check_last (); + void run (void); + + ::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: + ::Reader_Test::CCM_Receiver_Context_var context_; + ::CCM_DDS::ReaderTest::Reader_var reader_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + CORBA::Boolean has_run_; + + void read_all (); + void read_last (); + void read_one_all (bool test_handles = false); + void read_one_last (bool test_handles = false); + void test_exception (); + void test_exception_with_handles (); + + read_action_Generator *ticker_; + + typedef std::map<ACE_CString, DDS::InstanceHandle_t> Handle_Table; + Handle_Table handles_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Reader_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.idl new file mode 100644 index 00000000000..f8f0afcb3ae --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.idl @@ -0,0 +1,30 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_READER_TEST_SENDER_IDL +#define DDS_READER_TEST_SENDER_IDL + +#include "Connector/Reader_Test_Connector.idl" +#include "Base/Reader_Starter.idl" + +module Reader_Test +{ + component Sender + { + port CCM_DDS::ReaderTest::DDS_Write info_write; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + + uses ReaderStarter start_reader; + + attribute unsigned short keys; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.mpc new file mode 100755 index 00000000000..6679ff15677 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender.mpc @@ -0,0 +1,152 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Reader_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_Reader_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_Reader_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 { + Reader_Test_Sender.idl + } +} + +project(DDS_Reader_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Reader_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 { + Reader_Test_SenderE.idl + } +} + +project(DDS_Reader_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Reader_Test_Sender_lem_gen DDS_Reader_Test_Sender_stub \ + DDS_Reader_Test_Base_stub DDS_Reader_Starter_stub + libs += DDS_Reader_Test_Base_stub Sender_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_SenderEC.cpp + } + + Header_Files { + Reader_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Reader_Test_SenderEC.inl + } +} + +project(DDS_Reader_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_Reader_Test_Sender_idl_gen DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_stub DDS_Reader_Starter_stub \ + DDS_Reader_Starter_lem_stub + libs += DDS_Reader_Test_Base_stub DDS_Reader_Test_Connector_stub \ + Reader_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_SenderC.cpp + } + + Header_Files { + Reader_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Reader_Test_SenderC.inl + } +} + +project(DDS_Reader_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_Reader_Test_Sender_lem_stub DDS_Reader_Test_Sender_stub \ + DDS_Reader_Test_Connector_lem_stub DDS_Reader_Test_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_Reader_Test_Base_stub \ + DDS_Reader_Test_Connector_lem_stub DDS_Reader_Test_Connector_stub \ + Reader_Starter_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_Sender_exec.cpp + } + + Header_Files { + Reader_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Reader_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Reader_Test_Base_stub DDS_Reader_Test_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_Reader_Test_Connector_stub \ + DDS_Reader_Test_Connector_svnt DDS_Reader_Test_Connector_lem_stub \ + DDS_Reader_Starter_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub DDS_Reader_Test_Base_stub DDS4CCM_lem_stub \ + DDS4CCM_skel DDS_Reader_Test_Connector_stub DDS_Reader_Test_Connector_svnt \ + DDS_Reader_Test_Connector_lem_stub Reader_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Reader_Test_SenderS.cpp + Reader_Test_Sender_svnt.cpp + } + + Header_Files { + Reader_Test_SenderS.h + Reader_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Reader_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.cpp new file mode 100644 index 00000000000..242249bbcd2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.cpp @@ -0,0 +1,202 @@ +// -*- C++ -*- +// $Id$ + +#include "Reader_Test_Sender_exec.h" +#include "ace/Log_Msg.h" + +namespace CIAO_Reader_Test_Sender_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Sender_exec_i &callback) + : callback_ (callback) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr , + const DDS::InconsistentTopicStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr , + const DDS::RequestedIncompatibleQosStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr , + const DDS::SampleRejectedStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr , + const DDS::OfferedDeadlineMissedStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr , + const DDS::OfferedIncompatibleQosStatus & ) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind status_kind) + { + if (status_kind == ::DDS::PUBLICATION_MATCHED_STATUS) + this->callback_.start (); + } + + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : iterations_ (10), + keys_ (5), + done_ (false), + ccm_activated_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + void + Sender_exec_i::start (void) + { + //start can be called more than once... + if (!this->done_ && this->ccm_activated_) + { + this->done_ = true; + if (! ::CORBA::is_nil (this->starter_)) + { + this->starter_->set_reader_properties (this->keys_, this->iterations_); + this->starter_->read_no_data (); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unable to start the reader\n"))); + return; + } + for (CORBA::UShort iter_key = 1; iter_key < this->keys_ + 1; ++iter_key) + { + char key[7]; + ReaderTest *new_key = new ReaderTest; + ACE_OS::sprintf (key, "KEY_%d", iter_key); + new_key->key = CORBA::string_dup(key); + for (CORBA::UShort iter = 1; iter < 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)); + } + } + this->starter_->start_read (); + } + } + + ::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; + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_info_out_connector_status (void) + { + return new ConnectorStatusListener_exec_i (*this); + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Reader_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 (); + this->ccm_activated_ = true; + } + 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_Reader_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.h new file mode 100644 index 00000000000..8b1fc86efbe --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/Sender/Reader_Test_Sender_exec.h @@ -0,0 +1,98 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Reader_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_Reader_Test_Sender_Impl +{ + class Sender_exec_i; + + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Sender_exec_i &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic( ::DDS::Topic_ptr , + const DDS::InconsistentTopicStatus & ); + virtual + void on_requested_incompatible_qos( ::DDS::DataReader_ptr , + const DDS::RequestedIncompatibleQosStatus & ); + virtual + void on_sample_rejected( ::DDS::DataReader_ptr , + const DDS::SampleRejectedStatus & ); + virtual + void on_offered_deadline_missed( ::DDS::DataWriter_ptr , + const DDS::OfferedDeadlineMissedStatus & ); + virtual + void on_offered_incompatible_qos( ::DDS::DataWriter_ptr , + const DDS::OfferedIncompatibleQosStatus & ); + virtual + void on_unexpected_status( ::DDS::Entity_ptr , + ::DDS::StatusKind ); + 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 ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_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); + + void start (void); + + private: + ::Reader_Test::CCM_Sender_Context_var context_; + CCM_DDS::ReaderTest::Writer_var writer_; + ReaderStarter_var starter_; + + CORBA::UShort iterations_; + CORBA::UShort keys_; + bool done_; + bool ccm_activated_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Reader_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/Plan.cdp new file mode 100644 index 00000000000..718e64b1b42 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/Plan.cdp @@ -0,0 +1,388 @@ +<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>Reader_Test_Depl_1</label> + <UUID>Reader_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_Reader_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_Reader_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="Reader_Test_ConnectorComponentImplementation"> + <name>Reader_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Reader_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Reader_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_Reader_Test_Reader_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Reader_Test_Reader_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_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_Reader_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_Reader_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="Reader_Test_ConnectorComponentInstance"> + <name>Reader_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Reader_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_Library#Reader_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Reader_Test_ConnectorComponentInstance2"> + <name>Reader_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Reader_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_Library#Reader_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Reader_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_ulong</kind> + </type> + <value> + <ulong>5</ulong> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ulong</kind> + </type> + <value> + <ulong>50</ulong> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Reader_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_out_connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Reader_Test_ConnectorComponentInstance" /> + </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="Reader_Test_ConnectorComponentInstance" /> + </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> + + <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="Reader_Test_Connector_ExecArtifact"> + <name>Reader_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_Reader_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="Reader_Test_Connector_SvntArtifact"> + <name>Reader_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Reader_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="Reader_Test_Connector_StubArtifact"> + <name>Reader_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_Reader_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/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..8406e3003a3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/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="Reader_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="Reader_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>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/Reader/descriptors/run_test.pl new file mode 100755 index 00000000000..997852c0618 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Reader/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.idl new file mode 100644 index 00000000000..dc4f13b6f93 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file SL_Disabled_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_DISABLED_BASE_IDL +#define SL_DISABLED_BASE_IDL + +#pragma ndds typesupport "Base/SL_Disabled_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.mpc new file mode 100644 index 00000000000..87a021362d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Base/SL_Disabled_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SL_Disabled_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SL_Disabled_Base_stub + dynamicflags += SL_DISABLED_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=SL_DISABLED_BASE_STUB_Export \ + -Wb,stub_export_include=SL_Disabled_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + SL_Disabled_Base.idl + } + + opendds_ts_flags += --export=SL_DISABLED_BASE_STUB_Export + + DDSGenerator_Files { + SL_Disabled_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.idl new file mode 100644 index 00000000000..4fb52425ceb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file SL_Disabled_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_DISABLED_CONNECTOR_IDL_ +#define SL_DISABLED_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/SL_Disabled_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/SL_Disabled_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module SL_Disabled +{ + connector SL_Disabled_Connector : ::CCM_DDS::TestTopic::DDS_State + { + }; +}; + +#endif /* SL_Disabled_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.mpc new file mode 100644 index 00000000000..7b56d2276f5 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Connector/SL_Disabled_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_Disabled_Base -l .. -o ../lib -u DDS SL_Disabled_Connector" + +project(DDS_SL_OC_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SL_DISABLED_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=SL_Disabled_Connector_stub_export.h \ + -Wb,skel_export_macro=SL_DISABLED_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=SL_Disabled_Connector_svnt_export.h \ + -Wb,svnt_export_macro=SL_DISABLED_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=SL_Disabled_Connector_svnt_export.h \ + -Wb,conn_export_macro=SL_DISABLED_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=SL_Disabled_Connector_conn_export.h \ + -I .. + + IDL_Files { + SL_Disabled_Connector.idl + } +} + +project(DDS_SL_OC_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_OC_Connector_idl_gen + idlflags += -Wb,stub_export_macro=SL_DISABLED_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=SL_Disabled_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + SL_Disabled_ConnectorE.idl + } +} + +project(DDS_SL_OC_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_OC_Connector_lem_gen DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Base_stub DDS4CCM_lem_stub + libs += DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_OC_Connector_lem_stub + dynamicflags = SL_DISABLED_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ConnectorEC.cpp + } + + Header_Files { + SL_Disabled_ConnectorEC.h + SL_Disabled_Connector_lem_stub_export.h + } + + Inline_Files { + SL_Disabled_ConnectorEC.inl + } +} + +project(DDS_SL_Disabled_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_OC_Connector_idl_gen DDS_SL_Disabled_Base_stub + libs += DDS_SL_Disabled_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_Disabled_Connector_stub + dynamicflags = SL_DISABLED_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ConnectorC.cpp + } + + Header_Files { + SL_Disabled_ConnectorC.h + SL_Disabled_Connector_stub_export.h + } + + Inline_Files { + SL_Disabled_ConnectorC.inl + } +} + +project(DDS_SL_Disabled_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SL_OC_Connector_lem_stub DDS_SL_Disabled_Connector_stub DDS4CCM_lem_stub DDS_SL_Disabled_Base_stub + sharedname = DDS_SL_Disabled_Connector_exec + libs += DDS_SL_Disabled_Connector_stub DDS_SL_OC_Connector_lem_stub DDS_SL_Disabled_Base_stub DDS4CCM_lem_stub DDS_SL_Disabled_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_DISABLED_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_Connector_conn.cpp + } + + Header_Files { + SL_Disabled_Connector_conn.h + SL_Disabled_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_Disabled_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SL_OC_Connector_lem_stub DDS_SL_Disabled_Connector_exec DDS_SL_Disabled_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_SL_Disabled_Connector_svnt + libs += DDS_SL_Disabled_Connector_stub \ + DDS_SL_OC_Connector_lem_stub \ + DDS_SL_Disabled_Base_stub \ + DDS_SL_Disabled_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_DISABLED_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ConnectorS.cpp + SL_Disabled_Connector_svnt.cpp + } + + Header_Files { + SL_Disabled_ConnectorS.h + SL_Disabled_Connector_svnt.h + SL_Disabled_Connector_svnt_export.h + } + + Inline_Files { + SL_Disabled_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.idl new file mode 100644 index 00000000000..69961d9a952 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/SL_Disabled_Connector.idl" + +module SL_Disabled +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_StateListen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.mpc new file mode 100644 index 00000000000..e6da1488efa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_SL_Disabled_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_OC_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 { + SL_Disabled_Receiver.idl + } +} + +project(DDS_SL_Disabled_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_Disabled_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 { + SL_Disabled_ReceiverE.idl + } +} + +project(DDS_SL_OC_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_Disabled_Receiver_lem_gen DDS_SL_Disabled_Receiver_stub DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Base_stub + libs += Receiver_stub DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ReceiverEC.cpp + } + + Header_Files { + SL_Disabled_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + SL_Disabled_ReceiverEC.inl + } +} + +project(DDS_SL_Disabled_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_Disabled_Receiver_idl_gen DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Base_stub DDS_SL_OC_Connector_lem_gen + libs += DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ReceiverC.cpp + } + + Header_Files { + SL_Disabled_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + SL_Disabled_ReceiverC.inl + } +} + +project(DDS_SL_Disabled_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_OC_Receiver_lem_stub DDS_SL_Disabled_Receiver_stub DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub DDS_SL_OC_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub DDS_SL_OC_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_Receiver_exec.cpp + } + + Header_Files { + SL_Disabled_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_Disabled_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_OC_Receiver_lem_stub DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Connector_svnt DDS_SL_Disabled_Receiver_exec DDS_SL_OC_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Connector_svnt Receiver_exec DDS_SL_OC_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_ReceiverS.cpp + SL_Disabled_Receiver_svnt.cpp + } + + Header_Files { + SL_Disabled_ReceiverS.h + SL_Disabled_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + SL_Disabled_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.cpp new file mode 100644 index 00000000000..671c45eb08e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.cpp @@ -0,0 +1,231 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for statelistener: NOT_ENABLED + +#include "SL_Disabled_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +namespace CIAO_SL_Disabled_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + try + { + this->pulse_callback_.read_all(); + } + catch (...) + { + // @todo + } + return 0; + } + + //============================================================ + // StateListener_exec_i + //============================================================ + StateListener_exec_i::StateListener_exec_i (Atomic_Boolean &no_operation) + :no_operation_(no_operation) + { + } + + StateListener_exec_i::~StateListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::StateListener + void + StateListener_exec_i::on_creation (const ::TestTopic & /*datum*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + this->no_operation_ = false; + } + + void + StateListener_exec_i::on_one_update (const ::TestTopic & /*datum*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + this->no_operation_ = false; + } + + void + StateListener_exec_i::on_many_updates (const ::TestTopicSeq & /*data*/, + const ::CCM_DDS::ReadInfoSeq & /*infos*/) + { + this->no_operation_ = false; + } + + void + StateListener_exec_i::on_deletion (const ::TestTopic & /*datum*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + this->no_operation_ = false; + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (10), + no_operation_ (true), + updater_data_ (false) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + TestTopicSeq_var TestTopic_infos; + ::CCM_DDS::ReadInfoSeq_var readinfoseq; + try + { + this->reader_->read_all(TestTopic_infos.out(), readinfoseq.out()); + for (CORBA::ULong i = 0; i < readinfoseq->length(); ++i) + { + this->updater_data_ = true; + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for (CORBA::ULong i = 0; i < TestTopic_infos->length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + TestTopic_infos[i].key.in (), + TestTopic_infos[i].x)); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("internal error or no data\n"))); + } + } + + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::TestTopic::CCM_StateListener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return new StateListener_exec_i(this->no_operation_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::SL_Disabled::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_out_data (); + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::CCM_DDS::StateListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + + lc->mode (::CCM_DDS::NOT_ENABLED); + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(3, usec), + ACE_Time_Value(3, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->no_operation_.value ()|| !this->updater_data_.value()) + { + + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Received an unexpected ") + ACE_TEXT (" operation. StateListener or Updater doesn't work in Receiver") + )); + } + + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Haven't received an unexpected ") + ACE_TEXT (" oparation from StateListener in Receiver") + )); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_Disabled_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.h new file mode 100644 index 00000000000..8b5460e8057 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Receiver/SL_Disabled_Receiver_exec.h @@ -0,0 +1,117 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "SL_Disabled_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_SL_Disabled_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Receiver_exec_i; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + private: + Receiver_exec_i &pulse_callback_; + + }; + + //============================================================ + // StateListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export StateListener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_StateListener, + public virtual ::CORBA::LocalObject + { + public: + StateListener_exec_i (Atomic_Boolean &); + virtual ~StateListener_exec_i (void); + + virtual void + on_creation ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_one_update ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_updates ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & infos); + virtual void + on_deletion ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + private: + Atomic_Boolean &no_operation_; + }; + + //============================================================ + // 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_StateListener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + void read_all (void); + + private: + ::SL_Disabled::CCM_Receiver_Context_var context_; + ::CCM_DDS::TestTopic::Reader_var reader_; + read_action_Generator * ticker_; + + CORBA::ULong rate_; + Atomic_Boolean no_operation_; + Atomic_Boolean updater_data_; +}; + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_Disabled_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.idl new file mode 100644 index 00000000000..c03faed763a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_SL_DISABLED_SENDER_IDL +#define DDS_SL_DISABLED_SENDER_IDL + +#include "Connector/SL_Disabled_Connector.idl" + +module SL_Disabled +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Update test_topic_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.mpc new file mode 100644 index 00000000000..43f66775112 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_Disabled_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_SL_Disabled_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SL_OC_Connector_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 { + SL_Disabled_Sender.idl + } +} + +project(DDS_SL_Disabled_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_Disabled_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 { + SL_Disabled_SenderE.idl + } +} + +project(DDS_SL_Disabled_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_Disabled_Sender_lem_gen DDS_SL_Disabled_Sender_stub DDS_SL_Disabled_Base_stub + libs += DDS_SL_Disabled_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_SenderEC.cpp + } + + Header_Files { + SL_Disabled_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + SL_Disabled_SenderEC.inl + } +} + +project(DDS_SL_Disabled_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_Disabled_Sender_idl_gen DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub + libs += DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_SenderC.cpp + } + + Header_Files { + SL_Disabled_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + SL_Disabled_SenderC.inl + } +} + +project(DDS_SL_Disabled_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_Disabled_Sender_lem_stub DDS_SL_Disabled_Sender_stub DDS_SL_OC_Connector_lem_stub DDS_SL_Disabled_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_SL_Disabled_Base_stub DDS_SL_OC_Connector_lem_stub DDS_SL_Disabled_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_Sender_exec.cpp + } + + Header_Files { + SL_Disabled_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_Disabled_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_Disabled_Base_stub DDS_SL_Disabled_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Connector_svnt DDS_SL_OC_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_SL_Disabled_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_Disabled_Connector_stub DDS_SL_Disabled_Connector_svnt DDS_SL_OC_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_Disabled_SenderS.cpp + SL_Disabled_Sender_svnt.cpp + } + + Header_Files { + SL_Disabled_SenderS.h + SL_Disabled_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + SL_Disabled_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.cpp new file mode 100644 index 00000000000..bf3bb99ef50 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.cpp @@ -0,0 +1,358 @@ +// -*- C++ -*- +// $Id$ + +#include "SL_Disabled_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_SL_Disabled_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : test_nr_(UPDATE_CREATE), + test_ok_(true) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + CORBA::Boolean + Sender_exec_i::create_one(void) + { + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + if (! ::CORBA::is_nil (this->updater_) ) + { + this->updater_->create_one(i); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SL_Disabled: create_one with instance key <%C>\n"), + i.key.in())); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: updater_ is nil"))); + result = false; + } + } + catch (const CCM_DDS::AlreadyCreated &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test updater create_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while create_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_one() + { + //update already created instance with handle nil + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + this->updater_->update_one(i, DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update_one with already existing instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_one() + { + //delete registerd instance with DDS::HANDLE_NIL + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete_one with registerd instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, DDS::HANDLE_NIL); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::create_many() + { + //create many with no exception + CORBA::Boolean result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->create_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater create_many\n"))); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("in updater: create_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_many() + { + CORBA::Boolean result = false; + try + { + this->updater_->update_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("update_many : written <%u> samples\n"), + this->topic_seq_many_.length ())); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_many.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("whit update_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_many() + { + CORBA::Boolean result = false; + result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_many : deleted <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->delete_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_many\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("with test updater delete_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + + return result; + } + + void + Sender_exec_i::add_instances_of_topic () + { + CORBA::UShort total = 3; + this->topic_seq_one_.length (total); + //sequence for tests with .._one + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_one_[i-1] = new_key; + } + //sequence for tests with .._many + this->topic_seq_many_.length (total); + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "many_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_many_[i-1] = new_key; + } + } + + void + Sender_exec_i::tick () + { + if(this->test_ok_.value()) + { + switch (this->test_nr_) + { + case UPDATE_CREATE: + this->test_ok_ = this->create_one(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_ONE; + } + else + { + this->test_nr_ = END_TEST; + } + break; + case UPDATE_ONE: + this->test_ok_ = this->update_one(); + this->test_nr_ = DELETE_ONE; + break; + case DELETE_ONE: + this->test_ok_ = this->delete_one(); + this->test_nr_ = CREATE_MANY; + case CREATE_MANY: + this->test_ok_ = this->create_many(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_MANY; + } + else + { + this->test_nr_ = END_TEST; + } + this->test_nr_ = UPDATE_MANY; + break; + case UPDATE_MANY: + this->test_ok_ = this->update_many(); + this->test_nr_ = DELETE_MANY; + break; + case DELETE_MANY: + this->test_ok_ = this->delete_many(); + this->test_nr_ = END_TEST; + break; + default: + break; + } + } + } + void + Sender_exec_i::start (void) + { + long sec = 1L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::SL_Disabled::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_= this->context_->get_connection_test_topic_update_data (); + } + void + Sender_exec_i::ccm_activate (void) + { + this->add_instances_of_topic (); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_Disabled_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.h new file mode 100644 index 00000000000..b5d37e7a059 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/Sender/SL_Disabled_Sender_exec.h @@ -0,0 +1,89 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "SL_Disabled_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_SL_Disabled_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + enum UPDATER_TEST { + UPDATE_CREATE, + UPDATE_ONE, + DELETE_ONE, + CREATE_MANY, + UPDATE_MANY, + DELETE_MANY, + END_TEST + }; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_callback_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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 tick (void); + + private: + void start (void); + void stop (void); + void add_instances_of_topic (void); + CORBA::Boolean create_one(void); + CORBA::Boolean update_one(void); + CORBA::Boolean delete_one(void); + CORBA::Boolean create_many(void); + CORBA::Boolean update_many(void); + CORBA::Boolean delete_many(void); + + pulse_Generator * ticker_; + ::SL_Disabled::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Updater_var updater_; + UPDATER_TEST test_nr_; + Atomic_Boolean test_ok_; + TestTopicSeq topic_seq_one_; + TestTopicSeq topic_seq_many_; + }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_Disabled_Sender_Impl (void); + + + +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/descriptors/Plan.cdp new file mode 100644 index 00000000000..9a086079ff7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/descriptors/Plan.cdp @@ -0,0 +1,365 @@ +<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>SL_Disabled_Depl_1</label> + <UUID>SL_Disabled_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_SL_Disabled_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_Disabled_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="SL_Disabled_ConnectorComponentImplementation"> + <name>SL_Disabled_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="SL_Disabled_Connector_ExecArtifact" /> + <artifact xmi:idref="SL_Disabled_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_SL_Disabled_SL_Disabled_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_Disabled_SL_Disabled_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_Disabled_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_Disabled_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_SL_Disabled_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_Disabled_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="SL_Disabled_ConnectorComponentInstance"> + <name>SL_Disabled_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_Disabled_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SL_Disabled_ConnectorComponentInstance2"> + <name>SL_Disabled_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_Disabled_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_Disabled_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_statelistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_Disabled_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SL_Disabled_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_Disabled_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>updater_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="SL_Disabled_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="SL_Disabled_Connector_ExecArtifact"> + <name>SL_Disabled_Connector_exec</name> + <source/> + <node/> + <location>DDS_SL_Disabled_Connector_exec</location> + </artifact> + <artifact xmi:id="SL_Disabled_Connector_SvntArtifact"> + <name>SL_Disabled_Connector_svnt</name> + <source/> + <node/> + <location>DDS_SL_Disabled_Connector_svnt</location> + </artifact> + <artifact xmi:id="SL_Disabled_Connector_StubArtifact"> + <name>SL_Disabled_Connector_stub</name> + <source/> + <node/> + <location>DDS_SL_Disabled_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/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/descriptors/run_test.pl new file mode 100755 index 00000000000..66cc403a1fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLDisabled/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 20 seconds to allow task to complete\n"; +sleep (20); + +# 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/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.idl new file mode 100644 index 00000000000..a1ef6e34f42 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file SL_ManyByMany_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_MANYBYMANY_BASE_IDL +#define SL_MANYBYMANY_BASE_IDL + +#pragma ndds typesupport "Base/SL_ManyByMany_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.mpc new file mode 100644 index 00000000000..0730e183bb9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Base/SL_ManyByMany_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SL_ManyByMany_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SL_ManyByMany_Base_stub + dynamicflags += SL_MANYBYMANY_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=SL_MANYBYMANY_BASE_STUB_Export \ + -Wb,stub_export_include=SL_ManyByMany_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + SL_ManyByMany_Base.idl + } + + opendds_ts_flags += --export=SL_MANYBYMANY_BASE_STUB_Export + + DDSGenerator_Files { + SL_ManyByMany_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.idl new file mode 100644 index 00000000000..ea597b5c5c1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file SL_ManyByMany_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_MANYBYMANY_CONNECTOR_IDL_ +#define SL_MANYBYMANY_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/SL_ManyByMany_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/SL_ManyByMany_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module SL_ManyByMany +{ + connector SL_ManyByMany_Connector : ::CCM_DDS::TestTopic::DDS_State + { + }; +}; + +#endif /* SL_ManyByMany_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.mpc new file mode 100644 index 00000000000..77df887a47d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Connector/SL_ManyByMany_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_ManyByMany_Base -l .. -o ../lib -u DDS SL_ManyByMany_Connector" + +project(DDS_SL_MBM_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SL_MANYBYMANY_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=SL_ManyByMany_Connector_stub_export.h \ + -Wb,skel_export_macro=SL_MANYBYMANY_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=SL_ManyByMany_Connector_svnt_export.h \ + -Wb,svnt_export_macro=SL_MANYBYMANY_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=SL_ManyByMany_Connector_svnt_export.h \ + -Wb,conn_export_macro=SL_MANYBYMANY_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=SL_ManyByMany_Connector_conn_export.h \ + -I .. + + IDL_Files { + SL_ManyByMany_Connector.idl + } +} + +project(DDS_SL_MBM_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_MBM_Connector_idl_gen + idlflags += -Wb,stub_export_macro=SL_MANYBYMANY_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=SL_ManyByMany_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + SL_ManyByMany_ConnectorE.idl + } +} + +project(DDS_SL_MBM_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_MBM_Connector_lem_gen DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Base_stub DDS4CCM_lem_stub + libs += DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_MBM_Connector_lem_stub + dynamicflags = SL_MANYBYMANY_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ConnectorEC.cpp + } + + Header_Files { + SL_ManyByMany_ConnectorEC.h + SL_ManyByMany_Connector_lem_stub_export.h + } + + Inline_Files { + SL_ManyByMany_ConnectorEC.inl + } +} + +project(DDS_SL_ManyByMany_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_MBM_Connector_idl_gen DDS_SL_ManyByMany_Base_stub + libs += DDS_SL_ManyByMany_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_ManyByMany_Connector_stub + dynamicflags = SL_MANYBYMANY_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ConnectorC.cpp + } + + Header_Files { + SL_ManyByMany_ConnectorC.h + SL_ManyByMany_Connector_stub_export.h + } + + Inline_Files { + SL_ManyByMany_ConnectorC.inl + } +} + +project(DDS_SL_ManyByMany_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SL_MBM_Connector_lem_stub DDS_SL_ManyByMany_Connector_stub DDS4CCM_lem_stub DDS_SL_ManyByMany_Base_stub + sharedname = DDS_SL_ManyByMany_Connector_exec + libs += DDS_SL_ManyByMany_Connector_stub DDS_SL_MBM_Connector_lem_stub DDS_SL_ManyByMany_Base_stub DDS4CCM_lem_stub DDS_SL_ManyByMany_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_MANYBYMANY_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_Connector_conn.cpp + } + + Header_Files { + SL_ManyByMany_Connector_conn.h + SL_ManyByMany_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_ManyByMany_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SL_MBM_Connector_lem_stub DDS_SL_ManyByMany_Connector_exec DDS_SL_ManyByMany_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_SL_ManyByMany_Connector_svnt + libs += DDS_SL_ManyByMany_Connector_stub \ + DDS_SL_MBM_Connector_lem_stub \ + DDS_SL_ManyByMany_Base_stub \ + DDS_SL_ManyByMany_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_MANYBYMANY_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ConnectorS.cpp + SL_ManyByMany_Connector_svnt.cpp + } + + Header_Files { + SL_ManyByMany_ConnectorS.h + SL_ManyByMany_Connector_svnt.h + SL_ManyByMany_Connector_svnt_export.h + } + + Inline_Files { + SL_ManyByMany_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.idl new file mode 100644 index 00000000000..509db69e052 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/SL_ManyByMany_Connector.idl" + +module SL_ManyByMany +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_StateListen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.mpc new file mode 100644 index 00000000000..88db59ce7dd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_SL_ManyByMany_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_MBM_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 { + SL_ManyByMany_Receiver.idl + } +} + +project(DDS_SL_ManyByMany_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_ManyByMany_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 { + SL_ManyByMany_ReceiverE.idl + } +} + +project(DDS_SL_MBM_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_ManyByMany_Receiver_lem_gen DDS_SL_ManyByMany_Receiver_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Base_stub + libs += Receiver_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ReceiverEC.cpp + } + + Header_Files { + SL_ManyByMany_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + SL_ManyByMany_ReceiverEC.inl + } +} + +project(DDS_SL_ManyByMany_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_ManyByMany_Receiver_idl_gen DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Base_stub DDS_SL_MBM_Connector_lem_gen + libs += DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ReceiverC.cpp + } + + Header_Files { + SL_ManyByMany_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + SL_ManyByMany_ReceiverC.inl + } +} + +project(DDS_SL_ManyByMany_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_MBM_Receiver_lem_stub DDS_SL_ManyByMany_Receiver_stub DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_MBM_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_MBM_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_Receiver_exec.cpp + } + + Header_Files { + SL_ManyByMany_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_ManyByMany_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_MBM_Receiver_lem_stub DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Connector_svnt DDS_SL_ManyByMany_Receiver_exec DDS_SL_MBM_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Connector_svnt Receiver_exec DDS_SL_MBM_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_ReceiverS.cpp + SL_ManyByMany_Receiver_svnt.cpp + } + + Header_Files { + SL_ManyByMany_ReceiverS.h + SL_ManyByMany_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + SL_ManyByMany_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.cpp new file mode 100644 index 00000000000..de63a9a54e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.cpp @@ -0,0 +1,373 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for statelistener: MANY_BY_MANY. Expect the operations on_creation, on_deletion, on_many_updates + +#include "SL_ManyByMany_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +namespace CIAO_SL_ManyByMany_Receiver_Impl +{ + //============================================================ + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback) + : pulse_callback_ (callback) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + try + { + this->pulse_callback_.read_all(); + } + catch (...) + { + // @todo + } + return 0; + } + //============================================================ + // Facet Executor Implementation Class: StateListener_exec_i + //============================================================ + StateListener_exec_i::StateListener_exec_i (Atomic_Boolean &no_operation, + Atomic_Boolean &on_creation, + Atomic_Boolean &on_many_update, + Atomic_Boolean &on_deletion, + Atomic_Boolean &create_data, + Atomic_Boolean &update_data) + :no_operation_(no_operation), + on_creation_(on_creation), + on_many_update_(on_many_update), + on_deletion_(on_deletion), + create_data_(create_data), + update_data_(update_data) + { + } + + StateListener_exec_i::~StateListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::StateListener + void + StateListener_exec_i::on_creation (const ::TestTopic & data, + const ::CCM_DDS::ReadInfo & readinfo) + { + this->on_creation_ = true; + ACE_Time_Value tv; + tv <<= readinfo.source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Statelistener:on_creation : ") + ACE_TEXT ("Received datum for <%C> at %u\n"), + data.key.in (), + data.x)); + //one of the data must have the key 'KEY_1' with x == 1 + if((strcmp(data.key.in() ,"KEY_1")==0) && (data.x == 1L)) + { + this->create_data_ = true; + } + } + + void + StateListener_exec_i::on_one_update (const ::TestTopic & /*datum*/, + const ::CCM_DDS::ReadInfo & /*info*/) + { + this->no_operation_ = false; + } + + void + StateListener_exec_i::on_many_updates (const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & readinfoseq) + { + this->on_many_update_ = true; + for(CORBA::ULong i = 0; i < readinfoseq.length(); ++i) + { + if( readinfoseq[i].instance_status != CCM_DDS::INSTANCE_UPDATED) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected info.instance_status ") + ACE_TEXT ("'CCM_DDS::INSTANCE_UPDATED'") + ACE_TEXT (" with operation 'on_many_updates' from StateListener in Receiver\n") + )); + + } + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for(CORBA::ULong i = 0; i < data.length(); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + data[i].key.in (), + data[i].x)); + //one of the data must have the key 'KEY_1' with x == 2 + if((strcmp(data[i].key,"KEY_1")==0 ) && (data[i].x == 2L)) + { + this->update_data_ = true; + } + } + } + + void + StateListener_exec_i::on_deletion (const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info) + { + if(info.instance_status != CCM_DDS::INSTANCE_DELETED) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected info.instance_status ") + ACE_TEXT ("'CCM_DDS::INSTANCE_DELETED'") + ACE_TEXT (" with operation 'on_deletion' from StateListener in Receiver\n") + )); + + } + if((!datum.key.in()==0) && (info.instance_status == CCM_DDS::INSTANCE_DELETED)) + { + this->on_deletion_ = true; + } + } + //============================================================ + // Facet Executor Implementation Class: PortStatusListener_exec_i + //============================================================ + PortStatusListener_exec_i::PortStatusListener_exec_i () + { + } + + PortStatusListener_exec_i::~PortStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::PortStatusListener + void + PortStatusListener_exec_i::on_requested_deadline_missed ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::RequestedDeadlineMissedStatus & /* status */) + { + } + + void + PortStatusListener_exec_i::on_sample_lost ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::SampleLostStatus & /* status */) + { + } + + //============================================================ + // Component Executor Implementation Class: Receiver_exec_iTestTopic_RawListener_exec_i (); + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : rate_ (10), + no_operation_(true), + on_creation_(false), + on_many_update_(false), + on_deletion_(false), + create_data_(false), + update_data_(false), + reader_data_(false) + { + this->ticker_ = new read_action_Generator (*this); + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + void + Receiver_exec_i::read_all (void) + { + if (::CORBA::is_nil (this->reader_.in ())) + { + return; + } + TestTopicSeq_var TestTopic_infos; + ::CCM_DDS::ReadInfoSeq_var readinfoseq; + try + { + this->reader_->read_all(TestTopic_infos.out(), readinfoseq.out()); + for(CORBA::ULong i = 0; i < readinfoseq->length(); ++i) + { + ACE_Time_Value tv; + tv <<= readinfoseq[i].source_timestamp; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL ReadInfo ") + ACE_TEXT ("-> UTC date =%#T\n"), + &tv)); + } + for(CORBA::ULong i = 0; i < TestTopic_infos->length(); ++i) + { + this->reader_data_= true; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("READ_ALL keyed test info : ") + ACE_TEXT ("Number <%d> : received TestTopic_info for <%C> at %u\n"), + i, + TestTopic_infos[i].key.in (), + TestTopic_infos[i].x)); + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("internal error or no data\n"))); + } + } + + // Component attributes. + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); + return new PortStatusListener_exec_i (); + } + + ::CCM_DDS::TestTopic::CCM_StateListener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return new StateListener_exec_i(this->no_operation_, + this->on_creation_, + this->on_many_update_, + this->on_deletion_, + this->create_data_, + this->update_data_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::SL_ManyByMany::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_out_data(); + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::CCM_DDS::StateListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + + lc->mode (::CCM_DDS::MANY_BY_MANY); + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(3, usec), + ACE_Time_Value(3, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::ccm_passivate (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + } + + void + Receiver_exec_i::ccm_remove (void) + { + CORBA::Boolean no_error = true; + if(!this->no_operation_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did receive an unexpected ") + ACE_TEXT (" operation 'on_one_update' from StateListener in Receiver\n") + )); + } + if(!this->on_creation_ .value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" operation 'on_creation' from StateListener in Receiver\n") + )); + } + if(!this->create_data_ .value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" data with 'on_creation' from StateListener in Receiver\n") + )); + } + if(!this->on_many_update_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR:didn't receive the expected ") + ACE_TEXT (" operation 'on_many_updates' from StateListener in Receiver\n") + )); + } + if(!this->update_data_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR:didn't receive the expected ") + ACE_TEXT (" data with 'on_many_updates' from StateListener in Receiver\n") + )); + } + if(!this->on_deletion_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" operation 'on_deletion' from StateListener in Receiver\n") + )); + } + if(this->reader_data_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did receive unexpected ") + ACE_TEXT (" data on the Reader in combination with StateListener in Receiver\n") + )); + } + if(no_error==true) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK : Have received the expected ") + ACE_TEXT (" operations for MANY_BY_MANY from StateListener in Receiver\n") + )); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_ManyByMany_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.h new file mode 100644 index 00000000000..b74cb60eb0f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Receiver/SL_ManyByMany_Receiver_exec.h @@ -0,0 +1,138 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "SL_ManyByMany_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_SL_ManyByMany_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Receiver_exec_i; + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback); + + ~read_action_Generator (); + + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + private: + /// Maintains a handle that actually process the event + Receiver_exec_i &pulse_callback_; + + }; + class RECEIVER_EXEC_Export PortStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_PortStatusListener, + public virtual ::CORBA::LocalObject + { + public: + PortStatusListener_exec_i (void); + virtual ~PortStatusListener_exec_i (void); + + virtual void + on_requested_deadline_missed ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::RequestedDeadlineMissedStatus & status); + + virtual void + on_sample_lost ( + ::DDS::DataReader_ptr the_reader, + const ::DDS::SampleLostStatus & status); + }; + class RECEIVER_EXEC_Export StateListener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_StateListener, + public virtual ::CORBA::LocalObject + { + public: + StateListener_exec_i (Atomic_Boolean &, Atomic_Boolean &, Atomic_Boolean &, + Atomic_Boolean &, Atomic_Boolean &, Atomic_Boolean &); + virtual ~StateListener_exec_i (void); + + virtual void + on_creation ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_one_update ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_updates ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & infos); + virtual void + on_deletion ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + private: + Atomic_Boolean &no_operation_; + Atomic_Boolean &on_creation_; + Atomic_Boolean &on_many_update_; + Atomic_Boolean &on_deletion_; + Atomic_Boolean &create_data_; + Atomic_Boolean &update_data_; + + }; + + 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_StateListener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + void read_all(void); + + private: + ::SL_ManyByMany::CCM_Receiver_Context_var context_; + ::CCM_DDS::TestTopic::Reader_var reader_; + read_action_Generator * ticker_; + CORBA::ULong rate_; + Atomic_Boolean no_operation_; + Atomic_Boolean on_creation_; + Atomic_Boolean on_many_update_; + Atomic_Boolean on_deletion_; + Atomic_Boolean create_data_; + Atomic_Boolean update_data_; + Atomic_Boolean reader_data_; + +}; + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_ManyByMany_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.idl new file mode 100644 index 00000000000..59d0fec7676 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_SL_MANYBYMANY_SENDER_IDL +#define DDS_SL_MANYBYMANY_SENDER_IDL + +#include "Connector/SL_ManyByMany_Connector.idl" + +module SL_ManyByMany +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Update test_topic_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.mpc new file mode 100644 index 00000000000..6ca574dfe16 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_ManyByMany_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_SL_ManyByMany_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SL_MBM_Connector_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 { + SL_ManyByMany_Sender.idl + } +} + +project(DDS_SL_ManyByMany_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_ManyByMany_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 { + SL_ManyByMany_SenderE.idl + } +} + +project(DDS_SL_ManyByMany_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_ManyByMany_Sender_lem_gen DDS_SL_ManyByMany_Sender_stub DDS_SL_ManyByMany_Base_stub + libs += DDS_SL_ManyByMany_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_SenderEC.cpp + } + + Header_Files { + SL_ManyByMany_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + SL_ManyByMany_SenderEC.inl + } +} + +project(DDS_SL_ManyByMany_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_ManyByMany_Sender_idl_gen DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub + libs += DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_SenderC.cpp + } + + Header_Files { + SL_ManyByMany_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + SL_ManyByMany_SenderC.inl + } +} + +project(DDS_SL_ManyByMany_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_ManyByMany_Sender_lem_stub DDS_SL_ManyByMany_Sender_stub DDS_SL_MBM_Connector_lem_stub DDS_SL_ManyByMany_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_SL_ManyByMany_Base_stub DDS_SL_MBM_Connector_lem_stub DDS_SL_ManyByMany_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_Sender_exec.cpp + } + + Header_Files { + SL_ManyByMany_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_ManyByMany_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_ManyByMany_Base_stub DDS_SL_ManyByMany_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Connector_svnt DDS_SL_MBM_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_SL_ManyByMany_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_ManyByMany_Connector_stub DDS_SL_ManyByMany_Connector_svnt DDS_SL_MBM_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_ManyByMany_SenderS.cpp + SL_ManyByMany_Sender_svnt.cpp + } + + Header_Files { + SL_ManyByMany_SenderS.h + SL_ManyByMany_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + SL_ManyByMany_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.cpp new file mode 100644 index 00000000000..662e1b1326b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.cpp @@ -0,0 +1,363 @@ +// -*- C++ -*- +// $Id$ + +#include "SL_ManyByMany_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_SL_ManyByMany_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : test_nr_(UPDATE_CREATE), + test_ok_(true) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + CORBA::Boolean + Sender_exec_i::create_one(void) + { + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + if (! ::CORBA::is_nil (this->updater_) ) + { + this->updater_->create_one(i); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SL_ManyByMany: create_one with instance key <%C>\n"), + i.key.in())); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: updater_ is nil"))); + result = false; + } + } + catch (const CCM_DDS::AlreadyCreated &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test updater create_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while create_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_one() + { + //update already created instance with handle nil + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + i.x++; + this->updater_->update_one(i, DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update_one with already existing instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_one() + { + //delete registerd instance with DDS::HANDLE_NIL + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete_one with registerd instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, DDS::HANDLE_NIL); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::create_many() + { + //create many with no exception + CORBA::Boolean result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->create_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater create_many\n"))); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("in updater: create_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_many() + { + CORBA::Boolean result = false; + try + { + for(CORBA::ULong i = 0; i < this->topic_seq_many_.length(); i++) + { + this->topic_seq_many_[i].x= i+ 10; + } + this->updater_->update_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("update_many : written <%u> samples\n"), + this->topic_seq_many_.length ())); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_many.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("with update_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_many() + { + CORBA::Boolean result = false; + result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_many : deleted <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->delete_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_many\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("with test updater delete_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + + return result; + } + + void + Sender_exec_i::add_instances_of_topic () + { + CORBA::UShort total = 3; + this->topic_seq_one_.length (total); + //sequence for tests with .._one + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_one_[i-1] = new_key; + } + //sequence for tests with .._many + this->topic_seq_many_.length (total); + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "many_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_many_[i-1] = new_key; + } + } + + void + Sender_exec_i::tick () + { + if(this->test_ok_.value()) + { + switch (this->test_nr_) + { + case UPDATE_CREATE: + this->test_ok_ = this->create_one(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_ONE; + } + else + { + this->test_nr_ = END_TEST; + } + break; + case UPDATE_ONE: + this->test_ok_ = this->update_one(); + this->test_nr_ = DELETE_ONE; + break; + case DELETE_ONE: + this->test_ok_ = this->delete_one(); + this->test_nr_ = CREATE_MANY; + case CREATE_MANY: + this->test_ok_ = this->create_many(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_MANY; + } + else + { + this->test_nr_ = END_TEST; + } + this->test_nr_ = UPDATE_MANY; + break; + case UPDATE_MANY: + this->test_ok_ = this->update_many(); + this->test_nr_ = DELETE_MANY; + break; + case DELETE_MANY: + this->test_ok_ = this->delete_many(); + this->test_nr_ = END_TEST; + break; + default: + break; + } + } + } + void + Sender_exec_i::start (void) + { + long sec = 3L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::SL_ManyByMany::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_= this->context_->get_connection_test_topic_update_data (); + } + void + Sender_exec_i::ccm_activate (void) + { + this->add_instances_of_topic (); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_ManyByMany_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.h new file mode 100644 index 00000000000..b53cbe1b3bc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/Sender/SL_ManyByMany_Sender_exec.h @@ -0,0 +1,89 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "SL_ManyByMany_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_SL_ManyByMany_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + enum UPDATER_TEST { + UPDATE_CREATE, + UPDATE_ONE, + DELETE_ONE, + CREATE_MANY, + UPDATE_MANY, + DELETE_MANY, + END_TEST + }; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_callback_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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 tick (void); + + private: + void start (void); + void stop (void); + void add_instances_of_topic (void); + CORBA::Boolean create_one(void); + CORBA::Boolean update_one(void); + CORBA::Boolean delete_one(void); + CORBA::Boolean create_many(void); + CORBA::Boolean update_many(void); + CORBA::Boolean delete_many(void); + + pulse_Generator * ticker_; + ::SL_ManyByMany::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Updater_var updater_; + UPDATER_TEST test_nr_; + Atomic_Boolean test_ok_; + TestTopicSeq topic_seq_one_; + TestTopicSeq topic_seq_many_; + }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_ManyByMany_Sender_Impl (void); + + + +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/descriptors/Plan.cdp new file mode 100644 index 00000000000..76d9ea2f269 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/descriptors/Plan.cdp @@ -0,0 +1,365 @@ +<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>SL_ManyByMany_Depl_1</label> + <UUID>SL_ManyByMany_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_SL_ManyByMany_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_ManyByMany_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="SL_ManyByMany_ConnectorComponentImplementation"> + <name>SL_ManyByMany_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="SL_ManyByMany_Connector_ExecArtifact" /> + <artifact xmi:idref="SL_ManyByMany_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_SL_ManyByMany_SL_ManyByMany_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_ManyByMany_SL_ManyByMany_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_ManyByMany_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_ManyByMany_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_SL_ManyByMany_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_ManyByMany_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="SL_ManyByMany_ConnectorComponentInstance"> + <name>SL_ManyByMany_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_ManyByMany_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SL_ManyByMany_ConnectorComponentInstance2"> + <name>SL_ManyByMany_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_ManyByMany_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_ManyByMany_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_statelistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_ManyByMany_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SL_ManyByMany_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_ManyByMany_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>updater_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="SL_ManyByMany_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="SL_ManyByMany_Connector_ExecArtifact"> + <name>SL_ManyByMany_Connector_exec</name> + <source/> + <node/> + <location>DDS_SL_ManyByMany_Connector_exec</location> + </artifact> + <artifact xmi:id="SL_ManyByMany_Connector_SvntArtifact"> + <name>SL_ManyByMany_Connector_svnt</name> + <source/> + <node/> + <location>DDS_SL_ManyByMany_Connector_svnt</location> + </artifact> + <artifact xmi:id="SL_ManyByMany_Connector_StubArtifact"> + <name>SL_ManyByMany_Connector_stub</name> + <source/> + <node/> + <location>DDS_SL_ManyByMany_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/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/descriptors/run_test.pl new file mode 100755 index 00000000000..66cc403a1fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLManyByMany/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 20 seconds to allow task to complete\n"; +sleep (20); + +# 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/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.idl new file mode 100644 index 00000000000..eae516f7136 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file SL_OneByOne_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_ONEBYONE_BASE_IDL +#define SL_ONEBYONE_BASE_IDL + +#pragma ndds typesupport "Base/SL_OneByOne_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.mpc new file mode 100644 index 00000000000..96f81db664a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Base/SL_OneByOne_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SL_OneByOne_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SL_OneByOne_Base_stub + dynamicflags += SL_ONEBYONE_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=SL_ONEBYONE_BASE_STUB_Export \ + -Wb,stub_export_include=SL_OneByOne_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + SL_OneByOne_Base.idl + } + + opendds_ts_flags += --export=SL_ONEBYONE_BASE_STUB_Export + + DDSGenerator_Files { + SL_OneByOne_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SLOneByOne_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SLOneByOne_Connector.mpc new file mode 100644 index 00000000000..381ffe38c3e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SLOneByOne_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_OneByOne_Base -l .. -o ../lib -u DDS SL_OneByOne_Connector" + +project(DDS_SL_OBO_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SL_ONEBYONE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=SL_OneByOne_Connector_stub_export.h \ + -Wb,skel_export_macro=SL_ONEBYONE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=SL_OneByOne_Connector_svnt_export.h \ + -Wb,svnt_export_macro=SL_ONEBYONE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=SL_OneByOne_Connector_svnt_export.h \ + -Wb,conn_export_macro=SL_ONEBYONE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=SL_OneByOne_Connector_conn_export.h \ + -I .. + + IDL_Files { + SL_OneByOne_Connector.idl + } +} + +project(DDS_SL_OBO_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_OBO_Connector_idl_gen + idlflags += -Wb,stub_export_macro=SL_ONEBYONE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=SL_OneByOne_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + SL_OneByOne_ConnectorE.idl + } +} + +project(DDS_SL_OBO_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_OBO_Connector_lem_gen DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Base_stub DDS4CCM_lem_stub + libs += DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_OBO_Connector_lem_stub + dynamicflags = SL_ONEBYONE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ConnectorEC.cpp + } + + Header_Files { + SL_OneByOne_ConnectorEC.h + SL_OneByOne_Connector_lem_stub_export.h + } + + Inline_Files { + SL_OneByOne_ConnectorEC.inl + } +} + +project(DDS_SL_OneByOne_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_OBO_Connector_idl_gen DDS_SL_OneByOne_Base_stub + libs += DDS_SL_OneByOne_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SL_OneByOne_Connector_stub + dynamicflags = SL_ONEBYONE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ConnectorC.cpp + } + + Header_Files { + SL_OneByOne_ConnectorC.h + SL_OneByOne_Connector_stub_export.h + } + + Inline_Files { + SL_OneByOne_ConnectorC.inl + } +} + +project(DDS_SL_OneByOne_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SL_OBO_Connector_lem_stub DDS_SL_OneByOne_Connector_stub DDS4CCM_lem_stub DDS_SL_OneByOne_Base_stub + sharedname = DDS_SL_OneByOne_Connector_exec + libs += DDS_SL_OneByOne_Connector_stub DDS_SL_OBO_Connector_lem_stub DDS_SL_OneByOne_Base_stub DDS4CCM_lem_stub DDS_SL_OneByOne_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_ONEBYONE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_Connector_conn.cpp + } + + Header_Files { + SL_OneByOne_Connector_conn.h + SL_OneByOne_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_OneByOne_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SL_OBO_Connector_lem_stub DDS_SL_OneByOne_Connector_exec DDS_SL_OneByOne_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_SL_OneByOne_Connector_svnt + libs += DDS_SL_OneByOne_Connector_stub \ + DDS_SL_OBO_Connector_lem_stub \ + DDS_SL_OneByOne_Base_stub \ + DDS_SL_OneByOne_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SL_ONEBYONE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ConnectorS.cpp + SL_OneByOne_Connector_svnt.cpp + } + + Header_Files { + SL_OneByOne_ConnectorS.h + SL_OneByOne_Connector_svnt.h + SL_OneByOne_Connector_svnt_export.h + } + + Inline_Files { + SL_OneByOne_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SL_OneByOne_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SL_OneByOne_Connector.idl new file mode 100644 index 00000000000..d522a746ef6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Connector/SL_OneByOne_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file SL_OneByOne_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef SL_ONEBYONE_CONNECTOR_IDL_ +#define SL_ONEBYONE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/SL_OneByOne_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/SL_OneByOne_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module SL_OneByOne +{ + connector SL_OneByOne_Connector : ::CCM_DDS::TestTopic::DDS_State + { + }; +}; + +#endif /* SL_OneByOne_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.idl new file mode 100644 index 00000000000..88f9e6bec6a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/SL_OneByOne_Connector.idl" + +module SL_OneByOne +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_StateListen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.mpc new file mode 100644 index 00000000000..4ff2ea80094 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_SL_OneByOne_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SL_OBO_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 { + SL_OneByOne_Receiver.idl + } +} + +project(DDS_SL_OneByOne_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_OneByOne_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 { + SL_OneByOne_ReceiverE.idl + } +} + +project(DDS_SL_OBO_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_OneByOne_Receiver_lem_gen DDS_SL_OneByOne_Receiver_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Base_stub + libs += Receiver_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ReceiverEC.cpp + } + + Header_Files { + SL_OneByOne_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + SL_OneByOne_ReceiverEC.inl + } +} + +project(DDS_SL_OneByOne_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_OneByOne_Receiver_idl_gen DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Base_stub DDS_SL_OBO_Connector_lem_gen + libs += DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ReceiverC.cpp + } + + Header_Files { + SL_OneByOne_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + SL_OneByOne_ReceiverC.inl + } +} + +project(DDS_SL_OneByOne_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_OBO_Receiver_lem_stub DDS_SL_OneByOne_Receiver_stub DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OBO_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OBO_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_Receiver_exec.cpp + } + + Header_Files { + SL_OneByOne_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_OneByOne_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_OBO_Receiver_lem_stub DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Connector_svnt DDS_SL_OneByOne_Receiver_exec DDS_SL_OBO_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Connector_svnt Receiver_exec DDS_SL_OBO_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_ReceiverS.cpp + SL_OneByOne_Receiver_svnt.cpp + } + + Header_Files { + SL_OneByOne_ReceiverS.h + SL_OneByOne_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + SL_OneByOne_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.cpp new file mode 100644 index 00000000000..25fc7a95945 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.cpp @@ -0,0 +1,278 @@ +// -*- C++ -*- +// +// $Id$ + +// Test for statelistener: ONE_BY_ONE. Expect the operations on_creation, on_deletion, on_one_update + +#include "SL_OneByOne_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_SL_OneByOne_Receiver_Impl +{ + //============================================================ + // StateListener_exec_i + //============================================================ + StateListener_exec_i::StateListener_exec_i (Atomic_Boolean &on_many_updates, + Atomic_Boolean &on_creation, + Atomic_Boolean &on_one_update, + Atomic_Boolean &on_deletion, + Atomic_ThreadId &thread_id) + : on_many_updates_ (on_many_updates), + on_creation_ (on_creation), + on_one_update_ (on_one_update), + on_deletion_ (on_deletion), + thread_id_ (thread_id) + { + } + + StateListener_exec_i::~StateListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::StateListener + void + StateListener_exec_i::on_creation (const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info) + { + this->thread_id_ = ACE_Thread::self (); + if (!datum.key.in() == 0 && info.instance_status == CCM_DDS::INSTANCE_CREATED) + { + this->on_creation_ = true; + } + ACE_DEBUG ((LM_DEBUG, "StateListener_exec_i::on_creation - " + "Received sample: key <%C> - iteration <%d>\n", + datum.key.in (), + datum.x)); + } + + void + StateListener_exec_i::on_one_update (const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info) + { + if (info.instance_status != CCM_DDS::INSTANCE_UPDATED) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected info.status ") + ACE_TEXT ("'CCM_DDS::INSTANCE_UPDATED'") + ACE_TEXT (" with operation 'on_one_update' from StateListener in Receiver\n") + )); + + } + + ACE_DEBUG ((LM_DEBUG, "StateListener_exec_i::on_one_update - " + "Received sample: key <%C> - iteration <%d>\n", + datum.key.in (), + datum.x)); + + if (!datum.key.in() == 0 && info.instance_status == CCM_DDS::INSTANCE_UPDATED) + { + this->on_one_update_ = true; + } + } + + void + StateListener_exec_i::on_many_updates (const ::TestTopicSeq & /*data*/, + const ::CCM_DDS::ReadInfoSeq & /*infos*/) + { + this->on_many_updates_ = true; + } + + void + StateListener_exec_i::on_deletion (const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info) + { + if (info.instance_status != CCM_DDS::INSTANCE_DELETED) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected info.status ") + ACE_TEXT ("'CCM_DDS::INSTANCE_DELETED' ") + ACE_TEXT ("with operation 'on_deletion' from StateListener in Receiver\n") + )); + + } + if (!datum.key.in() == 0 && info.instance_status == CCM_DDS::INSTANCE_DELETED) + { + this->on_deletion_ = true; + } + ACE_DEBUG ((LM_DEBUG, "StateListener_exec_i::on_deletion - " + "Received sample: key <%C> - iteration <%d>\n", + datum.key.in (), + datum.x)); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : on_many_updates_ (false), + updater_data_ (false), + on_creation_ (false), + on_one_update_ (false), + on_deletion_ (false), + thread_id_listener_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Component attributes. + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::TestTopic::CCM_StateListener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return new StateListener_exec_i (this->on_many_updates_, + this->on_creation_, + this->on_one_update_, + this->on_deletion_, + this->thread_id_listener_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::SL_OneByOne::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) + { + ::CCM_DDS::StateListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::ONE_BY_ONE); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + CORBA::Boolean no_error = true; + if (this->on_many_updates_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Received unexpected ") + ACE_TEXT ("operation 'on_many_updates' from StateListener in Receiver\n") + )); + } + + if (!this->on_creation_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" operation 'on_creation' from StateListener in Receiver\n") + )); + } + if (!this->on_one_update_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" operation 'on_one_update' from StateListener in Receiver\n") + )); + } + if (!this->on_deletion_.value ()) + { + no_error = false; + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: didn't receive the expected ") + ACE_TEXT (" operation 'on_deletion' from StateListener in Receiver\n") + )); + } + + if (no_error) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK: Have received the expected ") + ACE_TEXT (" operations for ONE_BY_ONE from StateListener in Receiver\n") + )); + } + + if (this->thread_id_listener_.value () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: " + "Thread ID for StatusListener 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, "OK: " + "Thread switch for StatusListener 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: " + "Thread switch for StatusListener " + "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: StatusListener: " + "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, "OK: StatusListener: " + "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_SL_OneByOne_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.h new file mode 100644 index 00000000000..4eb7a3d13d2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Receiver/SL_OneByOne_Receiver_exec.h @@ -0,0 +1,108 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "SL_OneByOne_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" + +namespace CIAO_SL_OneByOne_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean> Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // StateListener_exec_i + //============================================================ + class RECEIVER_EXEC_Export StateListener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_StateListener, + public virtual ::CORBA::LocalObject + { + public: + StateListener_exec_i (Atomic_Boolean &, + Atomic_Boolean &, + Atomic_Boolean &, + Atomic_Boolean &, + Atomic_ThreadId &); + virtual ~StateListener_exec_i (void); + + virtual void + on_creation ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_one_update ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_updates ( + const ::TestTopicSeq & data, + const ::CCM_DDS::ReadInfoSeq & infos); + virtual void + on_deletion ( + const ::TestTopic & datum, + const ::CCM_DDS::ReadInfo & info); + private: + Atomic_Boolean &on_many_updates_; + Atomic_Boolean &on_creation_; + Atomic_Boolean &on_one_update_; + Atomic_Boolean &on_deletion_; + 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_StateListener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::SL_OneByOne::CCM_Receiver_Context_var context_; + + Atomic_Boolean on_many_updates_; + Atomic_Boolean updater_data_; + Atomic_Boolean on_creation_; + Atomic_Boolean on_one_update_; + Atomic_Boolean on_deletion_; + Atomic_ThreadId thread_id_listener_; + }; + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_OneByOne_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.idl new file mode 100644 index 00000000000..3408f28190a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_SL_ONEBYONE_SENDER_IDL +#define DDS_SL_ONEBYONE_SENDER_IDL + +#include "Connector/SL_OneByOne_Connector.idl" + +module SL_OneByOne +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Update test_topic_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.mpc new file mode 100644 index 00000000000..347d73bca4e --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SL_OneByOne_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_SL_OneByOne_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SL_OBO_Connector_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 { + SL_OneByOne_Sender.idl + } +} + +project(DDS_SL_OneByOne_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SL_OneByOne_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 { + SL_OneByOne_SenderE.idl + } +} + +project(DDS_SL_OneByOne_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SL_OneByOne_Sender_lem_gen DDS_SL_OneByOne_Sender_stub DDS_SL_OneByOne_Base_stub + libs += DDS_SL_OneByOne_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_SenderEC.cpp + } + + Header_Files { + SL_OneByOne_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + SL_OneByOne_SenderEC.inl + } +} + +project(DDS_SL_OneByOne_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_SL_OneByOne_Sender_idl_gen DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub + libs += DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_SenderC.cpp + } + + Header_Files { + SL_OneByOne_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + SL_OneByOne_SenderC.inl + } +} + +project(DDS_SL_OneByOne_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_SL_OneByOne_Sender_lem_stub DDS_SL_OneByOne_Sender_stub DDS_SL_OBO_Connector_lem_stub DDS_SL_OneByOne_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_SL_OneByOne_Base_stub DDS_SL_OBO_Connector_lem_stub DDS_SL_OneByOne_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_Sender_exec.cpp + } + + Header_Files { + SL_OneByOne_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SL_OneByOne_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SL_OneByOne_Base_stub DDS_SL_OneByOne_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Connector_svnt DDS_SL_OBO_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_SL_OneByOne_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SL_OneByOne_Connector_stub DDS_SL_OneByOne_Connector_svnt DDS_SL_OBO_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SL_OneByOne_SenderS.cpp + SL_OneByOne_Sender_svnt.cpp + } + + Header_Files { + SL_OneByOne_SenderS.h + SL_OneByOne_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + SL_OneByOne_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.cpp new file mode 100644 index 00000000000..8885fd86841 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.cpp @@ -0,0 +1,358 @@ +// -*- C++ -*- +// $Id$ + +#include "SL_OneByOne_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_SL_OneByOne_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : test_nr_(UPDATE_CREATE), + test_ok_(true) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + CORBA::Boolean + Sender_exec_i::create_one(void) + { + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + if (! ::CORBA::is_nil (this->updater_) ) + { + this->updater_->create_one(i); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("SL_OneByOne: create_one with instance key <%C>\n"), + i.key.in())); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: updater_ is nil"))); + result = false; + } + } + catch (const CCM_DDS::AlreadyCreated &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test updater create_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while create_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_one() + { + //update already created instance with handle nil + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + this->updater_->update_one(i, DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update_one with already existing instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_one() + { + //delete registered instance with DDS::HANDLE_NIL + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete_one with registered instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, DDS::HANDLE_NIL); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::create_many() + { + //create many with no exception + CORBA::Boolean result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->create_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater create_many\n"))); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("in updater: create_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_many() + { + CORBA::Boolean result = false; + try + { + this->updater_->update_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("update_many : written <%u> samples\n"), + this->topic_seq_many_.length ())); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_many.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("whit update_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_many() + { + CORBA::Boolean result = false; + result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_many : deleted <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->delete_many (this->topic_seq_many_); + result = true; + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_many\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("with test updater delete_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + + return result; + } + + void + Sender_exec_i::add_instances_of_topic () + { + CORBA::UShort total = 3; + this->topic_seq_one_.length (total); + //sequence for tests with .._one + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_one_[i-1] = new_key; + } + //sequence for tests with .._many + this->topic_seq_many_.length (total); + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "many_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_many_[i-1] = new_key; + } + } + + void + Sender_exec_i::tick () + { + if(this->test_ok_.value()) + { + switch (this->test_nr_) + { + case UPDATE_CREATE: + this->test_ok_ = this->create_one(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_ONE; + } + else + { + this->test_nr_ = END_TEST; + } + break; + case UPDATE_ONE: + this->test_ok_ = this->update_one(); + this->test_nr_ = DELETE_ONE; + break; + case DELETE_ONE: + this->test_ok_ = this->delete_one(); + this->test_nr_ = CREATE_MANY; + case CREATE_MANY: + this->test_ok_ = this->create_many(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_MANY; + } + else + { + this->test_nr_ = END_TEST; + } + this->test_nr_ = UPDATE_MANY; + break; + case UPDATE_MANY: + this->test_ok_ = this->update_many(); + this->test_nr_ = DELETE_MANY; + break; + case DELETE_MANY: + this->test_ok_ = this->delete_many(); + this->test_nr_ = END_TEST; + break; + default: + break; + } + } + } + void + Sender_exec_i::start (void) + { + long sec = 1L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::SL_OneByOne::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_= this->context_->get_connection_test_topic_update_data (); + } + void + Sender_exec_i::ccm_activate (void) + { + this->add_instances_of_topic (); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_OneByOne_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.h new file mode 100644 index 00000000000..629317869b6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/Sender/SL_OneByOne_Sender_exec.h @@ -0,0 +1,86 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "SL_OneByOne_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_SL_OneByOne_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + enum UPDATER_TEST { + UPDATE_CREATE, + UPDATE_ONE, + DELETE_ONE, + CREATE_MANY, + UPDATE_MANY, + DELETE_MANY, + END_TEST + }; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_callback_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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 tick (void); + + private: + void start (void); + void stop (void); + void add_instances_of_topic (void); + CORBA::Boolean create_one(void); + CORBA::Boolean update_one(void); + CORBA::Boolean delete_one(void); + CORBA::Boolean create_many(void); + CORBA::Boolean update_many(void); + CORBA::Boolean delete_many(void); + + pulse_Generator * ticker_; + ::SL_OneByOne::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Updater_var updater_; + UPDATER_TEST test_nr_; + Atomic_Boolean test_ok_; + TestTopicSeq topic_seq_one_; + TestTopicSeq topic_seq_many_; + }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_SL_OneByOne_Sender_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/descriptors/Plan.cdp new file mode 100644 index 00000000000..a794a8b59a1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/descriptors/Plan.cdp @@ -0,0 +1,365 @@ +<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>SL_OneByOne_Depl_1</label> + <UUID>SL_OneByOne_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_SL_OneByOne_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_OneByOne_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="SL_OneByOne_ConnectorComponentImplementation"> + <name>SL_OneByOne_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="SL_OneByOne_Connector_ExecArtifact" /> + <artifact xmi:idref="SL_OneByOne_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_SL_OneByOne_SL_OneByOne_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_OneByOne_SL_OneByOne_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_OneByOne_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SL_OneByOne_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_SL_OneByOne_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SL_OneByOne_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="SL_OneByOne_ConnectorComponentInstance"> + <name>SL_OneByOne_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_OneByOne_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SL_OneByOne_ConnectorComponentInstance2"> + <name>SL_OneByOne_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SL_OneByOne_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_OneByOne_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_statelistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_OneByOne_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SL_OneByOne_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="SL_OneByOne_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>updater_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="SL_OneByOne_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="SL_OneByOne_Connector_ExecArtifact"> + <name>SL_OneByOne_Connector_exec</name> + <source/> + <node/> + <location>DDS_SL_OneByOne_Connector_exec</location> + </artifact> + <artifact xmi:id="SL_OneByOne_Connector_SvntArtifact"> + <name>SL_OneByOne_Connector_svnt</name> + <source/> + <node/> + <location>DDS_SL_OneByOne_Connector_svnt</location> + </artifact> + <artifact xmi:id="SL_OneByOne_Connector_StubArtifact"> + <name>SL_OneByOne_Connector_stub</name> + <source/> + <node/> + <location>DDS_SL_OneByOne_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/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/descriptors/run_test.pl new file mode 100755 index 00000000000..66cc403a1fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SLOneByOne/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 20 seconds to allow task to complete\n"; +sleep (20); + +# 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/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.idl new file mode 100644 index 00000000000..94d30cd743c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file SetConnectorAttribute_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SETCONNECTORATTRIBUTE_BASE_IDL +#define SETCONNECTORATTRIBUTE_BASE_IDL + +#pragma ndds typesupport "Base/SetConnectorAttribute_BaseSupport.h" + +struct SetConnectorAttributeTest { + string key; + long iteration; +}; + +typedef sequence<SetConnectorAttributeTest> SetConnectorAttributeTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.mpc new file mode 100644 index 00000000000..5d5a42ccba8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Base/SetConnectorAttribute_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SCABase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SCABase_stub + dynamicflags += SETCONNECTORATTRIBUTE_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=SETCONNECTORATTRIBUTE_BASE_STUB_Export \ + -Wb,stub_export_include=SetConnectorAttribute_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + SetConnectorAttribute_Base.idl + } + + opendds_ts_flags += --export=SETCONNECTORATTRIBUTE_BASE_STUB_Export + + DDSGenerator_Files { + SetConnectorAttribute_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.idl new file mode 100644 index 00000000000..53f741205e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file SetConnectorAttribute_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SETCONNECTORATTRIBUTE_CONNECTOR_IDL_ +#define SETCONNECTORATTRIBUTE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/SetConnectorAttribute_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/SetConnectorAttribute_ConnectorE.idl" + +module SetConnectorAttribute +{ + module ::CCM_DDS::Typed + < ::SetConnectorAttributeTest, ::SetConnectorAttributeTestSeq> + SetConnectorAttributeTestConn; + connector SetConnectorAttribute_Connector : SetConnectorAttributeTestConn::DDS_Event + { + }; +}; + +#endif /* SetConnectorAttribute_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.mpc new file mode 100644 index 00000000000..6f913842f95 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/Connector/SetConnectorAttribute_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SCABase -l .. -o ../lib -u DDS SetConnectorAttribute_Connector" + +project(DDS_SCAConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SETCONNECTORATTRIBUTE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=SetConnectorAttribute_Connector_stub_export.h \ + -Wb,skel_export_macro=SETCONNECTORATTRIBUTE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=SetConnectorAttribute_Connector_svnt_export.h \ + -Wb,svnt_export_macro=SETCONNECTORATTRIBUTE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=SetConnectorAttribute_Connector_svnt_export.h \ + -Wb,conn_export_macro=SETCONNECTORATTRIBUTE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=SetConnectorAttribute_Connector_conn_export.h \ + -I .. + + IDL_Files { + SetConnectorAttribute_Connector.idl + } +} + +project(DDS_SCAConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SCAConnector_idl_gen + idlflags += -Wb,stub_export_macro=SETCONNECTORATTRIBUTE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=SetConnectorAttribute_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + SetConnectorAttribute_ConnectorE.idl + } +} + +project(DDS_SCAConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SCAConnector_lem_gen DDS_SCAConnector_stub DDS_SCABase_stub DDS4CCM_lem_stub + libs += DDS_SCABase_stub DDS_SCAConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SCAConnector_lem_stub + dynamicflags = SETCONNECTORATTRIBUTE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SetConnectorAttribute_ConnectorEC.cpp + } + + Header_Files { + SetConnectorAttribute_ConnectorEC.h + SetConnectorAttribute_Connector_lem_stub_export.h + } + + Inline_Files { + SetConnectorAttribute_ConnectorEC.inl + } +} + +project(DDS_SCAConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SCAConnector_idl_gen DDS_SCABase_stub + libs += DDS_SCABase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SCAConnector_stub + dynamicflags = SETCONNECTORATTRIBUTE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SetConnectorAttribute_ConnectorC.cpp + } + + Header_Files { + SetConnectorAttribute_ConnectorC.h + SetConnectorAttribute_Connector_stub_export.h + } + + Inline_Files { + SetConnectorAttribute_ConnectorC.inl + } +} + +project(DDS_SCAConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SCAConnector_lem_stub DDS_SCAConnector_stub DDS4CCM_lem_stub DDS_SCABase_stub + sharedname = DDS_SCAConnector_exec + libs += DDS_SCAConnector_stub DDS_SCAConnector_lem_stub DDS_SCABase_stub DDS4CCM_lem_stub DDS_SCABase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SETCONNECTORATTRIBUTE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SetConnectorAttribute_Connector_conn.cpp + } + + Header_Files { + SetConnectorAttribute_Connector_conn.h + SetConnectorAttribute_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SCAConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SCAConnector_lem_stub DDS_SCAConnector_exec DDS_SCAConnector_stub DDS4CCM_lem_stub + sharedname = DDS_SCAConnector_svnt + libs += DDS_SCAConnector_stub \ + DDS_SCAConnector_lem_stub \ + DDS_SCABase_stub \ + DDS_SCAConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SETCONNECTORATTRIBUTE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SetConnectorAttribute_ConnectorS.cpp + SetConnectorAttribute_Connector_svnt.cpp + } + + Header_Files { + SetConnectorAttribute_ConnectorS.h + SetConnectorAttribute_Connector_svnt.h + SetConnectorAttribute_Connector_svnt_export.h + } + + Inline_Files { + SetConnectorAttribute_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/README b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/README new file mode 100644 index 00000000000..8986a3b67ca --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/README @@ -0,0 +1,15 @@ +# $Id$ + +Tests whether the connector attribute are +properly set by the D&C framework. +The following connector attributes are defined in +the deployment plan: + * key_fields + * domain_id + * qos_profile + * topic_name + +On ccm_activate in the connector, these values +are checked. + +An error is reported for every mismatch. diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/descriptors/Plan.cdp new file mode 100644 index 00000000000..f7fe2fc0074 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/descriptors/Plan.cdp @@ -0,0 +1,150 @@ +<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>SetConnectorAttributeAttribute_Depl_1</label> + <UUID>SetConnectorAttributeAttribute_Depl_1</UUID> + + + <implementation xmi:id="SetConnectorAttributeConnectorComponentImplementation"> + <name>SetConnectorAttributeConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="SetConnectorAttributeConnector_ExecArtifact" /> + <artifact xmi:idref="SetConnectorAttributeConnector_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SetConnectorAttribute_SetConnectorAttribute_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SetConnectorAttribute_SetConnectorAttribute_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SetConnectorAttributeConnector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SetConnectorAttributeConnector_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="SetConnectorAttributeConnectorComponentInstance"> + <name>SetConnectorAttributeConnectorComponent</name> + <node>ComponentNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SetConnectorAttributeConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SetConnectorAttribute</string> + </value> + </value> + </configProperty> + <configProperty> + <name>domain_id</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>100</long> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>'qos profile'</string> + </value> + </value> + </configProperty> + <configProperty> + <name>key_fields</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_string</kind> + </elementType> + </sequence> + </type> + <value> + <element> + <string>string_1</string> + </element> + <element> + <string>string_2</string> + </element> + <element> + <string>string_3</string> + </element> + <element> + <string>string_4</string> + </element> + <element> + <string>string_5</string> + </element> + </value> + </value> + </configProperty> + </instance> + + <artifact xmi:id="SetConnectorAttributeConnector_ExecArtifact"> + <name>SetConnectorAttributeConnector_exec</name> + <source/> + <node/> + <location>DDS_SCAConnector_exec</location> + </artifact> + <artifact xmi:id="SetConnectorAttributeConnector_SvntArtifact"> + <name>SetConnectorAttributeConnector_svnt</name> + <source/> + <node/> + <location>DDS_SCAConnector_svnt</location> + </artifact> + <artifact xmi:id="SetConnectorAttributeConnector_StubArtifact"> + <name>SetConnectorAttributeConnector_stub</name> + <source/> + <node/> + <location>DDS_SCAConnector_stub</location> + </artifact> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/descriptors/run_test.pl new file mode 100755 index 00000000000..b51ae16243d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SetConnectorAttributes/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 = 1; +@ports = ( 60001); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode"); + +# 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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 5 seconds to allow task to complete\n"; +sleep (5); + +# 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/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.idl new file mode 100644 index 00000000000..11bcfb8cf8a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.idl @@ -0,0 +1,40 @@ +// $Id$ + +/** + * @file Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef BASE_IDL +#define BASE_IDL + +#pragma ndds typesupport "Base/BaseSupport.h" + +#pragma DCPS_DATA_TYPE "SharedDPTest1" +#pragma DCPS_DATA_KEY "SharedDPTest1 key1" + +#pragma DCPS_DATA_TYPE "SharedDPTest2" +#pragma DCPS_DATA_KEY "SharedDPTest2 key2" + +#pragma DCPS_DATA_TYPE "SharedDPTest3" +#pragma DCPS_DATA_KEY "SharedDPTest3 key3" + +struct SharedDPTest1 { + string key1; + long iteration1; +}; +typedef sequence<SharedDPTest1> SharedDPTest1Seq; + +struct SharedDPTest2 { + string key2; + long iteration2; +}; +typedef sequence<SharedDPTest2> SharedDPTest2Seq; + +struct SharedDPTest3 { + string key3; + long iteration3; +}; +typedef sequence<SharedDPTest3> SharedDPTest3Seq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.mpc new file mode 100644 index 00000000000..5ef7334a4bc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Base/Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SharedDP_DDBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SharedDP_DDBase_stub + dynamicflags += BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=BASE_STUB_Export \ + -Wb,stub_export_include=Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Base.idl + } + + opendds_ts_flags += --export=BASE_STUB_Export + + DDSGenerator_Files { + Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.idl new file mode 100644 index 00000000000..888ebbf77d8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + */ + +#ifndef DDS_SHARED_DP_COMPONENT_IDL +#define DDS_SHARED_DP_COMPONENT_IDL + +#include "Connector1/Connector1.idl" +#include "Connector2/Connector2.idl" +#include "Connector3/Connector3.idl" + +module SharedDP +{ + component SharedDPComponent + { + port CCM_DDS::SharedDPTest1::DDS_Write write1; + port CCM_DDS::SharedDPTest2::DDS_Write write2; + port CCM_DDS::SharedDPTest3::DDS_Write write3; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.mpc new file mode 100644 index 00000000000..8c71912af03 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component.mpc @@ -0,0 +1,158 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SharedDPBase -l ../lib -o ../lib -c controller -u DDS Component" + +project(DDS_SharedDP_DDComponent_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SharedDP_Connector1_idl_gen DDS_SharedDP_Connector2_idl_gen \ + DDS_SharedDP_Connector3_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_STUB_Export \ + -Wb,stub_export_include=Component_stub_export.h \ + -Wb,skel_export_macro=COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Component_svnt_export.h \ + -Wb,svnt_export_macro=COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Component_svnt_export.h \ + -Wb,exec_export_macro=COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Component_exec_export.h \ + -I .. + + IDL_Files { + Component.idl + } +} + +project(DDS_SharedDP_DDComponent_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SharedDP_DDComponent_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Component_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + ComponentE.idl + } +} + +project(DDS_SharedDP_DDComponent_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDP_DDComponent_lem_gen DDS_SharedDP_DDComponent_stub DDS_SharedDP_DDBase_stub + libs += DDS_SharedDP_DDBase_stub Component_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Component_lem_stub + dynamicflags = COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentEC.cpp + } + + Header_Files { + ComponentEC.h + Component_lem_stub_export.h + } + + Inline_Files { + ComponentEC.inl + } +} + +project(DDS_SharedDP_DDComponent_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDP_DDComponent_idl_gen DDS_SharedDP_DDBase_stub \ + DDS_SharedDP_Connector1_stub DDS_SharedDP_Connector2_stub DDS_SharedDP_Connector3_stub \ + DDS_SharedDP_Connector1_lem_gen DDS_SharedDP_Connector2_lem_gen DDS_SharedDP_Connector3_lem_gen + libs += DDS_SharedDP_DDBase_stub DDS_Connector1_stub DDS_Connector2_stub DDS_Connector3_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Component_stub + dynamicflags = COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentC.cpp + } + + Header_Files { + ComponentC.h + Component_stub_export.h + } + + Inline_Files { + ComponentC.inl + } +} + +project(DDS_SharedDP_DDComponent_exec) : ciao_executor, dds4ccm_base, dds4ccm_impl { + after += DDS_SharedDP_DDComponent_lem_stub DDS_SharedDP_DDComponent_stub \ + DDS_SharedDP_Connector1_lem_stub DDS_SharedDP_Connector1_stub \ + DDS_SharedDP_Connector2_lem_stub DDS_SharedDP_Connector2_stub \ + DDS_SharedDP_Connector3_lem_stub DDS_SharedDP_Connector3_stub \ + DDS4CCM_lem_stub CIAO_DDS4CCM_DDS_Impl + sharedname = Component_exec + libs += Component_stub Component_lem_stub DDS_SharedDP_DDBase_stub \ + DDS_Connector1_lem_stub DDS_Connector1_stub \ + DDS_Connector2_lem_stub DDS_Connector2_stub \ + DDS_Connector3_lem_stub DDS_Connector3_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = COMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Component_exec.cpp + } + + Header_Files { + Component_exec.h + Component_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDP_DDComponent_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SharedDP_DDBase_stub DDS_SharedDP_DDComponent_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_SharedDP_Connector1_stub DDS_SharedDP_Connector1_svnt DDS_SharedDP_Connector1_lem_stub \ + DDS_SharedDP_Connector2_stub DDS_SharedDP_Connector2_svnt DDS_SharedDP_Connector2_lem_stub \ + DDS_SharedDP_Connector3_stub DDS_SharedDP_Connector3_svnt DDS_SharedDP_Connector3_lem_stub + sharedname = Component_svnt + libs += Component_stub Component_lem_stub \ + DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_Connector1_stub DDS_Connector1_svnt DDS_Connector1_lem_stub \ + DDS_Connector2_stub DDS_Connector2_svnt DDS_Connector2_lem_stub \ + DDS_Connector3_stub DDS_Connector3_svnt DDS_Connector3_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentS.cpp + Component_svnt.cpp + } + + Header_Files { + ComponentS.h + Component_svnt.h + Component_svnt_export.h + } + + Inline_Files { + ComponentS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.cpp new file mode 100644 index 00000000000..c67655b13ec --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.cpp @@ -0,0 +1,140 @@ +// -*- C++ -*- +// $Id$ + +#include "Component_exec.h" +#include "ace/Log_Msg.h" + +#include "Base/BaseSupport.h" + +#include "dds4ccm/impl/dds/DataWriter.h" + +namespace CIAO_SharedDP_SharedDPComponent_Impl +{ + //============================================================ + // Component Executor Implementation Class: Component_exec_i + //============================================================ + + Component_exec_i::Component_exec_i (void) + { + } + + Component_exec_i::~Component_exec_i (void) + { + } + + void + Component_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::SharedDP::CCM_SharedDPComponent_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Component_exec_i::configuration_complete (void) + { + } + + void + Component_exec_i::ccm_activate (void) + { + try + { + DDS::DataWriter_var dw1 = + this->context_->get_connection_write1_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd1 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw1.in ()); + DDSDataWriter * dds_dw1 = ccm_dds_rd1->get_impl (); + DDSPublisher * dds_p1 = dds_dw1->get_publisher (); + this->dds_dp1_ = dds_p1->get_participant (); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer1\n")); + } + + try + { + DDS::DataWriter_var dw2 = + this->context_->get_connection_write2_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd2 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw2.in ()); + DDSDataWriter * dds_dw2 = ccm_dds_rd2->get_impl (); + DDSPublisher * dds_p2 = dds_dw2->get_publisher (); + this->dds_dp2_ = dds_p2->get_participant (); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer2\n")); + } + + try + { + DDS::DataWriter_var dw3 = + this->context_->get_connection_write3_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd3 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw3.in ()); + DDSDataWriter * dds_dw3 = ccm_dds_rd3->get_impl (); + DDSPublisher * dds_p3 = dds_dw3->get_publisher (); + this->dds_dp3_ = dds_p3->get_participant (); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer3\n")); + } + } + + void + Component_exec_i::ccm_passivate (void) + { + if (!this->dds_dp1_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 1 seems to be NIL\n")); + if (!this->dds_dp2_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 2 seems to be NIL\n")); + if (!this->dds_dp3_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 3 seems to be NIL\n")); + } + + void + Component_exec_i::ccm_remove (void) + { + if (this->dds_dp1_ != this->dds_dp2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 2 don't seem to " + "share the same DomainParticipant\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Connector 1 and 2 seems to " + "share the same DomainParticipant\n")); + } + if (this->dds_dp1_ == this->dds_dp3_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 3 seem to " + "share the same DomainParticipant\n")); + } + if (this->dds_dp2_ == this->dds_dp3_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 2 and 3 seem to " + "share the same DomainParticipant\n")); + } + } + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Component_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.h new file mode 100644 index 00000000000..341c942af15 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Component/Component_exec.h @@ -0,0 +1,58 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_COMPONENT_EXEC_H_ +#define CIAO_COMPONENT_EXEC_H_ + + +#include "ComponentEC.h" + +#include /**/ "Component_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +class SharedDPTest1DataWriter; +class SharedDPTest2DataWriter; +class SharedDPTest3DataWriter; +class DDSDomainParticipant; + +namespace CIAO_SharedDP_SharedDPComponent_Impl +{ + class Component_exec_i + : public virtual SharedDPComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + Component_exec_i (void); + virtual ~Component_exec_i (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: + ::SharedDP::CCM_SharedDPComponent_Context_var context_; + + SharedDPTest1DataWriter * writer1_; + SharedDPTest2DataWriter * writer2_; + SharedDPTest3DataWriter * writer3_; + + DDSDomainParticipant * dds_dp1_; + DDSDomainParticipant * dds_dp2_; + DDSDomainParticipant * dds_dp3_; + }; + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Component_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.idl new file mode 100644 index 00000000000..a81668b8a25 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.idl @@ -0,0 +1,31 @@ +// $Id$ + +/** + * @file Connector1.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SHARED_DP_CONNECTOR1_IDL_ +#define SHARED_DP_CONNECTOR1_IDL_ + +#include <Components.idl> +#include "Base/Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector1/Connector1E.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::SharedDPTest1, ::SharedDPTest1Seq> SharedDPTest1; +}; + +module SharedDP_Connector1 +{ + connector Connector1 : ::CCM_DDS::SharedDPTest1::DDS_Event + { + }; +}; + + + +#endif /* SHARED_DP_CONNECTOR1_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.mpc new file mode 100644 index 00000000000..7a369c45ae9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector1/Connector1.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_SharedDP_Connector1_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR1_STUB_Export \ + -Wb,stub_export_include=Connector1_stub_export.h \ + -Wb,skel_export_macro=SHAREDDP_CONNECTOR1_SVNT_Export \ + -Wb,skel_export_include=Connector1_svnt_export.h \ + -Wb,svnt_export_macro=SHAREDDP_CONNECTOR1_SVNT_Export \ + -Wb,svnt_export_include=Connector1_svnt_export.h \ + -Wb,conn_export_macro=SHAREDDP_CONNECTOR1_CONN_Export \ + -Wb,conn_export_include=Connector1_conn_export.h \ + -I .. + + IDL_Files { + Connector1.idl + } +} + +project(DDS_SharedDP_Connector1_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SharedDP_Connector1_idl_gen + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR1_LEM_STUB_Export \ + -Wb,stub_export_include=Connector1_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Connector1E.idl + } +} + +project(DDS_SharedDP_Connector1_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDP_Connector1_lem_gen DDS_SharedDP_Connector1_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub + libs += DDS_SharedDP_DDBase_stub DDS_Connector1_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector1_lem_stub + dynamicflags = SHAREDDP_CONNECTOR1_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector1EC.cpp + } + + Header_Files { + Connector1EC.h + Connector1_lem_stub_export.h + } + + Inline_Files { + Connector1EC.inl + } +} + +project(DDS_SharedDP_Connector1_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDP_Connector1_idl_gen DDS_SharedDP_DDBase_stub + libs += DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector1_stub + dynamicflags = SHAREDDP_CONNECTOR1_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector1C.cpp + } + + Header_Files { + Connector1C.h + Connector1_stub_export.h + } + + Inline_Files { + Connector1C.inl + } +} + +project(DDS_SharedDP_Connector1_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SharedDP_Connector1_lem_stub DDS_SharedDP_Connector1_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + sharedname = DDS_Connector1_exec + libs += DDS_Connector1_stub DDS_Connector1_lem_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR1_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector1_conn.cpp + } + + Header_Files { + Connector1_conn.h + Connector1_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDP_Connector1_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SharedDP_Connector1_lem_stub DDS_SharedDP_Connector1_exec DDS_SharedDP_Connector1_stub DDS4CCM_lem_stub + sharedname = DDS_Connector1_svnt + libs += DDS_Connector1_stub \ + DDS_Connector1_lem_stub \ + DDS_SharedDP_DDBase_stub \ + DDS_Connector1_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR1_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector1S.cpp + Connector1_svnt.cpp + } + + Header_Files { + Connector1S.h + Connector1_svnt.h + Connector1_svnt_export.h + } + + Inline_Files { + Connector1S.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.idl new file mode 100644 index 00000000000..fbb5820b808 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Connector2.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SHARED_DP_CONNECTOR2_IDL_ +#define SHARED_DP_CONNECTOR2_IDL_ + +#include <Components.idl> +#include "Base/Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector2/Connector2E.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::SharedDPTest2, ::SharedDPTest2Seq> SharedDPTest2; +}; + +module SharedDP_Connector2 +{ + connector Connector2 : ::CCM_DDS::SharedDPTest2::DDS_Event + { + }; +}; + +#endif /* SHARED_DP_CONNECTOR2_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.mpc new file mode 100644 index 00000000000..2a5abfef8d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector2/Connector2.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_SharedDP_Connector2_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR2_STUB_Export \ + -Wb,stub_export_include=Connector2_stub_export.h \ + -Wb,skel_export_macro=SHAREDDP_CONNECTOR2_SVNT_Export \ + -Wb,skel_export_include=Connector2_svnt_export.h \ + -Wb,svnt_export_macro=SHAREDDP_CONNECTOR2_SVNT_Export \ + -Wb,svnt_export_include=Connector2_svnt_export.h \ + -Wb,conn_export_macro=SHAREDDP_CONNECTOR2_CONN_Export \ + -Wb,conn_export_include=Connector2_conn_export.h \ + -I .. + + IDL_Files { + Connector2.idl + } +} + +project(DDS_SharedDP_Connector2_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SharedDP_Connector2_idl_gen + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR2_LEM_STUB_Export \ + -Wb,stub_export_include=Connector2_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Connector2E.idl + } +} + +project(DDS_SharedDP_Connector2_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDP_Connector2_lem_gen DDS_SharedDP_Connector2_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub + libs += DDS_SharedDP_DDBase_stub DDS_Connector2_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector2_lem_stub + dynamicflags = SHAREDDP_CONNECTOR2_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector2EC.cpp + } + + Header_Files { + Connector2EC.h + Connector2_lem_stub_export.h + } + + Inline_Files { + Connector2EC.inl + } +} + +project(DDS_SharedDP_Connector2_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDP_Connector2_idl_gen DDS_SharedDP_DDBase_stub + libs += DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector2_stub + dynamicflags = SHAREDDP_CONNECTOR2_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector2C.cpp + } + + Header_Files { + Connector2C.h + Connector2_stub_export.h + } + + Inline_Files { + Connector2C.inl + } +} + +project(DDS_SharedDP_Connector2_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SharedDP_Connector2_lem_stub DDS_SharedDP_Connector2_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + sharedname = DDS_Connector2_exec + libs += DDS_Connector2_stub DDS_Connector2_lem_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR2_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector2_conn.cpp + } + + Header_Files { + Connector2_conn.h + Connector2_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDP_Connector2_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SharedDP_Connector2_lem_stub DDS_SharedDP_Connector2_exec DDS_SharedDP_Connector2_stub DDS4CCM_lem_stub + sharedname = DDS_Connector2_svnt + libs += DDS_Connector2_stub \ + DDS_Connector2_lem_stub \ + DDS_SharedDP_DDBase_stub \ + DDS_Connector2_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR2_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector2S.cpp + Connector2_svnt.cpp + } + + Header_Files { + Connector2S.h + Connector2_svnt.h + Connector2_svnt_export.h + } + + Inline_Files { + Connector2S.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.idl new file mode 100644 index 00000000000..29e798d9350 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Connector3.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SHARED_DP_CONNECTOR3_IDL_ +#define SHARED_DP_CONNECTOR3_IDL_ + +#include <Components.idl> +#include "Base/Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector3/Connector3E.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::SharedDPTest3, ::SharedDPTest3Seq> SharedDPTest3; +}; + +module SharedDP_Connector3 +{ + connector Connector3 : ::CCM_DDS::SharedDPTest3::DDS_Event + { + }; +}; + +#endif /* SHARED_DP_CONNECTOR3_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.mpc new file mode 100644 index 00000000000..2e7e85481aa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/Connector3/Connector3.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_SharedDP_Connector3_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR3_STUB_Export \ + -Wb,stub_export_include=Connector3_stub_export.h \ + -Wb,skel_export_macro=SHAREDDP_CONNECTOR3_SVNT_Export \ + -Wb,skel_export_include=Connector3_svnt_export.h \ + -Wb,svnt_export_macro=SHAREDDP_CONNECTOR3_SVNT_Export \ + -Wb,svnt_export_include=Connector3_svnt_export.h \ + -Wb,conn_export_macro=SHAREDDP_CONNECTOR3_CONN_Export \ + -Wb,conn_export_include=Connector3_conn_export.h \ + -I .. + + IDL_Files { + Connector3.idl + } +} + +project(DDS_SharedDP_Connector3_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SharedDP_Connector3_idl_gen + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR3_LEM_STUB_Export \ + -Wb,stub_export_include=Connector3_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Connector3E.idl + } +} + +project(DDS_SharedDP_Connector3_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDP_Connector3_lem_gen DDS_SharedDP_Connector3_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub + libs += DDS_SharedDP_DDBase_stub DDS_Connector3_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector3_lem_stub + dynamicflags = SHAREDDP_CONNECTOR3_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector3EC.cpp + } + + Header_Files { + Connector3EC.h + Connector3_lem_stub_export.h + } + + Inline_Files { + Connector3EC.inl + } +} + +project(DDS_SharedDP_Connector3_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDP_Connector3_idl_gen DDS_SharedDP_DDBase_stub + libs += DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector3_stub + dynamicflags = SHAREDDP_CONNECTOR3_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector3C.cpp + } + + Header_Files { + Connector3C.h + Connector3_stub_export.h + } + + Inline_Files { + Connector3C.inl + } +} + +project(DDS_SharedDP_Connector3_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SharedDP_Connector3_lem_stub DDS_SharedDP_Connector3_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + sharedname = DDS_Connector3_exec + libs += DDS_Connector3_stub DDS_Connector3_lem_stub DDS_SharedDP_DDBase_stub DDS4CCM_lem_stub DDS_SharedDP_DDBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR3_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector3_conn.cpp + } + + Header_Files { + Connector3_conn.h + Connector3_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDP_Connector3_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SharedDP_Connector3_lem_stub DDS_SharedDP_Connector3_exec DDS_SharedDP_Connector3_stub DDS4CCM_lem_stub + sharedname = DDS_Connector3_svnt + libs += DDS_Connector3_stub \ + DDS_Connector3_lem_stub \ + DDS_SharedDP_DDBase_stub \ + DDS_Connector3_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR3_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector3S.cpp + Connector3_svnt.cpp + } + + Header_Files { + Connector3S.h + Connector3_svnt.h + Connector3_svnt_export.h + } + + Inline_Files { + Connector3S.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/Plan.cdp new file mode 100644 index 00000000000..a8991de43aa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/Plan.cdp @@ -0,0 +1,444 @@ +<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>SharedDPTest_Depl_1</label> + <UUID>SharedDPTest_Depl_1</UUID> + + <implementation xmi:id="Connector1Implementation"> + <name>Connector1Implementation</name> + <source/> + <artifact xmi:idref="Connector1_ExecArtifact" /> + <artifact xmi:idref="Connector1_SvntArtifact" /> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector1_Connector1_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector1_Connector1_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector1_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector1_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Connector2Implementation"> + <name>Connector2Implementation</name> + <source/> + <artifact xmi:idref="Connector2_ExecArtifact" /> + <artifact xmi:idref="Connector2_SvntArtifact" /> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector2_Connector2_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector2_Connector2_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector2_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector2_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Connector3Implementation"> + <name>Connector3Implementation</name> + <source/> + <artifact xmi:idref="Connector3_ExecArtifact" /> + <artifact xmi:idref="Connector3_SvntArtifact" /> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector3_Connector3_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector3_Connector3_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector3_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector3_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_SharedDPComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="Connector1Instance"> + <name>Connector1Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="Connector1Implementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector2Instance"> + <name>Connector2Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="Connector2Implementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP2</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector3Instance"> + <name>Connector3Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="Connector3Implementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StandaloneDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Standalone_Library#Standalone_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ComponentInstance"> + <name>Component</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + </instance> + + <connection> + <name>writer_connection1</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write1_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector1Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection2</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write2_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector2Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection3</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write3_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector3Instance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Component_ExecArtifact"> + <name>Component_exec</name> + <source/> + <node/> + <location>Component_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>Component_svnt</name> + <source/> + <node/> + <location>Component_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> + + <artifact xmi:id="Connector1_ExecArtifact"> + <name>DDS_Connector1_exec</name> + <source/> + <node/> + <location>DDS_Connector1_exec</location> + </artifact> + <artifact xmi:id="Connector1_SvntArtifact"> + <name>DDS_Connector1_svnt</name> + <source/> + <node/> + <location>DDS_Connector1_svnt</location> + </artifact> + <artifact xmi:id="Connector1_StubArtifact"> + <name>DDS_Connector1_stub</name> + <source/> + <node/> + <location>DDS_Connector1_stub</location> + </artifact> + + <artifact xmi:id="Connector2_ExecArtifact"> + <name>DDS_Connector2_exec</name> + <source/> + <node/> + <location>DDS_Connector2_exec</location> + </artifact> + <artifact xmi:id="Connector2_SvntArtifact"> + <name>DDS_Connector2_svnt</name> + <source/> + <node/> + <location>DDS_Connector2_svnt</location> + </artifact> + <artifact xmi:id="Connector2_StubArtifact"> + <name>DDS_Connector2_stub</name> + <source/> + <node/> + <location>DDS_Connector2_stub</location> + </artifact> + + <artifact xmi:id="Connector3_ExecArtifact"> + <name>DDS_Connector3_exec</name> + <source/> + <node/> + <location>DDS_Connector3_exec</location> + </artifact> + <artifact xmi:id="Connector3_SvntArtifact"> + <name>DDS_Connector3_svnt</name> + <source/> + <node/> + <location>DDS_Connector3_svnt</location> + </artifact> + <artifact xmi:id="Connector3_StubArtifact"> + <name>DDS_Connector3_stub</name> + <source/> + <node/> + <location>DDS_Connector3_stub</location> + </artifact> + +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..f163ee334f4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<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 name="Shared_Library"> + <qos_profile name="Shared_Profile" is_default_qos="true"> + <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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> + <qos_library name="Standalone_Library"> + <qos_profile name="Standalone_Profile" is_default_qos="true"> + <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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/run_test.pl new file mode 100755 index 00000000000..5a57844e894 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/DifferentDatatype/descriptors/run_test.pl @@ -0,0 +1,238 @@ +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 = 1; +@ports = ( 60001 ); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode" ); + +# 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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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"); +$E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/README b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/README new file mode 100644 index 00000000000..fc697e66371 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/README @@ -0,0 +1,11 @@ +# $Id$ + +To save resources, every subsequent connector with the same +library name and profile name, should get the same domain- +participant. + +There're three connectors. Two (Connector1 and Connector2) +with the same library/profile name. +One (Connector3) with a different library/profile name. + +The component checks the pointers of the domainparticipants. diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.idl new file mode 100644 index 00000000000..91ccce681ee --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef BASE_IDL +#define BASE_IDL + +#pragma ndds typesupport "Base/BaseSupport.h" + +#pragma DCPS_DATA_TYPE "SharedDPTest" +#pragma DCPS_DATA_KEY "SharedDPTest key" + +struct SharedDPTest { + string key; + long iteration; +}; +typedef sequence<SharedDPTest> SharedDPTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.mpc new file mode 100644 index 00000000000..00ca646663f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Base/Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SharedDPBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SharedDPBase_stub + dynamicflags += BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=BASE_STUB_Export \ + -Wb,stub_export_include=Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Base.idl + } + + opendds_ts_flags += --export=BASE_STUB_Export + + DDSGenerator_Files { + Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.idl new file mode 100644 index 00000000000..d86e77e5a5d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.idl @@ -0,0 +1,27 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + */ + +#ifndef DDS_SHARED_DP_COMPONENT_IDL +#define DDS_SHARED_DP_COMPONENT_IDL + +#include "Connector/Connector.idl" + +module SharedDP +{ + component SharedDPComponent + { + port CCM_DDS::SharedDPTest::DDS_Write write1; + port CCM_DDS::SharedDPTest::DDS_Write write2; + port CCM_DDS::SharedDPTest::DDS_Write write3; + port CCM_DDS::SharedDPTest::DDS_Write write4; + + attribute boolean perform_test; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.mpc new file mode 100644 index 00000000000..b49e7da658d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component.mpc @@ -0,0 +1,149 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SharedDPBase -l ../lib -o ../lib -c controller -u DDS Component" + +project(DDS_SharedDPComponent_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SharedDP_Connector_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_STUB_Export \ + -Wb,stub_export_include=Component_stub_export.h \ + -Wb,skel_export_macro=COMPONENT_SVNT_Export \ + -Wb,skel_export_include=Component_svnt_export.h \ + -Wb,svnt_export_macro=COMPONENT_SVNT_Export \ + -Wb,svnt_export_include=Component_svnt_export.h \ + -Wb,exec_export_macro=COMPONENT_EXEC_Export \ + -Wb,exec_export_include=Component_exec_export.h \ + -I .. + + IDL_Files { + Component.idl + } +} + +project(DDS_SharedDPComponent_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SharedDPComponent_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=COMPONENT_LEM_STUB_Export \ + -Wb,stub_export_include=Component_lem_stub_export.h \ + -SS -Gxhst -I $CIAO_ROOT/connectors -I .. + + IDL_Files { + ComponentE.idl + } +} + +project(DDS_SharedDPComponent_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDPComponent_lem_gen DDS_SharedDPComponent_stub DDS_SharedDPBase_stub + libs += DDS_SharedDPBase_stub Component_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Component_lem_stub + dynamicflags = COMPONENT_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentEC.cpp + } + + Header_Files { + ComponentEC.h + Component_lem_stub_export.h + } + + Inline_Files { + ComponentEC.inl + } +} + +project(DDS_SharedDPComponent_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDPComponent_idl_gen DDS_SharedDPBase_stub \ + DDS_SharedDP_Connector_lem_gen DDS_SharedDP_Connector_stub + libs += DDS_SharedDPBase_stub DDS_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Component_stub + dynamicflags = COMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentC.cpp + } + + Header_Files { + ComponentC.h + Component_stub_export.h + } + + Inline_Files { + ComponentC.inl + } +} + +project(DDS_SharedDPComponent_exec) : ciao_executor, dds4ccm_base, dds4ccm_impl { + after += DDS_SharedDPComponent_lem_stub DDS_SharedDPComponent_stub \ + DDS_SharedDP_Connector_lem_stub DDS_SharedDP_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Component_exec + libs += Component_stub Component_lem_stub DDS_SharedDPBase_stub \ + DDS_Connector_lem_stub DDS_Connector_stub \ + DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = COMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Component_exec.cpp + } + + Header_Files { + Component_exec.h + Component_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDPComponent_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SharedDPBase_stub DDS_SharedDPComponent_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_SharedDP_Connector_stub DDS_SharedDP_Connector_svnt \ + DDS_SharedDP_Connector_lem_stub + sharedname = Component_svnt + libs += Component_stub Component_lem_stub \ + DDS_SharedDPBase_stub DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_Connector_stub DDS_Connector_svnt DDS_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = COMPONENT_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ComponentS.cpp + Component_svnt.cpp + } + + Header_Files { + ComponentS.h + Component_svnt.h + Component_svnt_export.h + } + + Inline_Files { + ComponentS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.cpp new file mode 100644 index 00000000000..d72899f20ae --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.cpp @@ -0,0 +1,239 @@ +// -*- C++ -*- +// $Id$ + +// Test whether Connector 1,2 and 3 are sharing the same DomainParticipant. +// Connector 4 should have a different DomainParticipant. +// Also test whether Connector 1 and 2 share the same topic. + +#include "Component_exec.h" +#include "ace/Log_Msg.h" + +#include "Base/BaseSupport.h" + +#include "dds4ccm/impl/dds/DataWriter.h" + +const char * tp_name_conn_1_ = "SharedDP"; +const char * tp_name_conn_2_ = "SharedDP"; +const char * tp_name_conn_3_ = "SharedDP1"; +const char * tp_name_conn_4_ = "StandaloneDP"; + +namespace CIAO_SharedDP_SharedDPComponent_Impl +{ + //============================================================ + // Component Executor Implementation Class: Component_exec_i + //============================================================ + + Component_exec_i::Component_exec_i (void) + : perform_test_ (false) + { + } + + Component_exec_i::~Component_exec_i (void) + { + } + + void + Component_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::SharedDP::CCM_SharedDPComponent_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Component_exec_i::configuration_complete (void) + { + } + + CORBA::Boolean + Component_exec_i::perform_test (void) + { + return this->perform_test_; + } + + void + Component_exec_i::perform_test (CORBA::Boolean perform_test) + { + this->perform_test_ = perform_test; + } + + void + Component_exec_i::ccm_activate (void) + { + try + { + DDS::DataWriter_var dw1 = + this->context_->get_connection_write1_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd1 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw1.in ()); + DDSDataWriter * dds_dw1 = ccm_dds_rd1->get_impl (); + DDSPublisher * dds_p1 = dds_dw1->get_publisher (); + this->dds_dp1_ = dds_p1->get_participant (); + + DDSTopicDescription * td1 = + this->dds_dp1_->lookup_topicdescription (tp_name_conn_1_); + this->dds_tp1_ = DDSTopic::narrow (td1); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer1\n")); + } + + try + { + DDS::DataWriter_var dw2 = + this->context_->get_connection_write2_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd2 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw2.in ()); + DDSDataWriter * dds_dw2 = ccm_dds_rd2->get_impl (); + DDSPublisher * dds_p2 = dds_dw2->get_publisher (); + this->dds_dp2_ = dds_p2->get_participant (); + DDSTopicDescription * td2 = + this->dds_dp2_->lookup_topicdescription (tp_name_conn_2_); + this->dds_tp2_ = DDSTopic::narrow (td2); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer2\n")); + } + + try + { + DDS::DataWriter_var dw3 = + this->context_->get_connection_write3_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd3 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw3.in ()); + DDSDataWriter * dds_dw3 = ccm_dds_rd3->get_impl (); + DDSPublisher * dds_p3 = dds_dw3->get_publisher (); + this->dds_dp3_ = dds_p3->get_participant (); + DDSTopicDescription * td3 = + this->dds_dp3_->lookup_topicdescription (tp_name_conn_3_); + this->dds_tp3_ = DDSTopic::narrow (td3); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer3\n")); + } + + try + { + DDS::DataWriter_var dw4 = + this->context_->get_connection_write4_dds_entity (); + CIAO::DDS4CCM::CCM_DDS_DataWriter_i *ccm_dds_rd4 = + dynamic_cast <CIAO::DDS4CCM::CCM_DDS_DataWriter_i *> (dw4.in ()); + DDSDataWriter * dds_dw4 = ccm_dds_rd4->get_impl (); + DDSPublisher * dds_p4 = dds_dw4->get_publisher (); + this->dds_dp4_ = dds_p4->get_participant (); + DDSTopicDescription * td4 = + this->dds_dp4_->lookup_topicdescription (tp_name_conn_4_); + this->dds_tp4_ = DDSTopic::narrow (td4); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to create dds_entity for writer3\n")); + } + } + + void + Component_exec_i::ccm_passivate (void) + { + if (this->perform_test_) + { + if (!this->dds_dp1_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 1 seems to be NIL\n")); + if (!this->dds_dp2_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 2 seems to be NIL\n")); + if (!this->dds_dp3_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 3 seems to be NIL\n")); + if (!this->dds_dp4_) + ACE_ERROR ((LM_ERROR, "ERROR: DomainParticipant for Connector 4 seems to be NIL\n")); + + if (!this->dds_tp1_) + ACE_ERROR ((LM_ERROR, "ERROR: Topic for Connector 1 seems to be NIL\n")); + if (!this->dds_tp2_) + ACE_ERROR ((LM_ERROR, "ERROR: Topic for Connector 2 seems to be NIL\n")); + if (!this->dds_tp3_) + ACE_ERROR ((LM_ERROR, "ERROR: Topic for Connector 3 seems to be NIL\n")); + if (!this->dds_tp4_) + ACE_ERROR ((LM_ERROR, "ERROR: Topic for Connector 4 seems to be NIL\n")); + } + } + + void + Component_exec_i::ccm_remove (void) + { + if (this->perform_test_) + { + //check shared DomainParticipants + if (this->dds_dp1_ != this->dds_dp2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 2 don't seem to " + "share the same DomainParticipant\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Connector 1 and 2 seems to " + "share the same DomainParticipant\n")); + } + if (this->dds_dp1_ == this->dds_dp4_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 4 seem to " + "share the same DomainParticipant\n")); + } + if (this->dds_dp2_ == this->dds_dp4_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 2 and 4 seem to " + "share the same DomainParticipant\n")); + } + if (this->dds_dp3_ == this->dds_dp4_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 3 and 4 seem to " + "share the same DomainParticipant\n")); + } + + //check shared Topics + if (this->dds_tp1_ != this->dds_tp2_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 2 don't seem to " + "share the same Topic\n")); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Connector 1 and 2 seems to " + "share the same Topic\n")); + } + if (this->dds_tp1_ == this->dds_tp3_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 3 seem to " + "share the same Topic\n")); + } + if (this->dds_tp1_ == this->dds_tp4_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Connector 1 and 4 seem to " + "share the same Topic\n")); + } + } + else + { + ACE_DEBUG ((LM_DEBUG, "Don't test this component. It's used for compilation errors.\n")); + } + } + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Component_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.h b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.h new file mode 100644 index 00000000000..69f397a4dfb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Component/Component_exec.h @@ -0,0 +1,72 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_COMPONENT_EXEC_H_ +#define CIAO_COMPONENT_EXEC_H_ + + +#include "ComponentEC.h" + +#include /**/ "Component_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +class SharedDPTest1DataWriter; +class SharedDPTest2DataWriter; +class SharedDPTest3DataWriter; +class SharedDPTest4DataWriter; +class DDSDomainParticipant; +class DDSTopic; + +namespace CIAO_SharedDP_SharedDPComponent_Impl +{ + class Component_exec_i + : public virtual SharedDPComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + Component_exec_i (void); + virtual ~Component_exec_i (void); + + virtual void set_session_context (::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + CORBA::Boolean perform_test (void); + void perform_test (CORBA::Boolean perform_test); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::SharedDP::CCM_SharedDPComponent_Context_var context_; + + CORBA::Boolean perform_test_; + + SharedDPTest1DataWriter * writer1_; + SharedDPTest2DataWriter * writer2_; + SharedDPTest3DataWriter * writer3_; + SharedDPTest4DataWriter * writer4_; + + DDSDomainParticipant * dds_dp1_; + DDSDomainParticipant * dds_dp2_; + DDSDomainParticipant * dds_dp3_; + DDSDomainParticipant * dds_dp4_; + + DDSTopic * dds_tp1_; + DDSTopic * dds_tp2_; + DDSTopic * dds_tp3_; + DDSTopic * dds_tp4_; + }; + + extern "C" COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Component_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.idl new file mode 100644 index 00000000000..11d4d0cc409 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef SHARED_DP_CONNECTOR_IDL_ +#define SHARED_DP_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::SharedDPTest, ::SharedDPTestSeq> SharedDPTest; +}; + +module SharedDP_Connector +{ + connector SDP_Connector : ::CCM_DDS::SharedDPTest::DDS_Event + { + }; +}; + +#endif /* SHARED_DP_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.mpc new file mode 100644 index 00000000000..8e7678a41fc --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/Connector/Connector.mpc @@ -0,0 +1,142 @@ +// $Id$ + +project(DDS_SharedDP_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Connector_stub_export.h \ + -Wb,skel_export_macro=SHAREDDP_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Connector_svnt_export.h \ + -Wb,svnt_export_macro=SHAREDDP_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Connector_svnt_export.h \ + -Wb,conn_export_macro=SHAREDDP_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Connector_conn_export.h \ + -I .. + + IDL_Files { + Connector.idl + } +} + +project(DDS_SharedDP_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SharedDP_Connector_idl_gen + idlflags += -Wb,stub_export_macro=SHAREDDP_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + ConnectorE.idl + } +} + +project(DDS_SharedDP_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SharedDP_Connector_lem_gen DDS_SharedDP_Connector_stub DDS_SharedDPBase_stub DDS4CCM_lem_stub + libs += DDS_SharedDPBase_stub DDS_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector_lem_stub + dynamicflags = SHAREDDP_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorEC.cpp + } + + Header_Files { + ConnectorEC.h + Connector_lem_stub_export.h + } + + Inline_Files { + ConnectorEC.inl + } +} + +project(DDS_SharedDP_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SharedDP_Connector_idl_gen DDS_SharedDPBase_stub + libs += DDS_SharedDPBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector_stub + dynamicflags = SHAREDDP_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorC.cpp + } + + Header_Files { + ConnectorC.h + Connector_stub_export.h + } + + Inline_Files { + ConnectorC.inl + } +} + +project(DDS_SharedDP_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SharedDP_Connector_lem_stub DDS_SharedDP_Connector_stub DDS4CCM_lem_stub DDS_SharedDPBase_stub + sharedname = DDS_Connector_exec + libs += DDS_Connector_stub DDS_Connector_lem_stub DDS_SharedDPBase_stub DDS4CCM_lem_stub DDS_SharedDPBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector_conn.cpp + } + + Header_Files { + Connector_conn.h + Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SharedDP_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SharedDP_Connector_lem_stub DDS_SharedDP_Connector_exec DDS_SharedDP_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Connector_svnt + libs += DDS_Connector_stub \ + DDS_Connector_lem_stub \ + DDS_SharedDPBase_stub \ + DDS_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SHAREDDP_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorS.cpp + Connector_svnt.cpp + } + + Header_Files { + ConnectorS.h + Connector_svnt.h + Connector_svnt_export.h + } + + Inline_Files { + ConnectorS.inl + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/DefaultQoS.cdp b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/DefaultQoS.cdp new file mode 100644 index 00000000000..7c10cb028b9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/DefaultQoS.cdp @@ -0,0 +1,320 @@ +<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>SharedDPTest_Depl</label> + <UUID>SharedDPTest_Depl</UUID> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="Connector_ExecArtifact" /> + <artifact xmi:idref="Connector_SvntArtifact" /> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector_SDP_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector_SDP_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_SharedDPComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="Connector1Instance"> + <name>Connector1Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector2Instance"> + <name>Connector2Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector3Instance"> + <name>Connector3Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP1</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector4Instance"> + <name>Connector4Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StandaloneDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Standalone_Library#Standalone_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ComponentInstance"> + <name>Component</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + </instance> + + <connection> + <name>writer_connection1</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write1_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector1Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection2</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write2_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector2Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection3</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write3_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector3Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection4</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write4_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector4Instance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Component_ExecArtifact"> + <name>Component_exec</name> + <source/> + <node/> + <location>Component_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>Component_svnt</name> + <source/> + <node/> + <location>Component_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> + + <artifact xmi:id="Connector_ExecArtifact"> + <name>DDS_Connector_exec</name> + <source/> + <node/> + <location>DDS_Connector_exec</location> + </artifact> + <artifact xmi:id="Connector_SvntArtifact"> + <name>DDS_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Connector_svnt</location> + </artifact> + <artifact xmi:id="Connector_StubArtifact"> + <name>DDS_Connector_stub</name> + <source/> + <node/> + <location>DDS_Connector_stub</location> + </artifact> + +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/Plan.cdp new file mode 100644 index 00000000000..56628402110 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/Plan.cdp @@ -0,0 +1,495 @@ +<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>SharedDPTest_Depl</label> + <UUID>SharedDPTest_Depl</UUID> + + <implementation xmi:id="ConnectorImplementation"> + <name>ConnectorImplementation</name> + <source/> + <artifact xmi:idref="Connector_ExecArtifact" /> + <artifact xmi:idref="Connector_SvntArtifact" /> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector_SDP_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_Connector_SDP_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DDS_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ComponentImplementation"> + <name>ComponentImplementation</name> + <source/> + <artifact xmi:idref="Component_ExecArtifact" /> + <artifact xmi:idref="Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_SharedDP_SharedDPComponent_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Component_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <!-- This connector is used to detect run_time errors, + not for functional testing.--> + <instance xmi:id="Connector0Instance"> + <name>Connector0Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector1Instance"> + <name>Connector1Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector2Instance"> + <name>Connector2Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector3Instance"> + <name>Connector3Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SharedDP1</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Shared_Library#Shared_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Connector4Instance"> + <name>Connector4Instance</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ConnectorImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>StandaloneDP</string> + </value> + </value> + </configProperty> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Standalone_Library#Standalone_Profile</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="ComponentInstance"> + <name>Component</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>perform_test</name> + <value> + <type> + <kind>tk_boolean</kind> + </type> + <value> + <boolean>true</boolean> + </value> + </value> + </configProperty> + </instance> + + <!-- This component is used to detect run_time errors, + not for functional testing.--> + <instance xmi:id="Component0Instance"> + <name>Component0</name> + <node>ComponentNode</node> + <source/> + <implementation xmi:idref="ComponentImplementation" /> + <configProperty> + <name>perform_test</name> + <value> + <type> + <kind>tk_boolean</kind> + </type> + <value> + <boolean>false</boolean> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>writer_connection01</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write1_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Component0Instance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector0Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection02</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write2_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Component0Instance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector0Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection03</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write3_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Component0Instance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector0Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection04</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write4_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Component0Instance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector0Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection1</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write1_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector1Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection2</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write2_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector2Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection3</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write3_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector3Instance" /> + </internalEndpoint> + </connection> + + <connection> + <name>writer_connection4</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>write4_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>supplier_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Connector4Instance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Component_ExecArtifact"> + <name>Component_exec</name> + <source/> + <node/> + <location>Component_exec</location> + </artifact> + <artifact xmi:id="Component_SvntArtifact"> + <name>Component_svnt</name> + <source/> + <node/> + <location>Component_svnt</location> + </artifact> + <artifact xmi:id="Component_StubArtifact"> + <name>Component_stub</name> + <source/> + <node/> + <location>Component_stub</location> + </artifact> + + <artifact xmi:id="Connector_ExecArtifact"> + <name>DDS_Connector_exec</name> + <source/> + <node/> + <location>DDS_Connector_exec</location> + </artifact> + <artifact xmi:id="Connector_SvntArtifact"> + <name>DDS_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Connector_svnt</location> + </artifact> + <artifact xmi:id="Connector_StubArtifact"> + <name>DDS_Connector_stub</name> + <source/> + <node/> + <location>DDS_Connector_stub</location> + </artifact> + +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/USER_QOS_PROFILES.xml b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..f163ee334f4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<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 name="Shared_Library"> + <qos_profile name="Shared_Profile" is_default_qos="true"> + <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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> + <qos_library name="Standalone_Library"> + <qos_profile name="Standalone_Profile" is_default_qos="true"> + <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_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_LAST_HISTORY_QOS</kind> + <depth>20</depth> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds>
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test.pl new file mode 100755 index 00000000000..c1a88c75f90 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test.pl @@ -0,0 +1,238 @@ +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 = 1; +@ports = ( 60001 ); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode" ); + +# 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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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"); +$E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test_default_qos.pl b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test_default_qos.pl new file mode 100755 index 00000000000..b7b2c12ee80 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/SharedDomainParticipant/SameDatatype/descriptors/run_test_default_qos.pl @@ -0,0 +1,238 @@ +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 = 1; +@ports = ( 60001 ); +@iorbases = ( "NodeApp1.ior" ); +@iorfiles = 0; +@nodenames = ( "ComponentNode" ); + +# 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 = "DefaultQoS.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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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"); +$E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.idl new file mode 100644 index 00000000000..a55a8a9106f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file State_Connection_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef STATE_CONNECTION_TEST_BASE_IDL +#define STATE_CONNECTION_TEST_BASE_IDL + +#pragma ndds typesupport "Base/State_Connection_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "State_ConnectionTest" +#pragma DCPS_DATA_KEY "State_ConnectionTest key" + +struct State_ConnectionTest { + string key; //@key + long iteration; +}; + +typedef sequence<State_ConnectionTest> State_ConnectionTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.mpc new file mode 100644 index 00000000000..a0c2462af7b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_SCT_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_SCT_Base_stub + dynamicflags += STATE_CONNECTION_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=STATE_CONNECTION_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=State_Connection_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + State_Connection_Test_Base.idl + } + + opendds_ts_flags += --export=STATE_CONNECTION_TEST_BASE_STUB_Export + + DDSGenerator_Files { + State_Connection_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.idl new file mode 100644 index 00000000000..268dd4acae6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file State_Connection_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef KEYED_TEST_CONNECTOR_IDL_ +#define KEYED_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/State_Connection_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/State_Connection_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::State_ConnectionTest, ::State_ConnectionTestSeq> State_ConnectionTest; +}; + +module State_Connection_Test +{ + connector State_Connection_Test_Connector : ::CCM_DDS::State_ConnectionTest::DDS_State + { + }; +}; + +#endif /* State_Connection_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.mpc new file mode 100644 index 00000000000..6e02d6eea27 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Connector/State_Connection_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SCT_Base -l .. -o ../lib -u DDS State_Connection_Test_Connector" + +project(DDS_SCT_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=STATE_CONNECTION_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=State_Connection_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=STATE_CONNECTION_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=State_Connection_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=STATE_CONNECTION_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=State_Connection_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=STATE_CONNECTION_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=State_Connection_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + State_Connection_Test_Connector.idl + } +} + +project(DDS_SCT_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SCT_Connector_idl_gen + idlflags += -Wb,stub_export_macro=STATE_CONNECTION_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=State_Connection_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + State_Connection_Test_ConnectorE.idl + } +} + +project(DDS_SCT_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SCT_Connector_lem_gen DDS_SCT_Connector_stub DDS_SCT_Base_stub DDS4CCM_lem_stub + libs += DDS_SCT_Base_stub DDS_SCT_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SCT_Connector_lem_stub + dynamicflags = STATE_CONNECTION_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ConnectorEC.cpp + } + + Header_Files { + State_Connection_Test_ConnectorEC.h + State_Connection_Test_Connector_lem_stub_export.h + } + + Inline_Files { + State_Connection_Test_ConnectorEC.inl + } +} + +project(DDS_SCT_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_SCT_Connector_idl_gen DDS_SCT_Base_stub + libs += DDS_SCT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_SCT_Connector_stub + dynamicflags = STATE_CONNECTION_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ConnectorC.cpp + } + + Header_Files { + State_Connection_Test_ConnectorC.h + State_Connection_Test_Connector_stub_export.h + } + + Inline_Files { + State_Connection_Test_ConnectorC.inl + } +} + +project(DDS_SCT_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_SCT_Connector_lem_stub DDS_SCT_Connector_stub DDS4CCM_lem_stub DDS_SCT_Base_stub + sharedname = DDS_SCT_Connector_exec + libs += DDS_SCT_Connector_stub DDS_SCT_Connector_lem_stub DDS_SCT_Base_stub DDS4CCM_lem_stub DDS_SCT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = STATE_CONNECTION_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_Connector_conn.cpp + } + + Header_Files { + State_Connection_Test_Connector_conn.h + State_Connection_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_SCT_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_SCT_Connector_lem_stub DDS_SCT_Connector_exec DDS_SCT_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_SCT_Connector_svnt + libs += DDS_SCT_Connector_stub \ + DDS_SCT_Connector_lem_stub \ + DDS_SCT_Base_stub \ + DDS_SCT_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = STATE_CONNECTION_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ConnectorS.cpp + State_Connection_Test_Connector_svnt.cpp + } + + Header_Files { + State_Connection_Test_ConnectorS.h + State_Connection_Test_Connector_svnt.h + State_Connection_Test_Connector_svnt_export.h + } + + Inline_Files { + State_Connection_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/README b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/README new file mode 100644 index 00000000000..9be82d2e260 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/README @@ -0,0 +1,35 @@ +# $Id$ + +This test tests all possible connections between +a Sender and a DDS State connector and a Receiver and a +DDS State connector. +The Sender requests the following connections: + * An updater + * A DDS updater + +The Receiver expects the following listeners to be created: + * A DataListenerControl for the DDS_Listen port + * A 'normal' listener for the DDS_Listen port + * A StateListener for the DDS_StateListen port + * A PortStatusListener for the DDS_Get port + * A PortStatusListener for the DDS_Read port + * A PortStatusListener for the DDS_Listen port + * A PortStatusListener for the DDS_StateLisen port + +The Receiver requests the following connections: + * A reader for the DDS_Read port + * A DDS reader for the DDS_Read port + * A reader for the DDS_Get port + * A getter for the DDS_Get port + * A DDS reader for the DDS_Read port + * A reader for the DDS_Listen port + * A DataControlListener for the DDS_Listen port + * A DDS reader for the DDS_Listen port + * A reader for the DDS_StateListen port + * A StateListener for the DDS_StateListen port + * A DDS reader for the DDS_StateListen port + +This test tests every single connection and reports an error when +a connections couldn't be esthablished. + +No actual read/write/listen operations are performed. diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.idl new file mode 100644 index 00000000000..e38088656f4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/State_Connection_Test_Connector.idl" + +module State_Connection_Test +{ + component Receiver + { + port CCM_DDS::State_ConnectionTest::DDS_Read info_read; + port CCM_DDS::State_ConnectionTest::DDS_Get info_get; + port CCM_DDS::State_ConnectionTest::DDS_Listen info_listen; + port CCM_DDS::State_ConnectionTest::DDS_StateListen info_statelisten; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.mpc new file mode 100644 index 00000000000..2d627ca41ee --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_SCT_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_SCT_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 { + State_Connection_Test_Receiver.idl + } +} + +project(DDS_SCT_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SCT_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 { + State_Connection_Test_ReceiverE.idl + } +} + +project(DDS_SCT_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SCT_Receiver_lem_gen DDS_SCT_Receiver_stub DDS_SCT_Connector_stub DDS_SCT_Base_stub + libs += Receiver_stub DDS_SCT_Connector_stub DDS_SCT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ReceiverEC.cpp + } + + Header_Files { + State_Connection_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + State_Connection_Test_ReceiverEC.inl + } +} + +project(DDS_SCT_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_SCT_Receiver_idl_gen DDS_SCT_Connector_stub DDS_SCT_Base_stub DDS_SCT_Connector_lem_gen + libs += DDS_SCT_Connector_stub DDS_SCT_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ReceiverC.cpp + } + + Header_Files { + State_Connection_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + State_Connection_Test_ReceiverC.inl + } +} + +project(DDS_SCT_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_SCT_Receiver_lem_stub DDS_SCT_Receiver_stub DDS_SCT_Base_stub DDS_SCT_Connector_stub DDS_SCT_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_SCT_Base_stub DDS_SCT_Connector_stub DDS_SCT_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_Receiver_exec.cpp + } + + Header_Files { + State_Connection_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SCT_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SCT_Receiver_lem_stub DDS_SCT_Base_stub DDS_SCT_Connector_stub DDS_SCT_Connector_svnt DDS_SCT_Receiver_exec DDS_SCT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_SCT_Base_stub DDS_SCT_Connector_stub DDS_SCT_Connector_svnt Receiver_exec DDS_SCT_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_ReceiverS.cpp + State_Connection_Test_Receiver_svnt.cpp + } + + Header_Files { + State_Connection_Test_ReceiverS.h + State_Connection_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + State_Connection_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..0575753bcb9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.cpp @@ -0,0 +1,325 @@ +// -*- C++ -*- +// +// $Id$ + +#include "State_Connection_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" + +namespace CIAO_State_Connection_Test_Receiver_Impl +{ + //============================================================ + // Component Executor Implementation Class: Receiver_exec_i + //============================================================ + + Receiver_exec_i::Receiver_exec_i (void) + : //DDS_Read + reader_data_ok_ (false), + reader_dds_entity_ok_ (false), + //DDS_Get + getter_data_ok_ (false), + getter_fresh_data_ok_ (false), + getter_dds_entity_ok_ (false), + //DDS_Listen + listen_data_ok_ (false), + listen_data_control_ok_ (false), + listen_dds_entity_ok_ (false), + //DDS_StateListen + statelisten_data_ok_ (false), + statelisten_data_control_ok_ (false), + statelisten_dds_entity_ok_ (false), + //Provides for DDS_Read + reader_port_status_created_ (false), + //Provides for DDS_Get + getter_port_status_created_ (false), + //Provides for DDS_Listen + listen_data_listener_created_ (false), + listen_port_status_created_ (false), + //Provides for DDS_StateListen + statelisten_data_listener_created_ (false), + statelisten_port_status_created_ (false) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_read_status (void) + { + this->reader_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + //Provides for DDS_Get + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_get_status (void) + { + this->getter_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + //Provides for DDS_Listen + ::CCM_DDS::State_ConnectionTest::CCM_Listener_ptr + Receiver_exec_i::get_info_listen_data_listener () + { + this->listen_data_listener_created_ = true; + return ::CCM_DDS::State_ConnectionTest::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_listen_status (void) + { + this->listen_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + //Provides for DDS_StateListen + ::CCM_DDS::State_ConnectionTest::CCM_StateListener_ptr + Receiver_exec_i::get_info_statelisten_data_listener (void) + { + this->statelisten_data_listener_created_ = true; + return ::CCM_DDS::State_ConnectionTest::CCM_StateListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_statelisten_status (void) + { + this->statelisten_port_status_created_ = true; + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::State_Connection_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + //DDS_Read + this->reader_data_ = + this->context_->get_connection_info_read_data (); + this->reader_data_ok_ = ! ::CORBA::is_nil (this->reader_data_); + + this->reader_dds_entity_ = + this->context_->get_connection_info_read_dds_entity (); + this->reader_dds_entity_ok_ = ! ::CORBA::is_nil (this->reader_dds_entity_); + + //DDS_Get + this->getter_data_ = + this->context_->get_connection_info_get_data (); + this->getter_data_ok_ = ! ::CORBA::is_nil (this->getter_data_); + this->getter_fresh_data_ = + this->context_->get_connection_info_get_fresh_data (); + this->getter_fresh_data_ok_ = ! ::CORBA::is_nil (this->getter_fresh_data_); + this->getter_dds_entity_ = + this->context_->get_connection_info_get_dds_entity (); + this->getter_dds_entity_ok_ = ! ::CORBA::is_nil (this->getter_dds_entity_); + + //DDS_Listen + this->listen_data_ = + this->context_->get_connection_info_listen_data (); + this->listen_data_ok_ = ! ::CORBA::is_nil (this->listen_data_); + this->listen_data_control_ = + this->context_->get_connection_info_listen_data_control (); + this->listen_data_control_ok_ = ! ::CORBA::is_nil (this->listen_data_control_); + this->listen_dds_entity_ = + this->context_->get_connection_info_listen_dds_entity (); + this->listen_dds_entity_ok_ = ! ::CORBA::is_nil (this->listen_dds_entity_); + + //DDS_StateListen + this->statelisten_data_ = + this->context_->get_connection_info_statelisten_data (); + this->statelisten_data_ok_ = ! ::CORBA::is_nil (this->statelisten_data_); + this->statelisten_data_control_ = + this->context_->get_connection_info_statelisten_data_control (); + this->statelisten_data_control_ok_ = ! ::CORBA::is_nil (this->statelisten_data_control_); + this->statelisten_dds_entity_ = + this->context_->get_connection_info_statelisten_dds_entity (); + this->statelisten_dds_entity_ok_ = ! ::CORBA::is_nil (this->statelisten_dds_entity_); + } + + void + Receiver_exec_i::ccm_activate (void) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + //DDS_Read + if (!this->reader_data_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Read failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Read passed\n"))); + } + if (!this->reader_dds_entity_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_Read failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_Read passed\n"))); + } + //DDS_Get + if (!this->getter_data_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Get failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Get passed\n"))); + } + + if (!this->getter_fresh_data_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get getter of DDS_Get failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get getter of DDS_Get passed\n"))); + } + if (!this->getter_dds_entity_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_Get failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_Get passed\n"))); + } + //DDS_Listen + if (!this->listen_data_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_Listen passed\n"))); + } + if (!this->listen_data_control_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get data control of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get data control of DDS_Listen passed\n"))); + } + if (!this->listen_dds_entity_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_Listen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_Listen passed\n"))); + } + //DDS_StateListen + if (!this->statelisten_data_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get reader of DDS_StateListen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get reader of DDS_StateListen passed\n"))); + } + if (!this->statelisten_data_control_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get data control of DDS_StateListen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get data control of DDS_StateListen passed\n"))); + } + if (!this->statelisten_dds_entity_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : get DDS reader of DDS_StateListen failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : Get DDS reader of DDS_StateListen passed\n"))); + } + //Provides for DDS_Read + if (!this->reader_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Read not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Read was created\n"))); + } + //Provides for DDS_Get + if (!this->getter_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Get not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Get was created\n"))); + } + //Provides for DDS_Listen + if (!this->listen_data_listener_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : DataListener of DDS_Listen not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : DataListener of DDS_Listen was created\n"))); + } + if (!this->listen_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_Listen not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_Listen was created\n"))); + } + //Provides for DDS_StateListen + if (!this->statelisten_data_listener_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : DataListener of DDS_StateListen not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : DataListener of DDS_StateListen was created\n"))); + } + if (!this->statelisten_port_status_created_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Receiver : PortStatusListener of DDS_StateListen not created\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Receiver : PortStatusListener of DDS_StateListen was created\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.h new file mode 100644 index 00000000000..55c7cc0ec50 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Receiver/State_Connection_Test_Receiver_exec.h @@ -0,0 +1,119 @@ +// -*- C++ -*- +// $Id$ + +#ifndef STATE_CONNECTION_RECEIVER_EXEC_H_ +#define STATE_CONNECTION_RECEIVER_EXEC_H_ + +#include "State_Connection_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_State_Connection_Test_Receiver_Impl +{ + 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); + + // Port operations. + //Provides for DDS_Read + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_read_status (void); + //Provides for DDS_Get + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_get_status (void); + //Provides for DDS_Listen + virtual ::CCM_DDS::State_ConnectionTest::CCM_Listener_ptr + get_info_listen_data_listener (); + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_listen_status (void); + //Provides for DDS_StateListen + virtual ::CCM_DDS::State_ConnectionTest::CCM_StateListener_ptr + get_info_statelisten_data_listener (void); + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_statelisten_status (void); + + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::State_Connection_Test::CCM_Receiver_Context_var context_; + //DDS_Read + ::CCM_DDS::State_ConnectionTest::Reader_var reader_data_; + ::DDS::DataReader_var reader_dds_entity_; + + //DDS_Get + ::CCM_DDS::State_ConnectionTest::Reader_var getter_data_; + ::CCM_DDS::State_ConnectionTest::Getter_var getter_fresh_data_; + ::DDS::DataReader_var getter_dds_entity_; + + //DDS_Listen + ::CCM_DDS::State_ConnectionTest::Reader_var listen_data_; + ::CCM_DDS::DataListenerControl_var listen_data_control_; + ::DDS::DataReader_var listen_dds_entity_; + + //DDS_StateListen + ::CCM_DDS::State_ConnectionTest::Reader_var statelisten_data_; + ::CCM_DDS::StateListenerControl_var statelisten_data_control_; + ::DDS::DataReader_var statelisten_dds_entity_; + + //DDS_Read + bool reader_data_ok_; + bool reader_dds_entity_ok_; + + //DDS_Get + bool getter_data_ok_; + bool getter_fresh_data_ok_; + bool getter_dds_entity_ok_; + + //DDS_Listen + bool listen_data_ok_; + bool listen_data_control_ok_; + bool listen_dds_entity_ok_; + + //DDS_StateListen + bool statelisten_data_ok_; + bool statelisten_data_control_ok_; + bool statelisten_dds_entity_ok_; + + //Provides for DDS_Read + bool reader_port_status_created_; + + //Provides for DDS_Get + bool getter_port_status_created_; + + //Provides for DDS_Listen + bool listen_data_listener_created_; + bool listen_port_status_created_; + + //Provides for DDS_StateListen + bool statelisten_data_listener_created_; + bool statelisten_port_status_created_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl new file mode 100644 index 00000000000..6fdd94e698c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_STATE_CONNECTION_TEST_SENDER_IDL +#define DDS_STATE_CONNECTION_TEST_SENDER_IDL + +#include "Connector/State_Connection_Test_Connector.idl" + +module State_Connection_Test +{ + component Sender + { + port CCM_DDS::State_ConnectionTest::DDS_Update info_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc new file mode 100644 index 00000000000..97b11af7e00 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_SCT_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_SCT_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_SCT_Connector_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 { + State_Connection_Test_Sender.idl + } +} + +project(DDS_SCT_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_SCT_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 { + State_Connection_Test_SenderE.idl + } +} + +project(DDS_SCT_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_SCT_Sender_lem_gen DDS_SCT_Sender_stub DDS_SCT_Base_stub + libs += DDS_SCT_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderEC.cpp + } + + Header_Files { + State_Connection_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + State_Connection_Test_SenderEC.inl + } +} + +project(DDS_SCT_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_SCT_Sender_idl_gen DDS_SCT_Base_stub DDS_SCT_Connector_stub + libs += DDS_SCT_Base_stub DDS_SCT_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderC.cpp + } + + Header_Files { + State_Connection_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + State_Connection_Test_SenderC.inl + } +} + +project(DDS_SCT_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_SCT_Sender_lem_stub DDS_SCT_Sender_stub DDS_SCT_Connector_lem_stub DDS_SCT_Connector_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_SCT_Base_stub DDS_SCT_Connector_lem_stub DDS_SCT_Connector_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_Sender_exec.cpp + } + + Header_Files { + State_Connection_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_SCT_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_SCT_Base_stub DDS_SCT_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SCT_Connector_stub DDS_SCT_Connector_svnt DDS_SCT_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_SCT_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_SCT_Connector_stub DDS_SCT_Connector_svnt DDS_SCT_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + State_Connection_Test_SenderS.cpp + State_Connection_Test_Sender_svnt.cpp + } + + Header_Files { + State_Connection_Test_SenderS.h + State_Connection_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + State_Connection_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp new file mode 100644 index 00000000000..8c7b8d82c1a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.cpp @@ -0,0 +1,100 @@ +// -*- C++ -*- +// $Id$ + +#include "State_Connection_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_State_Connection_Test_Sender_Impl +{ + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : updater_ok_ (false), + updater_dds_datawriter_ok_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = + ::State_Connection_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_ = + this->context_->get_connection_info_update_data (); + if (! ::CORBA::is_nil (this->updater_)) + { + this->updater_ok_ = true; + } + this->updater_dds_datawriter_ = + this->context_->get_connection_info_update_dds_entity (); + if (! ::CORBA::is_nil (this->updater_dds_datawriter_)) + { + this->updater_dds_datawriter_ok_ = true; + } + } + + void + Sender_exec_i::ccm_activate (void) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if (!this->updater_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : get updater failed\n"))); + } + else + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Sender : Get updater passed\n"))); + } + if (!this->updater_dds_datawriter_ok_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Sender : Get dds writer for DDS_Updater failed\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender : Get dds writer for DDS_Updater passed\n"))); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h new file mode 100644 index 00000000000..3835b874c21 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/Sender/State_Connection_Test_Sender_exec.h @@ -0,0 +1,52 @@ +// -*- C++ -*- +// $Id$ + +#ifndef STATE_CONNECTION_SENDER_EXEC_H_ +#define STATE_CONNECTION_SENDER_EXEC_H_ + + +#include "State_Connection_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_State_Connection_Test_Sender_Impl +{ + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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: + ::State_Connection_Test::CCM_Sender_Context_var context_; + CCM_DDS::State_ConnectionTest::Updater_var updater_; + DDS::DataWriter_var updater_dds_datawriter_; + + bool updater_ok_; + bool updater_dds_datawriter_ok_; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_State_Connection_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/descriptors/Plan.cdp new file mode 100644 index 00000000000..a601edd7010 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/descriptors/Plan.cdp @@ -0,0 +1,644 @@ +<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>State_Connection_Test_Depl_1</label> + <UUID>State_Connection_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_State_Connection_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_State_Connection_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="State_Connection_Test_ConnectorComponentImplementation"> + <name>State_Connection_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="State_Connection_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="State_Connection_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_State_Connection_Test_State_Connection_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_State_Connection_Test_State_Connection_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>State_Connection_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>State_Connection_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_State_Connection_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_State_Connection_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="State_Connection_Test_ConnectorComponentInstance"> + <name>State_Connection_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="State_Connection_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>State_Connection_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="State_Connection_Test_ConnectorComponentInstance2"> + <name>State_Connection_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="State_Connection_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>State_Connection_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <!-- SENDER COMPONENT CONNECTIONS --> + <connection> + <name>update_data</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="State_Connection_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <connection> + <name>update_dds_entity</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_update_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>observable_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- RECEIVER COMPONENT CONNECTIONS --> + <!-- DDS_Get port --> + <connection> + <name>get_data_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>get_fresh_data_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>get_dds_entity_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <!-- DDS_Get mirrorport --> + <connection> + <name>get_status_mirrorport</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_get_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <!-- DDS_Read port --> + <connection> + <name>read_data_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_read_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>read_dds_entity_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_read_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <!-- DDS_Read mirrorport --> + <connection> + <name>read_status_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_read_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <!-- DDS_Listen port --> + <connection> + <name>listen_data_port</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_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>listen_data_control_port</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_observer_data_control</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>listen_dds_entity_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <!-- DDS_Listen mirrorport --> + <connection> + <name>listen_data_listener_port</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_observer_data_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>listen_status_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_listen_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <!-- DDS_StateListen port --> + <connection> + <name>statelisten_data_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_statelisten_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>statelisten_data_control_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_statelisten_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>statelisten_dds_entity_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_statelisten_dds_entity</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_dds_entity</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <!-- DDS_Listen mirrorport --> + <connection> + <name>statelisten_data_listener_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_statelisten_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="State_Connection_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>statelisten_status_port</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_statelisten_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="State_Connection_Test_ConnectorComponentInstance2" /> + </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="State_Connection_Test_Connector_ExecArtifact"> + <name>State_Connection_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_SCT_Connector_exec</location> + </artifact> + <artifact xmi:id="State_Connection_Test_Connector_SvntArtifact"> + <name>State_Connection_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_SCT_Connector_svnt</location> + </artifact> + <artifact xmi:id="State_Connection_Test_Connector_StubArtifact"> + <name>State_Connection_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_SCT_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/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/descriptors/run_test.pl new file mode 100755 index 00000000000..5d0ab35419d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/State_Connection_Test/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/Time_Conversion.mpc b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/Time_Conversion.mpc new file mode 100644 index 00000000000..19cf287fe67 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/Time_Conversion.mpc @@ -0,0 +1,9 @@ +// $Id$ + +project(DDS_TimeConversion) : taoexe, dds4ccm_base { + includes += $(CIAO_ROOT) + exename = TimeConversion + Source_Files { + time_conversion.cpp + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/run_test.pl new file mode 100755 index 00000000000..bd6bc129d77 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/run_test.pl @@ -0,0 +1,25 @@ +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; + +my $program = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; + +$PROG = $program->CreateProcess ("TimeConversion", ""); +$program_status = $PROG->Spawn (); + +if ($program_status != 0) { + print STDERR "ERROR: TimeConversion returned $program_status\n"; + exit 1; +} + +sleep ($program->ProcessStartWaitInterval()); + +$program_status = $PROG->Kill (); + +exit 0; diff --git a/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/time_conversion.cpp b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/time_conversion.cpp new file mode 100644 index 00000000000..338ad6e0d52 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TimeConversion/time_conversion.cpp @@ -0,0 +1,86 @@ +// $Id$ + +#include "dds4ccm/impl/dds/TimeUtilities.h" +#include "ace/OS_NS_sys_time.h" + +int +ACE_TMAIN(int , ACE_TCHAR **) +{ + try + { + ::DDS::Time_t dds_time; + ACE_Time_Value ace_time = ACE_OS::gettimeofday (); + + dds_time <<= ace_time; + if (dds_time.sec != ace_time.sec ()) + { + ACE_ERROR ((LM_ERROR, "ERROR : TimeConversion - Conversion from " + "ACE_Time_Value to DDS::Time_t " + "seconds expected <%u> - seconds found <%u>\n", + ace_time.sec (), dds_time.sec)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "TimeConversion - Conversion from " + "ACE_Time_Value to DDS::Time_t " + "regarding seconds succeeded\n")); + } + if (dds_time.nanosec / 1000 != static_cast <CORBA::ULong>(ace_time.usec ())) + { + ACE_ERROR ((LM_ERROR, "ERROR : TimeConversion - Conversion from " + "ACE_Time_Value to DDS::Time_t " + "micro seconds expected <%u> - micro seconds found <%u>\n", + ace_time.usec (), dds_time.nanosec/1000)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "TimeConversion - Conversion from " + "ACE_Time_Value to DDS::Time_t " + "regarding micro seconds succeeded\n")); + } + + ::DDS::Time_t dds_now; + ACE_Time_Value ace_now = ACE_OS::gettimeofday (); + dds_now <<= ace_now; + //create real nanoseconds. + dds_now.nanosec = 1234567890; + ace_time <<= dds_now; + + if (ace_time.sec () != dds_now.sec) + { + ACE_ERROR ((LM_ERROR, "ERROR : TimeConversion - Conversion from " + "DDS::Time_t to ACE_Time_Value " + "seconds expected <%u> - seconds found <%u>\n", + dds_now.sec, ace_time.sec ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "TimeConversion - Conversion from " + "DDS::Time_t to ACE_Time_Value " + "regarding seconds succeeded\n")); + } + // The resolution of an ACE_Time_Value is less than the resolution of a + // DDS::Time_T. Therefor don't multiply ace_time.usec by 1000 but devide + // dds_time.nanosec by 1000. + if (static_cast<CORBA::ULong>(ace_time.usec ()) != dds_now.nanosec/1000) + { + ACE_ERROR ((LM_ERROR, "ERROR : TimeConversion - Conversion from " + "DDS::Time_t to ACE_Time_Value " + "nano seconds expected <%u> - nano seconds found <%u>\n", + dds_now.nanosec/1000, ace_time.usec ())); + } + else + { + ACE_DEBUG ((LM_DEBUG, "TimeConversion - Conversion from " + "DDS::Time_t to ACE_Time_Value " + "regarding nano seconds succeeded\n")); + } + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.idl new file mode 100644 index 00000000000..431b831632b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file TwoTopics_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef TWOTOPICS_BASE_IDL +#define TWOTOPICS_BASE_IDL + +#pragma ndds typesupport "Base/TwoTopics_BaseSupport.h" + +struct HelloTopic { + string hello; //@key + long iteration; +}; +typedef sequence<HelloTopic> HelloTopicSeq; + +struct GoodbyeTopic { + string goodbye; //@key + long iteration; +}; +typedef sequence<GoodbyeTopic> GoodbyeTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.mpc new file mode 100755 index 00000000000..2046f252b05 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Base/TwoTopics_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_TwoTopics_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_TwoTopics_Base_stub + dynamicflags += TWOTOPICS_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=TWOTOPICS_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=TwoTopics_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + TwoTopics_Base.idl + } + + opendds_ts_flags += --export=TWOTOPICS_TEST_BASE_STUB_Export + + DDSGenerator_Files { + TwoTopics_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.idl new file mode 100644 index 00000000000..766783208bf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.idl @@ -0,0 +1,31 @@ +// $Id$ + +/** + * @file TwoTopics_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef TWOTOPICS_CONNECTOR_IDL_ +#define TWOTOPICS_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/TwoTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/TwoTopics_ConnectorE.idl" +#pragma ndds typesupport "Base/TwoTopics_BaseSupport.h" + +module TT_Connector +{ + module ::CCM_DDS::Typed < HelloTopic, HelloTopicSeq> HelloConn; + connector TwoTopicsHello_Connector : HelloConn::DDS_Event + { + }; + + module ::CCM_DDS::Typed < GoodbyeTopic, GoodbyeTopicSeq> GoodbyeConn; + connector TwoTopicsGoodbye_Connector : GoodbyeConn::DDS_Event + { + }; +}; + +#endif /* TWOTOPICS_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.mpc new file mode 100755 index 00000000000..e5c8961f372 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopics/Connector/TwoTopics_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_TwoTopics_Base -l .. -o ../lib -u DDS TwoTopics_Connector" + +project(DDS_TwoTopics_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=TWOTOPICS_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=TwoTopics_Connector_stub_export.h \ + -Wb,skel_export_macro=TWOTOPICS_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=TwoTopics_Connector_svnt_export.h \ + -Wb,svnt_export_macro=TWOTOPICS_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=TwoTopics_Connector_svnt_export.h \ + -Wb,conn_export_macro=TWOTOPICS_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=TwoTopics_Connector_conn_export.h \ + -I .. + + IDL_Files { + TwoTopics_Connector.idl + } +} + +project(DDS_TwoTopics_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_TwoTopics_Connector_idl_gen + idlflags += -Wb,stub_export_macro=TWOTOPICS_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=TwoTopics_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + TwoTopics_ConnectorE.idl + } +} + +project(DDS_TwoTopics_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_TwoTopics_Connector_lem_gen DDS_TwoTopics_Connector_stub DDS_TwoTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_TwoTopics_Base_stub DDS_TwoTopics_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_TwoTopics_Connector_lem_stub + dynamicflags = TWOTOPICS_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + TwoTopics_ConnectorEC.cpp + } + + Header_Files { + TwoTopics_ConnectorEC.h + TwoTopics_Connector_lem_stub_export.h + } + + Inline_Files { + TwoTopics_ConnectorEC.inl + } +} + +project(DDS_TwoTopics_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_TwoTopics_Connector_idl_gen DDS_TwoTopics_Base_stub + libs += DDS_TwoTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_TwoTopics_Connector_stub + dynamicflags = TWOTOPICS_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + TwoTopics_ConnectorC.cpp + } + + Header_Files { + TwoTopics_ConnectorC.h + TwoTopics_Connector_stub_export.h + } + + Inline_Files { + TwoTopics_ConnectorC.inl + } +} + +project(DDS_TwoTopics_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_TwoTopics_Connector_lem_stub DDS_TwoTopics_Connector_stub DDS4CCM_lem_stub DDS_TwoTopics_Base_stub + sharedname = DDS_TwoTopics_Connector_exec + libs += DDS_TwoTopics_Connector_stub DDS_TwoTopics_Connector_lem_stub DDS_TwoTopics_Base_stub DDS4CCM_lem_stub DDS_TwoTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = TWOTOPICS_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + TwoTopics_Connector_conn.cpp + } + + Header_Files { + TwoTopics_Connector_conn.h + TwoTopics_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_TwoTopics_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_TwoTopics_Connector_lem_stub DDS_TwoTopics_Connector_exec DDS_TwoTopics_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_TwoTopics_Connector_svnt + libs += DDS_TwoTopics_Connector_stub \ + DDS_TwoTopics_Connector_lem_stub \ + DDS_TwoTopics_Base_stub \ + DDS_TwoTopics_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = TWOTOPICS_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + TwoTopics_ConnectorS.cpp + TwoTopics_Connector_svnt.cpp + } + + Header_Files { + TwoTopics_ConnectorS.h + TwoTopics_Connector_svnt.h + TwoTopics_Connector_svnt_export.h + } + + Inline_Files { + TwoTopics_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.idl new file mode 100644 index 00000000000..e873178dd86 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.idl @@ -0,0 +1,66 @@ +// $Id$ + +/** + * @file Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef CONNECTOR_IDL_ +#define CONNECTOR_IDL_ + +#include <Components.idl> +#include "Hello/HelloGoodbye.idl" +#include "Goodbye/HelloGoodbye.idl" + +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/ConnectorE.idl" +#pragma ndds typesupport "Hello/HelloGoodbyeSupport.h" +#pragma ndds typesupport "Goodbye/HelloGoodbyeSupport.h" + +module Hello +{ + // Hello connector + module ::CCM_DDS::Typed < HelloGoodbye, HelloGoodbyeSeq> HelloConn; + connector Hello_Connector : HelloConn::DDS_Event + { + }; +}; + +module Goodbye +{ + // Goodbye connector + module ::CCM_DDS::Typed < HelloGoodbye, HelloGoodbyeSeq> GoodbyeConn; + connector Goodbye_Connector : GoodbyeConn::DDS_Event + { + }; +}; + +module HelloGoodbye +{ + // Hello connector + module ::CCM_DDS::Typed < ::Hello::HelloGoodbye, ::Hello::HelloGoodbyeSeq> HelloConn; + connector Hello_Connector : HelloConn::DDS_Event + { + }; + + // Goodbye connector + module ::CCM_DDS::Typed < ::Goodbye::HelloGoodbye, ::Goodbye::HelloGoodbyeSeq> GoodbyeConn; + connector Goodbye_Connector : GoodbyeConn::DDS_Event + { + }; +}; + +// Hello connector +module ::CCM_DDS::Typed < ::Hello::HelloGoodbye, ::Hello::HelloGoodbyeSeq> HelloConn; +connector Hello_Connector : HelloConn::DDS_Event +{ +}; + +// Goodbye connector +module ::CCM_DDS::Typed < ::Goodbye::HelloGoodbye, ::Goodbye::HelloGoodbyeSeq> GoodbyeConn; +connector Goodbye_Connector : GoodbyeConn::DDS_Event +{ +}; + +#endif /* CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.mpc new file mode 100644 index 00000000000..38666186695 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Connector/Connector.mpc @@ -0,0 +1,158 @@ +// $Id$ + +project(DDS_TTDN_Connector_idl_gen) : connectoridldefaults, dds4ccm { + requires += dummy_label + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=TWOTOPICSDIFFERENTNS_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Connector_stub_export.h \ + -Wb,skel_export_macro=TWOTOPICSDIFFERENTNS_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Connector_svnt_export.h \ + -Wb,svnt_export_macro=TWOTOPICSDIFFERENTNS_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Connector_svnt_export.h \ + -Wb,conn_export_macro=TWOTOPICSDIFFERENTNS_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Connector_conn_export.h \ + -I .. + + IDL_Files { + Connector.idl + } +} + +project(DDS_TTDN_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + requires += dummy_label + custom_only = 1 + after += DDS_TTDN_Connector_idl_gen + idlflags += -Wb,stub_export_macro=TWOTOPICSDIFFERENTNS_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + ConnectorE.idl + } +} + +project(DDS_TTDN_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + requires += dummy_label + after += DDS_TTDN_Connector_lem_gen DDS_TTDN_Connector_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub \ + DDS4CCM_lem_stub + libs += DDS_Connector_stub DDS4CCM_lem_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector_lem_stub + dynamicflags = TWOTOPICSDIFFERENTNS_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorEC.cpp + } + + Header_Files { + ConnectorEC.h + Connector_lem_stub_export.h + } + + Inline_Files { + ConnectorEC.inl + } +} + +project(DDS_TTDN_Connector_stub) : ccm_stub, dds4ccm_base { + requires += dummy_label + after += DDS_TTDN_Connector_idl_gen \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub + libs += DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Connector_stub + dynamicflags = TWOTOPICSDIFFERENTNS_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorC.cpp + } + + Header_Files { + ConnectorC.h + Connector_stub_export.h + } + + Inline_Files { + ConnectorC.inl + } +} + +project(DDS_TTDN_Connector_exec) : ciao_executor, dds4ccm_impl { + requires += dummy_label + after += DDS_TTDN_Connector_lem_stub DDS_TTDN_Connector_stub DDS4CCM_lem_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub + libs += DDS_Connector_stub DDS_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub + sharedname = DDS_Connector_exec + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = TWOTOPICSDIFFERENTNS_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Connector_conn.cpp + } + + Header_Files { + Connector_conn.h + Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_TTDN_Connector_svnt) : ciao_servant, dds4ccm_impl { + requires += dummy_label + after += DDS_TTDN_Connector_lem_stub DDS_TTDN_Connector_exec \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub \ + DDS_TTDN_Connector_stub DDS4CCM_lem_stub + libs += DDS_Connector_stub \ + DDS_Connector_lem_stub \ + DDS_Goodbye_Namespace_Base_stub DDS_Hello_Namespace_Base_stub \ + DDS_Connector_exec \ + DDS4CCM_lem_stub + sharedname = DDS_Connector_svnt + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = TWOTOPICSDIFFERENTNS_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ConnectorS.cpp + Connector_svnt.cpp + } + + Header_Files { + ConnectorS.h + Connector_svnt.h + Connector_svnt_export.h + } + + Inline_Files { + ConnectorS.inl + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.idl b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.idl new file mode 100644 index 00000000000..1db39cdf666 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.idl @@ -0,0 +1,20 @@ +// $Id$ + +/** + * @file HelloGoodbye.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef GOODBYE_IDL_ +#define GOODBYE_IDL_ + +module Goodbye +{ + struct HelloGoodbye { + string goodbye; //@key + long iteration; + }; + typedef sequence<HelloGoodbye> HelloGoodbyeSeq; +}; + +#endif /* GOODBYE_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.mpc b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.mpc new file mode 100644 index 00000000000..b4c18b66c2d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Goodbye/HelloGoodbye.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Goodbye_Namespace_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Goodbye_Namespace_Base_stub + dynamicflags += GOODBYE_NAMESPACE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=GOODBYE_NAMESPACE_STUB_Export \ + -Wb,stub_export_include=Goodbye_stub_export.h + + IDL_Files { + idlflags += -Gxhst + HelloGoodbye.idl + } + + opendds_ts_flags += --export=GOODBYE_NAMESPACE_STUB_Export + + DDSGenerator_Files { + HelloGoodbye.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.idl b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.idl new file mode 100644 index 00000000000..ca1336f2f29 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file HelloGoodbye.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef HELLO_IDL_ +#define HELLO_IDL_ + +module Hello +{ + struct HelloGoodbye { + string hello; //@key + long iteration; + }; + typedef sequence<HelloGoodbye> HelloGoodbyeSeq; +}; + + +#endif /* HELLO_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.mpc b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.mpc new file mode 100644 index 00000000000..7bfd2ea596a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/TwoTopicsDifferentNs/Hello/HelloGoodbye.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Hello_Namespace_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Hello_Namespace_Base_stub + dynamicflags += HELLO_NAMESPACE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=HELLO_NAMESPACE_STUB_Export \ + -Wb,stub_export_include=Hello_stub_export.h + + IDL_Files { + idlflags += -Gxhst + HelloGoodbye.idl + } + + opendds_ts_flags += --export=HELLO_NAMESPACE_STUB_Export + + DDSGenerator_Files { + HelloGoodbye.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.idl new file mode 100644 index 00000000000..03b2b1d664b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Unkeyed_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef UNKEYED_TEST_BASE_IDL +#define UNKEYED_TEST_BASE_IDL + +#pragma ndds typesupport "Base/Unkeyed_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "UnkeyedTest" +#pragma DCPS_DATA_KEY "UnkeyedTest key" + +struct UnkeyedTest { + string key; + long iteration; +}; + +typedef sequence<UnkeyedTest> UnkeyedTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.mpc new file mode 100644 index 00000000000..51a38f0973b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Base/Unkeyed_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Unkeyed_Test_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Unkeyed_Test_Base_stub + dynamicflags += UNKEYED_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=UNKEYED_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=Unkeyed_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Unkeyed_Test_Base.idl + } + + opendds_ts_flags += --export=UNKEYED_TEST_BASE_STUB_Export + + DDSGenerator_Files { + Unkeyed_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.idl new file mode 100644 index 00000000000..d59543e6501 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Unkeyed_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef UNKEYED_TEST_CONNECTOR_IDL_ +#define UNKEYED_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Unkeyed_Test_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Unkeyed_Test_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::UnkeyedTest, ::UnkeyedTestSeq> UnkeyedTest; +}; + +module Unkeyed_Test +{ + connector Unkeyed_Test_Connector : ::CCM_DDS::UnkeyedTest::DDS_Event + { + }; +}; + +#endif /* Unkeyed_Test_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.mpc new file mode 100644 index 00000000000..1953801f39b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Connector/Unkeyed_Test_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Unkeyed_Test_Base -l .. -o ../lib -u DDS Unkeyed_Test_Connector" + +project(DDS_Unkeyed_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=UNKEYED_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Unkeyed_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=UNKEYED_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Unkeyed_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=UNKEYED_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Unkeyed_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=UNKEYED_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Unkeyed_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + Unkeyed_Test_Connector.idl + } +} + +project(DDS_Unkeyed_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Unkeyed_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=UNKEYED_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Unkeyed_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Unkeyed_Test_ConnectorE.idl + } +} + +project(DDS_Unkeyed_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Unkeyed_Test_Connector_lem_gen DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Base_stub DDS4CCM_lem_stub + libs += DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Unkeyed_Test_Connector_lem_stub + dynamicflags = UNKEYED_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ConnectorEC.cpp + } + + Header_Files { + Unkeyed_Test_ConnectorEC.h + Unkeyed_Test_Connector_lem_stub_export.h + } + + Inline_Files { + Unkeyed_Test_ConnectorEC.inl + } +} + +project(DDS_Unkeyed_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_Unkeyed_Test_Connector_idl_gen DDS_Unkeyed_Test_Base_stub + libs += DDS_Unkeyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Unkeyed_Test_Connector_stub + dynamicflags = UNKEYED_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ConnectorC.cpp + } + + Header_Files { + Unkeyed_Test_ConnectorC.h + Unkeyed_Test_Connector_stub_export.h + } + + Inline_Files { + Unkeyed_Test_ConnectorC.inl + } +} + +project(DDS_Unkeyed_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_Unkeyed_Test_Connector_lem_stub DDS_Unkeyed_Test_Connector_stub DDS4CCM_lem_stub DDS_Unkeyed_Test_Base_stub + sharedname = DDS_Unkeyed_Test_Connector_exec + libs += DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_lem_stub DDS_Unkeyed_Test_Base_stub DDS4CCM_lem_stub DDS_Unkeyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = UNKEYED_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_Connector_conn.cpp + } + + Header_Files { + Unkeyed_Test_Connector_conn.h + Unkeyed_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_Unkeyed_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_Unkeyed_Test_Connector_lem_stub DDS_Unkeyed_Test_Connector_exec DDS_Unkeyed_Test_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Unkeyed_Test_Connector_svnt + libs += DDS_Unkeyed_Test_Connector_stub \ + DDS_Unkeyed_Test_Connector_lem_stub \ + DDS_Unkeyed_Test_Base_stub \ + DDS_Unkeyed_Test_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = UNKEYED_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ConnectorS.cpp + Unkeyed_Test_Connector_svnt.cpp + } + + Header_Files { + Unkeyed_Test_ConnectorS.h + Unkeyed_Test_Connector_svnt.h + Unkeyed_Test_Connector_svnt_export.h + } + + Inline_Files { + Unkeyed_Test_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/README b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/README new file mode 100644 index 00000000000..c7b52e154a0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/README @@ -0,0 +1,6 @@ +# $Id$ + +UnkeyedSamples consists of a Sender and a Receiver. +The Sender writes samples unkeyed; the Receiver should +receive the same number of samples. An error is printed +when this isn't the case.
\ No newline at end of file diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.idl new file mode 100644 index 00000000000..1729bbe238f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Unkeyed_Test_Connector.idl" + +module Unkeyed_Test +{ + component Receiver + { + port CCM_DDS::UnkeyedTest::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener info_out_connector_status; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.mpc new file mode 100644 index 00000000000..3828155ff07 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_Unkeyed_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_Unkeyed_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 { + Unkeyed_Test_Receiver.idl + } +} + +project(DDS_Unkeyed_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Unkeyed_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 { + Unkeyed_Test_ReceiverE.idl + } +} + +project(DDS_Unkeyed_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Unkeyed_Test_Receiver_lem_gen DDS_Unkeyed_Test_Receiver_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Base_stub + libs += Receiver_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ReceiverEC.cpp + } + + Header_Files { + Unkeyed_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Unkeyed_Test_ReceiverEC.inl + } +} + +project(DDS_Unkeyed_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_Unkeyed_Test_Receiver_idl_gen DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_lem_gen + libs += DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ReceiverC.cpp + } + + Header_Files { + Unkeyed_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Unkeyed_Test_ReceiverC.inl + } +} + +project(DDS_Unkeyed_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_Unkeyed_Test_Receiver_lem_stub DDS_Unkeyed_Test_Receiver_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_Receiver_exec.cpp + } + + Header_Files { + Unkeyed_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Unkeyed_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Unkeyed_Test_Receiver_lem_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_svnt DDS_Unkeyed_Test_Receiver_exec DDS_Unkeyed_Test_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_svnt Receiver_exec DDS_Unkeyed_Test_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_ReceiverS.cpp + Unkeyed_Test_Receiver_svnt.cpp + } + + Header_Files { + Unkeyed_Test_ReceiverS.h + Unkeyed_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Unkeyed_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..6fc273d1eae --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.cpp @@ -0,0 +1,224 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Unkeyed_Test_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" + +namespace CIAO_Unkeyed_Test_Receiver_Impl +{ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i () + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /* the_topic */, + const DDS::InconsistentTopicStatus & /* status */) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_inconsistent_topic\n"))); + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_requested_incompatible_qos\n"))); + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_sample_rejected\n"))); + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_offered_deadline_missed\n"))); + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_offered_incompatible_qos\n"))); + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr /*the_entity*/, + ::DDS::StatusKind /*status_kind*/) + { + ACE_ERROR ((LM_DEBUG, ACE_TEXT ("Receiver: ") + ACE_TEXT ("ConnectorStatusListener_exec_i::on_unexpected_status\n"))); + } + + //============================================================ + // Facet Executor Implementation Class: UnkeyedTest_Listener_exec_i + //============================================================ + + UnkeyedTest_Listener_exec_i::UnkeyedTest_Listener_exec_i (Atomic_ULong &received) + : received_ (received) + { + } + + UnkeyedTest_Listener_exec_i::~UnkeyedTest_Listener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::UnkeyedTest_Listener + + void + UnkeyedTest_Listener_exec_i::on_one_data ( + const UnkeyedTest & an_instance , + const ::CCM_DDS::ReadInfo & info) + { + ++this->received_; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("UnkeyedTest_Listener: ") + ACE_TEXT ("received keyed_test_info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.iteration)); + if (info.instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: UnkeyedTest_Listener::on_one_data: ") + ACE_TEXT ("received instance handle should be invalid ") + ACE_TEXT ("for unkeyed data ") + ACE_TEXT ("key <%C> - iteration <%u>\n"), + an_instance.key.in (), + an_instance.iteration)); + } + if (info.source_timestamp.sec == 0 && + info.source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: UnkeyedTest_Listener::on_one_data: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.iteration)); + } + } + + void + UnkeyedTest_Listener_exec_i::on_many_data ( + const UnkeyedTestSeq & /* an_instance */, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + } + + //============================================================ + // Component Executor Implementation Class: Receiver_exec_iUnkeyedTest_Listener_exec_i (); + //============================================================ + + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (10), + received_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + // Port operations. + ::CCM_DDS::UnkeyedTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new UnkeyedTest RAW listener\n"))); + return new UnkeyedTest_Listener_exec_i (this->received_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_info_out_connector_status (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new Connector Status Listener\n"))); + return new ConnectorStatusListener_exec_i (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Unkeyed_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) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::ONE_BY_ONE); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + ACE_DEBUG ((LM_INFO, "Receiver_exec_i summary: received <%u>\n", + this->received_.value ())); + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Unkeyed_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.h new file mode 100644 index 00000000000..426ca0a9428 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Receiver/Unkeyed_Test_Receiver_exec.h @@ -0,0 +1,118 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Unkeyed_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_Unkeyed_Test_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::ULong > Atomic_ULong; + + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual void + on_inconsistent_topic( ::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual void + on_requested_incompatible_qos( ::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual void + on_sample_rejected( ::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual void + on_offered_deadline_missed( ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual void + on_offered_incompatible_qos( ::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual void on_unexpected_status( ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + }; + + class RECEIVER_EXEC_Export UnkeyedTest_Listener_exec_i + : public virtual ::CCM_DDS::UnkeyedTest::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + UnkeyedTest_Listener_exec_i (Atomic_ULong &); + virtual ~UnkeyedTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const UnkeyedTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const UnkeyedTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + Atomic_ULong &received_; + }; + + 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); + + // Component attributes. + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + // Port operations. + virtual ::CCM_DDS::UnkeyedTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_info_out_connector_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::Unkeyed_Test::CCM_Receiver_Context_var context_; + ::CCM_DDS::UnkeyedTest::Reader_var reader_; + ::CCM_DDS::UnkeyedTest::Getter_var getter_; + + CORBA::UShort iterations_; + Atomic_ULong received_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Unkeyed_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.idl new file mode 100644 index 00000000000..a75a12c8e54 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_KEYED_TEST_SENDER_IDL +#define DDS_KEYED_TEST_SENDER_IDL + +#include "Connector/Unkeyed_Test_Connector.idl" + +module Unkeyed_Test +{ + component Sender + { + port CCM_DDS::UnkeyedTest::DDS_Write info_write; + attribute unsigned short rate; + attribute unsigned short iterations; + attribute unsigned short keys; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.mpc new file mode 100644 index 00000000000..547001eafca --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Unkeyed_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_Unkeyed_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_Unkeyed_Test_Connector_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 { + Unkeyed_Test_Sender.idl + } +} + +project(DDS_Unkeyed_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Unkeyed_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 { + Unkeyed_Test_SenderE.idl + } +} + +project(DDS_Unkeyed_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Unkeyed_Test_Sender_lem_gen DDS_Unkeyed_Test_Sender_stub DDS_Unkeyed_Test_Base_stub + libs += DDS_Unkeyed_Test_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_SenderEC.cpp + } + + Header_Files { + Unkeyed_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Unkeyed_Test_SenderEC.inl + } +} + +project(DDS_Unkeyed_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_Unkeyed_Test_Sender_idl_gen DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub + libs += DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_SenderC.cpp + } + + Header_Files { + Unkeyed_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Unkeyed_Test_SenderC.inl + } +} + +project(DDS_Unkeyed_Test_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_Unkeyed_Test_Sender_lem_stub DDS_Unkeyed_Test_Sender_stub DDS_Unkeyed_Test_Connector_lem_stub DDS_Unkeyed_Test_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Connector_lem_stub DDS_Unkeyed_Test_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_Sender_exec.cpp + } + + Header_Files { + Unkeyed_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Unkeyed_Test_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Unkeyed_Test_Base_stub DDS_Unkeyed_Test_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_svnt DDS_Unkeyed_Test_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_Unkeyed_Test_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Unkeyed_Test_Connector_stub DDS_Unkeyed_Test_Connector_svnt DDS_Unkeyed_Test_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Unkeyed_Test_SenderS.cpp + Unkeyed_Test_Sender_svnt.cpp + } + + Header_Files { + Unkeyed_Test_SenderS.h + Unkeyed_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Unkeyed_Test_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.cpp new file mode 100644 index 00000000000..780e4bf8350 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.cpp @@ -0,0 +1,214 @@ +// -*- C++ -*- +// $Id$ + +#include "Unkeyed_Test_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Unkeyed_Test_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : rate_ (1), + iterations_ (10), + keys_ (5) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + + void + Sender_exec_i::tick () + { + if (this->last_key != this->ktests_.end ()) + { + try + { + ++this->last_key->second->iteration; + this->writer_->write_one (this->last_key->second, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written key <%C> with <%d>\n"), + this->last_key->first.c_str (), + this->last_key->second->iteration)); + } + catch (const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Key info for <%C> not updated: <%C> didn't exist.\n"), + this->last_key->first.c_str (), this->last_key->first.c_str ())); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error while updating key info for <%C>.\n"), + this->last_key->first.c_str ())); + } + ++this->last_key; + } + else + { + //onto the next iteration + this->last_key = this->ktests_.begin (); + while (this->last_key != this->ktests_.end ()) + { + if (this->last_key->second->iteration == this->iterations_) + { + //next key + ++this->last_key; + } + else + { + break; + } + } + } + } + + void + Sender_exec_i::start (void) + { + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + ::CORBA::UShort + Sender_exec_i::rate (void) + { + return this->rate_; + } + + void + Sender_exec_i::rate (::CORBA::UShort rate) + { + this->rate_ = rate; + } + + ::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_ = + ::Unkeyed_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_info_write_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->start (); + + 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]; + UnkeyedTest *new_key = new UnkeyedTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 0; + + this->ktests_[key] = new_key; + } + this->last_key = this->ktests_.begin (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Unkeyed_Test_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.h new file mode 100644 index 00000000000..fb9d5a9bab8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/Sender/Unkeyed_Test_Sender_exec.h @@ -0,0 +1,90 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Unkeyed_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_Unkeyed_Test_Sender_Impl +{ + class Sender_exec_i; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_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 rate (void); + + virtual void rate (::CORBA::UShort rate); + + 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 tick (); + + private: + void start (void); + void stop (void); + + CCM_DDS::UnkeyedTest::Writer_var writer_; + + pulse_Generator * ticker_; + ::Unkeyed_Test::CCM_Sender_Context_var context_; + CORBA::UShort rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, UnkeyedTest_var> Unkeyed_Test_Table; + Unkeyed_Test_Table ktests_; + Unkeyed_Test_Table::iterator last_key; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Unkeyed_Test_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/descriptors/Plan.cdp new file mode 100644 index 00000000000..a8886179aec --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/descriptors/Plan.cdp @@ -0,0 +1,393 @@ +<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>Unkeyed_Test_Depl_1</label> + <UUID>Unkeyed_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_Unkeyed_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_Unkeyed_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="Unkeyed_Test_ConnectorComponentImplementation"> + <name>Unkeyed_Test_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Unkeyed_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="Unkeyed_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_Unkeyed_Test_Unkeyed_Test_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Unkeyed_Test_Unkeyed_Test_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Unkeyed_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Unkeyed_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_Unkeyed_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_Unkeyed_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>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <!-- Sender->keys * Sender->iterations --> + <ushort>30</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Unkeyed_Test_ConnectorComponentInstance"> + <name>Unkeyed_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Unkeyed_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Unkeyed_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Unkeyed_Test_ConnectorComponentInstance2"> + <name>Unkeyed_Test_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Unkeyed_Test_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Unkeyed_Test</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>rate</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>1</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>10</ushort> + </value> + </value> + </configProperty> + <configProperty> + <name>keys</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>3</ushort> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Unkeyed_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>_datacontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Unkeyed_Test_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>info_out_connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Unkeyed_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="Unkeyed_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="Unkeyed_Test_Connector_ExecArtifact"> + <name>Unkeyed_Test_Connector_exec</name> + <source/> + <node/> + <location>DDS_Unkeyed_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="Unkeyed_Test_Connector_SvntArtifact"> + <name>Unkeyed_Test_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Unkeyed_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="Unkeyed_Test_Connector_StubArtifact"> + <name>Unkeyed_Test_Connector_stub</name> + <source/> + <node/> + <location>DDS_Unkeyed_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/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/descriptors/run_test.pl new file mode 100755 index 00000000000..3ca8a0ee149 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedSamples/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (60); + +# 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/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.idl new file mode 100644 index 00000000000..938b96c382d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file Writer_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_BASE_IDL +#define WRITER_BASE_IDL + +#pragma ndds typesupport "Base/Writer_BaseSupport.h" + +typedef sequence<octet> OctetSeq; + +#pragma DCPS_DATA_TYPE "WriterTest" +#pragma DCPS_DATA_KEY "WriterTest key" + +struct WriterTest { + string key; + long iteration; + OctetSeq data; +}; + +typedef sequence<WriterTest> WriterTestSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.mpc new file mode 100644 index 00000000000..014070bbbab --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Base/Writer_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_UnkeyedWriterBase_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_UnkeyedWriterBase_stub + dynamicflags += WRITER_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=WRITER_BASE_STUB_Export \ + -Wb,stub_export_include=Writer_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Writer_Base.idl + } + + opendds_ts_flags += --export=WRITER_BASE_STUB_Export + + DDSGenerator_Files { + Writer_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.idl new file mode 100644 index 00000000000..a5894738606 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Writer_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef WRITER_CONNECTOR_IDL_ +#define WRITER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Writer_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Writer_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::WriterTest, ::WriterTestSeq> WriterTest; +}; + +module Writer +{ + connector Writer_Connector : ::CCM_DDS::WriterTest::DDS_Event + { + }; +}; + +#endif /* Writer_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.mpc new file mode 100644 index 00000000000..302e2adb3b8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Connector/Writer_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_UnkeyedWriterBase -l .. -o ../lib -u DDS Writer_Connector" + +project(DDS_UnkeyedWriterConnector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_stub_export.h \ + -Wb,skel_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Writer_Connector_svnt_export.h \ + -Wb,svnt_export_macro=WRITER_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Writer_Connector_svnt_export.h \ + -Wb,conn_export_macro=WRITER_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Writer_Connector_conn_export.h \ + -I .. + + IDL_Files { + Writer_Connector.idl + } +} + +project(DDS_UnkeyedWriterConnector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_UnkeyedWriterConnector_idl_gen + idlflags += -Wb,stub_export_macro=WRITER_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Writer_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Writer_ConnectorE.idl + } +} + +project(DDS_UnkeyedWriterConnector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_UnkeyedWriterConnector_lem_gen DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterBase_stub DDS4CCM_lem_stub + libs += DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_UnkeyedWriterConnector_lem_stub + dynamicflags = WRITER_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorEC.cpp + } + + Header_Files { + Writer_ConnectorEC.h + Writer_Connector_lem_stub_export.h + } + + Inline_Files { + Writer_ConnectorEC.inl + } +} + +project(DDS_UnkeyedWriterConnector_stub) : ccm_stub, dds4ccm_base { + after += DDS_UnkeyedWriterConnector_idl_gen DDS_UnkeyedWriterBase_stub + libs += DDS_UnkeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_UnkeyedWriterConnector_stub + dynamicflags = WRITER_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorC.cpp + } + + Header_Files { + Writer_ConnectorC.h + Writer_Connector_stub_export.h + } + + Inline_Files { + Writer_ConnectorC.inl + } +} + +project(DDS_UnkeyedWriterConnector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_UnkeyedWriterConnector_lem_stub DDS_UnkeyedWriterConnector_stub DDS4CCM_lem_stub DDS_UnkeyedWriterBase_stub + sharedname = DDS_UnkeyedWriterConnector_exec + libs += DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_lem_stub DDS_UnkeyedWriterBase_stub DDS4CCM_lem_stub DDS_UnkeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Connector_conn.cpp + } + + Header_Files { + Writer_Connector_conn.h + Writer_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_UnkeyedWriterConnector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_UnkeyedWriterConnector_lem_stub DDS_UnkeyedWriterConnector_exec DDS_UnkeyedWriterConnector_stub DDS4CCM_lem_stub + sharedname = DDS_UnkeyedWriterConnector_svnt + libs += DDS_UnkeyedWriterConnector_stub \ + DDS_UnkeyedWriterConnector_lem_stub \ + DDS_UnkeyedWriterBase_stub \ + DDS_UnkeyedWriterConnector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = WRITER_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ConnectorS.cpp + Writer_Connector_svnt.cpp + } + + Header_Files { + Writer_ConnectorS.h + Writer_Connector_svnt.h + Writer_Connector_svnt_export.h + } + + Inline_Files { + Writer_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.idl new file mode 100644 index 00000000000..e42f3efc798 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Receiver + { + port CCM_DDS::WriterTest::DDS_Listen info_out; + attribute unsigned short iterations; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.mpc new file mode 100644 index 00000000000..8a3f6f0f12f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_UnkeyedWriterReceiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_UnkeyedWriterConnector_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 { + Writer_Receiver.idl + } +} + +project(DDS_UnkeyedWriterReceiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_UnkeyedWriterReceiver_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 { + Writer_ReceiverE.idl + } +} + +project(DDS_UnkeyedWriterReceiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_UnkeyedWriterReceiver_lem_gen DDS_UnkeyedWriterReceiver_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterBase_stub + libs += Receiver_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverEC.cpp + } + + Header_Files { + Writer_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Writer_ReceiverEC.inl + } +} + +project(DDS_UnkeyedWriterReceiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_UnkeyedWriterReceiver_idl_gen DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_lem_gen + libs += DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterBase_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverC.cpp + } + + Header_Files { + Writer_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Writer_ReceiverC.inl + } +} + +project(DDS_UnkeyedWriterReceiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_UnkeyedWriterReceiver_lem_stub DDS_UnkeyedWriterReceiver_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Receiver_exec.cpp + } + + Header_Files { + Writer_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_UnkeyedWriterReceiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_UnkeyedWriterReceiver_lem_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_svnt DDS_UnkeyedWriterReceiver_exec DDS_UnkeyedWriterConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_svnt Receiver_exec DDS_UnkeyedWriterConnector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_ReceiverS.cpp + Writer_Receiver_svnt.cpp + } + + Header_Files { + Writer_ReceiverS.h + Writer_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Writer_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.cpp new file mode 100644 index 00000000000..fd1e853f12a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.cpp @@ -0,0 +1,157 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Writer_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" + +namespace CIAO_Writer_Receiver_Impl +{ + //============================================================ + // Facet Executor Implementation Class: WriterTest_Listener_exec_i + //============================================================ + + WriterTest_Listener_exec_i::WriterTest_Listener_exec_i (CORBA::UShort iterations) + : iterations_ (iterations) + { + } + + WriterTest_Listener_exec_i::~WriterTest_Listener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::WriterTest_Listener + + void + WriterTest_Listener_exec_i::on_one_data ( + const WriterTest & an_instance , + const ::CCM_DDS::ReadInfo & /* info */) + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("WriterTest_Listener::on_one_data ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance.key.in (), + an_instance.iteration)); + if (an_instance.iteration > this->iterations_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: received iteration ") + ACE_TEXT ("greater than expected : ") + ACE_TEXT ("expected <%u> - received <%u>\n"), + an_instance.iteration, this->iterations_)); + } + if (an_instance.iteration == 0) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: received iteration ") + ACE_TEXT ("is zero\n"))); + } + } + + void + WriterTest_Listener_exec_i::on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & /* info */) + { + for (unsigned int i = 0; i < an_instance.length (); ++i) + { + ACE_DEBUG ((LM_ERROR, ACE_TEXT ("WriterTest_Listener::on_many_data ") + ACE_TEXT ("received writer info for <%C> at %u\n"), + an_instance[i].key.in (), + an_instance[i].iteration)); + } + } + + //============================================================ + // Component Executor Implementation Class: Receiver_exec_iKeyedTest_Listener_exec_i (); + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (15) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Port operations. + ::CCM_DDS::WriterTest::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new WriterTest RAW listener\n"))); + return new WriterTest_Listener_exec_i (this->iterations_); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return 0; + } + + // Operations from Components::SessionComponent. + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Writer::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) + { + ::CCM_DDS::DataListenerControl_var lc = + this->context_->get_connection_info_out_data_control (); + + if (::CORBA::is_nil (lc.in ())) + { + ACE_ERROR ((LM_INFO, ACE_TEXT ("Error: Listener control receptacle is null!\n"))); + throw CORBA::INTERNAL (); + } + lc->mode (::CCM_DDS::NOT_ENABLED); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.h new file mode 100644 index 00000000000..d1f941be18c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Receiver/Writer_Receiver_exec.h @@ -0,0 +1,82 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Writer_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_Writer_Receiver_Impl +{ + class RECEIVER_EXEC_Export WriterTest_Listener_exec_i + : public virtual ::CCM_DDS::WriterTest::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + WriterTest_Listener_exec_i (CORBA::UShort iterations); + virtual ~WriterTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const WriterTest & an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const WriterTestSeq & an_instance, + const ::CCM_DDS::ReadInfoSeq & info); + private: + CORBA::UShort iterations_; + }; + + 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); + + // Component attributes. + virtual ::CORBA::UShort iterations (void); + + virtual void iterations (::CORBA::UShort iterations); + + // Port operations. + virtual ::CCM_DDS::WriterTest::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::Writer::CCM_Receiver_Context_var context_; + CORBA::UShort iterations_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Receiver_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.idl new file mode 100644 index 00000000000..eebc31419e2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_KEYED_TEST_SENDER_IDL +#define DDS_KEYED_TEST_SENDER_IDL + +#include "Connector/Writer_Connector.idl" + +module Writer +{ + component Sender + { + port CCM_DDS::WriterTest::DDS_Write info_write; + attribute unsigned short rate; + attribute unsigned short iterations; + attribute unsigned short keys; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.mpc new file mode 100644 index 00000000000..643847c1268 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_UnkeyedWriterBase -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_UnkeyedWriterSender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_UnkeyedWriterConnector_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 { + Writer_Sender.idl + } +} + +project(DDS_UnkeyedWriterSender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_UnkeyedWriterSender_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 { + Writer_SenderE.idl + } +} + +project(DDS_UnkeyedWriterSender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_UnkeyedWriterSender_lem_gen DDS_UnkeyedWriterSender_stub DDS_UnkeyedWriterBase_stub + libs += DDS_UnkeyedWriterBase_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderEC.cpp + } + + Header_Files { + Writer_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Writer_SenderEC.inl + } +} + +project(DDS_UnkeyedWriterSender_stub) : ccm_stub, dds4ccm_base { + after += DDS_UnkeyedWriterSender_idl_gen DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub + libs += DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderC.cpp + } + + Header_Files { + Writer_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Writer_SenderC.inl + } +} + +project(DDS_UnkeyedWriterSender_exec) : ciao_executor, dds4ccm_base { + after += DDS_UnkeyedWriterSender_lem_stub DDS_UnkeyedWriterSender_stub DDS_UnkeyedWriterConnector_lem_stub DDS_UnkeyedWriterConnector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterConnector_lem_stub DDS_UnkeyedWriterConnector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_Sender_exec.cpp + } + + Header_Files { + Writer_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_UnkeyedWriterSender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_UnkeyedWriterBase_stub DDS_UnkeyedWriterSender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_svnt DDS_UnkeyedWriterConnector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_UnkeyedWriterBase_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_UnkeyedWriterConnector_stub DDS_UnkeyedWriterConnector_svnt DDS_UnkeyedWriterConnector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Writer_SenderS.cpp + Writer_Sender_svnt.cpp + } + + Header_Files { + Writer_SenderS.h + Writer_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Writer_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.cpp new file mode 100644 index 00000000000..3933929dcef --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.cpp @@ -0,0 +1,334 @@ +// -*- C++ -*- +// $Id$ + +#include "Writer_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Writer_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : rate_ (1), + iterations_ (15), + keys_ (5), + assignment_ (WRITE_UNKEYED) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + void + Sender_exec_i::reset_iterations () + { + for (Writer_Table::iterator i = this->ktests_.begin (); + i != this->ktests_.end (); + ++i) + { + i->second->iteration = 0; + } + } + + void + Sender_exec_i::start_new_assignment (WRITER_ASSIGNMENT assignment) + { + this->last_key = this->ktests_.begin (); + this->assignment_ = assignment; + reset_iterations (); + } + + void + Sender_exec_i::write_unkeyed () + { + if (this->last_key != this->ktests_.end ()) + { + try + { + ++this->last_key->second->iteration; + OctetSeq_var reply_mesg = new OctetSeq (1); + reply_mesg->length (1); + this->last_key->second->data = *reply_mesg._retn (); + this->writer_->write_one (this->last_key->second, ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Written keyed <%C> - iteration <%d>\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->ktests_.begin (); + while (this->last_key != this->ktests_.end ()) + { + if (this->last_key->second->iteration == this->iterations_) + { + //next key + ++this->last_key; + } + else + { + break; + } + } + if (this->last_key == this->ktests_.end ()) + { + start_new_assignment (WRITE_MULTI); + } + } + } + + void + Sender_exec_i::write_many () + { + CORBA::ULong nr_samples = this->keys_ * this->iterations_; + WriterTestSeq write_many_no_excep; + write_many_no_excep.length (nr_samples); + //write with no exception + for (CORBA::ULong i = 1; i < nr_samples - 1; ++i) + { + WriterTest new_key; + new_key.key = CORBA::string_dup("KEY_1"); + new_key.iteration = i; + OctetSeq_var reply_mesg = new OctetSeq (1); + reply_mesg->length (1); + new_key.data = *reply_mesg._retn (); + write_many_no_excep[i-1] = new_key; + } + try + { + this->writer_->write_many (write_many_no_excep); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("write_many : written <%u> samples\n"), + write_many_no_excep.length ())); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("while write many writer info: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + } + start_new_assignment (TEST_EXCEPTION); + } + + void + Sender_exec_i::test_exception () + { + if (this->last_key != this->ktests_.end ()) + { + try + { + ++this->last_key->second->iteration; + const long length = 100000; + OctetSeq_var reply_mesg = + new OctetSeq (length); + reply_mesg->length (length); + this->last_key->second->data = *reply_mesg._retn (); + this->writer_->write_one (this->last_key->second, ::DDS::HANDLE_NIL); + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: No InternalError ") + ACE_TEXT ("caught while writing a large amount of data.\n"))); + } + catch (const CCM_DDS::InternalError& ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::test_exception: ") + ACE_TEXT ("OK: Expected InternalErr received\n"))); + } + ++this->last_key; + } + else + { + //onto the next iteration + this->last_key = this->ktests_.begin (); + while (this->last_key != this->ktests_.end ()) + { + if (this->last_key->second->iteration == this->iterations_) + { + //next key + ++this->last_key; + } + else + { + break; + } + } + if (this->last_key == this->ktests_.end ()) + { + start_new_assignment (WRITE_NONE); + } + } + } + + void + Sender_exec_i::tick () + { + switch (this->assignment_) + { + case WRITE_UNKEYED: + write_unkeyed (); + break; + case WRITE_MULTI: + write_many (); + break; + case TEST_EXCEPTION: + test_exception (); + break; + default: + break; + } + } + + void + Sender_exec_i::start (void) + { + // calculate the interval time + long usec = 1000000 / this->rate_; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + ::CORBA::UShort + Sender_exec_i::rate (void) + { + return this->rate_; + } + + void + Sender_exec_i::rate (::CORBA::UShort rate) + { + this->rate_ = rate; + } + + ::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_ = + ::Writer::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->writer_ = this->context_->get_connection_info_write_data (); + } + + void + Sender_exec_i::ccm_activate (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]; + WriterTest *new_key = new WriterTest; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key->key = CORBA::string_dup(key); + new_key->iteration = 1; + + this->ktests_[key] = new_key; + } + this->start (); + this->last_key = this->ktests_.begin (); + reset_iterations (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.h new file mode 100644 index 00000000000..ead020fedfe --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/Sender/Writer_Sender_exec.h @@ -0,0 +1,106 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "Writer_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_Writer_Sender_Impl +{ + class Sender_exec_i; + + enum WRITER_ASSIGNMENT { + WRITE_NONE, + WRITE_UNKEYED, + WRITE_MULTI, + TEST_EXCEPTION + }; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_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 rate (void); + + virtual void rate (::CORBA::UShort rate); + + 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 tick (); + + private: + void start (void); + void stop (void); + + CCM_DDS::WriterTest::Writer_var writer_; + + pulse_Generator * ticker_; + ::Writer::CCM_Sender_Context_var context_; + CORBA::UShort rate_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + WRITER_ASSIGNMENT assignment_; + + void reset_iterations (); + void start_new_assignment ( + WRITER_ASSIGNMENT assignment); + void write_unkeyed (); + void write_many (); + void test_exception (); + + TAO_SYNCH_MUTEX mutex_; + typedef std::map<ACE_CString, WriterTest_var> Writer_Table; + Writer_Table ktests_; + + Writer_Table::iterator last_key; + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Writer_Sender_Impl (void); +} + +#endif /* ifndef */ + diff --git a/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/descriptors/Plan.cdp new file mode 100644 index 00000000000..88c24d90338 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/descriptors/Plan.cdp @@ -0,0 +1,396 @@ +<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>UnkeyedWriter_Depl_1</label> + <UUID>UnkeyedWriter_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_Writer_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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="Writer_ConnectorComponentImplementation"> + <name>Writer_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Writer_Connector_ExecArtifact" /> + <artifact xmi:idref="Writer_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_Writer_Writer_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_Writer_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Writer_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_Writer_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Writer_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>iterations</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <!-- should be equal to iterations in + Sender component --> + <ushort>10</ushort> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Writer_ConnectorComponentInstance"> + <name>Writer_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>UnkeyedWriter</string> + </value> + </value> + </configProperty> + <!--configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>UnkeyedWriter_Library#UnkeyedWriter_Profile</string> + </value> + </value> + </configProperty--> +</instance> + <instance xmi:id="Writer_ConnectorComponentInstance2"> + <name>Writer_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Writer_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>UnkeyedWriter</string> + </value> + </value> + </configProperty> + <!--configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>UnkeyedWriter_Library#UnkeyedWriter_Profile</string> + </value> + </value> + </configProperty--> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + <configProperty> + <name>rate</name> + <value> + <type> + <kind>tk_ushort</kind> + </type> + <value> + <ushort>15</ushort> + </value> + </value> + </configProperty> + <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>_listener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <connection> + <name>_datacontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Writer_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="Writer_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="Writer_Connector_ExecArtifact"> + <name>Writer_Connector_exec</name> + <source/> + <node/> + <location>DDS_UnkeyedWriterConnector_exec</location> + </artifact> + <artifact xmi:id="Writer_Connector_SvntArtifact"> + <name>Writer_Connector_svnt</name> + <source/> + <node/> + <location>DDS_UnkeyedWriterConnector_svnt</location> + </artifact> + <artifact xmi:id="Writer_Connector_StubArtifact"> + <name>Writer_Connector_stub</name> + <source/> + <node/> + <location>DDS_UnkeyedWriterConnector_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/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/descriptors/run_test.pl new file mode 100755 index 00000000000..58d28e2d477 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/UnkeyedWriter/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (70); + +# 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/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.idl new file mode 100644 index 00000000000..aac765bc8dd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file Updater_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef UPDATER_BASE_IDL +#define UPDATER_BASE_IDL + +#pragma ndds typesupport "Base/Updater_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "TestTopic" +#pragma DCPS_DATA_KEY "TestTopic key" + +struct TestTopic { + string key; //@key + long x; +}; + +typedef sequence<TestTopic> TestTopicSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.mpc new file mode 100644 index 00000000000..97490cd2c74 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Base/Updater_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project (DDS_Updater_Base_stub) : taoidldefaults, anytypecode, dds4ccm_ts_default { + sharedname = DDS_Updater_Base_stub + dynamicflags += UPDATER_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=UPDATER_BASE_STUB_Export \ + -Wb,stub_export_include=Updater_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + Updater_Base.idl + } + + opendds_ts_flags += --export=UPDATER_BASE_STUB_Export + + DDSGenerator_Files { + Updater_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.idl new file mode 100644 index 00000000000..1e93838fe70 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file Updater_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef UPDATER_CONNECTOR_IDL_ +#define UPDATER_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/Updater_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/Updater_ConnectorE.idl" + +module CCM_DDS +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopic; +}; + +module Updater +{ + connector Updater_Connector : ::CCM_DDS::TestTopic::DDS_State + { + }; +}; + +#endif /* UPDATER_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.mpc new file mode 100644 index 00000000000..af19013fa69 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Connector/Updater_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Updater_Base -l .. -o ../lib -u DDS Updater_Connector" + +project(DDS_UPDATER_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=UPDATER_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=Updater_Connector_stub_export.h \ + -Wb,skel_export_macro=UPDATER_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=Updater_Connector_svnt_export.h \ + -Wb,svnt_export_macro=UPDATER_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=Updater_Connector_svnt_export.h \ + -Wb,conn_export_macro=UPDATER_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=Updater_Connector_conn_export.h \ + -I .. + + IDL_Files { + Updater_Connector.idl + } +} + +project(DDS_UPDATER_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_UPDATER_Connector_idl_gen + idlflags += -Wb,stub_export_macro=UPDATER_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=Updater_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + Updater_ConnectorE.idl + } +} + +project(DDS_UPDATER_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_UPDATER_Connector_lem_gen DDS_Updater_Connector_stub DDS_Updater_Base_stub DDS4CCM_lem_stub + libs += DDS_Updater_Base_stub DDS_Updater_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_UPDATER_Connector_lem_stub + dynamicflags = UPDATER_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ConnectorEC.cpp + } + + Header_Files { + Updater_ConnectorEC.h + Updater_Connector_lem_stub_export.h + } + + Inline_Files { + Updater_ConnectorEC.inl + } +} + +project(DDS_Updater_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_UPDATER_Connector_idl_gen DDS_Updater_Base_stub + libs += DDS_Updater_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_Updater_Connector_stub + dynamicflags = UPDATER_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ConnectorC.cpp + } + + Header_Files { + Updater_ConnectorC.h + Updater_Connector_stub_export.h + } + + Inline_Files { + Updater_ConnectorC.inl + } +} + +project(DDS_Updater_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_UPDATER_Connector_lem_stub DDS_Updater_Connector_stub DDS4CCM_lem_stub DDS_Updater_Base_stub + sharedname = DDS_Updater_Connector_exec + libs += DDS_Updater_Connector_stub DDS_UPDATER_Connector_lem_stub DDS_Updater_Base_stub DDS4CCM_lem_stub DDS_Updater_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = UPDATER_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_Connector_conn.cpp + } + + Header_Files { + Updater_Connector_conn.h + Updater_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_Updater_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_UPDATER_Connector_lem_stub DDS_Updater_Connector_exec DDS_Updater_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_Updater_Connector_svnt + libs += DDS_Updater_Connector_stub \ + DDS_UPDATER_Connector_lem_stub \ + DDS_Updater_Base_stub \ + DDS_Updater_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = UPDATER_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ConnectorS.cpp + Updater_Connector_svnt.cpp + } + + Header_Files { + Updater_ConnectorS.h + Updater_Connector_svnt.h + Updater_Connector_svnt_export.h + } + + Inline_Files { + Updater_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.idl new file mode 100644 index 00000000000..1a819121236 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/Updater_Connector.idl" + +module Updater +{ + component Receiver + { + port CCM_DDS::TestTopic::DDS_Listen info_out; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.mpc new file mode 100644 index 00000000000..0a1c0c1ae8b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver.mpc @@ -0,0 +1,138 @@ +// $Id$ + +project(DDS_Updater_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_UPDATER_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 { + Updater_Receiver.idl + } +} + +project(DDS_Updater_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Updater_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 { + Updater_ReceiverE.idl + } +} + +project(DDS_UPDATER_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Updater_Receiver_lem_gen DDS_Updater_Receiver_stub DDS_Updater_Connector_stub DDS_Updater_Base_stub + libs += Receiver_stub DDS_Updater_Connector_stub DDS_Updater_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ReceiverEC.cpp + } + + Header_Files { + Updater_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + Updater_ReceiverEC.inl + } +} + +project(DDS_Updater_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_Updater_Receiver_idl_gen DDS_Updater_Connector_stub DDS_Updater_Base_stub DDS_UPDATER_Connector_lem_gen + libs += DDS_Updater_Connector_stub DDS_Updater_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ReceiverC.cpp + } + + Header_Files { + Updater_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + Updater_ReceiverC.inl + } +} + +project(DDS_Updater_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_UPDATER_Receiver_lem_stub DDS_Updater_Receiver_stub DDS_Updater_Base_stub DDS_Updater_Connector_stub DDS_UPDATER_Connector_lem_stub DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_Updater_Base_stub DDS_Updater_Connector_stub DDS_UPDATER_Connector_lem_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_Receiver_exec.cpp + } + + Header_Files { + Updater_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Updater_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_UPDATER_Receiver_lem_stub DDS_Updater_Base_stub DDS_Updater_Connector_stub DDS_Updater_Connector_svnt DDS_Updater_Receiver_exec DDS_UPDATER_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_Updater_Base_stub DDS_Updater_Connector_stub DDS_Updater_Connector_svnt Receiver_exec DDS_UPDATER_Connector_lem_stub DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_ReceiverS.cpp + Updater_Receiver_svnt.cpp + } + + Header_Files { + Updater_ReceiverS.h + Updater_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + Updater_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.cpp new file mode 100644 index 00000000000..5402c553baf --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.cpp @@ -0,0 +1,185 @@ +// -*- C++ -*- +// $Id$ + +// Test for UPDATER + +#include "Updater_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/OS_NS_time.h" +#include "dds4ccm/impl/dds/Utils.h" +#include "dds4ccm/impl/dds/TimeUtilities.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +namespace CIAO_Updater_Receiver_Impl +{ + //============================================================ + // ListenOneByOneTest_Listener_exec_i + //============================================================ + ListenOneByOneTest_Listener_exec_i::ListenOneByOneTest_Listener_exec_i ( + Atomic_ThreadId &thread_id) + : thread_id_ (thread_id) + { + } + + ListenOneByOneTest_Listener_exec_i::~ListenOneByOneTest_Listener_exec_i (void) + { + } + + void + ListenOneByOneTest_Listener_exec_i::on_one_data ( + const TestTopic & an_instance, + const ::CCM_DDS::ReadInfo & info) + { + this->thread_id_ = ACE_Thread::self (); + ACE_DEBUG ((LM_DEBUG, "ListenOneByOneTest_Listener_exec_i::on_one_data: " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.x)); + if (!info.instance_handle.isValid) + { + ACE_ERROR ((LM_ERROR, "ERROR: ListenOneByOneTest_Listener_exec_i::on_one_data: " + "instance handle seems to be invalid " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.x)); + } + if (info.source_timestamp.sec == 0 && + info.source_timestamp.nanosec == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: ListenOneByOneTest_Listener_exec_i::on_one_data: " + "source timestamp seems to be invalid (nil) " + "key <%C> - iteration <%d>\n", + an_instance.key.in (), + an_instance.x)); + } + } + + void + ListenOneByOneTest_Listener_exec_i::on_many_data ( + const TestTopicSeq & , + const ::CCM_DDS::ReadInfoSeq & ) + { + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : thread_id_listener_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Port operations. + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::TestTopic::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return new ListenOneByOneTest_Listener_exec_i ( + this->thread_id_listener_); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Updater::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) + { + ::CCM_DDS::DataListenerControl_var dlc = + this->context_->get_connection_info_out_data_control (); + dlc->mode (::CCM_DDS::ONE_BY_ONE); + } + + 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, "ONE_BY_ONE: " + "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: ONE_BY_ONE: " + "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: ONE_BY_ONE: 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, "ONE_BY_ONE: 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_Updater_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.h new file mode 100644 index 00000000000..3d7dfb09a7d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Receiver/Updater_Receiver_exec.h @@ -0,0 +1,88 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "Updater_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" + +namespace CIAO_Updater_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, ACE_thread_t> Atomic_ThreadId; + + class Receiver_exec_i; + + //============================================================ + // ListenOneByOneTest_Listener_exec_i + //============================================================ + class RECEIVER_EXEC_Export ListenOneByOneTest_Listener_exec_i + : public virtual ::CCM_DDS::TestTopic::CCM_Listener, + public virtual ::CORBA::LocalObject + { + public: + ListenOneByOneTest_Listener_exec_i (Atomic_ThreadId &); + virtual ~ListenOneByOneTest_Listener_exec_i (void); + + virtual void + on_one_data ( + const TestTopic& an_instance, + const ::CCM_DDS::ReadInfo & info); + virtual void + on_many_data ( + const TestTopicSeq & 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); + + // Port operations. + virtual ::CCM_DDS::TestTopic::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::Updater::CCM_Receiver_Context_var context_; + Atomic_ThreadId thread_id_listener_; +}; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Updater_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.idl new file mode 100644 index 00000000000..8ca5811a426 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_UPDATER_SENDER_IDL +#define DDS_UPDATER_SENDER_IDL + +#include "Connector/Updater_Connector.idl" + +module Updater +{ + component Sender + { + port CCM_DDS::TestTopic::DDS_Update test_topic_update; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.mpc new file mode 100644 index 00000000000..d1097877d1d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender.mpc @@ -0,0 +1,140 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_Updater_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_Updater_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_UPDATER_Connector_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 { + Updater_Sender.idl + } +} + +project(DDS_Updater_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_Updater_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 { + Updater_SenderE.idl + } +} + +project(DDS_Updater_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_Updater_Sender_lem_gen DDS_Updater_Sender_stub DDS_Updater_Base_stub + libs += DDS_Updater_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_SenderEC.cpp + } + + Header_Files { + Updater_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + Updater_SenderEC.inl + } +} + +project(DDS_Updater_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_Updater_Sender_idl_gen DDS_Updater_Base_stub DDS_Updater_Connector_stub + libs += DDS_Updater_Base_stub DDS_Updater_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_SenderC.cpp + } + + Header_Files { + Updater_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + Updater_SenderC.inl + } +} + +project(DDS_Updater_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_Updater_Sender_lem_stub DDS_Updater_Sender_stub DDS_UPDATER_Connector_lem_stub DDS_Updater_Connector_stub DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_Updater_Base_stub DDS_UPDATER_Connector_lem_stub DDS_Updater_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_Sender_exec.cpp + } + + Header_Files { + Updater_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_Updater_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_Updater_Base_stub DDS_Updater_Sender_lem_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Updater_Connector_stub DDS_Updater_Connector_svnt DDS_UPDATER_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_Updater_Base_stub DDS4CCM_lem_stub DDS4CCM_skel DDS_Updater_Connector_stub DDS_Updater_Connector_svnt DDS_UPDATER_Connector_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + Updater_SenderS.cpp + Updater_Sender_svnt.cpp + } + + Header_Files { + Updater_SenderS.h + Updater_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + Updater_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.cpp new file mode 100644 index 00000000000..6a594890db2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.cpp @@ -0,0 +1,672 @@ +// -*- C++ -*- +// $Id$ + +//Test Updater functions +#include "Updater_Sender_exec.h" +#include "ace/Guard_T.h" +#include "ace/Log_Msg.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +namespace CIAO_Updater_Sender_Impl +{ + //============================================================ + // Pulse generator + //============================================================ + pulse_Generator::pulse_Generator (Sender_exec_i &callback) + : pulse_callback_ (callback) + { + } + + int + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + // Notify the subscribers + this->pulse_callback_.tick (); + return 0; + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : test_nr_(UPDATE_CREATE), + test_ok_(true) + { + this->ticker_ = new pulse_Generator (*this); + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + // Supported operations and attributes. + CORBA::Boolean + Sender_exec_i::create_one() + { + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + if (! ::CORBA::is_nil (this->updater_) ) { + this->updater_->create_one(i); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: create_one with instance key <%C>\n"), + i.key.in())); + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: updater_ is nil"))); + result= false; + } + } + catch(const CCM_DDS::AlreadyCreated &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test updater create_one <%C>.\n"), + i.key.in())); + result= false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while create_one for <%C>.\n"), + i.key.in())); + result = false;; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::create_one_already_exist() + { + CORBA::Boolean result = false; + TestTopic i = this->topic_seq_one_[0]; + //try to create same instance again, this should erase an AlreadyCreated exception + try + { + this->updater_->create_one(i); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: create_one with already existing instance key <%Cs>\n"), + i.key.in())); + } + catch(const CCM_DDS::AlreadyCreated &) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception AlreadyCreated test updater create_one.\n"))); + result = true; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while create_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_one() + { + //update already created instance with handle nil + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + this->updater_->update_one(i, DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update_one with already existing instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + } + catch(const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_one_not_registered() + { + //update a not yet registered instance,expext a NonExistent exception + CORBA::Boolean result = false; + //use second instance of table + TestTopic i = this->topic_seq_one_[1]; + try + { + this->updater_->update_one(i, DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update_one with not registerd instance, key <%C>\n"), + i.key.in())); + } + catch (const CCM_DDS::NonExistent &) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception NonExistent test updater updater_one.\n"))); + result = true; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_one() + { + //delete registerd instance with DDS::HANDLE_NIL + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[0]; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete_one with registerd instance with DDS::HANDLE_NIL, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, DDS::HANDLE_NIL); + } + catch(const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_one <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_one_not_registered() + { + //delete non-existing instance, expect NonExistent exception + CORBA::Boolean result = false; + TestTopic i = this->topic_seq_one_[1]; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete_one with not registerd instance, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, DDS::HANDLE_NIL); + } + catch(const CCM_DDS::NonExistent &) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception NonExistent test updater delete_one.\n"))); + result = true; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_and_delete_one_after_register() + { + //update an instance after registering first, using a handle + CORBA::Boolean result = true; + TestTopic i = this->topic_seq_one_[2]; + //take third instance of table + DDS::InstanceHandle_t hnd = this->updater_->register_instance(i); + try + { + if(hnd.isValid) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update a new instance after registrating instance, key <%C>\n"), + i.key.in())); + this->updater_->update_one(i, hnd); + + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Error, invalid handle for <%C>.\n"), + i.key.in())); + result = false; + } + } + catch(const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one using handle <%C>.\n"), + i.key.in())); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while update_one for <%C>.\n"), + i.key.in())); + result = false; + } + //update an instance with an instance_handler belonging to an other instance + if(result == true) + { + try + { + result = false; + TestTopic y = this->topic_seq_one_[0]; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: update an instance with an instance_handler belonging to an other instance\n"))); + this->updater_->update_one(y, hnd); + } + catch(const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_one with incompatible datum and handle.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("OK: Expected : Exception InternalE. test updater update_one with incompatible datum and handle. ex %d\n"),ex.error_code)); + result = true; + } + } + if (result==true) + { + try + { + i = this->topic_seq_one_[2]; + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Updater: delete a instance with handle, key <%C>\n"), + i.key.in())); + this->updater_->delete_one(i, hnd); + } + + catch (const CCM_DDS::NonExistent &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delett_one with valid handler.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while delete_one for <%C>.\n"), + i.key.in())); + result = false; + } + } + return result; + } + + CORBA::Boolean + Sender_exec_i::create_many() + { + //create many with no exception + CORBA::Boolean result = false; + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + this->updater_->create_many (this->topic_seq_many_); + result = true; + } + catch(const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater create_many\n"))); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("in updater: create_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + + } + if(result==true) + { + result = false; + //test create_many with AlreadyCreated exception + + try + { + this->updater_->create_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many which are already created : <%u> samples\n"), + this->topic_seq_many_.length ())); + + } + catch (const CCM_DDS::NonExistent & ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Unexpected Error ") + ACE_TEXT ("in create_many , already created.\n"))); + result = false; + } + catch (const CCM_DDS::AlreadyCreated & ) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception AlreadyCreated test updater create_many.\n"))); + result = true; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("in test create_many,already created: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + } + return result; + } + + CORBA::Boolean + Sender_exec_i::update_many() + { + CORBA::Boolean result = false; + try + { + this->updater_->update_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("update_many : written <%u> samples\n"), + this->topic_seq_many_.length ())); + result = true; + } + catch(const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater update_many.\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("whit update_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + if(result==true) + { + result = false; + //update with exception + // make from the second and third instances a unregistered instance , see above + char key[7]; + TestTopic test_key; + ACE_OS::sprintf (key, "XXX_%d",2); + test_key.key = CORBA::string_dup(key); + test_key.x = 2; + this->topic_seq_many_[1] = test_key; + ACE_OS::sprintf (key, "YYY_%d",3); + test_key.key = CORBA::string_dup(key); + test_key.x = 3; + this->topic_seq_many_[2] = test_key; + try + { + this->updater_->update_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + } + catch (const CCM_DDS::NonExistent & ex) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception NonExistent test updater update_many.\n"), + ACE_TEXT ("index length expected = 2 and value = %d, expected index[0] = 1 and value = %d.\n"), + ex.indexes.length(),ex.indexes[0])); + + if((ex.indexes.length() != 2) || (ex.indexes[0] != 1) ||(ex.indexes[1] != 2)) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Create_maney:expected exception: NonExistent gives wrong indexes.\n"))); + result = false; + } + else + { + result = true; + } + } + catch (const CCM_DDS::InternalError& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("test update_many with not registerd instances\n"))); + } + catch (const CCM_DDS::AlreadyCreated & ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test update_many with not registerd instances.\n"))); + result = false; + } + } + return result; + } + + CORBA::Boolean + Sender_exec_i::delete_many() + { + CORBA::Boolean result = false; + result = false; + //delete_many with exception + // make from the second and third instances a unregistered instance + try + { + this->updater_->delete_many (this->topic_seq_many_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("create_many : <%u> samples\n"), + this->topic_seq_many_.length ())); + } + catch (const CCM_DDS::NonExistent & ex) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Expected : Exception NonExistent test updater delete_many.\n"), + ACE_TEXT ("index length expected = 2 and value = %d, expected index[0] = 1 and value = %d.\n"), + ex.indexes.length(),ex.indexes[0])); + + if((ex.indexes.length() != 2) || (ex.indexes[0] != 1) ||(ex.indexes[1] != 2)) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Create_many:expected exception: NonExistent gives wrong indices.\n"))); + result = false; + } + else + { + result = true; + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("test updater delete_many with inregisterd instances, info: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + catch (const CCM_DDS::AlreadyCreated &) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: AlreadyCreated with test updater delete_many.\n"))); + result = false; + } + if(result==true) + { + //delete many with no exception + //reset instances to original values + for (int i = 1; i < 4; i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "many_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_many_[i-1] = new_key; + } + try + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("delete_many : deleted <%u> samples\n"), + this->topic_seq_many_.length ())); + + this->updater_->delete_many (this->topic_seq_many_); + result = true; + } + catch(const CCM_DDS::NonExistent& ) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unexpected exception: NonExistent with test updater delete_many\n"))); + result = false; + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Internal Error ") + ACE_TEXT ("with test updater delete_many: index <%d> - retval <%d>\n"), + ex.index, ex.error_code)); + result = false; + } + } + return result; + } + + void + Sender_exec_i::add_instances_of_topic () + { + //make 2 sequences of instances as testdata + CORBA::UShort total = 3; + this->topic_seq_one_.length (total); + //sequence for tests with .._one + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "KEY_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_one_[i-1] = new_key; + } + //sequence for tests with .._many + this->topic_seq_many_.length (total); + for (int i = 1; i < (total + 1); i++) + { + char key[7]; + TestTopic new_key; + ACE_OS::sprintf (key, "many_%d", i); + new_key.key = CORBA::string_dup(key); + new_key.x = i; + this->topic_seq_many_[i-1] = new_key; + } + } + + void + Sender_exec_i::tick () + { + if(this->test_ok_.value()) + { + switch (this->test_nr_) + { + case UPDATE_CREATE: + this->test_ok_ = this->create_one(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_CREATE_ALREADY_EXIST; + } + else + { + this->test_nr_ = END_TEST; + } + break; + case UPDATE_CREATE_ALREADY_EXIST: + this->test_ok_ = this->create_one_already_exist(); + this->test_nr_ = UPDATE_ONE; + break; + case UPDATE_ONE: + this->test_ok_ = this->update_one(); + this->test_nr_ = UPDATE_ONE_NOT_REGISTERED; + break; + case UPDATE_ONE_NOT_REGISTERED: + this->test_ok_ = this->update_one_not_registered(); + this->test_nr_ = DELETE_ONE; + break; + case DELETE_ONE: + this->test_ok_ = this->delete_one(); + this->test_nr_ = DELETE_ONE_NOT_REGISTERED; + break; + case DELETE_ONE_NOT_REGISTERED: + this->test_ok_ = this->delete_one_not_registered(); + this->test_nr_ = UPDATE_DELETE_REGISTER; + break; + case UPDATE_DELETE_REGISTER: + this->test_ok_ = this->update_and_delete_one_after_register(); + this->test_nr_ = CREATE_MANY; + break; + case CREATE_MANY: + this->test_ok_ = this->create_many(); + if(this->test_ok_.value()) + { + this->test_nr_ = UPDATE_MANY; + } + else + { + this->test_nr_ = END_TEST; + } + this->test_nr_ = UPDATE_MANY; + break; + case UPDATE_MANY: + this->test_ok_ = this->update_many(); + this->test_nr_ = DELETE_MANY; + break; + case DELETE_MANY: + this->test_ok_ = this->delete_many(); + this->test_nr_ = END_TEST; + break; + default: + break; + } + } + } + void + Sender_exec_i::start (void) + { + long sec = 3L; + long usec = 0L; + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value (sec, usec), + ACE_Time_Value (sec, usec)) == -1) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sender_exec_i::start : ") + ACE_TEXT ("Error scheduling timer"))); + } + } + + void + Sender_exec_i::stop (void) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Sender_exec_i::stop : Timer canceled.\n"))); + delete this->ticker_; + } + + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::Updater::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + this->updater_ = this->context_->get_connection_test_topic_update_data (); + } + + void + Sender_exec_i::ccm_activate (void) + { + this->add_instances_of_topic (); + this->start (); + } + + void + Sender_exec_i::ccm_passivate (void) + { + this->stop (); + } + + void + Sender_exec_i::ccm_remove (void) + { + if(!this->test_ok_.value()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: Error in Updater in Sender"))); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Updater_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.h new file mode 100644 index 00000000000..3a900367ac4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/Sender/Updater_Sender_exec.h @@ -0,0 +1,93 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + +#include "Updater_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_Updater_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + enum UPDATER_TEST { + UPDATE_CREATE, + UPDATE_CREATE_ALREADY_EXIST, + UPDATE_ONE, + UPDATE_ONE_NOT_REGISTERED, + DELETE_ONE, + DELETE_ONE_NOT_REGISTERED, + UPDATE_DELETE_REGISTER, + CREATE_MANY, + UPDATE_MANY, + DELETE_MANY, + END_TEST + }; + + class pulse_Generator : + public ACE_Event_Handler + { + public: + pulse_Generator (Sender_exec_i &callback); + /// Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + /// Maintains a handle that actually process the event + Sender_exec_i &pulse_callback_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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 tick (void); + + private: + void start (void); + void stop (void); + void add_instances_of_topic (void); + CORBA::Boolean create_one(void); + CORBA::Boolean create_one_already_exist(void); + CORBA::Boolean update_one(void); + CORBA::Boolean update_one_not_registered(void); + CORBA::Boolean delete_one(void); + CORBA::Boolean delete_one_not_registered(void); + CORBA::Boolean update_and_delete_one_after_register(void); + CORBA::Boolean create_many(void); + CORBA::Boolean update_many(void); + CORBA::Boolean delete_many(void); + + pulse_Generator * ticker_; + ::Updater::CCM_Sender_Context_var context_; + CCM_DDS::TestTopic::Updater_var updater_; + UPDATER_TEST test_nr_; + Atomic_Boolean test_ok_; + TestTopicSeq topic_seq_one_; + TestTopicSeq topic_seq_many_; + }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Updater_Sender_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/Updater/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/Updater/descriptors/Plan.cdp new file mode 100644 index 00000000000..2cb74af488c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/descriptors/Plan.cdp @@ -0,0 +1,370 @@ +<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>Updater_Depl_1</label> + <UUID>Updater_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_Updater_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Updater_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="Updater_ConnectorComponentImplementation"> + <name>Updater_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="Updater_Connector_ExecArtifact" /> + <artifact xmi:idref="Updater_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_Updater_Updater_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Updater_Updater_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Updater_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Updater_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_Updater_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Updater_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="Updater_ConnectorComponentInstance"> + <name>Updater_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Updater_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="Updater_ConnectorComponentInstance2"> + <name>Updater_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Updater_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestQoS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <connection> + <name>_listenercontrol</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_data_control</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_data_control</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Updater_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_statelistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_data_listener</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_data_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Updater_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>_portstatuslistener</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_state_observer_status</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Updater_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="Updater_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>updater_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>test_topic_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="Updater_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="Updater_Connector_ExecArtifact"> + <name>Updater_Connector_exec</name> + <source/> + <node/> + <location>DDS_Updater_Connector_exec</location> + </artifact> + <artifact xmi:id="Updater_Connector_SvntArtifact"> + <name>Updater_Connector_svnt</name> + <source/> + <node/> + <location>DDS_Updater_Connector_svnt</location> + </artifact> + <artifact xmi:id="Updater_Connector_StubArtifact"> + <name>Updater_Connector_stub</name> + <source/> + <node/> + <location>DDS_Updater_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/modules/CIAO/connectors/dds4ccm/tests/Updater/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/Updater/descriptors/run_test.pl new file mode 100755 index 00000000000..7a20e61732d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/Updater/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 60 seconds to allow task to complete\n"; +sleep (60); + +# 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/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.idl new file mode 100644 index 00000000000..c792557b4c0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.idl @@ -0,0 +1,75 @@ +// $Id$ + +/** + * @file VTopic_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTOPIC_BASE_IDL +#define VTOPIC_BASE_IDL + +#pragma ndds typesupport "Base/VTopic_BaseSupport.h" + +// Plain topic +struct TestTopic { + string key; //@key + long x; +}; + +// String +struct TopicString { + string key; //@key + string x_str; +}; + +// Arrays +struct TopicArray { + string key; //@key + octet x_array[5]; + }; + +// Unions +union X_Union switch (short) { + case 0: + string x_test; + case 1: + long x_long; +}; + +struct TopicUnion { + string key; //@key + X_Union x_uni; +}; + +// Sequence +struct test { + short x_test; + string x_teststr; +}; +typedef sequence<test> test_seq; + +struct TopicSeq { + string key; //@key + test_seq x_seq; +}; + +// ValueType +valuetype X_Valuetype { + public string type; + public long x_long; +}; + +struct TopicValuetype { + string key; //@key + X_Valuetype x_vt; +}; + +// Sequences +typedef sequence<TestTopic> TestTopicSeq; +typedef sequence<TopicString> TopicStringSeq; +typedef sequence<TopicArray> TopicArraySeq; +typedef sequence<TopicUnion> TopicUnionSeq; +typedef sequence<TopicSeq> TopicSeqSeq; +typedef sequence<TopicValuetype> TopicValuetypeSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.mpc new file mode 100644 index 00000000000..8eadd06dcb4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Base/VTopic_Base.mpc @@ -0,0 +1,27 @@ +// $Id$ + +project (DDS_VTopic_Base_stub) : taoidldefaults, anytypecode, \ + dds4ccm_ts_default, valuetype { + sharedname = DDS_VTopic_Base_stub + dynamicflags += VTOPIC_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS \ + -Wb,stub_export_macro=VTOPIC_BASE_STUB_Export \ + -Wb,stub_export_include=VTopic_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + VTopic_Base.idl + } + + opendds_ts_flags += --export=VTOPIC_BASE_STUB_Export + + DDSGenerator_Files { + VTopic_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.idl new file mode 100644 index 00000000000..37ca6e60444 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VT_Array_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VT_ARRAY_CONNECTOR_IDL_ +#define VT_ARRAY_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Array/VT_Array_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicArray, ::TopicArraySeq> TopicArrayConn; + connector VT_Array_Connector : TopicArrayConn::DDS_Event + { + }; +}; + +#endif /* VT_ARRAY_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.mpc new file mode 100644 index 00000000000..6b59865630a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Array/VT_Array_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopic_Base -l .. -o ../lib -u DDS VT_Array_Connector" + +project(DDS_VT_ARRAY_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_ARRAY_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VT_Array_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_ARRAY_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VT_Array_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_ARRAY_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VT_Array_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_ARRAY_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VT_Array_Connector_conn_export.h \ + -I .. + + IDL_Files { + VT_Array_Connector.idl + } +} + +project(DDS_VT_ARRAY_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VT_ARRAY_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_ARRAY_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VT_Array_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VT_Array_ConnectorE.idl + } +} + +project(DDS_VT_ARRAY_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VT_ARRAY_Connector_lem_gen DDS_VT_Array_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VT_Array_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_ARRAY_Connector_lem_stub + dynamicflags = VT_ARRAY_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Array_ConnectorEC.cpp + } + + Header_Files { + VT_Array_ConnectorEC.h + VT_Array_Connector_lem_stub_export.h + } + + Inline_Files { + VT_Array_ConnectorEC.inl + } +} + +project(DDS_VT_Array_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VT_ARRAY_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_Array_Connector_stub + dynamicflags = VT_ARRAY_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Array_ConnectorC.cpp + } + + Header_Files { + VT_Array_ConnectorC.h + VT_Array_Connector_stub_export.h + } + + Inline_Files { + VT_Array_ConnectorC.inl + } +} + +project(DDS_VT_Array_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VT_ARRAY_Connector_lem_stub DDS_VT_Array_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VT_Array_Connector_exec + libs += DDS_VT_Array_Connector_stub DDS_VT_ARRAY_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_ARRAY_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Array_Connector_conn.cpp + } + + Header_Files { + VT_Array_Connector_conn.h + VT_Array_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VT_Array_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VT_ARRAY_Connector_lem_stub DDS_VT_Array_Connector_exec DDS_VT_Array_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VT_Array_Connector_svnt + libs += DDS_VT_Array_Connector_stub \ + DDS_VT_ARRAY_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VT_Array_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_ARRAY_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Array_ConnectorS.cpp + VT_Array_Connector_svnt.cpp + } + + Header_Files { + VT_Array_ConnectorS.h + VT_Array_Connector_svnt.h + VT_Array_Connector_svnt_export.h + } + + Inline_Files { + VT_Array_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.idl new file mode 100644 index 00000000000..6ce6854d245 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VT_Seq_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VT_SEQ_CONNECTOR_IDL_ +#define VT_SEQ_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Seq/VT_Seq_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicSeq, ::TopicSeqSeq> TopicSeqConn; + connector VT_Seq_Connector : TopicSeqConn::DDS_Event + { + }; +}; + +#endif /* VTopic_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.mpc new file mode 100644 index 00000000000..82fbfe90d15 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Seq/VT_Seq_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopic_Base -l .. -o ../lib -u DDS VT_Seq_Connector" + +project(DDS_VT_SEQ_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_SEQ_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VT_Seq_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_SEQ_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VT_Seq_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_SEQ_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VT_Seq_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_SEQ_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VT_Seq_Connector_conn_export.h \ + -I .. + + IDL_Files { + VT_Seq_Connector.idl + } +} + +project(DDS_VT_SEQ_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VT_SEQ_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_SEQ_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VT_Seq_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VT_Seq_ConnectorE.idl + } +} + +project(DDS_VT_SEQ_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VT_SEQ_Connector_lem_gen DDS_VT_Seq_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VT_Seq_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_SEQ_Connector_lem_stub + dynamicflags = VT_SEQ_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Seq_ConnectorEC.cpp + } + + Header_Files { + VT_Seq_ConnectorEC.h + VT_Seq_Connector_lem_stub_export.h + } + + Inline_Files { + VT_Seq_ConnectorEC.inl + } +} + +project(DDS_VT_Seq_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VT_SEQ_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_Seq_Connector_stub + dynamicflags = VT_SEQ_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Seq_ConnectorC.cpp + } + + Header_Files { + VT_Seq_ConnectorC.h + VT_Seq_Connector_stub_export.h + } + + Inline_Files { + VT_Seq_ConnectorC.inl + } +} + +project(DDS_VT_Seq_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VT_SEQ_Connector_lem_stub DDS_VT_Seq_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VT_Seq_Connector_exec + libs += DDS_VT_Seq_Connector_stub DDS_VT_SEQ_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_SEQ_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Seq_Connector_conn.cpp + } + + Header_Files { + VT_Seq_Connector_conn.h + VT_Seq_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VT_Seq_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VT_SEQ_Connector_lem_stub DDS_VT_Seq_Connector_exec DDS_VT_Seq_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VT_Seq_Connector_svnt + libs += DDS_VT_Seq_Connector_stub \ + DDS_VT_SEQ_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VT_Seq_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_SEQ_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Seq_ConnectorS.cpp + VT_Seq_Connector_svnt.cpp + } + + Header_Files { + VT_Seq_ConnectorS.h + VT_Seq_Connector_svnt.h + VT_Seq_Connector_svnt_export.h + } + + Inline_Files { + VT_Seq_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.idl new file mode 100644 index 00000000000..eaf5964090d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VT_String_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VT_STRING_CONNECTOR_IDL_ +#define VT_STRING_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_String/VT_String_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicString, ::TopicStringSeq> TopicStringConn; + connector VT_String_Connector : TopicStringConn::DDS_Event + { + }; +}; + +#endif /* VTopic_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.mpc new file mode 100644 index 00000000000..3e805c1127b --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_String/VT_String_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopic_Base -l .. -o ../lib -u DDS VT_String_Connector" + +project(DDS_VT_STRING_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_STRING_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VT_String_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_STRING_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VT_String_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_STRING_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VT_String_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_STRING_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VT_String_Connector_conn_export.h \ + -I .. + + IDL_Files { + VT_String_Connector.idl + } +} + +project(DDS_VT_STRING_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VT_STRING_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_STRING_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VT_String_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VT_String_ConnectorE.idl + } +} + +project(DDS_VT_STRING_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VT_STRING_Connector_lem_gen DDS_VT_String_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VT_String_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_STRING_Connector_lem_stub + dynamicflags = VT_STRING_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_String_ConnectorEC.cpp + } + + Header_Files { + VT_String_ConnectorEC.h + VT_String_Connector_lem_stub_export.h + } + + Inline_Files { + VT_String_ConnectorEC.inl + } +} + +project(DDS_VT_String_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VT_STRING_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_String_Connector_stub + dynamicflags = VT_STRING_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_String_ConnectorC.cpp + } + + Header_Files { + VT_String_ConnectorC.h + VT_String_Connector_stub_export.h + } + + Inline_Files { + VT_String_ConnectorC.inl + } +} + +project(DDS_VT_String_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VT_STRING_Connector_lem_stub DDS_VT_String_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VT_String_Connector_exec + libs += DDS_VT_String_Connector_stub DDS_VT_STRING_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_STRING_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_String_Connector_conn.cpp + } + + Header_Files { + VT_String_Connector_conn.h + VT_String_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VT_String_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VT_STRING_Connector_lem_stub DDS_VT_String_Connector_exec DDS_VT_String_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VT_String_Connector_svnt + libs += DDS_VT_String_Connector_stub \ + DDS_VT_STRING_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VT_String_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_STRING_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_String_ConnectorS.cpp + VT_String_Connector_svnt.cpp + } + + Header_Files { + VT_String_ConnectorS.h + VT_String_Connector_svnt.h + VT_String_Connector_svnt_export.h + } + + Inline_Files { + VT_String_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.idl new file mode 100644 index 00000000000..263bc47e583 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VT_Union_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef VT_UNION_CONNECTOR_IDL_ +#define VT_UNION_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Union/VT_Union_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicUnion, ::TopicUnionSeq> TopicUnionConn; + connector VT_Union_Connector : TopicUnionConn::DDS_Event + { + }; +}; + +#endif /* VT_UNION_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.mpc new file mode 100644 index 00000000000..eeadc56b29c --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Union/VT_Union_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_VT_UNION_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_UNION_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VT_Union_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_UNION_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VT_Union_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_UNION_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VT_Union_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_UNION_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VT_Union_Connector_conn_export.h \ + -I .. + + IDL_Files { + VT_Union_Connector.idl + } +} + +project(DDS_VT_UNION_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VT_UNION_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_UNION_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VT_Union_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VT_Union_ConnectorE.idl + } +} + +project(DDS_VT_UNION_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VT_UNION_Connector_lem_gen DDS_VT_Union_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VT_Union_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_UNION_Connector_lem_stub + dynamicflags = VT_UNION_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Union_ConnectorEC.cpp + } + + Header_Files { + VT_Union_ConnectorEC.h + VT_Union_Connector_lem_stub_export.h + } + + Inline_Files { + VT_Union_ConnectorEC.inl + } +} + +project(DDS_VT_Union_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VT_UNION_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_Union_Connector_stub + dynamicflags = VT_UNION_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Union_ConnectorC.cpp + } + + Header_Files { + VT_Union_ConnectorC.h + VT_Union_Connector_stub_export.h + } + + Inline_Files { + VT_Union_ConnectorC.inl + } +} + +project(DDS_VT_Union_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VT_UNION_Connector_lem_stub DDS_VT_Union_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VT_Union_Connector_exec + libs += DDS_VT_Union_Connector_stub DDS_VT_UNION_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_UNION_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Union_Connector_conn.cpp + } + + Header_Files { + VT_Union_Connector_conn.h + VT_Union_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VT_Union_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VT_UNION_Connector_lem_stub DDS_VT_Union_Connector_exec \ + DDS_VT_Union_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VT_Union_Connector_svnt + libs += DDS_VT_Union_Connector_stub \ + DDS_VT_UNION_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VT_Union_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_UNION_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Union_ConnectorS.cpp + VT_Union_Connector_svnt.cpp + } + + Header_Files { + VT_Union_ConnectorS.h + VT_Union_Connector_svnt.h + VT_Union_Connector_svnt_export.h + } + + Inline_Files { + VT_Union_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.idl new file mode 100644 index 00000000000..c17f1e0ffd2 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VT_Valuetype_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef VT_VALUETYPE_CONNECTOR_IDL_ +#define VT_VALUETYPE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Valuetype/VT_Valuetype_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicValuetype, ::TopicValuetypeSeq> TopicValuetypeConn; + connector VT_Valuetype_Connector : TopicValuetypeConn::DDS_Event + { + }; +}; + +#endif /* VT_VALUETYPE_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.mpc new file mode 100644 index 00000000000..f3ebeff878f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Conn_Valuetype/VT_Valuetype_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_VT_VALUETYPE_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_VALUETYPE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VT_Valuetype_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_VALUETYPE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VT_Valuetype_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_VALUETYPE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VT_Valuetype_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_VALUETYPE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VT_Valuetype_Connector_conn_export.h \ + -I .. + + IDL_Files { + VT_Valuetype_Connector.idl + } +} + +project(DDS_VT_VALUETYPE_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VT_VALUETYPE_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_VALUETYPE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VT_Valuetype_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VT_Valuetype_ConnectorE.idl + } +} + +project(DDS_VT_VALUETYPE_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VT_VALUETYPE_Connector_lem_gen DDS_VT_Valuetype_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VT_Valuetype_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_VALUETYPE_Connector_lem_stub + dynamicflags = VT_VALUETYPE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Valuetype_ConnectorEC.cpp + } + + Header_Files { + VT_Valuetype_ConnectorEC.h + VT_Valuetype_Connector_lem_stub_export.h + } + + Inline_Files { + VT_Valuetype_ConnectorEC.inl + } +} + +project(DDS_VT_Valuetype_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VT_VALUETYPE_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VT_Valuetype_Connector_stub + dynamicflags = VT_VALUETYPE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Valuetype_ConnectorC.cpp + } + + Header_Files { + VT_Valuetype_ConnectorC.h + VT_Valuetype_Connector_stub_export.h + } + + Inline_Files { + VT_Valuetype_ConnectorC.inl + } +} + +project(DDS_VT_Valuetype_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VT_VALUETYPE_Connector_lem_stub DDS_VT_Valuetype_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VT_Valuetype_Connector_exec + libs += DDS_VT_Valuetype_Connector_stub DDS_VT_VALUETYPE_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_VALUETYPE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Valuetype_Connector_conn.cpp + } + + Header_Files { + VT_Valuetype_Connector_conn.h + VT_Valuetype_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VT_Valuetype_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VT_VALUETYPE_Connector_lem_stub DDS_VT_Valuetype_Connector_exec \ + DDS_VT_Valuetype_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VT_Valuetype_Connector_svnt + libs += DDS_VT_Valuetype_Connector_stub \ + DDS_VT_VALUETYPE_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VT_Valuetype_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_VALUETYPE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VT_Valuetype_ConnectorS.cpp + VT_Valuetype_Connector_svnt.cpp + } + + Header_Files { + VT_Valuetype_ConnectorS.h + VT_Valuetype_Connector_svnt.h + VT_Valuetype_Connector_svnt_export.h + } + + Inline_Files { + VT_Valuetype_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.idl new file mode 100644 index 00000000000..bc2b73833b6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTopic_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTOPIC_CONNECTOR_IDL_ +#define VTOPIC_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopic_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/VTopic_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector VTopic_Connector : TestTopicConn::DDS_Event + { + }; +}; + +#endif /* VTopic_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.mpc new file mode 100644 index 00000000000..c96d76e6265 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Connector/VTopic_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopic_Base -l .. -o ../lib -u DDS VTopic_Connector" + +project(DDS_VTopic_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTOPIC_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTopic_Connector_stub_export.h \ + -Wb,skel_export_macro=VTOPIC_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTopic_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTOPIC_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTopic_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTOPIC_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTopic_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTopic_Connector.idl + } +} + +project(DDS_VTopic_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTopic_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTOPIC_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTopic_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTopic_ConnectorE.idl + } +} + +project(DDS_VTopic_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopic_Connector_lem_gen DDS_VTopic_Connector_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopic_Base_stub DDS_VTopic_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTopic_Connector_lem_stub + dynamicflags = VTOPIC_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ConnectorEC.cpp + } + + Header_Files { + VTopic_ConnectorEC.h + VTopic_Connector_lem_stub_export.h + } + + Inline_Files { + VTopic_ConnectorEC.inl + } +} + +project(DDS_VTopic_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopic_Connector_idl_gen DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTopic_Connector_stub + dynamicflags = VTOPIC_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ConnectorC.cpp + } + + Header_Files { + VTopic_ConnectorC.h + VTopic_Connector_stub_export.h + } + + Inline_Files { + VTopic_ConnectorC.inl + } +} + +project(DDS_VTopic_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + sharedname = DDS_VTopic_Connector_exec + libs += DDS_VTopic_Connector_stub DDS_VTopic_Connector_lem_stub DDS_VTopic_Base_stub DDS4CCM_lem_stub DDS_VTopic_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTOPIC_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_Connector_conn.cpp + } + + Header_Files { + VTopic_Connector_conn.h + VTopic_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopic_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_exec DDS_VTopic_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTopic_Connector_svnt + libs += DDS_VTopic_Connector_stub \ + DDS_VTopic_Connector_lem_stub \ + DDS_VTopic_Base_stub \ + DDS_VTopic_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTOPIC_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ConnectorS.cpp + VTopic_Connector_svnt.cpp + } + + Header_Files { + VTopic_ConnectorS.h + VTopic_Connector_svnt.h + VTopic_Connector_svnt_export.h + } + + Inline_Files { + VTopic_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.idl new file mode 100644 index 00000000000..8f24ce55e4f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/VTopic_Connector.idl" + +module VTopic +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.mpc new file mode 100644 index 00000000000..140c955f992 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver.mpc @@ -0,0 +1,173 @@ +// $Id$ + +project(DDS_VTopic_Receiver_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_VTopic_Connector_idl_gen + custom_only = 1 + 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 { + VTopic_Receiver.idl + } +} + +project(DDS_VTopic_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_VTopic_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 $CIAO_ROOT/connectors -I .. + + IDL_Files { + VTopic_ReceiverE.idl + } +} + +project(DDS_VTopic_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopic_Receiver_lem_gen DDS_VTopic_Receiver_stub DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub Receiver_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ReceiverEC.cpp + } + + Header_Files { + VTopic_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + VTopic_ReceiverEC.inl + } +} + +project(DDS_VTopic_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopic_Receiver_idl_gen DDS_VTopic_Base_stub \ + DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub \ + DDS_VT_String_Connector_lem_stub DDS_VT_String_Connector_stub \ + DDS_VT_Array_Connector_lem_stub DDS_VT_Array_Connector_stub \ + DDS_VT_Valuetype_Connector_lem_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_lem_stub DDS_VT_Union_Connector_stub \ + DDS_VT_Seq_Connector_lem_stub DDS_VT_Seq_Connector_stub + libs += DDS_VTopic_Base_stub DDS_VTopic_Connector_stub DDS_VT_Array_Connector_stub \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Union_Connector_stub \ + DDS_VT_String_Connector_stub DDS_VT_Seq_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ReceiverC.cpp + } + + Header_Files { + VTopic_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + VTopic_ReceiverC.inl + } +} + +project(DDS_VTopic_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_VTopic_Receiver_lem_stub DDS_VTopic_Receiver_stub \ + DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub\ + DDS_VT_Array_Connector_lem_stub DDS_VT_Array_Connector_stub \ + DDS_VT_String_Connector_lem_stub DDS_VT_String_Connector_stub \ + DDS_VT_Valuetype_Connector_lem_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_lem_stub DDS_VT_Union_Connector_stub \ + DDS_VT_Seq_Connector_lem_stub DDS_VT_Seq_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_VTopic_Base_stub DDS_VTopic_Connector_lem_stub \ + DDS_VTopic_Connector_stub DDS_VT_Array_Connector_stub DDS_VT_String_Connector_stub \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Union_Connector_stub \ + DDS_VT_Seq_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_Receiver_exec.cpp + } + + Header_Files { + VTopic_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopic_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_VTopic_Base_stub DDS_VTopic_Receiver_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_VT_String_Connector_stub DDS_VT_String_Connector_svnt DDS_VT_String_Connector_lem_stub \ + DDS_VT_Seq_Connector_stub DDS_VT_Seq_Connector_svnt DDS_VT_Seq_Connector_lem_stub\ + DDS_VT_Array_Connector_stub DDS_VT_Array_Connector_svnt DDS_VT_Array_Connector_lem_stub \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Valuetype_Connector_svnt DDS_VT_Valuetype_Connector_lem_stub \ + DDS_VT_Union_Connector_stub DDS_VT_Union_Connector_svnt DDS_VT_Union_Connector_lem_stub \ + DDS_VTopic_Connector_stub DDS_VTopic_Connector_svnt DDS_VTopic_Connector_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub \ + DDS_VTopic_Base_stub \ + DDS4CCM_lem_stub \ + DDS4CCM_skel \ + DDS_VTopic_Connector_stub DDS_VTopic_Connector_svnt \ + DDS_VT_Array_Connector_stub DDS_VT_Array_Connector_svnt \ + DDS_VT_String_Connector_stub DDS_VT_String_Connector_svnt \ + DDS_VT_Seq_Connector_stub DDS_VT_Seq_Connector_svnt \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Valuetype_Connector_svnt \ + DDS_VT_Union_Connector_stub DDS_VT_Union_Connector_svnt + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_ReceiverS.cpp + VTopic_Receiver_svnt.cpp + } + + Header_Files { + VTopic_ReceiverS.h + VTopic_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + VTopic_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.cpp new file mode 100644 index 00000000000..1fb3279de8a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.cpp @@ -0,0 +1,158 @@ +// -*- C++ -*- +// +// $Id$ + +//Test for different topictypes with DDS_Event connector, look for 'SUBSCRIPTION_MATCHED_STATUS + +#include "VTopic_Receiver_exec.h" +#include "ace/Log_Msg.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_VTopic_Receiver_Impl +{ +//============================================================ + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_Boolean &subscription_matched) + : subscription_matched_ (subscription_matched) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + if (! ::CORBA::is_nil (the_entity) && + status_kind == ::DDS::SUBSCRIPTION_MATCHED_STATUS) + { + this->subscription_matched_ = true; + } + } + + //============================================================ + // Component Executor Implementation Class: Receiver_exec_iTestTopic_RawListener_exec_i (); + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : subscription_matched_ (false) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + // Port operations. + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->subscription_matched_); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + VTopic::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return VTopic::TestTopicConn::CCM_Listener::_nil (); + } + + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::VTopic::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) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if(!this->subscription_matched_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("states 'SUBSCRIPTION_MATCHED_STATUS' in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Received the expected ") + ACE_TEXT ("'SUBSCRIPTION_MATCHED_STATUS' in Receiver\n") + )); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopic_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.h new file mode 100644 index 00000000000..d9f91b7bc87 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Receiver/VTopic_Receiver_exec.h @@ -0,0 +1,94 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "VTopic_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/Task.h" +#include "ace/Reactor.h" + +namespace CIAO_VTopic_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Receiver_exec_i; + + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + + private: + Atomic_Boolean &subscription_matched_; + }; + + 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. + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + virtual VTopic::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::VTopic::CCM_Receiver_Context_var context_; + Atomic_Boolean subscription_matched_; +}; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopic_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.idl new file mode 100644 index 00000000000..175a69a14d6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_VTOPIC_SENDER_IDL +#define DDS_VTOPIC_SENDER_IDL + +#include "Connector/VTopic_Connector.idl" + +module VTopic +{ + component Sender + { + port TestTopicConn::DDS_Write info_write; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.mpc new file mode 100644 index 00000000000..8d65e29abf8 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender.mpc @@ -0,0 +1,174 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopic_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_VTopic_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_VTopic_Connector_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 { + VTopic_Sender.idl + } +} + +project(DDS_VTopic_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_VTopic_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 { + VTopic_SenderE.idl + } +} + +project(DDS_VTopic_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopic_Sender_lem_gen DDS_VTopic_Sender_stub DDS_VTopic_Base_stub + libs += DDS_VTopic_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_SenderEC.cpp + } + + Header_Files { + VTopic_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + VTopic_SenderEC.inl + } +} + +project(DDS_VTopic_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopic_Sender_idl_gen DDS_VTopic_Base_stub \ + DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub \ + DDS_VT_String_Connector_lem_stub DDS_VT_String_Connector_stub \ + DDS_VT_Array_Connector_lem_stub DDS_VT_Array_Connector_stub \ + DDS_VT_Valuetype_Connector_lem_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_lem_stub DDS_VT_Union_Connector_stub \ + DDS_VT_Seq_Connector_lem_stub DDS_VT_Seq_Connector_stub + libs += DDS_VTopic_Base_stub DDS_VTopic_Connector_stub \ + DDS_VT_Array_Connector_stub DDS_VT_String_Connector_stub \ + DDS_VT_Seq_Connector_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_SenderC.cpp + } + + Header_Files { + VTopic_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + VTopic_SenderC.inl + } +} + +project(DDS_VTopic_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_VTopic_Sender_lem_stub DDS_VTopic_Sender_stub \ + DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub \ + DDS_VT_Array_Connector_lem_stub DDS_VT_Array_Connector_stub \ + DDS_VT_Valuetype_Connector_lem_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_lem_stub DDS_VT_Union_Connector_stub \ + DDS_VT_String_Connector_lem_stub DDS_VT_String_Connector_stub \ + DDS_VT_Seq_Connector_lem_stub DDS_VT_Seq_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_VTopic_Base_stub \ + DDS_VTopic_Connector_lem_stub DDS_VTopic_Connector_stub \ + DDS_VT_Array_Connector_stub DDS_VT_String_Connector_stub \ + DDS_VT_Seq_Connector_stub DDS_VT_Valuetype_Connector_stub \ + DDS_VT_Union_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_Sender_exec.cpp + } + + Header_Files { + VTopic_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopic_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_VTopic_Base_stub DDS_VTopic_Sender_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_VTopic_Connector_stub DDS_VTopic_Connector_svnt DDS_VTopic_Connector_lem_stub \ + DDS_VT_Array_Connector_stub DDS_VT_Array_Connector_svnt DDS_VT_Array_Connector_lem_stub \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Valuetype_Connector_svnt DDS_VT_Valuetype_Connector_lem_stub \ + DDS_VT_Union_Connector_stub DDS_VT_Union_Connector_svnt DDS_VT_Union_Connector_lem_stub \ + DDS_VT_String_Connector_stub DDS_VT_String_Connector_svnt DDS_VT_String_Connector_lem_stub \ + DDS_VT_Seq_Connector_stub DDS_VT_Seq_Connector_svnt DDS_VT_Seq_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_VTopic_Base_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_VTopic_Connector_stub DDS_VTopic_Connector_svnt \ + DDS_VT_Array_Connector_stub DDS_VT_Array_Connector_svnt \ + DDS_VT_Valuetype_Connector_stub DDS_VT_Valuetype_Connector_svnt \ + DDS_VT_Union_Connector_stub DDS_VT_Union_Connector_svnt \ + DDS_VT_String_Connector_stub DDS_VT_String_Connector_svnt \ + DDS_VT_Seq_Connector_stub DDS_VT_Seq_Connector_svnt + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopic_SenderS.cpp + VTopic_Sender_svnt.cpp + } + + Header_Files { + VTopic_SenderS.h + VTopic_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + VTopic_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.cpp new file mode 100644 index 00000000000..b41127ab77a --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.cpp @@ -0,0 +1,141 @@ +// -*- C++ -*- +// $Id$ + + +//Test different topic types, with DDS_EVENT connectors, look for 'PUBLICATION_MATCHED_STATUS +#include "VTopic_Sender_exec.h" +#include "ace/Log_Msg.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_VTopic_Sender_Impl +{ + //============================================================ + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_Boolean &publication_matched) + : publication_matched_ (publication_matched) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + if (! ::CORBA::is_nil (the_entity) && + status_kind == ::DDS::PUBLICATION_MATCHED_STATUS) + { + this->publication_matched_ = true; + } + } + + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + Sender_exec_i::Sender_exec_i (void) + : publication_matched_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_connector_status (void) + + { + return new ConnectorStatusListener_exec_i (this->publication_matched_); + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::VTopic::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) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if(!this->publication_matched_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("states 'PUBLICATION_MATCHED_STATUS' in Sender\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Received the expected ") + ACE_TEXT ("'PUBLICATION_MATCHED_STATUS' in Sender\n") + )); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopic_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.h new file mode 100644 index 00000000000..a92fddc93fa --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/Sender/VTopic_Sender_exec.h @@ -0,0 +1,83 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + +#include "VTopic_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_VTopic_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &publication_matched_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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); + + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status(void); + + private: + ::VTopic::CCM_Sender_Context_var context_; + + Atomic_Boolean publication_matched_; +}; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopic_Sender_Impl (void); + +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/descriptors/Plan.cdp new file mode 100644 index 00000000000..d430983f344 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/descriptors/Plan.cdp @@ -0,0 +1,1118 @@ +<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>VTopic_Depl_1</label> + <UUID>VTopic_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_VTopic_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_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="VTopic_ConnectorComponentImplementation"> + <name>VTopic_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VTopic_Connector_ExecArtifact" /> + <artifact xmi:idref="VTopic_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_VTopic_VTopic_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VTopic_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTopic_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTopic_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VT_String_ConnectorComponentImplementation"> + <name>VT_String_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VT_String_Connector_ExecArtifact" /> + <artifact xmi:idref="VT_String_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_VTopic_VT_String_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VT_String_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_String_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_String_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VT_Array_ConnectorComponentImplementation"> + <name>VT_Array_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VT_Array_Connector_ExecArtifact" /> + <artifact xmi:idref="VT_Array_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_VTopic_VT_Array_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VT_Array_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Array_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Array_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VT_Valuetype_ConnectorComponentImplementation"> + <name>VT_Valuetype_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VT_Valuetype_Connector_ExecArtifact" /> + <artifact xmi:idref="VT_Valuetype_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_VTopic_VT_Valuetype_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VT_Valuetype_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Valuetype_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Valuetype_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VT_Union_ConnectorComponentImplementation"> + <name>VT_Union_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VT_Union_Connector_ExecArtifact" /> + <artifact xmi:idref="VT_Union_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_VTopic_VT_Union_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VT_Union_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Union_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Union_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VT_Seq_ConnectorComponentImplementation"> + <name>VT_Seq_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VT_Seq_Connector_ExecArtifact" /> + <artifact xmi:idref="VT_Seq_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_VTopic_VT_Seq_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_VT_Seq_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Seq_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VT_Seq_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_VTopic_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopic_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="VTopic_ConnectorComponentInstance"> + <name>VTopic_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTopic_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VTopic_ConnectorComponentInstance2"> + <name>VTopic_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTopic_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VT_String_ConnectorComponentInstance"> + <name>VT_String_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_String_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestString</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VT_String_ConnectorComponentInstance2"> + <name>VT_String_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_String_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestString</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VT_Array_ConnectorComponentInstance"> + <name>VT_Array_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Array_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestArray</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VT_Array_ConnectorComponentInstance2"> + <name>VT_Array_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Array_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestArray</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VT_Valuetype_ConnectorComponentInstance"> + <name>VT_Valuetype_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Valuetype_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestValuetype</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VT_Valuetype_ConnectorComponentInstance2"> + <name>VT_Valuetype_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Valuetype_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestValuetype</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VT_Union_ConnectorComponentInstance"> + <name>VT_Union_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Union_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUnion</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VT_Union_ConnectorComponentInstance2"> + <name>VT_Union_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Union_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUnion</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VT_Seq_ConnectorComponentInstance"> + <name>VT_Seq_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Seq_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestSeq</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VT_Seq_ConnectorComponentInstance2"> + <name>VT_Seq_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VT_Seq_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestSeq</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <!-- + ***************************** + Regular connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTopic_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTopic_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <!-- connection in order to establish a publication_matched + --> + <connection> + <name>test_topic_info_write</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="VTopic_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <!-- connection in order to establish a subscription_matched + --> + <connection> + <name>test_topic_info_out</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_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="VTopic_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + String connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_string</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_String_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_string</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_String_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + Array connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_array</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Array_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_array</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Array_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + ValueType connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_valuetype</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Valuetype_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_valuetype</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Valuetype_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + Union connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_union</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Union_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_union</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Union_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + Sequence connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_seq</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Seq_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_seq</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VT_Seq_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="VTopic_Connector_ExecArtifact"> + <name>VTopic_Connector_exec</name> + <source/> + <node/> + <location>DDS_VTopic_Connector_exec</location> + </artifact> + <artifact xmi:id="VTopic_Connector_SvntArtifact"> + <name>VTopic_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VTopic_Connector_svnt</location> + </artifact> + <artifact xmi:id="VTopic_Connector_StubArtifact"> + <name>VTopic_Connector_stub</name> + <source/> + <node/> + <location>DDS_VTopic_Connector_stub</location> + </artifact> + + <artifact xmi:id="VT_String_Connector_ExecArtifact"> + <name>VT_String_Connector_exec</name> + <source/> + <node/> + <location>DDS_VT_String_Connector_exec</location> + </artifact> + <artifact xmi:id="VT_String_Connector_SvntArtifact"> + <name>VT_String_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VT_String_Connector_svnt</location> + </artifact> + <artifact xmi:id="VT_String_Connector_StubArtifact"> + <name>VT_String_Connector_stub</name> + <source/> + <node/> + <location>DDSVT_String_Connector_stub</location> + </artifact> + + <artifact xmi:id="VT_Array_Connector_ExecArtifact"> + <name>VT_Array_Connector_exec</name> + <source/> + <node/> + <location>DDS_VT_Array_Connector_exec</location> + </artifact> + <artifact xmi:id="VT_Array_Connector_SvntArtifact"> + <name>VT_Array_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VT_Array_Connector_svnt</location> + </artifact> + <artifact xmi:id="VT_Array_Connector_StubArtifact"> + <name>VT_Array_Connector_stub</name> + <source/> + <node/> + <location>DDS_VT_Array_Connector_stub</location> + </artifact> + + <artifact xmi:id="VT_Valuetype_Connector_ExecArtifact"> + <name>VT_Valuetype_Connector_exec</name> + <source/> + <node/> + <location>DDS_VT_Valuetype_Connector_exec</location> + </artifact> + <artifact xmi:id="VT_Valuetype_Connector_SvntArtifact"> + <name>VT_Valuetype_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VT_Valuetype_Connector_svnt</location> + </artifact> + <artifact xmi:id="VT_Valuetype_Connector_StubArtifact"> + <name>VT_Valuetype_Connector_stub</name> + <source/> + <node/> + <location>DDS_VT_Valuetype_Connector_stub</location> + </artifact> + + <artifact xmi:id="VT_Union_Connector_ExecArtifact"> + <name>VT_Union_Connector_exec</name> + <source/> + <node/> + <location>DDS_VT_Union_Connector_exec</location> + </artifact> + <artifact xmi:id="VT_Union_Connector_SvntArtifact"> + <name>VT_Union_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VT_Union_Connector_svnt</location> + </artifact> + <artifact xmi:id="VT_Union_Connector_StubArtifact"> + <name>VT_Union_Connector_stub</name> + <source/> + <node/> + <location>DDS_VT_Union_Connector_stub</location> + </artifact> + + <artifact xmi:id="VT_Seq_Connector_ExecArtifact"> + <name>VT_Seq_Connector_exec</name> + <source/> + <node/> + <location>DDS_VT_Seq_Connector_exec</location> + </artifact> + <artifact xmi:id="VT_Seq_Connector_SvntArtifact"> + <name>VT_Seq_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VT_Seq_Connector_svnt</location> + </artifact> + <artifact xmi:id="VT_Seq_Connector_StubArtifact"> + <name>VT_Seq_Connector_stub</name> + <source/> + <node/> + <location>DDS_VT_Seq_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/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/descriptors/run_test.pl new file mode 100755 index 00000000000..97e2bf434c6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsEvent/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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 (4 * $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/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.idl new file mode 100644 index 00000000000..4f852e618e3 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.idl @@ -0,0 +1,75 @@ +// $Id$ + +/** + * @file VTopics_Base.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTOPICS_BASE_IDL +#define VTOPICS_BASE_IDL + +#pragma ndds typesupport "Base/VTopics_BaseSupport.h" + +// Plain Topic +struct TestTopic { + string key; //@key + long x; +}; + +// String +struct TopicString { + string key; //@key + string x_str; +}; + +// Arrays +struct TopicArray { + string key; //@key + octet x_array[5]; +}; + +// Unions +union X_Union switch (short) { + case 0: + string x_test; + case 1: + long x_long; +}; + +struct TopicUnion { + string key; //@key + X_Union x_uni; +}; + +// Sequence +struct test { + short x_test; + string x_teststr; +}; +typedef sequence<test> test_seq; + +struct TopicSeq { + string key; //@key + test_seq x_seq; + }; + + // ValueType +valuetype X_Valuetype { + public string type; + public long x_long; +}; + +struct TopicValuetype { + string key; //@key + X_Valuetype x_vt; +}; + +// Sequences +typedef sequence<TestTopic> TestTopicSeq; +typedef sequence<TopicString> TopicStringSeq; +typedef sequence<TopicArray> TopicArraySeq; +typedef sequence<TopicUnion> TopicUnionSeq; +typedef sequence<TopicSeq> TopicSeqSeq; +typedef sequence<TopicValuetype> TopicValuetypeSeq; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.mpc new file mode 100644 index 00000000000..1ce360b9201 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Base/VTopics_Base.mpc @@ -0,0 +1,27 @@ +// $Id$ + +project (DDS_VTopics_Base_stub) : taoidldefaults, anytypecode, \ + dds4ccm_ts_default,valuetype { + sharedname = DDS_VTopics_Base_stub + dynamicflags += VTOPICS_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS \ + -Wb,stub_export_macro=VTOPICS_BASE_STUB_Export \ + -Wb,stub_export_include=VTopics_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + VTopics_Base.idl + } + + opendds_ts_flags += --export=VTOPICS_BASE_STUB_Export + + DDSGenerator_Files { + VTopics_Base.idl + } + + Source_Files { + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.idl new file mode 100644 index 00000000000..47160c4f29d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTS_Array_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTS_ARRAY_CONNECTOR_IDL_ +#define VTS_ARRAY_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Array/VTS_Array_ConnectorE.idl" + +module VTopics +{ + module ::CCM_DDS::Typed < ::TopicArray, ::TopicArraySeq> TopicArrayConn; + connector VTS_Array_Connector : TopicArrayConn::DDS_State + { + }; +}; + +#endif /* VTS_Array_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.mpc new file mode 100644 index 00000000000..839a9e5ef50 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Array/VTS_Array_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopics_Base -l .. -o ../lib -u DDS VTS_Array_Connector" + +project(DDS_VTS_ARRAY_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTS_ARRAY_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTS_Array_Connector_stub_export.h \ + -Wb,skel_export_macro=VTS_ARRAY_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTS_Array_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTS_ARRAY_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTS_Array_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTS_ARRAY_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTS_Array_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTS_Array_Connector.idl + } +} + +project(DDS_VTS_ARRAY_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTS_ARRAY_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTS_ARRAY_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTS_Array_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTS_Array_ConnectorE.idl + } +} + +project(DDS_VTS_ARRAY_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTS_ARRAY_Connector_lem_gen DDS_VTS_Array_Connector_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTS_Array_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_ARRAY_Connector_lem_stub + dynamicflags = VTS_ARRAY_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Array_ConnectorEC.cpp + } + + Header_Files { + VTS_Array_ConnectorEC.h + VTS_Array_Connector_lem_stub_export.h + } + + Inline_Files { + VTS_Array_ConnectorEC.inl + } +} + +project(DDS_VTS_Array_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTS_ARRAY_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_Array_Connector_stub + dynamicflags = VTS_ARRAY_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Array_ConnectorC.cpp + } + + Header_Files { + VTS_Array_ConnectorC.h + VTS_Array_Connector_stub_export.h + } + + Inline_Files { + VTS_Array_ConnectorC.inl + } +} + +project(DDS_VTS_Array_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTS_ARRAY_Connector_lem_stub DDS_VTS_Array_Connector_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTS_Array_Connector_exec + libs += DDS_VTS_Array_Connector_stub DDS_VTS_ARRAY_Connector_lem_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_ARRAY_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Array_Connector_conn.cpp + } + + Header_Files { + VTS_Array_Connector_conn.h + VTS_Array_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTS_Array_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTS_ARRAY_Connector_lem_stub DDS_VTS_Array_Connector_exec DDS_VTS_Array_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTS_Array_Connector_svnt + libs += DDS_VTS_Array_Connector_stub \ + DDS_VTS_ARRAY_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTS_Array_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_ARRAY_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Array_ConnectorS.cpp + VTS_Array_Connector_svnt.cpp + } + + Header_Files { + VTS_Array_ConnectorS.h + VTS_Array_Connector_svnt.h + VTS_Array_Connector_svnt_export.h + } + + Inline_Files { + VTS_Array_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.idl new file mode 100644 index 00000000000..4d2ef4d08cb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTS_Seq_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTS_SEQ_CONNECTOR_IDL_ +#define VTS_SEQ_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Seq/VTS_Seq_ConnectorE.idl" + +module VTopics +{ + module ::CCM_DDS::Typed < ::TopicSeq, ::TopicSeqSeq> TopicSeqConn; + connector VTS_Seq_Connector : TopicSeqConn::DDS_State + { + }; +}; + +#endif /* VTS_SEQ_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.mpc new file mode 100644 index 00000000000..d11a8536328 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Seq/VTS_Seq_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopics_Base -l .. -o ../lib -u DDS VTS_Seq_Connector" + +project(DDS_VTS_SEQ_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTS_SEQ_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTS_Seq_Connector_stub_export.h \ + -Wb,skel_export_macro=VTS_SEQ_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTS_Seq_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTS_SEQ_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTS_Seq_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTS_SEQ_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTS_Seq_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTS_Seq_Connector.idl + } +} + +project(DDS_VTS_SEQ_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTS_SEQ_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTS_SEQ_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTS_Seq_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTS_Seq_ConnectorE.idl + } +} + +project(DDS_VTS_SEQ_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTS_SEQ_Connector_lem_gen DDS_VTS_Seq_Connector_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTS_Seq_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_SEQ_Connector_lem_stub + dynamicflags = VTS_SEQ_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Seq_ConnectorEC.cpp + } + + Header_Files { + VTS_Seq_ConnectorEC.h + VTS_Seq_Connector_lem_stub_export.h + } + + Inline_Files { + VTS_Seq_ConnectorEC.inl + } +} + +project(DDS_VTS_Seq_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTS_SEQ_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_Seq_Connector_stub + dynamicflags = VTS_SEQ_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Seq_ConnectorC.cpp + } + + Header_Files { + VTS_Seq_ConnectorC.h + VTS_Seq_Connector_stub_export.h + } + + Inline_Files { + VTS_Seq_ConnectorC.inl + } +} + +project(DDS_VTS_Seq_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTS_SEQ_Connector_lem_stub DDS_VTS_Seq_Connector_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTS_Seq_Connector_exec + libs += DDS_VTS_Seq_Connector_stub DDS_VTS_SEQ_Connector_lem_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_SEQ_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Seq_Connector_conn.cpp + } + + Header_Files { + VTS_Seq_Connector_conn.h + VTS_Seq_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTS_Seq_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTS_SEQ_Connector_lem_stub DDS_VTS_Seq_Connector_exec DDS_VTS_Seq_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTS_Seq_Connector_svnt + libs += DDS_VTS_Seq_Connector_stub \ + DDS_VTS_SEQ_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTS_Seq_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_SEQ_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Seq_ConnectorS.cpp + VTS_Seq_Connector_svnt.cpp + } + + Header_Files { + VTS_Seq_ConnectorS.h + VTS_Seq_Connector_svnt.h + VTS_Seq_Connector_svnt_export.h + } + + Inline_Files { + VTS_Seq_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.idl new file mode 100644 index 00000000000..c3c0736f42d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTS_String_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTS_STRING_CONNECTOR_IDL_ +#define VTS_STRING_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_String/VTS_String_ConnectorE.idl" + +module VTopics +{ + module ::CCM_DDS::Typed < ::TopicString, ::TopicStringSeq> TopicStringConn; + connector VTS_String_Connector : TopicStringConn::DDS_Event + { + }; +}; + +#endif /* VTS_STRING_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.mpc new file mode 100644 index 00000000000..35548bf3c23 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_String/VTS_String_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopics_Base -l .. -o ../lib -u DDS VTS_String_Connector" + +project(DDS_VTS_STRING_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTS_STRING_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTS_String_Connector_stub_export.h \ + -Wb,skel_export_macro=VTS_STRING_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTS_String_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTS_STRING_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTS_String_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTS_STRING_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTS_String_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTS_String_Connector.idl + } +} + +project(DDS_VTS_STRING_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTS_STRING_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTS_STRING_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTS_String_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTS_String_ConnectorE.idl + } +} + +project(DDS_VTS_STRING_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTS_STRING_Connector_lem_gen DDS_VTS_String_Connector_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTS_String_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_STRING_Connector_lem_stub + dynamicflags = VTS_STRING_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_String_ConnectorEC.cpp + } + + Header_Files { + VTS_String_ConnectorEC.h + VTS_String_Connector_lem_stub_export.h + } + + Inline_Files { + VTS_String_ConnectorEC.inl + } +} + +project(DDS_VTS_String_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTS_STRING_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_String_Connector_stub + dynamicflags = VTS_STRING_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_String_ConnectorC.cpp + } + + Header_Files { + VTS_String_ConnectorC.h + VTS_String_Connector_stub_export.h + } + + Inline_Files { + VTS_String_ConnectorC.inl + } +} + +project(DDS_VTS_String_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTS_STRING_Connector_lem_stub DDS_VTS_String_Connector_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTS_String_Connector_exec + libs += DDS_VTS_String_Connector_stub DDS_VTS_STRING_Connector_lem_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_STRING_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_String_Connector_conn.cpp + } + + Header_Files { + VTS_String_Connector_conn.h + VTS_String_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTS_String_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTS_STRING_Connector_lem_stub DDS_VTS_String_Connector_exec DDS_VTS_String_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTS_String_Connector_svnt + libs += DDS_VTS_String_Connector_stub \ + DDS_VTS_STRING_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTS_String_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_STRING_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_String_ConnectorS.cpp + VTS_String_Connector_svnt.cpp + } + + Header_Files { + VTS_String_ConnectorS.h + VTS_String_Connector_svnt.h + VTS_String_Connector_svnt_export.h + } + + Inline_Files { + VTS_String_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.idl new file mode 100644 index 00000000000..435b3b84eb9 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTS_Union_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef VT_UNION_CONNECTOR_IDL_ +#define VT_UNION_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Union/VTS_Union_ConnectorE.idl" + +module VTopic +{ + module ::CCM_DDS::Typed < ::TopicUnion, ::TopicUnionSeq> TopicUnionConn; + connector VT_Union_Connector : TopicUnionConn::DDS_State + { + }; +}; + +#endif /* VT_UNION_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.mpc new file mode 100644 index 00000000000..90919833140 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Union/VTS_Union_Connector.mpc @@ -0,0 +1,144 @@ +// $Id$ + +project(DDS_VTS_Union_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VT_UNION_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTS_Union_Connector_stub_export.h \ + -Wb,skel_export_macro=VT_UNION_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTS_Union_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VT_UNION_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTS_Union_Connector_svnt_export.h \ + -Wb,conn_export_macro=VT_UNION_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTS_Union_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTS_Union_Connector.idl + } +} + +project(DDS_VTS_Union_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTS_Union_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VT_UNION_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTS_Union_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTS_Union_ConnectorE.idl + } +} + +project(DDS_VTS_Union_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTS_Union_Connector_lem_gen DDS_VTS_Union_Connector_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTS_Union_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_Union_Connector_lem_stub + dynamicflags = VT_UNION_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Union_ConnectorEC.cpp + } + + Header_Files { + VTS_Union_ConnectorEC.h + VTS_Union_Connector_lem_stub_export.h + } + + Inline_Files { + VTS_Union_ConnectorEC.inl + } +} + +project(DDS_VTS_Union_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTS_Union_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_Union_Connector_stub + dynamicflags = VT_UNION_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Union_ConnectorC.cpp + } + + Header_Files { + VTS_Union_ConnectorC.h + VTS_Union_Connector_stub_export.h + } + + Inline_Files { + VTS_Union_ConnectorC.inl + } +} + +project(DDS_VTS_Union_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTS_Union_Connector_lem_stub DDS_VTS_Union_Connector_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTS_Union_Connector_exec + libs += DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_lem_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_UNION_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Union_Connector_conn.cpp + } + + Header_Files { + VTS_Union_Connector_conn.h + VTS_Union_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTS_Union_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTS_Union_Connector_lem_stub DDS_VTS_Union_Connector_exec \ + DDS_VTS_Union_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTS_Union_Connector_svnt + libs += DDS_VTS_Union_Connector_stub \ + DDS_VTS_Union_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTS_Union_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VT_UNION_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Union_ConnectorS.cpp + VTS_Union_Connector_svnt.cpp + } + + Header_Files { + VTS_Union_ConnectorS.h + VTS_Union_Connector_svnt.h + VTS_Union_Connector_svnt_export.h + } + + Inline_Files { + VTS_Union_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.idl new file mode 100644 index 00000000000..6d61eb185d0 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTS_Valuetype_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef VTS_VALUE_TYPE_CONNECTOR_IDL_ +#define VTS_VALUE_TYPE_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Conn_Valuetype/VTS_Valuetype_ConnectorE.idl" + +module VTopics +{ + module ::CCM_DDS::Typed < ::TopicValuetype, ::TopicValuetypeSeq> TopicValuetypeConn; + connector VTS_Valuetype_Connector : TopicValuetypeConn::DDS_State + { + }; +}; + +#endif /* VTS_VALUE_TYPE_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.mpc new file mode 100644 index 00000000000..63d11365dd6 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Conn_Valuetype/VTS_Valuetype_Connector.mpc @@ -0,0 +1,147 @@ +// $Id$ + +project(DDS_VTS_Valuetype_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTS_VALUE_TYPE_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTS_Valuetype_Connector_stub_export.h \ + -Wb,skel_export_macro=VTS_VALUE_TYPE_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTS_Valuetype_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTS_VALUE_TYPE_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTS_Valuetype_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTS_VALUE_TYPE_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTS_Valuetype_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTS_Valuetype_Connector.idl + } +} + +project(DDS_VTS_Valuetype_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTS_Valuetype_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTS_VALUE_TYPE_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTS_Valuetype_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTS_Valuetype_ConnectorE.idl + } +} + +project(DDS_VTS_VALUE_TYPE_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTS_Valuetype_Connector_lem_gen DDS_VTS_Valuetype_Connector_stub \ + DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTS_Valuetype_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_VALUE_TYPE_Connector_lem_stub + dynamicflags = VTS_VALUE_TYPE_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Valuetype_ConnectorEC.cpp + } + + Header_Files { + VTS_Valuetype_ConnectorEC.h + VTS_Valuetype_Connector_lem_stub_export.h + } + + Inline_Files { + VTS_Valuetype_ConnectorEC.inl + } +} + +project(DDS_VTS_Valuetype_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTS_Valuetype_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTS_Valuetype_Connector_stub + dynamicflags = VTS_VALUE_TYPE_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Valuetype_ConnectorC.cpp + } + + Header_Files { + VTS_Valuetype_ConnectorC.h + VTS_Valuetype_Connector_stub_export.h + } + + Inline_Files { + VTS_Valuetype_ConnectorC.inl + } +} + +project(DDS_VTS_Valuetype_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTS_VALUE_TYPE_Connector_lem_stub DDS_VTS_Valuetype_Connector_stub \ + DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTS_Valuetype_Connector_exec + libs += DDS_VTS_Valuetype_Connector_stub DDS_VTS_VALUE_TYPE_Connector_lem_stub \ + DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_VALUE_TYPE_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Valuetype_Connector_conn.cpp + } + + Header_Files { + VTS_Valuetype_Connector_conn.h + VTS_Valuetype_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTS_Valuetype_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTS_VALUE_TYPE_Connector_lem_stub DDS_VTS_Valuetype_Connector_exec\ + DDS_VTS_Valuetype_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTS_Valuetype_Connector_svnt + libs += DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_VALUE_TYPE_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTS_Valuetype_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTS_VALUE_TYPE_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTS_Valuetype_ConnectorS.cpp + VTS_Valuetype_Connector_svnt.cpp + } + + Header_Files { + VTS_Valuetype_ConnectorS.h + VTS_Valuetype_Connector_svnt.h + VTS_Valuetype_Connector_svnt_export.h + } + + Inline_Files { + VTS_Valuetype_ConnectorS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.idl new file mode 100644 index 00000000000..cd1748ae3b1 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file VTopics_Connector.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef VTOPICS_CONNECTOR_IDL_ +#define VTOPICS_CONNECTOR_IDL_ + +#include <Components.idl> +#include "Base/VTopics_Base.idl" +#include "connectors/dds4ccm/idl/ccm_dds.idl" + +#pragma ciao lem "Connector/VTopics_ConnectorE.idl" + +module VTopics +{ + module ::CCM_DDS::Typed < ::TestTopic, ::TestTopicSeq> TestTopicConn; + connector VTopics_Connector : TestTopicConn::DDS_State + { + }; +}; + +#endif /* VTopics_CONNECTOR_IDL_ */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.mpc new file mode 100644 index 00000000000..c311d36e795 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Connector/VTopics_Connector.mpc @@ -0,0 +1,145 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopics_Base -l .. -o ../lib -u DDS VTopics_Connector" + +project(DDS_VTopics_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=VTOPICS_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=VTopics_Connector_stub_export.h \ + -Wb,skel_export_macro=VTOPICS_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=VTopics_Connector_svnt_export.h \ + -Wb,svnt_export_macro=VTOPICS_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=VTopics_Connector_svnt_export.h \ + -Wb,conn_export_macro=VTOPICS_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=VTopics_Connector_conn_export.h \ + -I .. + + IDL_Files { + VTopics_Connector.idl + } +} + +project(DDS_VTopics_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTopics_Connector_idl_gen + idlflags += -Wb,stub_export_macro=VTOPICS_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=VTopics_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + VTopics_ConnectorE.idl + } +} + +project(DDS_VTopics_Connector_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopics_Connector_lem_gen DDS_VTopics_Connector_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub + libs += DDS_VTopics_Base_stub DDS_VTopics_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTopics_Connector_lem_stub + dynamicflags = VTOPICS_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ConnectorEC.cpp + } + + Header_Files { + VTopics_ConnectorEC.h + VTopics_Connector_lem_stub_export.h + } + + Inline_Files { + VTopics_ConnectorEC.inl + } +} + +project(DDS_VTopics_Connector_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopics_Connector_idl_gen DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = DDS_VTopics_Connector_stub + dynamicflags = VTOPICS_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ConnectorC.cpp + } + + Header_Files { + VTopics_ConnectorC.h + VTopics_Connector_stub_export.h + } + + Inline_Files { + VTopics_ConnectorC.inl + } +} + +project(DDS_VTopics_Connector_exec) : ciao_executor, dds4ccm_impl { + after += DDS_VTopics_Connector_lem_stub DDS_VTopics_Connector_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + sharedname = DDS_VTopics_Connector_exec + libs += DDS_VTopics_Connector_stub DDS_VTopics_Connector_lem_stub DDS_VTopics_Base_stub DDS4CCM_lem_stub DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTOPICS_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_Connector_conn.cpp + } + + Header_Files { + VTopics_Connector_conn.h + VTopics_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopics_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += DDS_VTopics_Connector_lem_stub DDS_VTopics_Connector_exec DDS_VTopics_Connector_stub DDS4CCM_lem_stub + sharedname = DDS_VTopics_Connector_svnt + libs += DDS_VTopics_Connector_stub \ + DDS_VTopics_Connector_lem_stub \ + DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_exec \ + DDS4CCM_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = VTOPICS_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ConnectorS.cpp + VTopics_Connector_svnt.cpp + } + + Header_Files { + VTopics_ConnectorS.h + VTopics_Connector_svnt.h + VTopics_Connector_svnt_export.h + } + + Inline_Files { + VTopics_ConnectorS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.idl new file mode 100644 index 00000000000..de6eabc74dd --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.idl @@ -0,0 +1,22 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/VTopics_Connector.idl" + +module VTopics +{ + component Receiver + { + port TestTopicConn::DDS_Listen info_out; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.mpc new file mode 100644 index 00000000000..e4e4bdf788f --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver.mpc @@ -0,0 +1,176 @@ +// $Id$ + +project(DDS_VTopics_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += DDS_VTopics_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 { + VTopics_Receiver.idl + } +} + +project(DDS_VTopics_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_VTopics_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 { + VTopics_ReceiverE.idl + } +} + +project(DDS_VTopics_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopics_Receiver_lem_gen DDS_VTopics_Receiver_stub DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTS_String_Connector_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Seq_Connector_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Union_Connector_stub + libs += Receiver_stub DDS_VTopics_Connector_stub DDS_VTS_String_Connector_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Seq_Connector_stub DDS_VTopics_Base_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Union_Connector_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ReceiverEC.cpp + } + + Header_Files { + VTopics_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + VTopics_ReceiverEC.inl + } +} + +project(DDS_VTopics_Receiver_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopics_Receiver_idl_gen DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTopics_Connector_lem_gen \ + DDS_VTS_String_Connector_stub DDS_VTS_String_Connector_lem_gen \ + DDS_VTS_Array_Connector_stub DDS_VTS_Array_Connector_lem_gen \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Valuetype_Connector_lem_gen \ + DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_lem_gen \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Seq_Connector_lem_gen + libs += DDS_VTopics_Connector_stub DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_Array_Connector_stub \ + DDS_VTS_Union_Connector_stub DDS_VTS_Seq_Connector_stub \ + DDS_VTopics_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ReceiverC.cpp + } + + Header_Files { + VTopics_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + VTopics_ReceiverC.inl + } +} + +project(DDS_VTopics_Receiver_exec) : ciao_executor, dds4ccm_base { + after += DDS_VTopics_Receiver_lem_stub DDS_VTopics_Receiver_stub DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTopics_Connector_lem_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_String_Connector_lem_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Array_Connector_lem_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Valuetype_Connector_lem_stub \ + DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_lem_stub \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Seq_Connector_lem_stub \ + DDS4CCM_lem_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTS_String_Connector_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Seq_Connector_stub \ + DDS_VTopics_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Union_Connector_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_Receiver_exec.cpp + } + + Header_Files { + VTopics_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopics_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += DDS_VTopics_Receiver_lem_stub DDS_VTopics_Base_stub DDS_VTopics_Receiver_exec \ + DDS_VTopics_Connector_stub DDS_VTopics_Connector_svnt DDS_VTopics_Connector_lem_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_String_Connector_svnt DDS_VTS_String_Connector_lem_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Array_Connector_svnt DDS_VTS_Array_Connector_lem_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Valuetype_Connector_svnt DDS_VTS_Valuetype_Connector_lem_stub \ + DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_svnt DDS_VTS_Union_Connector_lem_stub \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Seq_Connector_svnt DDS_VTS_Seq_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTS_String_Connector_stub DDS_VTS_Array_Connector_stub DDS_VTS_Seq_Connector_stub \ + DDS_VTopics_Connector_svnt DDS_VTS_String_Connector_svnt DDS_VTS_Array_Connector_svnt DDS_VTS_Seq_Connector_svnt \ + DDS_VTS_Valuetype_Connector_svnt DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_Union_Connector_svnt DDS_VTS_Union_Connector_stub \ + Receiver_exec DDS_VTopics_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_ReceiverS.cpp + VTopics_Receiver_svnt.cpp + } + + Header_Files { + VTopics_ReceiverS.h + VTopics_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + VTopics_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.cpp new file mode 100644 index 00000000000..b822e6548ab --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.cpp @@ -0,0 +1,158 @@ +// -*- C++ -*- +// +// $Id$ + +//Test for different topic types , with DDS_STATE connector, look for 'SUBSCRIPTION_MATCHED_STATUS + +#include "VTopics_Receiver_exec.h" +#include "dds4ccm/impl/dds/Utils.h" + + +namespace CIAO_VTopics_Receiver_Impl +{ +//============================================================ + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_Boolean &subscription_matched) + : subscription_matched_ (subscription_matched) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::ConnectorStatusListener + void ConnectorStatusListener_exec_i::on_inconsistent_topic ( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + if (! ::CORBA::is_nil(the_entity) && + status_kind == DDS::SUBSCRIPTION_MATCHED_STATUS) + { + this->subscription_matched_ = true; + } + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : subscription_matched_ (false) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Port operations. + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Receiver_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->subscription_matched_); + } + + VTopics::TestTopicConn::CCM_Listener_ptr + Receiver_exec_i::get_info_out_data_listener (void) + { + return VTopics::TestTopicConn::CCM_Listener::_nil (); + } + + CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_info_out_status (void) + { + return CCM_DDS::CCM_PortStatusListener::_nil (); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::VTopics::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) + { + } + + void + Receiver_exec_i::ccm_passivate (void) + { + } + + void + Receiver_exec_i::ccm_remove (void) + { + if(!this->subscription_matched_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("status 'SUBSCRIPTION_MATCHED_STATUS' ") + ACE_TEXT ("in Receiver\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Received the expected ") + ACE_TEXT ("'SUBSCRIPTION_MATCHED_STATUS' ") + ACE_TEXT ("in Receiver\n") + )); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopics_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.h new file mode 100644 index 00000000000..5a611357d68 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Receiver/VTopics_Receiver_exec.h @@ -0,0 +1,92 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "VTopics_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +namespace CIAO_VTopics_Receiver_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Receiver_exec_i; + + class RECEIVER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + + private: + Atomic_Boolean &subscription_matched_; + }; + + 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. + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); + + virtual VTopics::TestTopicConn::CCM_Listener_ptr + get_info_out_data_listener (void); + + virtual CCM_DDS::CCM_PortStatusListener_ptr + get_info_out_status (void); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::VTopics::CCM_Receiver_Context_var context_; + Atomic_Boolean subscription_matched_; +}; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopics_Receiver_Impl (void); +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.idl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.idl new file mode 100644 index 00000000000..aa69235d695 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.idl @@ -0,0 +1,24 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_VTOPICS_SENDER_IDL +#define DDS_VTOPICS_SENDER_IDL + +#include "Connector/VTopics_Connector.idl" + +module VTopics +{ + component Sender + { + port TestTopicConn::DDS_Update info_write; + provides CCM_DDS::ConnectorStatusListener connector_status; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.mpc b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.mpc new file mode 100644 index 00000000000..b4011de4d40 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender.mpc @@ -0,0 +1,171 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p DDS_VTopics_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(DDS_VTopics_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += DDS_VTopics_Connector_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 { + VTopics_Sender.idl + } +} + +project(DDS_VTopics_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += DDS_VTopics_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 { + VTopics_SenderE.idl + } +} + +project(DDS_VTopics_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += DDS_VTopics_Sender_lem_gen DDS_VTopics_Sender_stub DDS_VTopics_Base_stub + libs += DDS_VTopics_Base_stub Sender_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags = SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_SenderEC.cpp + } + + Header_Files { + VTopics_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + VTopics_SenderEC.inl + } +} + +project(DDS_VTopics_Sender_stub) : ccm_stub, dds4ccm_base { + after += DDS_VTopics_Sender_idl_gen DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_stub DDS_VTS_String_Connector_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_Union_Connector_stub DDS_VTS_Seq_Connector_stub + libs += DDS_VTopics_Base_stub DDS_VTopics_Connector_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_Array_Connector_stub \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_Union_Connector_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags = SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_SenderC.cpp + } + + Header_Files { + VTopics_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + VTopics_SenderC.inl + } +} + +project(DDS_VTopics_Sender_exec) : ciao_executor, dds4ccm_base { + after += DDS_VTopics_Sender_lem_stub DDS_VTopics_Sender_stub \ + DDS_VTopics_Connector_lem_stub DDS_VTopics_Connector_stub \ + DDS_VTS_String_Connector_lem_stub DDS_VTS_String_Connector_stub \ + DDS_VTS_Array_Connector_lem_stub DDS_VTS_Array_Connector_stub \ + DDS_VTS_Valuetype_Connector_lem_stub DDS_VTS_Valuetype_Connector_stub \ + DDS_VTS_Union_Connector_lem_stub DDS_VTS_Union_Connector_stub \ + DDS_VTS_Seq_Connector_lem_stub DDS_VTS_Seq_Connector_stub \ + DDS4CCM_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub DDS_VTopics_Base_stub \ + DDS_VTopics_Connector_lem_stub DDS_VTopics_Connector_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_Array_Connector_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Seq_Connector_stub \ + DDS_VTS_Union_Connector_stub DDS4CCM_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags = SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_Sender_exec.cpp + } + + Header_Files { + VTopics_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(DDS_VTopics_Sender_svnt) : ciao_servant, dds4ccm_base { + after += DDS_VTopics_Base_stub DDS_VTopics_Sender_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel \ + DDS_VTopics_Connector_stub DDS_VTopics_Connector_svnt DDS_VTopics_Connector_lem_stub \ + DDS_VTS_String_Connector_stub DDS_VTS_String_Connector_svnt DDS_VTS_String_Connector_lem_stub \ + DDS_VTS_Array_Connector_stub DDS_VTS_Array_Connector_svnt DDS_VTS_Array_Connector_lem_stub \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Valuetype_Connector_svnt DDS_VTS_Valuetype_Connector_lem_stub \ + DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_svnt DDS_VTS_Union_Connector_lem_stub \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Seq_Connector_svnt DDS_VTS_Seq_Connector_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub \ + DDS_VTopics_Base_stub \ + DDS4CCM_lem_stub DDS4CCM_skel \ + DDS_VTopics_Connector_stub DDS_VTopics_Connector_svnt \ + DDS_VTS_String_Connector_stub DDS_VTS_String_Connector_svnt \ + DDS_VTS_Array_Connector_stub DDS_VTS_Array_Connector_svnt \ + DDS_VTS_Valuetype_Connector_stub DDS_VTS_Valuetype_Connector_svnt \ + DDS_VTS_Union_Connector_stub DDS_VTS_Union_Connector_svnt \ + DDS_VTS_Seq_Connector_stub DDS_VTS_Seq_Connector_svnt + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + VTopics_SenderS.cpp + VTopics_Sender_svnt.cpp + } + + Header_Files { + VTopics_SenderS.h + VTopics_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + VTopics_SenderS.inl + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.cpp new file mode 100644 index 00000000000..059372ba636 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.cpp @@ -0,0 +1,140 @@ +// -*- C++ -*- +// $Id$ + + +//Test different topic types, with DDS_STATE connector, look for 'PUBLICATION_MATCHED_STATUS +#include "VTopics_Sender_exec.h" +#include "dds4ccm/impl/dds/Utils.h" + +namespace CIAO_VTopics_Sender_Impl +{ + //============================================================ + // ConnectorStatusListener_exec_i + //============================================================ + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i ( + Atomic_Boolean &publication_matched) + : publication_matched_ (publication_matched) + { + } + + ConnectorStatusListener_exec_i::~ConnectorStatusListener_exec_i (void) + { + } + + void ConnectorStatusListener_exec_i::on_inconsistent_topic( + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::RequestedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_sample_rejected ( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) + { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status ( + ::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind) + { + if (! ::CORBA::is_nil (the_entity) && + status_kind == DDS::PUBLICATION_MATCHED_STATUS) + { + this->publication_matched_ = true; + } + } + //============================================================ + // Component Executor Implementation Class: Sender_exec_i + //============================================================ + + Sender_exec_i::Sender_exec_i (void) + : publication_matched_ (false) + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + } + + ::CCM_DDS::CCM_ConnectorStatusListener_ptr + Sender_exec_i::get_connector_status (void) + { + return new ConnectorStatusListener_exec_i (this->publication_matched_); + } + + // Supported operations and attributes. + void + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) + { + this->context_ = ::VTopics::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) + { + } + + void + Sender_exec_i::ccm_passivate (void) + { + } + + void + Sender_exec_i::ccm_remove (void) + { + if(!this->publication_matched_.value ()) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") + ACE_TEXT ("states 'PUBLICATION_MATCHED_STATUS' ") + ACE_TEXT ("in Sender\n") + )); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Received the expected ") + ACE_TEXT ("'PUBLICATION_MATCHED_STATUS' ") + ACE_TEXT ("in Sender\n") + )); + } + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopics_Sender_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + ACE_NEW_NORETURN ( + retval, + Sender_exec_i); + + return retval; + } +} diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.h b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.h new file mode 100644 index 00000000000..f2086ba3883 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/Sender/VTopics_Sender_exec.h @@ -0,0 +1,84 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_SENDER_EXEC_H_ +#define CIAO_SENDER_EXEC_H_ + + +#include "VTopics_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_VTopics_Sender_Impl +{ + typedef ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Boolean > Atomic_Boolean; + + class Sender_exec_i; + + class SENDER_EXEC_Export ConnectorStatusListener_exec_i + : public virtual ::CCM_DDS::CCM_ConnectorStatusListener, + public virtual ::CORBA::LocalObject + { + public: + ConnectorStatusListener_exec_i (Atomic_Boolean &); + virtual ~ConnectorStatusListener_exec_i (void); + + virtual + void on_inconsistent_topic (::DDS::Topic_ptr the_topic, + const DDS::InconsistentTopicStatus & status); + virtual + void on_requested_incompatible_qos (::DDS::DataReader_ptr the_reader, + const DDS::RequestedIncompatibleQosStatus & status); + virtual + void on_sample_rejected (::DDS::DataReader_ptr the_reader, + const DDS::SampleRejectedStatus & status); + virtual + void on_offered_deadline_missed (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedDeadlineMissedStatus & status); + virtual + void on_offered_incompatible_qos (::DDS::DataWriter_ptr the_writer, + const DDS::OfferedIncompatibleQosStatus & status); + virtual + void on_unexpected_status (::DDS::Entity_ptr the_entity, + ::DDS::StatusKind status_kind); + private: + Atomic_Boolean &publication_matched_; + }; + + class Sender_exec_i + : public virtual Sender_Exec, + public virtual ::CORBA::LocalObject + { + public: + Sender_exec_i (void); + virtual ~Sender_exec_i (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); + + // Port operations. + virtual ::CCM_DDS::CCM_ConnectorStatusListener_ptr + get_connector_status (void); + + private: + ::VTopics::CCM_Sender_Context_var context_; + + Atomic_Boolean publication_matched_; +}; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_VTopics_Sender_Impl (void); + +} + +#endif /* ifndef */ diff --git a/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/descriptors/Plan.cdp b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/descriptors/Plan.cdp new file mode 100644 index 00000000000..d2a09c3cb23 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/descriptors/Plan.cdp @@ -0,0 +1,815 @@ +<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>VTopics_Depl_1</label> + <UUID>VTopics_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_VTopics_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_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="VTopics_ConnectorComponentImplementation"> + <name>VTopics_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VTopics_Connector_ExecArtifact" /> + <artifact xmi:idref="VTopics_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_VTopics_VTopics_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_VTopics_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTopics_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTopics_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VTS_String_ConnectorComponentImplementation"> + <name>VTS_String_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VTS_String_Connector_ExecArtifact" /> + <artifact xmi:idref="VTS_String_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_VTopics_VTS_String_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_VTS_String_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_String_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_String_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VTS_Array_ConnectorComponentImplementation"> + <name>VTS_Array_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VTS_Array_Connector_ExecArtifact" /> + <artifact xmi:idref="VTS_Array_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_VTopics_VTS_Array_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_VTS_Array_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_Array_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_Array_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="VTS_Seq_ConnectorComponentImplementation"> + <name>VTS_Seq_ConnectorComponentImplementation</name> + <source/> + <artifact xmi:idref="VTS_Seq_Connector_ExecArtifact" /> + <artifact xmi:idref="VTS_Seq_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_VTopics_VTS_Seq_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_VTS_Seq_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_Seq_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>VTS_Seq_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_VTopics_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_VTopics_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="VTopics_ConnectorComponentInstance"> + <name>VTopics_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTopics_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VTopics_ConnectorComponentInstance2"> + <name>VTopics_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTopics_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestUS</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VTS_String_ConnectorComponentInstance"> + <name>VTS_String_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_String_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestString</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VTS_String_ConnectorComponentInstance2"> + <name>VTS_String_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_String_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestString</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VTS_Array_ConnectorComponentInstance"> + <name>VTS_Array_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_Array_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestArray</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VTS_Array_ConnectorComponentInstance2"> + <name>VTS_Array_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_Array_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestArray</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="VTS_Seq_ConnectorComponentInstance"> + <name>VTS_Seq_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_Seq_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestSeq</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="VTS_Seq_ConnectorComponentInstance2"> + <name>VTS_Seq_ConnectorComponent2</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="VTS_Seq_ConnectorComponentImplementation" /> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestSeq</string> + </value> + </value> + </configProperty> + </instance> + + + <instance xmi:id="SenderComponentInstance"> + <name>SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SenderComponentImplementation" /> + </instance> + + <!-- + ***************************** + Regular connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTopics_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTopics_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <!-- connection in order to establish a publication_matched + --> + <connection> + <name>info_write_data</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>observable_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="VTopics_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + <!-- connection in order to establish a subscription_matched + --> + <connection> + <name>info_out_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>info_out_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>push_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="VTopics_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + String connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_string</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_String_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_string</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_String_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + Array connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_array</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_Array_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_array</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_Array_ConnectorComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- + ***************************** + Sequence connector connections + ***************************** + --> + <connection> + <name>connector_status_receiver_seq</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_Seq_ConnectorComponentInstance2" /> + </internalEndpoint> + </connection> + <connection> + <name>connector_status_sender_seq</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>connector_status</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>error_listener</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="VTS_Seq_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="VTopics_Connector_ExecArtifact"> + <name>VTopics_Connector_exec</name> + <source/> + <node/> + <location>DDS_VTopics_Connector_exec</location> + </artifact> + <artifact xmi:id="VTopics_Connector_SvntArtifact"> + <name>VTopics_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VTopics_Connector_svnt</location> + </artifact> + <artifact xmi:id="VTopics_Connector_StubArtifact"> + <name>VTopics_Connector_stub</name> + <source/> + <node/> + <location>DDS_VTopics_Connector_stub</location> + </artifact> + + <artifact xmi:id="VTS_String_Connector_ExecArtifact"> + <name>VTS_String_Connector_exec</name> + <source/> + <node/> + <location>DDS_VTS_String_Connector_exec</location> + </artifact> + <artifact xmi:id="VTS_String_Connector_SvntArtifact"> + <name>VTS_String_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VTS_String_Connector_svnt</location> + </artifact> + <artifact xmi:id="VTS_String_Connector_StubArtifact"> + <name>VTS_String_Connector_stub</name> + <source/> + <node/> + <location>DDSVTS_String_Connector_stub</location> + </artifact> + + <artifact xmi:id="VTS_Array_Connector_ExecArtifact"> + <name>VTS_Array_Connector_exec</name> + <source/> + <node/> + <location>DDS_VTS_Array_Connector_exec</location> + </artifact> + <artifact xmi:id="VTS_Array_Connector_SvntArtifact"> + <name>VTS_Array_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VTS_Array_Connector_svnt</location> + </artifact> + <artifact xmi:id="VTS_Array_Connector_StubArtifact"> + <name>VTS_Array_Connector_stub</name> + <source/> + <node/> + <location>DDS_VTS_Array_Connector_stub</location> + </artifact> + + <artifact xmi:id="VTS_Seq_Connector_ExecArtifact"> + <name>VTS_Seq_Connector_exec</name> + <source/> + <node/> + <location>DDS_VTS_Seq_Connector_exec</location> + </artifact> + <artifact xmi:id="VTS_Seq_Connector_SvntArtifact"> + <name>VTS_Seq_Connector_svnt</name> + <source/> + <node/> + <location>DDS_VTS_Seq_Connector_svnt</location> + </artifact> + <artifact xmi:id="VTS_Seq_Connector_StubArtifact"> + <name>VTS_Seq_Connector_stub</name> + <source/> + <node/> + <location>DDS_VTS_Seq_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/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/descriptors/run_test.pl b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/descriptors/run_test.pl new file mode 100755 index 00000000000..d7266527ff7 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/VariousTopicsState/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 ('ciao_componentserver'); +} + +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 = "$CIAO_ROOT/bin/ciao_componentserver"; + + $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 10 seconds to allow task to complete\n"; +sleep (10); + +# 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 (2 * $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; |