summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/MT_Dispatching
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/MT_Dispatching')
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc38
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am162
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp39
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h43
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/README38
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp192
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp271
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl132
15 files changed, 0 insertions, 951 deletions
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc b/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc
deleted file mode 100644
index d576fd2920e..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc
+++ /dev/null
@@ -1,38 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-project(*idl): taoidldefaults {
- avoids += ace_for_tao
- IDL_Files {
- go.idl
- }
- custom_only = 1
-}
-
-project(*Ntf Struct Supp): notifytest {
- avoids += ace_for_tao
- exename = Structured_Supplier
-
- after += *idl
- Source_Files {
- Structured_Supplier.cpp
- goS.cpp
- goC.cpp
- }
- IDL_Files {
- }
-}
-
-project(*Ntf Struct Cons): notifytest {
- avoids += ace_for_tao
- exename = Structured_Consumer
-
- after += *idl
- Source_Files {
- goC.cpp
- Notify_Structured_Push_Consumer.cpp
- Structured_Consumer.cpp
- }
- IDL_Files {
- }
-}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am
deleted file mode 100644
index c78ddc8f1fe..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am
+++ /dev/null
@@ -1,162 +0,0 @@
-## Process this file with automake to create Makefile.in
-##
-## $Id$
-##
-## This file was generated by MPC. Any changes made directly to
-## this file will be lost the next time it is generated.
-##
-## MPC Command:
-## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
-
-ACE_BUILDDIR = $(top_builddir)/..
-ACE_ROOT = $(top_srcdir)/..
-TAO_BUILDDIR = $(top_builddir)
-TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
-TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
-TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
-TAO_ROOT = $(top_srcdir)
-
-noinst_PROGRAMS =
-
-## Makefile.MT_Dispatching_Idl.am
-
-if !BUILD_ACE_FOR_TAO
-
-BUILT_SOURCES = \
- goC.cpp \
- goC.h \
- goC.inl \
- goS.cpp \
- goS.h \
- goS.inl
-
-CLEANFILES = \
- go-stamp \
- goC.cpp \
- goC.h \
- goC.inl \
- goS.cpp \
- goS.h \
- goS.inl
-
-goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
-
-go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
- $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
- @touch $@
-
-
-noinst_HEADERS = \
- go.idl
-
-endif !BUILD_ACE_FOR_TAO
-
-## Makefile.MT_Dispatching_Ntf_Struct_Cons.am
-
-if BUILD_CORBA_MESSAGING
-if !BUILD_ACE_FOR_TAO
-if !BUILD_MINIMUM_CORBA
-
-noinst_PROGRAMS += Structured_Consumer
-
-Structured_Consumer_CPPFLAGS = \
- -I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -I$(TAO_ROOT) \
- -I$(TAO_BUILDDIR) \
- -I$(TAO_ROOT)/orbsvcs \
- -I$(TAO_BUILDDIR)/orbsvcs \
- -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
- -DTAO_HAS_TYPED_EVENT_CHANNEL
-
-Structured_Consumer_SOURCES = \
- Notify_Structured_Push_Consumer.cpp \
- Structured_Consumer.cpp \
- goC.cpp \
- Notify_Structured_Push_Consumer.h
-
-Structured_Consumer_LDADD = \
- $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
- $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
- $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
- $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
- $(TAO_BUILDDIR)/tao/libTAO_PI.la \
- $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
- $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
- $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
- $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
- $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
- $(TAO_BUILDDIR)/tao/libTAO.la \
- $(ACE_BUILDDIR)/ace/libACE.la
-
-endif !BUILD_MINIMUM_CORBA
-endif !BUILD_ACE_FOR_TAO
-endif BUILD_CORBA_MESSAGING
-
-## Makefile.MT_Dispatching_Ntf_Struct_Supp.am
-
-if BUILD_CORBA_MESSAGING
-if !BUILD_ACE_FOR_TAO
-if !BUILD_MINIMUM_CORBA
-
-noinst_PROGRAMS += Structured_Supplier
-
-Structured_Supplier_CPPFLAGS = \
- -I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -I$(TAO_ROOT) \
- -I$(TAO_BUILDDIR) \
- -I$(TAO_ROOT)/orbsvcs \
- -I$(TAO_BUILDDIR)/orbsvcs \
- -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
- -DTAO_HAS_TYPED_EVENT_CHANNEL
-
-Structured_Supplier_SOURCES = \
- Structured_Supplier.cpp \
- goC.cpp \
- goS.cpp \
- Notify_Structured_Push_Consumer.h
-
-Structured_Supplier_LDADD = \
- $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
- $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
- $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
- $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
- $(TAO_BUILDDIR)/tao/libTAO_PI.la \
- $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
- $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
- $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
- $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
- $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
- $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
- $(TAO_BUILDDIR)/tao/libTAO.la \
- $(ACE_BUILDDIR)/ace/libACE.la
-
-endif !BUILD_MINIMUM_CORBA
-endif !BUILD_ACE_FOR_TAO
-endif BUILD_CORBA_MESSAGING
-
-## Clean up template repositories, etc.
-clean-local:
- -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
- -rm -f gcctemp.c gcctemp so_locations *.ics
- -rm -rf cxx_repository ptrepository ti_files
- -rm -rf templateregistry ir.out
- -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp
deleted file mode 100644
index ce7921b2522..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// $Id$
-
-#include "Notify_Structured_Push_Consumer.h"
-#include "Notify_Test_Client.h"
-
-Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
- const char* name,
- unsigned int expected,
- Notify_Test_Client& client)
- : name_ (name),
- expected_ (expected),
- count_ (0),
- client_ (client)
-{
- this->client_.consumer_start (this);
-}
-
-
-void
-Notify_Structured_Push_Consumer::push_structured_event (
- const CosNotification::StructuredEvent& /*event*/
- ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
- ACE_THROW_SPEC ((CORBA::SystemException))
-{
- ACE_DEBUG((LM_DEBUG, "-"));
-
- ++count_;
-
- if (this->count_ > this->expected_)
- {
- ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n")));
- }
-
- if (this->count_ >= this->expected_)
- {
- this->client_.consumer_done (this);
- }
-}
-
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h
deleted file mode 100644
index bc4f2933b90..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-// ==========================================================================
-//
-// = LIBRARY
-// TAO/orbsvcs/tests/Notify/Discarding
-//
-// = FILENAME
-// Notify_Structured_Push_Consumer.h
-//
-// = DESCRIPTION
-// A structured push consumer implementation.
-//
-// = AUTHOR
-// Chad Elliott <elliott_c@ociweb.com>
-//
-// ==========================================================================
-#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
-#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
-
-#include "Notify_StructuredPushConsumer.h"
-
-class Notify_Test_Client;
-
-class Notify_Structured_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
-{
-public:
- Notify_Structured_Push_Consumer (
- const char* name,
- unsigned int expected,
- Notify_Test_Client& client);
-protected:
- void push_structured_event (const CosNotification::StructuredEvent&
- ACE_ENV_ARG_DECL)
- ACE_THROW_SPEC ((CORBA::SystemException));
-
- ACE_CString name_;
- unsigned int expected_;
- unsigned int count_;
- Notify_Test_Client& client_;
-};
-
-#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/README b/TAO/orbsvcs/tests/Notify/MT_Dispatching/README
deleted file mode 100644
index 5a2dce02e48..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/README
+++ /dev/null
@@ -1,38 +0,0 @@
-Notification MT Dispatching Test
-================================
-
-Description
------------
-This test exercises multi-threaded aspects of the Notification service.
-Dispatching, consumer filter evaluation and supplier filter evaluation. It
-also runs the notifcation service in single-threaded mode.
-
-Usage
------
-
-The test consists of a Structured_Supplier and Structured_Consumer. The
-usage for each as is follows:
-
-$ Structured_Supplier -\?
-usage: Structured_Supplier -o <iorfile> -e <# of events> -f
-
-$ Structured_Consumer -\?
-usage: Structured_Consumer -k <ior> -c <# of consumers> -e <expected events>
- -f
-
-To run this test, just run the run_test.pl perl script. It will run both
-structured and sequence tests with each of the implemented discard policies.
-
-
-Expected Results
-----------------
-********* Running multi-threaded dispatching test *******
-
-********* Running multi-threaded consumer filter evaluation *******
-
-********* Running multi-threaded supplier filter evaluation *******
-
-********* Running single-threaded notification service *******
-
-
-If an error is encountered, the perl script will exit with an error status.
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp
deleted file mode 100644
index 851210f4877..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-// $Id$
-
-// ******************************************************************
-// Include Section
-// ******************************************************************
-
-#include "ace/Get_Opt.h"
-
-#include "orbsvcs/CosNotifyCommC.h"
-#include "orbsvcs/CosNamingC.h"
-#include "Notify_Structured_Push_Consumer.h"
-#include "goC.h"
-#include "ace/OS_NS_sys_time.h"
-
-#include "Notify_Test_Client.h"
-
-// ******************************************************************
-// Data Section
-// ******************************************************************
-
-static Notify_Structured_Push_Consumer* consumers[1024] = {0};
-static const char* ior = "file://supplier.ior";
-static unsigned int consumer_count = 1;
-static unsigned int expected = 1;
-
-// ******************************************************************
-// Subroutine Section
-// ******************************************************************
-
-class Consumer_Client : public Notify_Test_Client
-{
-public:
- virtual int parse_args (int argc, char* argv[]);
-};
-
-
-int
-Consumer_Client::parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, "k:e:c:f");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'k':
- ior = get_opts.optarg;
- break;
-
- case 'c':
- consumer_count = ACE_OS::atoi (get_opts.optarg);
- break;
-
- case 'e':
- expected = ACE_OS::atoi (get_opts.optarg);
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "-k <ior> "
- "-c <# of consumers> "
- "-e <expected events> "
- "\n",
- argv [0]),
- -1);
- }
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-
-static CosNotifyChannelAdmin::ConsumerAdmin_ptr
-create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
- ACE_ENV_ARG_DECL)
-{
- CosNotifyChannelAdmin::AdminID adminid = 0;
- CosNotifyChannelAdmin::ConsumerAdmin_var admin =
- ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
- adminid
- ACE_ENV_ARG_PARAMETER);
-
- ACE_CHECK_RETURN (0);
-
- return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
-}
-
-
-static void
-create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
- Notify_Test_Client* client
- ACE_ENV_ARG_DECL)
-{
- for (unsigned int i = 0; i < consumer_count; i++)
- {
- // startup the consumers
- char name[64] = "";
- ACE_OS::sprintf (name, "consumer%u", i);
- ACE_NEW_THROW_EX (consumers[ i ],
- Notify_Structured_Push_Consumer (
- name,
- expected,
- *client),
- CORBA::NO_MEMORY ());
-
- consumers[ i ]->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- consumers[ i ]->connect (admin ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
- }
-}
-
-static void
-disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
-{
- for (unsigned int i = 0; i < consumer_count; i++)
- {
- consumers[ i ]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
- }
-}
-
-// ******************************************************************
-// Main Section
-// ******************************************************************
-
-int main (int argc, char* argv[])
-{
- int status = 0;
- ACE_TRY_NEW_ENV
- {
- Consumer_Client client;
-
- status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (status == 0)
- {
- CosNotifyChannelAdmin::EventChannel_var ec =
- client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::Object_var object =
- client.orb ()->string_to_object (ior ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (CORBA::is_nil (sig.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Object reference <%s> is nil\n",
- ior),
- 1);
- }
-
- CosNotifyChannelAdmin::ConsumerAdmin_var admin =
- create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (!CORBA::is_nil (admin.in ()))
- {
- create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- // Tell the supplier to go
- sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
- ACE_TRY_CHECK;
-
- disconnect_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- ACE_DEBUG ((LM_DEBUG, "Consumer done.\n"));
- sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- }
- }
- ACE_CATCH (CORBA::Exception, e)
- {
- ACE_PRINT_EXCEPTION (e, "Error: ");
- status = 1;
- }
- ACE_ENDTRY;
-
- return status;
-}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
deleted file mode 100644
index 4612ff106bf..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-// $Id$
-
-// ******************************************************************
-// Include Section
-// ******************************************************************
-
-#include "ace/Get_Opt.h"
-#include "ace/Auto_Ptr.h"
-
-#include "tao/ORB_Core.h"
-
-#include "orbsvcs/CosNotifyChannelAdminS.h"
-#include "orbsvcs/CosNotifyCommC.h"
-#include "orbsvcs/CosNamingC.h"
-#include "Notify_StructuredPushSupplier.h"
-#include "goS.h"
-
-#include "Notify_Test_Client.h"
-
-#include "ace/OS_NS_unistd.h"
-
-// ******************************************************************
-// Data Section
-// ******************************************************************
-
-static const unsigned int supplier_max = 32;
-static TAO_Notify_Tests_StructuredPushSupplier* suppliers[supplier_max] = {0};
-static unsigned int supplier_count = 1;
-static int event_count = 1;
-static const char* ior_output_file = "supplier.ior";
-
-// ******************************************************************
-// Subroutine Section
-// ******************************************************************
-class sig_i : public POA_sig
-{
-public:
- sig_i(CORBA::ORB_ptr orb)
- : orb_(orb)
- , started_(false)
- {
- }
-
- void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
- ACE_THROW_SPEC ((CORBA::SystemException))
- {
- started_ = true;
- }
-
- void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
- ACE_THROW_SPEC ((CORBA::SystemException))
- {
- started_ = false;
- }
-
- void wait_for_startup()
- {
- while (! started_) {
- ACE_Time_Value tv(0, 100 * 1000); // 100ms
- orb_->run(tv);
- }
- }
-
- void wait_for_completion()
- {
- while (started_) {
- ACE_Time_Value tv(0, 100 * 1000); // 100ms
- orb_->run(tv);
- }
- }
-
-private:
- CORBA::ORB_ptr orb_;
- bool started_;
-};
-
-class Consumer_Client : public Notify_Test_Client
-{
-public:
- virtual int parse_args (int argc, char* argv[]);
-};
-
-
-int
-Consumer_Client::parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, "o:e:fc:");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'c':
- supplier_count = ACE_OS::atoi (get_opts.optarg);
- if (supplier_count > supplier_max)
- {
- supplier_count = supplier_max;
- }
- break;
-
- case 'e':
- event_count = ACE_OS::atoi (get_opts.optarg);
- break;
-
- case 'o':
- ior_output_file = get_opts.optarg;
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "-o <iorfile> -e <# of events>"
- "\n",
- argv [0]),
- -1);
- }
-
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-
-static CosNotifyChannelAdmin::SupplierAdmin_ptr
-create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
- ACE_ENV_ARG_DECL)
-{
- CosNotifyChannelAdmin::AdminID adminid = 0;
- CosNotifyChannelAdmin::SupplierAdmin_var admin =
- ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
- adminid
- ACE_ENV_ARG_PARAMETER);
-
- ACE_CHECK_RETURN (0);
-
- return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
-}
-
-
-static void
-SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
-{
- ACE_UNUSED_ARG(id);
- CosNotification::StructuredEvent event;
-
- event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
- event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
- event.header.fixed_header.event_name = CORBA::string_dup ("test");
-
- ACE_TRY_NEW_ENV
- {
- for (unsigned int i = 0; i < supplier_count; i++)
- {
- suppliers[i]->send_event (event ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- }
- ACE_CATCH (CORBA::Exception, e)
- {
- ACE_PRINT_EXCEPTION (e, "Error: ");
- }
- ACE_ENDTRY;
-}
-
-static void
-create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
- Notify_Test_Client* client
- ACE_ENV_ARG_DECL)
-{
- for (unsigned int i = 0; i < supplier_count; i++)
- {
- ACE_NEW_THROW_EX (suppliers[i],
- TAO_Notify_Tests_StructuredPushSupplier (),
- CORBA::NO_MEMORY ());
-
- suppliers[i]->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-
- suppliers[i]->connect (admin ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
- }
-}
-
-static void
-disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
-{
- for (unsigned int i = 0; i < supplier_count; ++i)
- {
- suppliers[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
- }
-}
-
-// ******************************************************************
-// Main Section
-// ******************************************************************
-
-int main (int argc, char* argv[])
-{
- ACE_Auto_Ptr< sig_i > sig_impl;
- ACE_TRY_NEW_ENV
- {
- Consumer_Client client;
- int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- ACE_UNUSED_ARG(status);
- ACE_ASSERT(status == 0);
-
- CosNotifyChannelAdmin::EventChannel_var ec =
- client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::ORB_ptr orb = client.orb ();
-
- sig_impl.reset( new sig_i( orb ) );
- sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::String_var ior =
- orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (ior_output_file != 0)
- {
- FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
- if (output_file == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Cannot open output file for "
- "writing IOR: %s",
- ior_output_file),
- 1);
- ACE_OS::fprintf (output_file, "%s", ior.in ());
- ACE_OS::fclose (output_file);
- }
-
- CosNotifyChannelAdmin::SupplierAdmin_var admin =
- create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
- ACE_ASSERT(!CORBA::is_nil (admin.in ()));
- create_suppliers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- sig_impl->wait_for_startup();
-
- ACE_DEBUG((LM_DEBUG, "%i supplier(s) sending %d events...\n", supplier_count, event_count));
- for (int i = 0; i < event_count; ++i)
- {
- ACE_DEBUG((LM_DEBUG, "+"));
- SendEvent (i ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- ACE_DEBUG((LM_DEBUG, "\nEach Supplier sent %d events.\n", event_count));
-
- sig_impl->wait_for_completion();
-
- ACE_OS::unlink (ior_output_file);
-
- disconnect_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- return 0;
- }
- ACE_CATCH (CORBA::Exception, e)
- {
- ACE_PRINT_EXCEPTION (e, "Error: ");
- }
- ACE_ENDTRY;
-
- return 1;
-}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl
deleted file mode 100644
index e24bfd036c7..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl
+++ /dev/null
@@ -1,10 +0,0 @@
-// $Id$
-
-interface sig
-{
- // Tell the server to start
- oneway void go ();
-
- // Tell the server the consumer is done
- oneway void done ();
-};
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf
deleted file mode 100644
index 007cca48967..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-## $Id$
-#
-## Load the static Cos Notification Service
-static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 2"
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml
deleted file mode 100644
index 725528eac0c..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version='1.0'?>
-<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf by svcconf-convert.pl -->
-<ACE_Svc_Conf>
- <!-- # $Id$ -->
- <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 2"/>
-</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf
deleted file mode 100644
index d8608059bad..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-## $Id$
-static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1 -SourceThreads 2"
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml
deleted file mode 100644
index fe5182ff88a..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version='1.0'?>
-<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf by svcconf-convert.pl -->
-<ACE_Svc_Conf>
- <!-- # $Id$ -->
- <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1 -SourceThreads 2"/>
-</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf
deleted file mode 100644
index 111787f6e31..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-## $Id$
-static Notify_Default_Event_Manager_Objects_Factory ""
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml
deleted file mode 100644
index 6e3f08e4341..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version='1.0'?>
-<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf by svcconf-convert.pl -->
-<ACE_Svc_Conf>
- <!-- # $Id$ -->
- <static id="Notify_Default_Event_Manager_Objects_Factory"/>
-</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl
deleted file mode 100755
index 9df3b569d16..00000000000
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl
+++ /dev/null
@@ -1,132 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
-
-# $Id$
-# -*- perl -*-
-
-use lib "../../../../../bin";
-use PerlACE::Run_Test;
-
-$experiment_timeout = 60;
-$startup_timeout = 60;
-$shutdown_timeout = 10;
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-$supplier_ior = PerlACE::LocalFile ("supplier.ior");
-$status = 0;
-
-@tests =
- (
- {
- description => "no threads",
- config => "notify_nothreads$PerlACE::svcconf_ext",
- supplier => " -c 10 -e 10 ",
- consumer => " -c 2 -e 100 ",
- },
- {
- description => "multi-threaded dispatching",
- config => "notify_mtdispatching$PerlACE::svcconf_ext",
- supplier => " -c 10 -e 10 ",
- consumer => " -c 2 -e 100 ",
- },
- {
- description => "multi-threaded supplier-side",
- config => "notify_mtsource$PerlACE::svcconf_ext",
- supplier => " -c 10 -e 10 ",
- consumer => " -c 2 -e 100 ",
- },
- );
-
-@tests2 =
- (
- {
- description => "multi-threaded dispatching",
- config => "notify_mtdispatching$PerlACE::svcconf_ext",
- supplier => " ",
- consumer => " ",
- }
- );
-
-$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service");
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior ";
-
-$Supplier = new PerlACE::Process ("Structured_Supplier",
- "-ORBInitRef NameService=file://$naming_ior ");
-
-$Consumer = new PerlACE::Process ("Structured_Consumer",
- "-ORBInitRef NameService=file://$naming_ior ");
-
-unlink $naming_ior;
-$Naming->Spawn ();
-
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
-}
-
-for $test (@tests)
- {
- print STDERR "\nTesting $test->{description} ....\n\n";
-
- unlink $notify_ior;
- $Notification->Arguments ($Notify_Args . " -ORBSvcConf $test->{config}");
- $args = $Notification->Arguments ();
- print STDERR "Running Notification with arguments: $args\n";
- $Notification->Spawn ();
-
- if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
- }
-
- unlink $supplier_ior;
- $Supplier->Arguments ($Supplier->Arguments () . $test->{supplier});
- $args = $Supplier->Arguments ();
- print STDERR "Running Supplier with arguments: $args\n";
- $Supplier->Spawn ();
-
- if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the supplier to start\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
- }
-
- $Consumer->Arguments ($Consumer->Arguments () . $test->{consumer});
- $args = $Consumer->Arguments ();
- print STDERR "Running Consumer with arguments: $args\n";
- $status = $Consumer->SpawnWaitKill ($experiment_timeout);
- if ($status != 0)
- {
- print STDERR "ERROR: Consumer returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
- }
-
- $status = $Supplier->WaitKill ($shutdown_timeout);
- if ($status != 0) {
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
- }
- unlink $supplier_ior;
-
- $Notification->Kill ();
- unlink $notify_ior;
- }
-
-$Naming->Kill ();
-unlink $naming_ior;
-
-exit $status;