diff options
author | msmit <msmit@remedy.nl> | 2010-03-04 09:09:45 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2010-03-04 09:09:45 +0000 |
commit | 28670d226f4a27df7ae659193f93a797f46dd584 (patch) | |
tree | 4685dec9dfbd91d4d1ea16c5229689a7965494ce | |
parent | 53bfa9419ddab3098a1575e64578df69f4d3ed62 (diff) | |
download | ATCD-28670d226f4a27df7ae659193f93a797f46dd584.tar.gz |
Thu Mar 4 09:06:49 UTC 2010 Marcel Smit <msmit@remedy.nl>
* bin/ciao_tests.lst:
* connectors/dds4ccm/tests/CoherentWriter:
Added coherent writer test.
19 files changed, 2147 insertions, 0 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index b263a0d5df1..8489ec6d59f 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 4 09:06:49 UTC 2010 Marcel Smit <msmit@remedy.nl> + + * bin/ciao_tests.lst: + * connectors/dds4ccm/tests/CoherentWriter: + Added coherent writer test. + Thu Mar 4 08:55:49 UTC 2010 Marcel Smit <msmit@remedy.nl> * connectors/dds4ccm/impl/dds/ndds/TimeUtilities.h: diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst index 05f43ea4f5c..f25d0907b2f 100644 --- a/CIAO/bin/ciao_tests.lst +++ b/CIAO/bin/ciao_tests.lst @@ -77,3 +77,4 @@ TAO/CIAO/connectors/dds4ccm/tests/QueryFilter/descriptors/run_test.pl: !STATIC ! TAO/CIAO/connectors/dds4ccm/tests/InstanceHandle/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS TAO/CIAO/connectors/dds4ccm/tests/TimeConversion/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS TAO/CIAO/connectors/dds4ccm/tests/Policies/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS +TAO/CIAO/connectors/dds4ccm/tests/CoherentWriter/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS diff --git a/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl new file mode 100644 index 00000000000..cbb0c246148 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.idl @@ -0,0 +1,20 @@ +// $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" + +struct CoherentWriteTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<CoherentWriteTest> CoherentWriteTest_Seq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc new file mode 100755 index 00000000000..e0c080550f8 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/CoherentWrite_Test_Base.mpc @@ -0,0 +1,25 @@ +// $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 -Gxhst -Sci \ + -Wb,stub_export_macro=COHERENT_WRITE_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=CoherentWrite_Test_Base_stub_export.h + + IDL_Files { + 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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.idl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.idl new file mode 100644 index 00000000000..46dd49922d6 --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.mpc b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Base/Reader_Starter.mpc new file mode 100755 index 00000000000..7ba671f97d8 --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.idl new file mode 100644 index 00000000000..fdbdf59aa40 --- /dev/null +++ b/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, ::CoherentWriteTest_Seq> CoherentWriteTest; +}; + +module CoherentWrite_Test +{ + connector CoherentWrite_Test_Connector : ::CCM_DDS::CoherentWriteTest::DDS_Event + { + }; +}; + +#endif /* CoherentWrite_Test_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Connector/CoherentWrite_Test_Connector.mpc new file mode 100755 index 00000000000..b05a815d4ee --- /dev/null +++ b/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 .. -I $(CIAO_ROOT)/connectors -I$(CIAO_ROOT)/connectors/dds4ccm/idl + + 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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.idl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.idl new file mode 100644 index 00000000000..9d464e71125 --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver.mpc new file mode 100755 index 00000000000..f5870a7e346 --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..78c3446fb22 --- /dev/null +++ b/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 "ciao/Logger/Log_Macros.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 + { + CoherentWriteTest_Seq *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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.h b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Receiver/CoherentWrite_Test_Receiver_exec.h new file mode 100644 index 00000000000..efceb8b3c7b --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.idl new file mode 100644 index 00000000000..c496b47d1cb --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender.mpc new file mode 100755 index 00000000000..c986fdb963c --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp new file mode 100644 index 00000000000..3d959b7c75c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.cpp @@ -0,0 +1,178 @@ +// -*- C++ -*- +// $Id$ + +#include "CoherentWrite_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ciao/Logger/Log_Macros.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 ())); + + CoherentWriteTest_Seq 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->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/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/CoherentWriter/Sender/CoherentWrite_Test_Sender_exec.h new file mode 100644 index 00000000000..d86c551b456 --- /dev/null +++ b/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/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/Plan.cdp new file mode 100644 index 00000000000..0a814540765 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/CoherentWriter/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>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>QueryFilter_Library#QueryFilter_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>QueryFilter_Library#QueryFilter_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>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="CoherentWrite_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="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/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..571930e854d --- /dev/null +++ b/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="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/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/run_test.pl b/CIAO/connectors/dds4ccm/tests/CoherentWriter/descriptors/run_test.pl new file mode 100755 index 00000000000..4d9ba95b5f7 --- /dev/null +++ b/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 -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; |