diff options
author | Marijke Hengstmengel <MHengstmengel@users.noreply.github.com> | 2011-04-12 07:32:05 +0000 |
---|---|---|
committer | Marijke Hengstmengel <MHengstmengel@users.noreply.github.com> | 2011-04-12 07:32:05 +0000 |
commit | 81dd6f37c6da23eb22a86e7ff34512f873c5995d (patch) | |
tree | 5615b86f8ec7aa77e34297c586776d6aa91ea4c2 | |
parent | ef5fb48a443a30923d1b2add6ced0584ce1b1f7d (diff) | |
download | ATCD-81dd6f37c6da23eb22a86e7ff34512f873c5995d.tar.gz |
Tue Apr 12 08:26:58 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl>
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.mpc:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.cpp:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.idl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.h:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/Plan.cdp:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/run_test.pl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.idl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.h:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.mpc:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.cpp:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.idl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.mpc:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.idl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.idl:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.mpc:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.mpc:
* connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/README:
New test with two different queries and an empty one, uses get_many.
19 files changed, 3110 insertions, 0 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index c1e73c32f00..1c2c2592675 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,31 @@ +Tue Apr 12 08:26:58 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl> + + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.mpc: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.cpp: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.idl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.h: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/Plan.cdp: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/run_test.pl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.idl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.h: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.mpc: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.cpp: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.idl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.mpc: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.idl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.idl: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.mpc: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.mpc: + * connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/README: + New test with two different queries and an empty one, uses get_many. + Tue Apr 12 07:20:58 UTC 2011 Marcel Smit <msmit@remedy.nl> * connectors/dds4ccm/tests/PSLDeadline/Receiver/PSL_DeadlineTest_Receiver_exec.h: diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.idl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.idl new file mode 100644 index 00000000000..ebc61348070 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file QCTQM_Starter.idl + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + */ + +#ifndef QUERYCONDITION_STARTER_IDL +#define QUERYCONDITION_STARTER_IDL + +#pragma ciao lem "Base/QCTQM_StarterE.idl" + +interface TwoQueriesStarter +{ + void set_reader_properties (in unsigned short nr_keys, + in unsigned short nr_iterations); + void start_read (in unsigned short run); +}; + +interface TwoQueriesRestarter +{ + void restart_write (); +}; + +#endif /* QUERYCONDITION_STARTER_IDL */ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.mpc new file mode 100755 index 00000000000..bfb73fb293c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Starter.mpc @@ -0,0 +1,112 @@ +// $Id$ + +project(QC_QCTQM_Starter_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_STUB_Export \ + -Wb,stub_export_include=QCTQM_Starter_stub_export.h \ + -Wb,skel_export_macro=READER_STARTER_SVNT_Export \ + -Wb,skel_export_include=QCTQM_Starter_svnt_export.h \ + -Wb,svnt_export_macro=READER_STARTER_SVNT_Export \ + -Wb,svnt_export_include=QCTQM_Starter_svnt_export.h \ + -Wb,exec_export_macro=READER_STARTER_EXEC_Export \ + -Wb,exec_export_include=QCTQM_Starter_exec_export.h -I.. + + IDL_Files { + QCTQM_Starter.idl + } +} + +project(QC_QCTQM_Starter_lem_gen) : ciaoidldefaults, dds4ccm { + after += QC_QCTQM_Starter_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=READER_STARTER_LEM_STUB_Export \ + -Wb,stub_export_include=QCTQM_Starter_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + QCTQM_StarterE.idl + } +} + +project(QC_QCTQM_Starter_lem_stub) : ccm_svnt, dds4ccm_base { + after += QC_QCTQM_Starter_lem_gen QC_QCTQM_Starter_stub + libs += QC_QCTQM_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QC_QCTQM_Starter_lem_stub + dynamicflags += READER_STARTER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_StarterEC.cpp + } + + Header_Files { + QCTQM_StarterEC.h + QCTQM_Starter_lem_stub_export.h + } + + Inline_Files { + QCTQM_StarterEC.inl + } +} + +project(QC_QCTQM_Starter_stub) : ccm_stub, dds4ccm_base { + after += QC_QCTQM_Starter_idl_gen + libs += + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QC_QCTQM_Starter_stub + dynamicflags += READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_StarterC.cpp + } + + Header_Files { + QCTQM_StarterC.h + QCTQM_Starter_stub_export.h + } + + Inline_Files { + QCTQM_StarterC.inl + } +} + + +project(QC_QCTQM_Starter_svnt) : ciao_servant, dds4ccm_lem_stub, dds4ccm_skel { + after += QC_QCTQM_Starter_lem_stub QC_QCTQM_Starter_stub + sharedname = QC_QCTQM_Starter_svnt + libs += QC_QCTQM_Starter_stub QC_QCTQM_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += READER_STARTER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_StarterS.cpp + QCTQM_Starter_svnt.cpp + } + + Header_Files { + QCTQM_StarterS.h + QCTQM_Starter_svnt.h + QCTQM_Starter_svnt_export.h + } + + Inline_Files { + QCTQM_StarterS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.idl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.idl new file mode 100644 index 00000000000..bcf2dda3115 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file QCTQM_Test_Base.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_CONDITION_TEST_BASE_IDL +#define QUERY_CONDITION_TEST_BASE_IDL + +#pragma ndds typesupport "Base/QCTQM_Test_BaseSupport.h" + +#pragma DCPS_DATA_TYPE "QueryConditionTest" +#pragma DCPS_DATA_KEY "QueryConditionTest symbol" + +struct QueryConditionTest { + string symbol; //@key + long iteration; +}; + +typedef sequence<QueryConditionTest> QueryConditionTestSeq; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.mpc new file mode 100755 index 00000000000..aa5b613b3d6 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Base/QCTQM_Test_Base.mpc @@ -0,0 +1,26 @@ +// $Id$ + +project(QC_QCTQM_Test_Base_stub) : taoidldefaults, dds4ccm_ts_default { + sharedname = QC_QCTQM_Test_Base_stub + dynamicflags += QUERY_CONDITION_TEST_BASE_STUB_BUILD_DLL + libout = ../lib + + idlflags += -SS -Sci \ + -Wb,stub_export_macro=QUERY_CONDITION_TEST_BASE_STUB_Export \ + -Wb,stub_export_include=QCTQM_Test_Base_stub_export.h + + IDL_Files { + idlflags += -Gxhst + QCTQM_Test_Base.idl + } + + opendds_ts_flags += --export=QUERY_CONDITION_TEST_BASE_STUB_Export + + DDSGenerator_Files { + QCTQM_Test_Base.idl + } + + Source_Files { + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.idl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.idl new file mode 100644 index 00000000000..9848488a4df --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.idl @@ -0,0 +1,23 @@ +// $Id$ + +/** + * @file QCTQM_Test_Connector.idl + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef QUERY_CONDITION_TEST_CONNECTOR_IDL_ +#define QUERY_CONDITION_TEST_CONNECTOR_IDL_ + +#include <Components.idl> +#include <ccm_dds.idl> + +#include "Base/QCTQM_Test_Base.idl" + +#pragma ciao lem "Connector/QCTQM_Test_ConnectorE.idl" + +module QCTQM_Test +{ + module ::CCM_DDS::Typed < ::QueryConditionTest, ::QueryConditionTestSeq> QueryConditionTestConnector; +}; + +#endif /* QUERY_CONDITION_TEST_CONNECTOR_IDL_ */ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.mpc new file mode 100755 index 00000000000..8aaaabc6469 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Connector/QCTQM_Test_Connector.mpc @@ -0,0 +1,148 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p QCTQM_Test_Base -l .. -o ../lib -u DDS QCTQM_Test_Connector" + +project(QC_QCTQM_Test_Connector_idl_gen) : connectoridldefaults, dds4ccm { + after += DDS4CCM_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_STUB_Export \ + -Wb,stub_export_include=QCTQM_Test_Connector_stub_export.h \ + -Wb,skel_export_macro=QUERY_CONDITION_TEST_CONNECTOR_SVNT_Export \ + -Wb,skel_export_include=QCTQM_Test_Connector_svnt_export.h \ + -Wb,svnt_export_macro=QUERY_CONDITION_TEST_CONNECTOR_SVNT_Export \ + -Wb,svnt_export_include=QCTQM_Test_Connector_svnt_export.h \ + -Wb,conn_export_macro=QUERY_CONDITION_TEST_CONNECTOR_CONN_Export \ + -Wb,conn_export_include=QCTQM_Test_Connector_conn_export.h \ + -I .. + + IDL_Files { + QCTQM_Test_Connector.idl + } +} + +project(QC_QCTQM_Test_Connector_lem_gen) : ciaoidldefaults, dds4ccm { + custom_only = 1 + after += QC_QCTQM_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=QUERY_CONDITION_TEST_CONNECTOR_LEM_STUB_Export \ + -Wb,stub_export_include=QCTQM_Test_Connector_lem_stub_export.h \ + -SS -Gxhst \ + -I .. + + IDL_Files { + QCTQM_Test_ConnectorE.idl + } +} + +project(QC_QCTQM_Test_Connector_lem_stub) : ccm_svnt, dds4ccm_lem_stub { + after += QC_QCTQM_Test_Connector_lem_gen QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Base_stub + libs += QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Connector_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QC_QCTQM_Test_Connector_lem_stub + dynamicflags += QUERY_CONDITION_TEST_CONNECTOR_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ConnectorEC.cpp + } + + Header_Files { + QCTQM_Test_ConnectorEC.h + QCTQM_Test_Connector_lem_stub_export.h + } + + Inline_Files { + QCTQM_Test_ConnectorEC.inl + } +} + +project(QC_QCTQM_Test_Connector_stub) : ccm_stub, dds4ccm_base { + after += QC_QCTQM_Test_Connector_idl_gen QC_QCTQM_Test_Base_stub + libs += QC_QCTQM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = QC_QCTQM_Test_Connector_stub + dynamicflags += QUERY_CONDITION_TEST_CONNECTOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ConnectorC.cpp + } + + Header_Files { + QCTQM_Test_ConnectorC.h + QCTQM_Test_Connector_stub_export.h + } + + Inline_Files { + QCTQM_Test_ConnectorC.inl + } +} + +project(QC_QCTQM_Test_Connector_exec) : ciao_executor, dds4ccm_impl { + after += QC_QCTQM_Test_Connector_lem_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Base_stub + sharedname = QC_QCTQM_Test_Connector_exec + libs += QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Base_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += QUERY_CONDITION_TEST_CONNECTOR_CONN_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_Connector_conn.cpp + } + + Header_Files { + QCTQM_Test_Connector_conn.h + QCTQM_Test_Connector_conn_export.h + } + + Inline_Files { + } +} + + +project(QC_QCTQM_Test_Connector_svnt) : ciao_servant, dds4ccm_impl { + after += QC_QCTQM_Test_Connector_lem_stub QC_QCTQM_Test_Connector_exec \ + QC_QCTQM_Test_Connector_stub + sharedname = QC_QCTQM_Test_Connector_svnt + libs += QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_exec + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += QUERY_CONDITION_TEST_CONNECTOR_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ConnectorS.cpp + QCTQM_Test_Connector_svnt.cpp + } + + Header_Files { + QCTQM_Test_ConnectorS.h + QCTQM_Test_Connector_svnt.h + QCTQM_Test_Connector_svnt_export.h + } + + Inline_Files { + QCTQM_Test_ConnectorS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/README b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/README new file mode 100644 index 00000000000..64034e00651 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/README @@ -0,0 +1,39 @@ +// $Id$ + +The TwoQueriesMany exists of 4 runs. During each run the Sender writes 20 samples to DDS. +After that it informs the receiver that the samples were written. The receiver +in turn sets a filter and starts to pull the samples from DDS, using the Getter. +Once the receiver has received all samples, it informs the Sender that the next +run can be started. +Since the getter only receives non-read samples, an extra check is build in. The +receiver also performs a read on a different port in order to check whether the +right samples are available in DDS. This Reader should always receive ALL samples +since the QueryFilter only applies to the Getter. + +The following query expression is defined: + ( (iteration > %0) AND (iteration < %1) ) + +The following runs are defined: + +1. Sender writes iterations 1-20 to DDS for a certain number of keys, + defined in the deployment plan. The receiver sets the filter and filter + parameters and starts receiving the samples at once, using get_many. + After that it changes the filter parameters and informs the Sender that a + new run can be started. +2. Sender writes iterations 21-40 to DDS for the defined number of keys. After + that it informs the receiver which starts to get the samples from DDS. After + that, the receiver reset the QueryFilter (by setting the expression to an + empty string) and informs the Sender that a new run can be started. +3. Sender writes iterations 41-60 to DDS for the defined number of keys. After + that it informs the receiver which should receive with a get_many all samples + with iterations 1-60 without the ones it read during run 1 and 2. + The receiver then creates a new filter, using the same expression as used during + runs 1 and 2 but with different parameters. Again the receiver informs the + Sender that a new run can be started. +4. Sender writes iterations 61-80 to DDS for the defined number of keys. Again it + informs the receiver about this action. The receiver should only get the samples + according to the query expression and its parameters. + +After each get-action, the receiver reads the data from DDS. During this read action, +the receiver should read all samples the Sender has written up to that moment. Since +there's no filter applied to this reader, all sample states should be 'FRESH_INFO'.
\ No newline at end of file diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.idl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.idl new file mode 100644 index 00000000000..5a7c227c7e6 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.idl @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QCTQM_Test_Connector.idl" +#include "Base/QCTQM_Starter.idl" + +module QCTQM_Test +{ + component Receiver + { + port QueryConditionTestConnector::DDS_Get get_port; + port QueryConditionTestConnector::DDS_Read read_port; + + provides TwoQueriesStarter reader_start; + uses TwoQueriesRestarter writer_restart; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.mpc new file mode 100755 index 00000000000..3ae4655b697 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver.mpc @@ -0,0 +1,158 @@ +// $Id$ + +project(QC_QCTQM_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += QC_QCTQM_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 { + QCTQM_Test_Receiver.idl + } +} + +project(QC_QCTQM_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += QC_QCTQM_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 { + QCTQM_Test_ReceiverE.idl + } +} + +project(QC_QCTQM_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += QC_QCTQM_Test_Receiver_lem_gen QC_QCTQM_Test_Receiver_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Starter_stub + libs += Receiver_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Base_stub QC_QCTQM_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags += RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ReceiverEC.cpp + } + + Header_Files { + QCTQM_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + QCTQM_Test_ReceiverEC.inl + } +} + +project(QC_QCTQM_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += QC_QCTQM_Test_Receiver_idl_gen QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Connector_lem_gen \ + QC_QCTQM_Starter_stub QC_QCTQM_Starter_lem_stub + libs += QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags += RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ReceiverC.cpp + } + + Header_Files { + QCTQM_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + QCTQM_Test_ReceiverC.inl + } +} + +project(QC_QCTQM_Test_Receiver_exec) : ciao_executor, dds4ccm_lem_stub { + after += QC_QCTQM_Test_Receiver_lem_stub QC_QCTQM_Test_Receiver_stub \ + QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Starter_lem_stub QC_QCTQM_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Starter_lem_stub QC_QCTQM_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_Receiver_exec.cpp + } + + Header_Files { + QCTQM_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(QC_QCTQM_Test_Receiver_svnt) : ciao_servant, dds4ccm_lem_stub, dds4ccm_skel { + after += QC_QCTQM_Test_Receiver_lem_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Connector_svnt \ + QC_QCTQM_Test_Receiver_exec QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Starter_stub \ + QC_QCTQM_Starter_svnt QC_QCTQM_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Connector_svnt \ + Receiver_exec QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Starter_stub QC_QCTQM_Starter_svnt \ + QC_QCTQM_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_ReceiverS.cpp + QCTQM_Test_Receiver_svnt.cpp + } + + Header_Files { + QCTQM_Test_ReceiverS.h + QCTQM_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + QCTQM_Test_ReceiverS.inl + } +} + + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..8211f148d83 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.cpp @@ -0,0 +1,845 @@ +// -*- C++ -*- +// $Id$ + +/** + * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 + * TAO and the TAO IDL Compiler have been developed by: + * Center for Distributed Object Computing + * Washington University + * St. Louis, MO + * USA + * http://www.cs.wustl.edu/~schmidt/doc-center.html + * and + * Distributed Object Computing Laboratory + * University of California at Irvine + * Irvine, CA + * USA + * and + * Institute for Software Integrated Systems + * Vanderbilt University + * Nashville, TN + * USA + * http://www.isis.vanderbilt.edu/ + * + * Information about TAO is available at: + * http://www.cs.wustl.edu/~schmidt/TAO.html + **/ + +#include "QCTQM_Test_Receiver_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" +#include "dds4ccm/impl/Utils.h" + +#define QUERY "( (iteration > %0) AND (iteration < %1) )" + +//run 1 +#define MIN_ITERATION_1 "2" +#define MAX_ITERATION_1 "5" +//run 2 +#define MIN_ITERATION_2 "22" +#define MAX_ITERATION_2 "34" +//run 4 +#define MIN_ITERATION_3 "68" +#define MAX_ITERATION_3 "77" + +// Reader also reads already read samples. +// The getter receives the following iterations: +// During run 1: 2 (iterations 3 and 4) +// During run 2: 11 (iterations between 22 and 34) +// During run 3: 47 (all unread samples, meaning iterations 1-60 +// without iteration 3, 4 and iterations between 22 and 34) +// During run 4: 8 (iterations between 68 and 77) + +#define SAMPLES_PER_KEY_GETTER (2 + 11 + 47 + 8) + +namespace CIAO_QCTQM_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; + } + + /** + * Facet Executor Implementation Class: get_port_status_exec_i + */ + + get_port_status_exec_i::get_port_status_exec_i ( + ::QCTQM_Test::CCM_Receiver_Context_ptr ctx) + : ciao_context_ ( + ::QCTQM_Test::CCM_Receiver_Context::_duplicate (ctx)) + { + } + + get_port_status_exec_i::~get_port_status_exec_i (void) + { + } + + // Operations from ::CCM_DDS::PortStatusListener + + void + get_port_status_exec_i::on_requested_deadline_missed (::DDS::DataReader_ptr /* the_reader */, + const ::DDS::RequestedDeadlineMissedStatus & /* status */) + { + /* Your code here. */ + } + + void + get_port_status_exec_i::on_sample_lost (::DDS::DataReader_ptr /* the_reader */, + const ::DDS::SampleLostStatus & /* status */) + { + /* Your code here. */ + } + + /** + * Facet Executor Implementation Class: reader_start_exec_i + */ + + reader_start_exec_i::reader_start_exec_i ( + ::QCTQM_Test::CCM_Receiver_Context_ptr ctx, + Receiver_exec_i & callback) + : ciao_context_ ( + ::QCTQM_Test::CCM_Receiver_Context::_duplicate (ctx)) + , callback_ (callback) + { + } + + reader_start_exec_i::~reader_start_exec_i (void) + { + } + + // Operations from ::TwoQueriesStarter + + void + reader_start_exec_i::set_reader_properties (::CORBA::UShort nr_keys, + ::CORBA::UShort nr_iterations) + { + ACE_DEBUG ((LM_DEBUG, "Set reader propeties nr_keys %u, nr_iterations %u\n", + nr_keys, nr_iterations)); + + this->callback_.keys (nr_keys); + this->callback_.iterations (nr_iterations); + } + + void + reader_start_exec_i::start_read (::CORBA::UShort run) + { + this->callback_.start_read (run); + } + + /** + * Component Executor Implementation Class: Receiver_exec_i + */ + + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (20) + , keys_ (5) + , current_min_iteration_ (ACE_OS::atoi (MIN_ITERATION_1)) + , current_max_iteration_ (ACE_OS::atoi (MAX_ITERATION_1)) + , ticker_ (0) + , samples_expected_ (0) + , samples_received_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported operations and attributes. + ACE_Reactor* + Receiver_exec_i::reactor (void) + { + ACE_Reactor* reactor = 0; + ::CORBA::Object_var ccm_object = + this->ciao_context_->get_CCM_object(); + if (! ::CORBA::is_nil (ccm_object.in ())) + { + ::CORBA::ORB_var orb = ccm_object->_get_orb (); + if (! ::CORBA::is_nil (orb.in ())) + { + reactor = orb->orb_core ()->reactor (); + } + } + if (reactor == 0) + { + throw ::CORBA::INTERNAL (); + } + return reactor; + } + + // check if last key is received, if so we can assume + // that other key's are arrived too in Receiver. + bool + Receiver_exec_i::check_last () + { + ::QCTQM_Test::QueryConditionTestConnector::Reader_var reader = + this->ciao_context_->get_connection_get_port_data (); + + try + { + QueryConditionTest queryfiltertest_info; + ::CCM_DDS::ReadInfo readinfo; + char key[10]; + ACE_OS::sprintf (key, "KEY_%d", this->keys_); + + queryfiltertest_info.symbol = ::CORBA::string_dup (key); + reader->read_one_last ( + queryfiltertest_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last - " + "last iteration <%02d> - <%02d> this->keys_ %s\n", + queryfiltertest_info.iteration, + this->current_max_iteration_ - 1, key)); + return queryfiltertest_info.iteration >= this->current_max_iteration_ - 1; + } + catch (const ::CCM_DDS::InternalError &) + { + } + catch (const ::CCM_DDS::NonExistent &) + { + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::check_last: " + "ERROR: Unexpected exception caught\n")); + } + return false; + } + + // Supported operations and attributes. + + // Check for correct iteration belonging to a run. + // If info == 0, check iteration after a get, + // else check iteration after a read + void + Receiver_exec_i::check_iter (const QueryConditionTest & sample, + ::CORBA::UShort run, + ::CCM_DDS::ReadInfo * info) + { + if (run == 3) + { + // We need to receive all UNread samples. Therefore we should + // receive all samples except the ones between + // MIN_ITERATION_1 and MAX_ITERATION_1 and between + // MIN_ITERATION_2 and MAX_ITERATION_2 + if ((sample.iteration > ACE_OS::atoi (MIN_ITERATION_1) && + sample.iteration < ACE_OS::atoi (MAX_ITERATION_1)) || + (sample.iteration > ACE_OS::atoi (MIN_ITERATION_2) && + sample.iteration < ACE_OS::atoi (MAX_ITERATION_2))) + { + // Read supplies info. There check the sample status mask + // as well + if (info != 0) + { // access mask should be "ALREADY_SEEN" since the getter should + // already have seen this sample. + if (info->access_status != ::CCM_DDS::ALREADY_SEEN) + { + // READ ALL since this check is only performed + // during a read. + if (info->access_status == ::CCM_DDS::FRESH_INFO) + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL: " + "Unexpected sample access mask - " + "expected <ALREADY_SEEN> - " + "received <FRESH_INFO>\n")); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL: " + "Unexpected sample access mask - " + "expected <ALREADY_SEEN> - " + "received <UNKNOWN>\n")); + } + } + } + else + { + // Getter functionality + ACE_ERROR ((LM_ERROR, "ERROR: GET ALL: " + "Didn't except samples between " + "<%02d> and <%02d> and between " + "<%02d> and <%02d>\n", + ACE_OS::atoi (MIN_ITERATION_1), + ACE_OS::atoi (MAX_ITERATION_1), + ACE_OS::atoi (MIN_ITERATION_2), + ACE_OS::atoi (MAX_ITERATION_2))); + } + } + } + else //run 1,2, and 4 + { + //after get + if (!info) + { + if (sample.iteration <= current_min_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: GET ALL: " + "Didn't expect samples with iterations " + "<= %02d\n", + this->current_min_iteration_)); + } + if (sample.iteration > this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: GET ALL: " + "Didn't expect samples with iterations " + "> %02d\n", + this->current_max_iteration_)); + } + } + // after read + else if (info != 0) + { // access mask should be "FRESH_INFO" since the getter has not + // "seen" this sample. + if (sample.iteration > this->current_min_iteration_) + { + if (info->access_status != ::CCM_DDS::FRESH_INFO) + { + // READ ALL since this check is only performed + // during a read. + if (info->access_status == ::CCM_DDS::ALREADY_SEEN) + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL: " + "Unexpected sample access mask - " + "expected <FRESH_INFO> - " + "received <ALREADY_SEEN>\n")); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: READ ALL: " + "Unexpected sample access mask - " + "expected <FRESH_INFO> - " + "received <UNKNOWN>\n")); + } + } + } + } + } + } + + + void + Receiver_exec_i::read_all (::CORBA::UShort run) + { + ::QCTQM_Test::QueryConditionTestConnector::Reader_var reader = + this->ciao_context_->get_connection_read_port_data (); + + if (::CORBA::is_nil (reader.in ())) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::read_all - " + "ERROR: No Reader\n")); + return; + } + QueryConditionTestSeq qf_info; + ::CCM_DDS::ReadInfoSeq readinfos; + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::read_all - " + "Start checking samples in DDS\n")); + reader->read_all (qf_info, readinfos); + if (qf_info.length () != + static_cast < ::CORBA::ULong > (run * this->iterations_ * this->keys_)) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::read_all - " + "Unexpected number of samples received: " + "expected <%d> - received <%u>\n", + run * this->iterations_, qf_info.length ())); + } + for (::CORBA::ULong i = 0; i < qf_info.length (); ++i) + { + /* ACE_DEBUG ((LM_DEBUG, "READ ALL : Receiver_exec_i::read_all - " + "Sample received: key <%C> - iteration <%d> - " + "sample_read_state <%d>\n", + qf_info[i].symbol.in (), + qf_info[i].iteration, + readinfos[i].access_status)); + */ + this->check_iter (qf_info[i], run, &readinfos[i]); + } + } + + + ::CORBA::ULong + Receiver_exec_i::get_all (::CORBA::UShort run) + { + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("GET ALL run %d: \n"), run)); + sleep (3); + + ::QCTQM_Test::QueryConditionTestConnector::Getter_var getter = + this->ciao_context_->get_connection_get_port_fresh_data (); + ::CORBA::ULong samples_received = 0; + + if (::CORBA::is_nil (getter.in ())) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::get_all - " + "ERROR: No Getter\n")); + return 0; + } + DDS::Duration_t to; + to.sec = 10; + to.nanosec = 0; + + getter->time_out (to); + getter->max_delivered_data (0); + QueryConditionTestSeq gettertest_seq; + ::CCM_DDS::ReadInfoSeq readinfo; + bool const res = getter->get_many (gettertest_seq, readinfo); + if (res) + { + 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>, res = %u\n", res)); + } + 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>," + "instance status <%u> - access status <%u>\n", + gettertest_seq[i].symbol.in (), + gettertest_seq[i].iteration, + readinfo[i].instance_status, + readinfo[i].access_status)); + this->check_iter (gettertest_seq[i], run); + ++samples_received; + } + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: GET MANY: " + "Time out occurred\n")); + } + return samples_received; + } + + ::CORBA::ULong + Receiver_exec_i::test_all (::CORBA::UShort run) + { + try + { + return get_all (run); + } + catch (const CCM_DDS::NonExistent& ex) + { + for (::CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ERROR test_all <%d>: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + run, + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: test_all <%d>: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + run, + ex.error_code)); + } + catch (const ::CORBA::Exception& ex) + { + ex._tao_print_exception ("test_all"); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::test_all <%d> : Exception caught\n"), + run)); + } + return 0; + } + + void + Receiver_exec_i::check_filter (::CORBA::UShort run) + { + ::CCM_DDS::QueryFilter_var filter; + ::QCTQM_Test::QueryConditionTestConnector::Reader_var reader = + this->ciao_context_->get_connection_get_port_data (); + try + { + filter = reader->query (); + } + catch (const CCM_DDS::InternalError& ex) + { + if (run == 3) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_filter - " + "caught expected InternalEr excep: retval <%u>\n", + ex.error_code)); + } + else + { + 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 (run != 3) + { + if (ACE_OS::strcmp (filter->expression, QUERY) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->expression.in ())); + error = true; + } + //check current parameters. + if (filter->parameters.length () != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected number of parameters: " + "expected <%d> - received <%d>\n", + 2, filter->parameters.length ())); + error = true; + } + + if (filter->parameters.length () >= 1) + { + if (ACE_OS::atoi (filter->parameters[0]) != this->current_min_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected param value: " + "expected <%d> - received <%C>\n", + this->current_min_iteration_, + filter->parameters[0].in ())); + error = true; + } + } + if (filter->parameters.length () >= 2) + { + if (ACE_OS::atoi (filter->parameters[1]) != this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected param value: " + "expected <%d> - received <%C>\n", + this->current_max_iteration_, + filter->parameters[1].in ())); + error = true; + } + } + } + if (!error) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_filter - " + "Passed check_filter test for run <%d>.\n", + run)); + } + } + + void + Receiver_exec_i::set_filter (::CORBA::UShort run) + { + ACE_DEBUG ((LM_DEBUG, "Set filter for run <%d>\n", run)); + ::QCTQM_Test::QueryConditionTestConnector::Reader_var reader = + this->ciao_context_->get_connection_get_port_data (); + + try + { + ::CCM_DDS::QueryFilter filter; + run != 3 ? filter.expression = ::CORBA::string_dup (QUERY) : + filter.expression = ::CORBA::string_dup (""); + + filter.parameters.length (2); + if (run == 1) + { + filter.parameters[0] = ::CORBA::string_dup (MIN_ITERATION_1); + filter.parameters[1] = ::CORBA::string_dup (MAX_ITERATION_1); + this->current_min_iteration_ = ACE_OS::atoi (MIN_ITERATION_1); + this->current_max_iteration_ = ACE_OS::atoi (MAX_ITERATION_1); + } + else if (run == 2) + { + filter.parameters[0] = ::CORBA::string_dup (MIN_ITERATION_2); + filter.parameters[1] = ::CORBA::string_dup (MAX_ITERATION_2); + this->current_min_iteration_ = ACE_OS::atoi (MIN_ITERATION_2); + this->current_max_iteration_ = ACE_OS::atoi (MAX_ITERATION_2); + } + else if (run == 3) + { + // get all not yet seen by the getter samples of run 1, 2 and 3. + this->current_min_iteration_ = 1; + this->current_max_iteration_ = run * this->iterations_; + filter.parameters[0] = ::CORBA::string_dup (0); + filter.parameters[1] = ::CORBA::string_dup (0); + } + else if (run == 4) + { + filter.parameters[0] = ::CORBA::string_dup (MIN_ITERATION_3); + filter.parameters[1] = ::CORBA::string_dup (MAX_ITERATION_3); + this->current_min_iteration_ = ACE_OS::atoi (MIN_ITERATION_3); + this->current_max_iteration_ = ACE_OS::atoi (MAX_ITERATION_3); + } + ACE_DEBUG ((LM_DEBUG, "Filter : Query <%C>, parameter[0] <%C>, parameter[1] <%C>\n", + filter.expression.in (), filter.parameters[0].in (), filter.parameters[1].in ())); + reader->query (filter); + } + catch (const ::CCM_DDS::InternalError &ex) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::set_filter - " + "ERROR: Unexpected InternalError exception caught " + "with <%C> as error\n.", + ::CIAO::DDS4CCM::translate_retcode (ex.error_code))); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::set_filter - " + "ERROR: Unexpected exception caught.\n")); + } + } + + void + Receiver_exec_i::start_read (::CORBA::UShort run) + { + this->ticker_ = new read_action_Generator (*this, run); + if (this->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->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)); + TwoQueriesRestarter_var restarter = + this->ciao_context_->get_connection_writer_restart (); + if (!::CORBA::is_nil (restarter.in ())) + { + switch (run) + { + case 1: + { + this->samples_received_ += this->test_all (run); + this->check_filter (run); + this->read_all (run); + //set filter for the next run + this->set_filter (run + 1); + // inform the sender that it may start the next run + restarter->restart_write (); + } + break; + case 2: + { + this->samples_received_ += this->test_all (run); + check_filter (run); + this->read_all (run); + //set filter for the next run + this->set_filter (run + 1); + // inform the sender that it may start the next run + restarter->restart_write (); + } + break; + case 3: + { + this->samples_received_ += this->test_all (run); + this->check_filter (run); + this->read_all (run); + //set filter for the next run + this->set_filter (run + 1); + // inform the sender that it may start the next run + restarter->restart_write (); + } + break; + case 4: + { + this->samples_received_ += this->test_all (run); + this->read_all (run); + } + } + } + else + { + ACE_ERROR ((LM_ERROR, "Receiver_exec_i::run - " + "ERROR: Reference to Restarter not found\n")); + } + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + + //the last key is used for checking if all samples are received and therefore + //get access status 1. So these samples are not read by following + //get_all method. + this->samples_expected_ = (this->keys_ - 1) * SAMPLES_PER_KEY_GETTER; + } + + // Component attributes and port operations. + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_get_port_status (void) + { + if ( ::CORBA::is_nil (this->ciao_get_port_status_.in ())) + { + get_port_status_exec_i *tmp = 0; + ACE_NEW_RETURN ( + tmp, + get_port_status_exec_i ( + this->ciao_context_.in ()), + ::CCM_DDS::CCM_PortStatusListener::_nil ()); + + this->ciao_get_port_status_ = tmp; + } + + return + ::CCM_DDS::CCM_PortStatusListener::_duplicate ( + this->ciao_get_port_status_.in ()); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_read_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_TwoQueriesStarter_ptr + Receiver_exec_i::get_reader_start (void) + { + if ( ::CORBA::is_nil (this->ciao_reader_start_.in ())) + { + reader_start_exec_i *tmp = 0; + ACE_NEW_RETURN ( + tmp, + reader_start_exec_i ( + this->ciao_context_.in (), + *this), + ::CCM_TwoQueriesStarter::_nil ()); + + this->ciao_reader_start_ = tmp; + } + + return + ::CCM_TwoQueriesStarter::_duplicate ( + this->ciao_reader_start_.in ()); + } + + // Operations from Components::SessionComponent. + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->ciao_context_ = + ::QCTQM_Test::CCM_Receiver_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->ciao_context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + /* Your code here. */ + } + + void + Receiver_exec_i::ccm_activate (void) + { + ::QCTQM_Test::QueryConditionTestConnector::Getter_var getter = + this->ciao_context_->get_connection_get_port_fresh_data (); + DDS::Duration_t to; + to.sec = 5; to.nanosec = 0; + getter->time_out (to); + //set filter for the first run + this->set_filter (1); + } + + void + Receiver_exec_i::ccm_passivate (void) + { + if (this->ticker_) + { + this->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (this->samples_received_ != this->samples_expected_) + { + ACE_ERROR ((LM_ERROR, "ERROR: TWO QUERIES GET_MANY : " + "Unexpected number of samples received: " + "expected <%d> - received <%d>\n", + this->samples_expected_, + this->samples_received_)); + } + else + { + ACE_DEBUG ((LM_DEBUG, "TWO QUERIES : GET_MANY : " + "Expected number of samples received: " + "expected <%d> - received <%d>\n", + this->samples_expected_, + this->samples_received_)); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QCTQM_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/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.h b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.h new file mode 100644 index 00000000000..abc5a7a9442 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Receiver/QCTQM_Test_Receiver_exec.h @@ -0,0 +1,223 @@ +// -*- C++ -*- +// $Id$ + +/** + * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 + * TAO and the TAO IDL Compiler have been developed by: + * Center for Distributed Object Computing + * Washington University + * St. Louis, MO + * USA + * http://www.cs.wustl.edu/~schmidt/doc-center.html + * and + * Distributed Object Computing Laboratory + * University of California at Irvine + * Irvine, CA + * USA + * and + * Institute for Software Integrated Systems + * Vanderbilt University + * Nashville, TN + * USA + * http://www.isis.vanderbilt.edu/ + * + * Information about TAO is available at: + * http://www.cs.wustl.edu/~schmidt/TAO.html + **/ +#ifndef CIAO_QCTQM_TEST_RECEIVER_EXEC_HWBPVD_H_ +#define CIAO_QCTQM_TEST_RECEIVER_EXEC_HWBPVD_H_ + +#include /**/ "ace/pre.h" + +#include "QCTQM_Test_ReceiverEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include /**/ "Receiver_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO_QCTQM_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_; + + }; + + /** + * Provider Executor Implementation Class: get_port_status_exec_i + */ + + class get_port_status_exec_i + : public virtual ::CCM_DDS::CCM_PortStatusListener, + public virtual ::CORBA::LocalObject + { + public: + get_port_status_exec_i ( + ::QCTQM_Test::CCM_Receiver_Context_ptr ctx); + virtual ~get_port_status_exec_i (void); + + //@{ + /** Operations and attributes from CCM_DDS::PortStatusListener. */ + + 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: + ::QCTQM_Test::CCM_Receiver_Context_var ciao_context_; + }; + + /** + * Provider Executor Implementation Class: reader_start_exec_i + */ + + class reader_start_exec_i + : public virtual ::CCM_TwoQueriesStarter, + public virtual ::CORBA::LocalObject + { + public: + reader_start_exec_i ( + ::QCTQM_Test::CCM_Receiver_Context_ptr ctx, + Receiver_exec_i & callback); + virtual ~reader_start_exec_i (void); + + //@{ + /** Operations and attributes from TwoQueriesStarter. */ + + virtual + void set_reader_properties (::CORBA::UShort nr_keys, + ::CORBA::UShort nr_iterations); + + virtual + void start_read (::CORBA::UShort run); + //@} + + private: + ::QCTQM_Test::CCM_Receiver_Context_var ciao_context_; + Receiver_exec_i & callback_; + }; + + /** + * Component Executor Implementation Class: Receiver_exec_i + */ + + class 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 and port operations. */ + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_get_port_status (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_read_port_status (void); + + + virtual ::CCM_TwoQueriesStarter_ptr + get_reader_start (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); + //@} + + //@{ + /** User defined public operations. */ + void iterations (CORBA::UShort iterations); + void keys (::CORBA::UShort keys); + + bool check_last (void); + void start_read (::CORBA::UShort run); + void run (::CORBA::UShort run); + //@} + + private: + ::QCTQM_Test::CCM_Receiver_Context_var ciao_context_; + + //@{ + /** Component attributes. */ + ::CCM_DDS::CCM_PortStatusListener_var ciao_get_port_status_; + ::CCM_TwoQueriesStarter_var ciao_reader_start_; + //@} + + //@{ + /** User defined members. */ + ::CORBA::UShort iterations_; + ::CORBA::UShort keys_; + + int current_min_iteration_; + int current_max_iteration_; + + read_action_Generator *ticker_; + + ::CORBA::ULong samples_expected_; + ::CORBA::ULong samples_received_; + + //@} + + //@{ + /** User defined private operations. */ + ::CORBA::ULong test_all (::CORBA::UShort run); + ::CORBA::ULong get_all (::CORBA::UShort run); + void read_all (::CORBA::UShort run); + void check_iter (const QueryConditionTest & sample, + ::CORBA::UShort run, + ::CCM_DDS::ReadInfo * info = 0); + void check_filter (::CORBA::UShort run); + void set_filter (::CORBA::UShort run); + + //@} + + /// Get the ACE_Reactor + ACE_Reactor* reactor (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QCTQM_Test_Receiver_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.idl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.idl new file mode 100644 index 00000000000..622f83e43fb --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.idl @@ -0,0 +1,29 @@ +// $Id$ + +/** + * @file + * @author Marijke Hengstmengel <mhengstmengel@remedy.nl> + * + * by-hand idl3 translation of sender components. + */ + +#ifndef DDS_QUERY_CONDITION_TEST_SENDER_IDL +#define DDS_QUERY_CONDITION_TEST_SENDER_IDL + +#include "Connector/QCTQM_Test_Connector.idl" +#include "Base/QCTQM_Starter.idl" + +module QCTQM_Test +{ + component Sender + { + port QCTQM_Test::QueryConditionTestConnector::DDS_Write info_write; + + uses TwoQueriesStarter start_reader; + provides TwoQueriesRestarter restart_writer; + + attribute unsigned short keys; + }; +}; + +#endif diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.mpc b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.mpc new file mode 100755 index 00000000000..610c2244d45 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender.mpc @@ -0,0 +1,155 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p QCTQM_Test_Base -l ../lib -o ../lib -c controller -u DDS Sender" + +project(QC_QCTQM_Test_Sender_idl_gen) : componentidldefaults, dds4ccm { + after += QC_QCTQM_Test_Connector_idl_gen QC_QCTQM_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 { + QCTQM_Test_Sender.idl + } +} + +project(QC_QCTQM_Test_Sender_lem_gen) : ciaoidldefaults, dds4ccm { + after += QC_QCTQM_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 { + QCTQM_Test_SenderE.idl + } +} + +project(QC_QCTQM_Test_Sender_lem_stub) : ccm_svnt, dds4ccm_base { + after += QC_QCTQM_Test_Sender_lem_gen QC_QCTQM_Test_Sender_stub \ + QC_QCTQM_Test_Base_stub QC_QCTQM_Starter_stub + libs += QC_QCTQM_Test_Base_stub Sender_stub QC_QCTQM_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Sender_lem_stub + dynamicflags += SENDER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_SenderEC.cpp + } + + Header_Files { + QCTQM_Test_SenderEC.h + Sender_lem_stub_export.h + } + + Inline_Files { + QCTQM_Test_SenderEC.inl + } +} + +project(QC_QCTQM_Test_Sender_stub) : ccm_stub, dds4ccm_base { + after += QC_QCTQM_Test_Sender_idl_gen QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Starter_stub \ + QC_QCTQM_Starter_lem_stub + libs += QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Starter_stub + includes += .. + libpaths += ../lib + libout = ../lib + sharedname = Sender_stub + dynamicflags += SENDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_SenderC.cpp + } + + Header_Files { + QCTQM_Test_SenderC.h + Sender_stub_export.h + } + + Inline_Files { + QCTQM_Test_SenderC.inl + } +} + +project(QC_QCTQM_Test_Sender_exec) : ciao_executor, dds4ccm_lem_stub { + after += QC_QCTQM_Test_Sender_lem_stub QC_QCTQM_Test_Sender_stub \ + QC_QCTQM_Test_Connector_lem_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Starter_lem_stub + sharedname = Sender_exec + libs += Sender_stub Sender_lem_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_lem_stub QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Starter_stub QC_QCTQM_Starter_lem_stub \ + QC_QCTQM_Starter_lem_stub + libpaths += ../lib + includes += .. + libout = ../lib + dynamicflags += SENDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_Sender_exec.cpp + } + + Header_Files { + QCTQM_Test_Sender_exec.h + Sender_exec_export.h + } + + Inline_Files { + } +} + + +project(QC_QCTQM_Test_Sender_svnt) : ciao_servant, dds4ccm_lem_stub, dds4ccm_skel { + after += QC_QCTQM_Test_Base_stub QC_QCTQM_Test_Sender_lem_stub \ + QC_QCTQM_Test_Connector_stub \ + QC_QCTQM_Test_Connector_svnt QC_QCTQM_Test_Connector_lem_stub \ + QC_QCTQM_Starter_stub QC_QCTQM_Starter_svnt \ + QC_QCTQM_Starter_lem_stub + sharedname = Sender_svnt + libs += Sender_stub Sender_lem_stub QC_QCTQM_Test_Base_stub \ + QC_QCTQM_Test_Connector_stub QC_QCTQM_Test_Connector_svnt \ + QC_QCTQM_Test_Connector_lem_stub QC_QCTQM_Starter_stub \ + QC_QCTQM_Starter_svnt QC_QCTQM_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags += SENDER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QCTQM_Test_SenderS.cpp + QCTQM_Test_Sender_svnt.cpp + } + + Header_Files { + QCTQM_Test_SenderS.h + QCTQM_Test_Sender_svnt.h + Sender_svnt_export.h + } + + Inline_Files { + QCTQM_Test_SenderS.inl + } +} + diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.cpp b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.cpp new file mode 100644 index 00000000000..65832f555f1 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.cpp @@ -0,0 +1,281 @@ +// -*- C++ -*- +// $Id$ + +/** + * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 + * TAO and the TAO IDL Compiler have been developed by: + * Center for Distributed Object Computing + * Washington University + * St. Louis, MO + * USA + * http://www.cs.wustl.edu/~schmidt/doc-center.html + * and + * Distributed Object Computing Laboratory + * University of California at Irvine + * Irvine, CA + * USA + * and + * Institute for Software Integrated Systems + * Vanderbilt University + * Nashville, TN + * USA + * http://www.isis.vanderbilt.edu/ + * + * Information about TAO is available at: + * http://www.cs.wustl.edu/~schmidt/TAO.html + **/ + +#include "QCTQM_Test_Sender_exec.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" + +#define ITERATIONS 20 + + +namespace CIAO_QCTQM_Test_Sender_Impl +{ + /** + * WriteHandler + */ + + WriteHandler::WriteHandler (Sender_exec_i &callback) + : callback_ (callback) + { + } + + int + WriteHandler::handle_exception (ACE_HANDLE) + { + this->callback_.start (); + return 0; + } + + /** + * Facet Executor Implementation Class: restart_writer_exec_i + */ + + restart_writer_exec_i::restart_writer_exec_i ( + ::QCTQM_Test::CCM_Sender_Context_ptr ctx, + Sender_exec_i & callback) + : ciao_context_ ( + ::QCTQM_Test::CCM_Sender_Context::_duplicate (ctx)) + , callback_ (callback) + { + } + + restart_writer_exec_i::~restart_writer_exec_i (void) + { + } + + // Operations from ::TwoQueriesRestarter + + void + restart_writer_exec_i::restart_write (void) + { + this->callback_.restart (); + } + + /** + * Component Executor Implementation Class: Sender_exec_i + */ + + Sender_exec_i::Sender_exec_i (void) + : keys_ (5) + , iterations_ (ITERATIONS) + , run_ (1) + , wh_ (0) + + { + } + + Sender_exec_i::~Sender_exec_i (void) + { + if (this->wh_) + { + delete this->wh_; + } + } + + // Supported operations and attributes. + ACE_Reactor* + Sender_exec_i::reactor (void) + { + ACE_Reactor* reactor = 0; + ::CORBA::Object_var ccm_object = + this->ciao_context_->get_CCM_object(); + if (! ::CORBA::is_nil (ccm_object.in ())) + { + ::CORBA::ORB_var orb = ccm_object->_get_orb (); + if (! ::CORBA::is_nil (orb.in ())) + { + reactor = orb->orb_core ()->reactor (); + } + } + if (reactor == 0) + { + throw ::CORBA::INTERNAL (); + } + return reactor; + } + + void + Sender_exec_i::restart (void) + { + ++this->run_; + this->reactor ()->notify (this->wh_); + } + + void + Sender_exec_i::start (void) + { + ::QCTQM_Test::QueryConditionTestConnector::Writer_var writer = + this->ciao_context_->get_connection_info_write_data (); + TwoQueriesStarter_var starter = + this->ciao_context_->get_connection_start_reader (); + + if (! ::CORBA::is_nil (starter.in ())) + { + starter->set_reader_properties (this->keys_, this->iterations_); + } + 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]; + QueryConditionTest new_key; + ACE_OS::sprintf (key, "KEY_%d", iter_key); + + new_key.symbol = CORBA::string_dup(key); + CORBA::UShort iter = ((this->run_ - 1) * this->iterations_) + 1; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Write key <%C> with iterations <%d> to <%d>\n"), + key, iter, (iter + this->iterations_))); + + while (iter < this->run_ * this->iterations_ + 1) + { + new_key.iteration = iter; + writer->write_one (new_key, ::DDS::HANDLE_NIL); + ++iter; + } + } + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Sender call start read with run_ = <%u>\n"), + this->run_)); + + ACE_OS::sleep (2); + starter->start_read (this->run_); + } + + // Component attributes and port operations. + + ::CCM_TwoQueriesRestarter_ptr + Sender_exec_i::get_restart_writer (void) + { + if ( ::CORBA::is_nil (this->ciao_restart_writer_.in ())) + { + restart_writer_exec_i *tmp = 0; + ACE_NEW_RETURN ( + tmp, + restart_writer_exec_i ( + this->ciao_context_.in (), + *this), + ::CCM_TwoQueriesRestarter::_nil ()); + + this->ciao_restart_writer_ = tmp; + } + + return + ::CCM_TwoQueriesRestarter::_duplicate ( + this->ciao_restart_writer_.in ()); + } + + ::CORBA::UShort + Sender_exec_i::keys (void) + { + return this->keys_; + } + + void + Sender_exec_i::keys ( + const ::CORBA::UShort keys) + { + this->keys_ = keys; + } + + // Operations from Components::SessionComponent. + + void + Sender_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->ciao_context_ = + ::QCTQM_Test::CCM_Sender_Context::_narrow (ctx); + + if ( ::CORBA::is_nil (this->ciao_context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Sender_exec_i::configuration_complete (void) + { + /* Your code here. */ + } + + void + Sender_exec_i::ccm_activate (void) + { + try + { + if (this->wh_) + { + delete this->wh_; + this->wh_ = 0; + } + ACE_NEW_THROW_EX (this->wh_, + WriteHandler (*this), + ::CORBA::NO_MEMORY ()); + this->reactor ()->notify (this->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) + { + /* Your code here. */ + } + + void + Sender_exec_i::ccm_remove (void) + { + /* Your code here. */ + } + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QCTQM_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/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.h b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.h new file mode 100644 index 00000000000..4e7bb65baa5 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/Sender/QCTQM_Test_Sender_exec.h @@ -0,0 +1,161 @@ +// -*- C++ -*- +// $Id$ + +/** + * Code generated by the The ACE ORB (TAO) IDL Compiler v1.8.3 + * TAO and the TAO IDL Compiler have been developed by: + * Center for Distributed Object Computing + * Washington University + * St. Louis, MO + * USA + * http://www.cs.wustl.edu/~schmidt/doc-center.html + * and + * Distributed Object Computing Laboratory + * University of California at Irvine + * Irvine, CA + * USA + * and + * Institute for Software Integrated Systems + * Vanderbilt University + * Nashville, TN + * USA + * http://www.isis.vanderbilt.edu/ + * + * Information about TAO is available at: + * http://www.cs.wustl.edu/~schmidt/TAO.html + **/ +#ifndef CIAO_QCTQM_TEST_SENDER_EXEC_VZMKKL_H_ +#define CIAO_QCTQM_TEST_SENDER_EXEC_VZMKKL_H_ + +#include /**/ "ace/pre.h" + +#include "QCTQM_Test_SenderEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include /**/ "Sender_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO_QCTQM_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_; + }; + + /** + * Provider Executor Implementation Class: restart_writer_exec_i + */ + + class restart_writer_exec_i + : public virtual ::CCM_TwoQueriesRestarter, + public virtual ::CORBA::LocalObject + { + public: + restart_writer_exec_i ( + ::QCTQM_Test::CCM_Sender_Context_ptr ctx, + Sender_exec_i & callback); + virtual ~restart_writer_exec_i (void); + + //@{ + /** Operations and attributes from TwoQueriesRestarter. */ + + virtual + void restart_write (void); + //@} + + private: + ::QCTQM_Test::CCM_Sender_Context_var ciao_context_; + Sender_exec_i &callback_; + }; + + /** + * Component Executor Implementation Class: 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); + + //@{ + /** Supported operations and attributes. */ + + //@} + + //@{ + /** Component attributes and port operations. */ + + virtual ::CCM_TwoQueriesRestarter_ptr + get_restart_writer (void); + + virtual ::CORBA::UShort keys (void); + + virtual 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); + //@} + + //@{ + /** User defined public operations. */ + void start (void); + void restart (void); + + //@} + + private: + ::QCTQM_Test::CCM_Sender_Context_var ciao_context_; + + //@{ + /** Component attributes. */ + ::CCM_TwoQueriesRestarter_var ciao_restart_writer_; + + ::CORBA::UShort keys_; + //@} + + //@{ + /** User defined members. */ + CORBA::UShort iterations_; + CORBA::UShort run_; + WriteHandler *wh_; + //@} + + //@{ + /** User defined private operations. */ + + //@} + + /// Get the ACE_Reactor + ACE_Reactor* reactor (void); + }; + + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QCTQM_Test_Sender_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/Plan.cdp b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/Plan.cdp new file mode 100644 index 00000000000..156877d05c9 --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/Plan.cdp @@ -0,0 +1,500 @@ +<!-- $Id$ --> +<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>QCTQM_Test_Depl_1</label> + <UUID>QCTQM_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_QCTQM_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_QCTQM_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="QCTQM_Test_EventConnectorImplementation"> + <name>QCTQM_Test_EventConnectorImplementation</name> + <source/> + <artifact xmi:idref="QCTQM_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QCTQM_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_QCTQM_Test_QueryConditionTestConnector_DDS_Event_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QCTQM_Test_QueryConditionTestConnector_DDS_Event_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QC_QCTQM_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QC_QCTQM_Test_Connector_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="QCTQM_Test_StateConnectorImplementation"> + <name>QCTQM_Test_StateConnectorImplementation</name> + <source/> + <artifact xmi:idref="QCTQM_Test_Connector_ExecArtifact" /> + <artifact xmi:idref="QCTQM_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_QCTQM_Test_QueryConditionTestConnector_DDS_State_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_QCTQM_Test_QueryConditionTestConnector_DDS_State_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QC_QCTQM_Test_Connector_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QC_QCTQM_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_QCTQM_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_QCTQM_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="QCTQM_Test_SenderConnectorInstance"> + <name>QCTQM_Test_ConnectorComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QCTQM_Test_EventConnectorImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryCondition_Library#QueryCondition_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QCTQM_Test</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="QCTQM_Test_EventConnector"> + <name>QCTQM_Test_EventConnector</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QCTQM_Test_EventConnectorImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryCondition_Library#QueryCondition_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QCTQM_Test</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="QCTQM_Test_StateConnector"> + <name>QCTQM_Test_StateConnector</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="QCTQM_Test_StateConnectorImplementation" /> + <configProperty> + <name>qos_profile</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QueryCondition_Library#QueryCondition_Profile</string> + </value> + </value> + </configProperty> + <configProperty> + <name>topic_name</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>QCTQM_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> + </instance> + + <connection> + <name>read_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>read_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>passive_observer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="QCTQM_Test_StateConnector" /> + </internalEndpoint> + </connection> + + <connection> + <name>get_port_data</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>get_port_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>pull_consumer_data</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="QCTQM_Test_EventConnector" /> + </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="QCTQM_Test_EventConnector" /> + </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="QCTQM_Test_SenderConnectorInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>reader_starter</name> + <internalEndpoint> + <portName>start_reader</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>reader_start</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>restart_writer</name> + <internalEndpoint> + <portName>writer_restart</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="ReceiverComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>restart_writer</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SenderComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="Sender_ExecArtifact"> + <name>Sender_exec</name> + <source/> + <node/> + <location>Sender_exec</location> + </artifact> + <artifact xmi:id="Sender_SvntArtifact"> + <name>Sender_svnt</name> + <source/> + <node/> + <location>Sender_svnt</location> + </artifact> + <artifact xmi:id="Sender_StubArtifact"> + <name>Sender_stub</name> + <source/> + <node/> + <location>Sender_stub</location> + </artifact> + <artifact xmi:id="QCTQM_Test_Connector_ExecArtifact"> + <name>QC_QCTQM_Test_Connector_exec</name> + <source/> + <node/> + <location>QC_QCTQM_Test_Connector_exec</location> + </artifact> + <artifact xmi:id="QCTQM_Test_Connector_SvntArtifact"> + <name>QC_QCTQM_Test_Connector_svnt</name> + <source/> + <node/> + <location>QC_QCTQM_Test_Connector_svnt</location> + </artifact> + <artifact xmi:id="QCTQM_Test_Connector_StubArtifact"> + <name>QC_QCTQM_Test_Connector_stub</name> + <source/> + <node/> + <location>QC_QCTQM_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/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml new file mode 100644 index 00000000000..68c9a0e8f5e --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/USER_QOS_PROFILES.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +Description +XML QoS Profile + +The QoS configuration of the DDS entities in the generated example is +loaded from this file. + +This file is used only when it is in the current working directory +or when the enviroment variable +NDDS_QOS_PROFILES is defined and points to this file. + +For more information about XML QoS Profiles see Chapter 15 in the +RTI Data Distribution Service user manual. +--> +<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="c:/ndds/ndds.4.4d/scripts/../resource/rtiddsgen/../qos_profiles_4.4d/schema/rti_dds_qos_profiles.xsd" version="4.4d"> + <!-- QoS Library containing the QoS profile used in the generated example. + + A QoS library is a named set of QoS profiles. + --> + <qos_library name="QueryCondition_Library"> + <!-- QoS profile used to configure reliable communication between the DataWriter + and DataReader created in the example code. + + A QoS profile groups a set of related QoS. + --> + <qos_profile name="QueryCondition_Profile" is_default_qos="true"> + <!-- QoS used to configure the data writer created in the example code --> + <datawriter_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + <max_blocking_time> + <sec>10</sec> + <nanosec>0</nanosec> + </max_blocking_time> + </reliability> + <durability> + <kind>TRANSIENT_DURABILITY_QOS</kind> + </durability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + </history> + <protocol> + <rtps_reliable_writer> + <max_heartbeat_retries>10</max_heartbeat_retries> + </rtps_reliable_writer> + </protocol> + </datawriter_qos> + <!-- QoS used to configure the data reader created in the example code --> + <datareader_qos> + <reliability> + <kind>RELIABLE_RELIABILITY_QOS</kind> + </reliability> + <history> + <kind>KEEP_ALL_HISTORY_QOS</kind> + </history> + <durability> + <kind>TRANSIENT_LOCAL_DURABILITY_QOS</kind> + </durability> + </datareader_qos> + </qos_profile> + </qos_library> +</dds> diff --git a/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/run_test.pl b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/descriptors/run_test.pl new file mode 100755 index 00000000000..47a0d52da2c --- /dev/null +++ b/CIAO/connectors/dds4ccm/tests/QueryCondition/TwoQueriesMany/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 daemon $i failed\n"; + $tg_daemons[$i]->AddLibPath ('../lib'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('../lib'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('../lib'); +} + +sub init_ior_files { + $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase); + $ior_emfile = $tg_exe_man->LocalFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } + delete_ior_files (); +} + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i]->DeleteFile ($iorbases[$i]); + } + $tg_naming->DeleteFile ($ior_nsbase); + $tg_exe_man->DeleteFile ($ior_embase); + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]); + } +} + +sub kill_node_daemon { + for ($i = 0; $i < $nr_daemon; ++$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemon (); + } + + if ($em_running == 1) { + $EM->Kill (); $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); $NS->TimedWait (1); + } + # in case shutdown did not perform as expected + $tg_executor->KillAll ('dance_locality_manager'); +} + +sub run_node_daemons { + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorbase = $iorbases[$i]; + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = $tg_daemons[$i]->GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager"; + + $d_cmd = "$DANCE_ROOT/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService"; + + print "Run dance_node_manager with $d_param\n"; + + $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param); + $DEAMONS[$i]->Spawn (); + + if ($tg_daemons[$i]->WaitForFileTimed($iorbase, + $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +create_targets (); +init_ior_files (); + +# Invoke naming service + +$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -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 -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 40 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; |