diff options
author | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-07-01 20:27:01 +0000 |
---|---|---|
committer | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-07-01 20:27:01 +0000 |
commit | c6242e538b2144d1391aeae03d6139ed59ef2e9f (patch) | |
tree | edb6b78708bd65ec3ffb083a6c82fd6f3d9f87d3 /TAO/orbsvcs/tests/Notify | |
parent | c1eb8ab20e76266f9e5b0a1009bfc2e1c93f7aa0 (diff) | |
download | ATCD-c6242e538b2144d1391aeae03d6139ed59ef2e9f.tar.gz |
Fri Jul 1 14:43:27 2005 Justin Michel <michel_j@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/tests/Notify')
189 files changed, 4947 insertions, 5148 deletions
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp index 97db6fc7f80..7f05025928f 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp @@ -20,12 +20,11 @@ // ****************************************************************** static const char* ior = "file://supplier.ior"; -static TimeBase::TimeT blocking_timeout = 0; +// TimeT is in 10ths of a microsecond +static TimeBase::TimeT blocking_timeout = 2 * 1000 * 1000 * 10; // 2 secs +// Must match the number sent by supplier. (-1 if blocking_timeout less than 1) static unsigned int expected = 20; - -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static Notify_Structured_Push_Consumer* consumer_1 = 0; class Consumer_Client : public Notify_Test_Client { @@ -42,29 +41,30 @@ Consumer_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'k': - ior = get_opts.optarg; - break; - - case 'e': - expected = ACE_OS::atoi (get_opts.optarg); - break; - - case 't': - blocking_timeout = ACE_OS::atoi (get_opts.optarg); - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-e <expected events> " - "-t <relative blocking timeout seconds> " - "\n", - argv [0]), - -1); - } + { + case 'k': + ior = get_opts.optarg; + break; + + case 'e': + expected = ACE_OS::atoi (get_opts.optarg); + break; + + case 't': + blocking_timeout = ACE_OS::atoi (get_opts.optarg); + blocking_timeout *= 10 * 1000; + break; + + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-e <expected events> " + "-t <relative blocking timeout milliseconds> " + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; } @@ -92,14 +92,13 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, ACE_ENV_ARG_DECL) { // startup the consumer - Notify_Structured_Push_Consumer* consumer_1; ACE_NEW_THROW_EX (consumer_1, - Notify_Structured_Push_Consumer ( - "consumer1", - blocking_timeout, - expected, - client->done ()), - CORBA::NO_MEMORY ()); + Notify_Structured_Push_Consumer ( + "consumer1", + blocking_timeout, + expected, + *client), + CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -115,72 +114,58 @@ 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::ORB_ptr orb = client.orb (); - CORBA::Object_var object = - 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; - - CORBA::Boolean wait_more = 1; - while (!client.done () || wait_more) - { - // See if we can get any more events - if (client.done () && wait_more) - { - ACE_OS::sleep (5); - wait_more = 0; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - // Simulate a bit of consumer lag - ACE_OS::sleep (2); - } - } - } - } + { + Consumer_Client client; + + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (status != 0) + ACE_ERROR_RETURN ((LM_ERROR, "Error: Client init failed.\n"),1); + + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::ORB_ptr orb = client.orb (); + CORBA::Object_var object = + 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, "Error: Narrow failed.\n"),1); + + CosNotifyChannelAdmin::ConsumerAdmin_var admin = + create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (admin.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Error: nil ConsumerAdmin.\n"),1); + + create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n")); + + client.ORB_run (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); + consumer_1->disconnect(); + + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp index 03c7ce9214a..c096d38018a 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp @@ -22,31 +22,53 @@ // ****************************************************************** static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static int max_events = 20; 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { public: @@ -62,23 +84,23 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'e': - max_events = 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> -d" - "\n", - argv [0]), - -1); - } + { + case 'e': + max_events = 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> -d" + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; @@ -92,8 +114,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -102,61 +124,28 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvent (void) +SendEvent (int id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::StructuredEvent event; - - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); + CosNotification::StructuredEvent event; - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; + event.header.fixed_header.event_type.domain_name = CORBA::string_dup (""); + event.header.fixed_header.event_type.type_name = CORBA::string_dup (""); + event.header.fixed_header.event_name = CORBA::string_dup ("blocking-test"); - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; + event.filterable_data.length (1); + event.filterable_data[0].name = CORBA::string_dup ("id"); + event.filterable_data[0].value <<= id; - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::ULong)count; - count++; - - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + ACE_TRY_NEW_ENV + { + supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: "); + } + ACE_ENDTRY; } static void @@ -166,8 +155,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // startup the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_StructuredPushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -184,66 +173,79 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV + { + Supplier_Client client; + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) + CORBA::ORB_ptr orb = client.orb (); + + // Activate the signaler with the POA + 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 the ior_output_file exists, output the ior to it + 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); + if (!CORBA::is_nil (admin.in ())) + { + create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", max_events)); + for (int i = 0; i < max_events; ++i) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); + ACE_DEBUG((LM_DEBUG, "+")); + SendEvent (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events)); - // Activate the signaler with the POA - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sig_impl->wait_for_completion(); - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_OS::unlink (ior_output_file); - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvent (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Blocking/common.cpp b/TAO/orbsvcs/tests/Notify/Blocking/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/common.cpp +++ b/TAO/orbsvcs/tests/Notify/Blocking/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/Blocking/go.idl b/TAO/orbsvcs/tests/Notify/Blocking/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/go.idl +++ b/TAO/orbsvcs/tests/Notify/Blocking/go.idl @@ -4,4 +4,7 @@ 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/Blocking/notify.conf b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf index 81d7ba362a7..f15e4999f71 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf @@ -1,5 +1,10 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Client_Strategy_Factory "-ORBClientConnectionHandler RW" -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1 -MTSourceEval" +## The BlockingPolicy requires the notify service to use the following settings to prevent +## dispatch threads from handling supplier-side requests. This would allow dispatch threads +## to block on the condition variables used for the blocking feature, which would prevent +## the thread from handling the consumer response, resulting in deadlock. +static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive -ORBConnectStrategy blocked" +static Resource_Factory "-ORBFlushingStrategy blocking" +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml index 7d2088bfdd9..a499d551e4b 100644 --- a/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/Blocking/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1 -MTSourceEval"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl b/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl index aa518f5ef55..a91844db34e 100755 --- a/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl @@ -9,15 +9,15 @@ use lib "../../../../../bin"; use PerlACE::Run_Test; $ior = PerlACE::LocalFile ("supplier.ior"); +$namingior = PerlACE::LocalFile ("naming.ior"); $notifyior = PerlACE::LocalFile ("notify.ior"); $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); $status = 0; -unlink $notifyior; - $port = PerlACE::uniqueid () + 10001; $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); + "-ORBEndpoint iiop://localhost:$port " . + "-o $namingior"); $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . @@ -28,17 +28,22 @@ $STS = new PerlACE::Process ("Structured_Supplier", "localhost:$port/NameService"); $STC = new PerlACE::Process ("Structured_Consumer"); +unlink $ior; +unlink $notifyior; +unlink $namingior; + $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; -if ($NS->Spawn () == -1) { - exit 1; -} +$NS->Spawn (); -if ($TS->Spawn () == -1) { - $NS->Kill (); - exit 1; +if (PerlACE::waitforfile_timed ($namingior, 20) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); + exit 1; } +$TS->Spawn (); + if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; $TS->Kill (); @@ -46,36 +51,70 @@ if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { exit 1; } -print "************* Running Structured Consumer with the " . - "Blocking Policy ***********\n"; +print "****** Running consumer long blocking timeout ******\n"; unlink $ior; $STS->Arguments($STS->Arguments()); $STS->Spawn (); - -if (PerlACE::waitforfile_timed ($ior, 20) == -1) { +if (PerlACE::waitforfile_timed ($ior, 5) == -1) { print STDERR "ERROR: waiting for the supplier to start\n"; $STS->Kill (); $TS->Kill (); $NS->Kill (); - $status = 1; + exit 1; } -$STC->Arguments($client_args . " -t 10"); -$client = $STC->SpawnWaitKill (120); +$STC->Arguments($client_args . " -t 2000"); +$client = $STC->SpawnWaitKill (10); +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +print "****** Running consumer with short blocking timeout ******\n"; + +unlink $ior; +$STS->Arguments($STS->Arguments()); +$STS->Spawn (); + +if (PerlACE::waitforfile_timed ($ior, 5) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} -$STS->Kill (); +$STC->Arguments($client_args . " -e 19 -t 500"); +$client = $STC->SpawnWaitKill (10); if ($client != 0) { print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; } - $TS->Kill (); $NS->Kill (); unlink $ior; unlink $notifyior; +unlink $namingior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/Destroy/main.cpp b/TAO/orbsvcs/tests/Notify/Destroy/main.cpp index b437d7b75e3..727cdea1fa6 100644 --- a/TAO/orbsvcs/tests/Notify/Destroy/main.cpp +++ b/TAO/orbsvcs/tests/Notify/Destroy/main.cpp @@ -13,21 +13,24 @@ ACE_TMAIN (int argc, char *argv[]) Notify_Test_Client client; client.init (argc, argv ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); - + CosNotifyChannelAdmin::EventChannelFactory_ptr ecf = client.notify_factory (); - + NotifyExt::EventChannelFactory_var ecf_ext = NotifyExt::EventChannelFactory::_narrow (ecf); - + + ACE_DEBUG((LM_DEBUG, "Destroying ECF...\n")); + ecf_ext->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "ECF destroyed.\n")); } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - ACE_LIB_TEXT("Failed to run the program\n")); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_LIB_TEXT("Error: \n")); return 1; } ACE_ENDTRY; - + return 0; } diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp index 4ad43dcb356..f4abe8704a7 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp @@ -2,23 +2,40 @@ #include "ace/OS_NS_unistd.h" #include "Notify_Sequence_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/TimeBaseC.h" #include "common.h" #include "tao/debug.h" +// The NS will try to send in M size chunks, but may send smaller if +// the pacing interval expires. We set the pacing interval large +// enough so that *should* not happen. +// Note : This batch size must be coordinated with the events sent +// by the supplier. For example, when discard policy is set to +// PriorityOrder, then we want to have exactly BATCH_SIZE events +// with the highest priority so that we know we received the right ones. +// We also need to be sure to send a multiple of the batch size. +static const CORBA::Long BATCH_SIZE = 4; + +static const TimeBase::TimeT PACING = 20 * 1000 * 10000; + +// This needs to be big enough to ensure that the supplier has sent +// all the events. +static const int FIRST_SLEEP_SECS = 1; + Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer ( const char* name, CORBA::Short policy, - unsigned int low, - unsigned int high, - CORBA::Boolean& done) - : name_ (name), - discard_policy_ (policy), - low_ (low), - high_ (high), - count_ (0), - done_ (done) + Notify_Test_Client& client, + int sent) + : name_ (name) + , discard_policy_ (policy) + , count_ (0) + , client_ (client) + , sent_(sent) + , first_(0) { + this->client_.consumer_start (this); } @@ -28,7 +45,7 @@ Notify_Sequence_Push_Consumer::_connect ( ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - CosNotifyComm::SequencePushConsumer_var objref = + CosNotifyComm::SequencePushConsumer_var consumer = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -46,17 +63,20 @@ Notify_Sequence_Push_Consumer::_connect ( CosNotification::QoSProperties properties (4); properties.length (4); - properties[0].name = CORBA::string_dup (CosNotification::MaximumBatchSize); - properties[0].value <<= (CORBA::Long)5; - properties[1].name = CORBA::string_dup (CosNotification::PacingInterval); - properties[1].value <<= (TimeBase::TimeT)3; - properties[2].name = CORBA::string_dup (CosNotification::DiscardPolicy); - properties[2].value <<= this->discard_policy_; - properties[3].name = CORBA::string_dup (CosNotification::MaxEventsPerConsumer); - properties[3].value <<= (CORBA::Long)2; + CORBA::ULong idx = 0; + properties[idx].name = CORBA::string_dup (CosNotification::MaximumBatchSize); + properties[idx].value <<= BATCH_SIZE; + properties[++idx].name = CORBA::string_dup (CosNotification::PacingInterval); + properties[idx].value <<= PACING; + properties[++idx].name = CORBA::string_dup (CosNotification::DiscardPolicy); + properties[idx].value <<= this->discard_policy_; + properties[++idx].name = CORBA::string_dup (CosNotification::MaxEventsPerConsumer); + // We set this equal to the batch size so that we conveniently always receive + // one more batch after the first. + properties[idx].value <<= BATCH_SIZE; this->proxy_->set_qos (properties); - this->proxy_->connect_sequence_push_consumer (objref.in () + this->proxy_->connect_sequence_push_consumer (consumer.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -72,53 +92,81 @@ Notify_Sequence_Push_Consumer::push_structured_events ( ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - CORBA::ULong length = events.length (); - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Received %u events:\n", length)); - - for (CORBA::ULong e = 0; e < length; e++) - { - CORBA::ULong hlength = events[e].header.variable_header.length (); - for (CORBA::ULong hi = 0; hi < hlength; hi++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)events[e].header.variable_header[hi].name, - Any_String (events[e].header.variable_header[hi].value))); - } - - CORBA::ULong flength = events[e].filterable_data.length (); - for (CORBA::ULong i = 0; i < flength; i++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)events[e].filterable_data[i].name, - Any_String (events[e].filterable_data[i].value))); - } - } - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "-------------------------\n")); - this->count_++; - - if (this->count_ > this->high_) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too " - "many events received.\n"))); - - ACE_THROW (CORBA::INTERNAL ()); - } - else if (this->count_ == this->low_) + ++count_; + + // The pacing interval is set large enough that it should never come into + // play unless something goes wrong. + if (events.length() != static_cast<size_t>(BATCH_SIZE)) + { + ACE_ERROR((LM_ERROR, + "Error : Unexpected batch size %u/%u\n", events.length(), + BATCH_SIZE)); + this->client_.consumer_done (this); + } + ACE_ASSERT(ACE_OS::strcmp(events[0].header.variable_header[0].name.in(), "Id") == 0); + + CORBA::Long id1 = 0; + CORBA::Long id2 = 0; + events[0].header.variable_header[0].value >>= id1; + events[events.length() - 1].header.variable_header[0].value >>= id2; + + ACE_DEBUG((LM_DEBUG, "{%d-%d}\n", id1, id2)); + + if (count_ == 1) + { + // We sleep long enough after the first batch to ensure that + // the supplier has time to send all the events. This will allow + // the notify service to discard all but one batch. + ACE_OS::sleep(FIRST_SLEEP_SECS); + + first_ = id1; + } + + // Validate the batch is ordered + for (CORBA::Long i = 1; i < BATCH_SIZE; ++i) + { + CORBA::Long id = 0; + events[i].header.variable_header[0].value >>= id; + if (id != id1 + i) { - this->done_ = 1; + ACE_ERROR((LM_ERROR, "Error: Invalid batch. Expected %d, Was %d\n", id1 + i, id)); + this->client_.consumer_done (this); + return; } + } + + CORBA::Long expected = 0; + + if (discard_policy_ == CosNotification::PriorityOrder) + { + expected = sent_ - BATCH_SIZE + 1; // e.g. 37, 38, 39, 40 + } + else if (discard_policy_ == CosNotification::FifoOrder) + { + expected = sent_ - BATCH_SIZE + 1; // e.g. 37, 38, 39, 40 + } else - { - ACE_OS::sleep (1); - } + { + ACE_ASSERT(discard_policy_ == CosNotification::LifoOrder); + expected = BATCH_SIZE + 1; // e.g. 5, 6, 7, 8 + } + + // On some slower platforms, the discard policy may be applied before the first + // batch is sent. In that case we may only get a single batch. + // On other platforms we may get two batches, but the first batch + // may or may not conform to the discard policy. + + if (count_ == 1 && id1 != expected && discard_policy_ != CosNotification::LifoOrder) + { + // We expect to get another batch with the correct one. + } + else + { + this->client_.consumer_done (this); + } + + if (count_ > 2) + { + ACE_ERROR((LM_ERROR, "Error : Too many batches received.\n")); + } } diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h index e4139dd8f51..e49cb83cab3 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h @@ -20,15 +20,15 @@ #include "Notify_SequencePushConsumer.h" +class Notify_Test_Client; class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer { public: Notify_Sequence_Push_Consumer (const char* name, CORBA::Short policy, - unsigned int low, - unsigned int high, - CORBA::Boolean& done); + Notify_Test_Client& client, + int sent); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL) @@ -41,10 +41,10 @@ protected: ACE_CString name_; CORBA::Short discard_policy_; - unsigned int low_; - unsigned int high_; unsigned int count_; - CORBA::Boolean& done_; + Notify_Test_Client& client_; + int sent_; + int first_; }; #endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp index ba2fb39df56..cd14bb71ac9 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp @@ -2,29 +2,31 @@ #include "ace/OS_NS_unistd.h" #include "Notify_Structured_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "common.h" #include "tao/debug.h" Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer ( - const char* name, - CORBA::Short policy, - CORBA::Long expected, - CORBA::Long max_events_per_consumer, - CORBA::Boolean& done) - : name_ (name), - discard_policy_ (policy), - expected_ (expected), - max_events_per_consumer_ (max_events_per_consumer), - count_ (0), - done_ (done) + const char* name, + CORBA::Short policy, + CORBA::Long max_events_per_consumer, + Notify_Test_Client& client) + : name_ (name), + discard_policy_ (policy), + max_events_per_consumer_ (max_events_per_consumer), + count_ (0), + first_ (0), + client_ (client), + sent_(40) { + this->client_.consumer_start (this); } void Notify_Structured_Push_Consumer::_connect ( - CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin - ACE_ENV_ARG_DECL) + CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { CosNotifyComm::StructuredPushConsumer_var objref = @@ -33,14 +35,14 @@ Notify_Structured_Push_Consumer::_connect ( CosNotifyChannelAdmin::ProxySupplier_var proxysupplier = consumer_admin->obtain_notification_push_supplier ( - CosNotifyChannelAdmin::STRUCTURED_EVENT, - proxy_id_ - ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::STRUCTURED_EVENT, + proxy_id_ + ACE_ENV_ARG_PARAMETER); ACE_CHECK; this->proxy_ = CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow ( - proxysupplier.in () ACE_ENV_ARG_PARAMETER); + proxysupplier.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; CosNotification::QoSProperties properties (2); @@ -52,7 +54,7 @@ Notify_Structured_Push_Consumer::_connect ( this->proxy_->set_qos (properties); this->proxy_->connect_structured_push_consumer (objref.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_CHECK; // give ownership to POA @@ -63,49 +65,80 @@ Notify_Structured_Push_Consumer::_connect ( void Notify_Structured_Push_Consumer::push_structured_event ( - const CosNotification::StructuredEvent& event - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) + const CosNotification::StructuredEvent& event + ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Received event:\n")); - - CORBA::ULong hlength = event.header.variable_header.length (); - for (CORBA::ULong hi = 0; hi < hlength; hi++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)event.header.variable_header[hi].name, - Any_String (event.header.variable_header[hi].value))); - } - CORBA::ULong flength = event.filterable_data.length (); - for (CORBA::ULong i = 0; i < flength; i++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)event.filterable_data[i].name, - Any_String (event.filterable_data[i].value))); - } - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "-------------------------\n")); + ACE_DEBUG((LM_DEBUG, "-")); + this->count_++; - if (this->count_ > this->expected_) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Structured Consumer (%P|%t): ERROR: too " - "many events received (%d).\n"), this->count_)); - } - else if (this->count_ == this->max_events_per_consumer_) - { - this->done_ = 1; - } + if (this->count_ > max_events_per_consumer_ + 1) + { + this->client_.consumer_done (this); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Structured Consumer (%P|%t): ERROR: too " + "many events received (%d).\n"), this->count_)); + } + + ACE_ASSERT(ACE_OS::strcmp(event.header.variable_header[0].name.in(), "Id") == 0); + CORBA::Any v = event.header.variable_header[0].value; + CORBA::Long id = 0; + v >>= id; + + // Force the notify service to queue events + if (this->count_ == 1) + { + ACE_OS::sleep(2); + first_ = id; + } + + // @@ The priority header isn't making it through the notify service. + //n = event.header.variable_header[1].name; + //if (ACE_OS::strcmp(n.in(), CosNotification::Priority) != 0) + //{ + // ACE_ERROR((LM_ERROR, "Error: Couldn't find Priority header in event.\n")); + // break; + //} + //v = event.header.variable_header[1].value; + //CORBA::Long priority = 0; + //v >>= priority; + CORBA::Long expected = 0; + if (discard_policy_ == CosNotification::PriorityOrder) + { + expected = sent_ - max_events_per_consumer_ + count_; + if (first_ != sent_ - max_events_per_consumer_ + 1) + --expected; + } + else if (discard_policy_ == CosNotification::FifoOrder) + { + expected = sent_ - max_events_per_consumer_ + count_; + if (first_ != sent_ - max_events_per_consumer_ + 1) + --expected; + } + else if (discard_policy_ == CosNotification::LifoOrder) + { + expected = count_; + } else - { - ACE_OS::sleep (1); - } + { + ACE_ERROR((LM_ERROR, "Error: Unexpected discard policy.\n")); + return; + } + + if (id != expected && count_ != 1) + { + ACE_DEBUG((LM_DEBUG, "Error: Expected %d, ", expected)); + this->client_.consumer_done (this); + } + + ACE_DEBUG((LM_DEBUG, "received %d\n", expected, id)); + + // We should receive mepc + 1, because the first event will be in-transit + // before our sleep causes the notify to queue events. + // However, on some platforms, we'll only receive mepc, because filtering + // happened before the first event. + if (this->count_ >= this->max_events_per_consumer_) + { + this->client_.consumer_done (this); + } } diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h index 4b5ec086ce2..6eac74346e4 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; class Notify_Structured_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer { @@ -27,9 +28,8 @@ public: Notify_Structured_Push_Consumer ( const char* name, CORBA::Short policy, - CORBA::Long expected, CORBA::Long max_events_per_consumer, - CORBA::Boolean& done); + Notify_Test_Client& client); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL) @@ -42,10 +42,11 @@ protected: ACE_CString name_; CORBA::Short discard_policy_; - CORBA::Long expected_; CORBA::Long max_events_per_consumer_; CORBA::Long count_; - CORBA::Boolean& done_; + CORBA::Long first_; + Notify_Test_Client& client_; + CORBA::Long sent_; }; #endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp index 46516422f0f..514506a20f9 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp @@ -19,9 +19,9 @@ // ****************************************************************** static const char* ior = "file://supplier.ior"; -static CORBA::Short discard_policy = CosNotification::FifoOrder; -static unsigned int low = 2; -static unsigned int high = 4; +static CORBA::Short discard_policy = CosNotification::AnyOrder; +static int sent = 40; +static Notify_Sequence_Push_Consumer* consumer_1 = 0; // ****************************************************************** // Subroutine Section @@ -42,65 +42,55 @@ Consumer_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'k': - ior = get_opts.optarg; - break; - - case 'l': - low = ACE_OS::atoi (get_opts.optarg); - break; - - case 'h': - high = ACE_OS::atoi (get_opts.optarg); - break; + { + case 'k': + ior = get_opts.optarg; + break; - case 'd': + case 'd': { const char* discard = get_opts.optarg; if (ACE_OS::strcmp (discard, "fifo") == 0) - { - discard_policy = CosNotification::FifoOrder; - } + { + discard_policy = CosNotification::FifoOrder; + } else if (ACE_OS::strcmp (discard, "priority") == 0) - { - discard_policy = CosNotification::PriorityOrder; - } + { + discard_policy = CosNotification::PriorityOrder; + } else if (ACE_OS::strcmp (discard, "lifo") == 0) - { - discard_policy = CosNotification::LifoOrder; - } + { + discard_policy = CosNotification::LifoOrder; + } else if (ACE_OS::strcmp (discard, "deadline") == 0) - { - discard_policy = CosNotification::DeadlineOrder; + { + discard_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif - } + } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unknown discard policy: %s\n", - discard_policy), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unknown discard policy: %s\n", + discard_policy), + -1); + } break; } - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-l <low expected events> " - "-h <high expected events> " - "-d <fifo|priority|lifo|deadline> " - "\n", - argv [0]), - -1); - } + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-d <any|fifo|lifo|priority|deadline> " + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; } @@ -113,8 +103,8 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::ConsumerAdmin_var admin = ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -128,14 +118,9 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, ACE_ENV_ARG_DECL) { // startup the consumer - Notify_Sequence_Push_Consumer* consumer_1; ACE_NEW_THROW_EX (consumer_1, - Notify_Sequence_Push_Consumer ("consumer1", - discard_policy, - low, - high, - client->done ()), - CORBA::NO_MEMORY ()); + Notify_Sequence_Push_Consumer ("consumer1", discard_policy, *client, sent), + CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -152,73 +137,55 @@ 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::ORB_ptr orb = client.orb (); - CORBA::Object_var object = - 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; - - unsigned int try_count = 0; - unsigned int try_max = (high - low) * 2; - while (true) - { - // See if we can get any more events - if (client.done ()) - { - ACE_OS::sleep (1); - try_count++; - if (try_count >= try_max) - break; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } - } + { + Consumer_Client client; + + 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", 1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::ORB_ptr orb = client.orb (); + CORBA::Object_var object = + 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; + ACE_ASSERT(! CORBA::is_nil (sig.in ())); + + CosNotifyChannelAdmin::ConsumerAdmin_var admin = + create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + ACE_ASSERT(!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; + + ACE_DEBUG((LM_DEBUG, "Consumer waiting for events...\n")); + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); + consumer_1->disconnect(); + + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp index 427fc996aea..14956b5ccc5 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -22,32 +23,66 @@ // ****************************************************************** static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; + static CORBA::Boolean use_deadline_ordering = 0; -static int max_events = 2; // 2 sets of 10 -static int batch_size = 10; + +// Must be a multiple of the consumers batch size. +static int num_events = 40; + +// Must match the consumers batch size so that we send +// the correct number of each type of event per batch, which +// allows us to validate the discard policy. +static const CORBA::Long BATCH_SIZE = 4; + static const char* ior_output_file = "supplier.ior"; // ****************************************************************** // Subroutine Section // ****************************************************************** +// The supplier will not start sending events until the +// go() operation is invoked. class sig_i : public POA_sig { public: + sig_i(CORBA::ORB_ptr orb) + : orb_(orb) + , started_(false) + { + } + void go (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -64,34 +99,34 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'd': - use_deadline_ordering = 1; + { + case 'd': + use_deadline_ordering = 1; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); -#else - break; + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif /* ACE_HAS_TIMED_MESSAGE_BLOCKS */ - case 'e': - max_events = 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> -d" - "\n", - argv [0]), - -1); - } + break; + case 'e': + num_events = ACE_OS::atoi (get_opts.optarg); + num_events -= num_events % BATCH_SIZE; // round down + break; + + case 'o': + ior_output_file = get_opts.optarg; + break; + + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile> -e <# of events> -d" + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; @@ -105,8 +140,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -115,94 +150,37 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvents (void) +SendBatch (int batch_id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::EventBatch events; - - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; - - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; - - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::ULong)count; - - events.length (batch_size); - events[0] = event; - - CosNotification::StructuredEvent revents[9]; - for (int z = 0; z < 9; z++) - { - revents[z].header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - revents[z].header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - revents[z].header.fixed_header.event_name = CORBA::string_dup ("test revents[z]"); - - revents[z].header.variable_header.length (1); - revents[z].header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - revents[z].header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - - revents[z].filterable_data.length (3); - revents[z].filterable_data[0].name = CORBA::string_dup ("objectId"); - revents[z].filterable_data[0].value <<= (CORBA::Long)z; - - revents[z].filterable_data[1].name = CORBA::string_dup ("type"); - revents[z].filterable_data[1].value <<= types[2 - (count % 3)]; - - revents[z].filterable_data[2].name = CORBA::string_dup ("enum"); - revents[z].filterable_data[2].value <<= (CORBA::ULong)count; - events[z + 1] = revents[z]; - } - count++; - - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + CosNotification::EventBatch events; + events.length(BATCH_SIZE); + for (CORBA::Long i = 0; i < BATCH_SIZE; ++i) + { + int id = batch_id * BATCH_SIZE + i + 1; + + 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 ("c"); + + event.header.variable_header.length (3); + event.header.variable_header[0].name = + CORBA::string_dup ("Id"); + event.header.variable_header[0].value <<= (CORBA::Long)id; + + event.header.variable_header[1].name = + CORBA::string_dup (CosNotification::Priority); + event.header.variable_header[1].value <<= (CORBA::Short)(id); + + event.header.variable_header[2].name = + CORBA::string_dup (CosNotification::Timeout); + event.header.variable_header[2].value <<= (TimeBase::TimeT) (id * 10000); + + events[i] = event; } + supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); + ACE_CHECK; } static void @@ -212,8 +190,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // start up the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_SequencePushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_SequencePushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -230,74 +208,78 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV + { + Supplier_Client client; + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (use_deadline_ordering) + { + CosNotification::QoSProperties qos (1); + qos.length (1); + qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); + qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder; + ec->set_qos (qos); + } + + sig_impl.reset( new sig_i( client.orb() ) ); + sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::String_var ior = + client.orb()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // If the ior_output_file exists, output the ior to it + if (ior_output_file != 0) + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + ACE_ASSERT(output_file != 0); + 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.root_poa () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) - { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (use_deadline_ordering) - { - CosNotification::QoSProperties qos (1); - qos.length (1); - qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); - qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder; - ec->set_qos (qos); - } - - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvents (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events / BATCH_SIZE; ++i) + { + ACE_DEBUG((LM_DEBUG, "+")); + SendBatch (i ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_output_file); + + supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp index 18563673738..ed96bf96881 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp @@ -1,31 +1,20 @@ // $Id$ -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" - -#include "orbsvcs/CosNotifyCommC.h" -#include "orbsvcs/CosNamingC.h" #include "Notify_Structured_Push_Consumer.h" #include "goC.h" - #include "Notify_Test_Client.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "orbsvcs/CosNotifyCommC.h" +#include "orbsvcs/CosNamingC.h" + +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_strings.h" static const char* ior = "file://supplier.ior"; static CORBA::Short discard_policy = CosNotification::FifoOrder; -static CORBA::Long expected = 13; -CORBA::Long max_events_per_consumer = 10; - -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +CORBA::Long max_events_per_consumer = 4; +static Notify_Structured_Push_Consumer* consumer_1; class Consumer_Client : public Notify_Test_Client { @@ -47,26 +36,22 @@ Consumer_Client::parse_args (int argc, char *argv[]) ior = get_opts.optarg; break; - case 'e': - expected = ACE_OS::atoi (get_opts.optarg); - break; - case 'd': { const char* discard = get_opts.optarg; - if (ACE_OS::strcmp (discard, "fifo") == 0) + if (ACE_OS::strcasecmp (discard, "fifo") == 0) { discard_policy = CosNotification::FifoOrder; } - else if (ACE_OS::strcmp (discard, "priority") == 0) + else if (ACE_OS::strcasecmp (discard, "priority") == 0) { discard_policy = CosNotification::PriorityOrder; } - else if (ACE_OS::strcmp (discard, "lifo") == 0) + else if (ACE_OS::strcasecmp (discard, "lifo") == 0) { discard_policy = CosNotification::LifoOrder; } - else if (ACE_OS::strcmp (discard, "deadline") == 0) + else if (ACE_OS::strcasecmp (discard, "deadline") == 0) { discard_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) @@ -90,7 +75,6 @@ Consumer_Client::parse_args (int argc, char *argv[]) ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-k <ior> " - "-e <expected events> " "-d <fifo|priority|lifo|deadline> " "\n", argv [0]), @@ -125,14 +109,12 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, ACE_DEBUG ((LM_DEBUG, "Max Events per Consumer = %d...\n", max_events_per_consumer)); // startup the consumer - Notify_Structured_Push_Consumer* consumer_1; ACE_NEW_THROW_EX (consumer_1, Notify_Structured_Push_Consumer ( "consumer1", discard_policy, - expected, max_events_per_consumer, - client->done ()), + *client), CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -185,32 +167,26 @@ int main (int argc, char* argv[]) { 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; - CORBA::Boolean wait_more = 1; - while (!client.done () || wait_more) - { - // See if we can get any more events - if (client.done () && wait_more) - { - ACE_OS::sleep (5); - wait_more = 0; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } + ACE_DEBUG((LM_DEBUG, "Consumer waiting for events...\n")); + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); + consumer_1->disconnect(); + + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } } } ACE_CATCH (CORBA::Exception, e) { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); + ACE_PRINT_EXCEPTION (e, "Error: "); status = 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp index 47302392e00..66fb7ff2967 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -22,31 +23,57 @@ // ****************************************************************** static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static CORBA::Boolean use_deadline_ordering = 0; -static int max_events = 40; +static int num_events = 40; static const char* ior_output_file = "supplier.ior"; // ****************************************************************** // Subroutine Section // ****************************************************************** +// The supplier will not start sending events until the +// go() operation is invoked. class sig_i : public POA_sig { public: + sig_i(CORBA::ORB_ptr orb) + : orb_(orb) + , started_(false) + { + } + void go (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -63,34 +90,34 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'd': - use_deadline_ordering = 1; + { + case 'd': + use_deadline_ordering = 1; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #else - break; + break; #endif /* ACE_HAS_TIMED_MESSAGE_BLOCKS */ - case 'e': - max_events = 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> -d" - "\n", - argv [0]), - -1); - } + case 'e': + num_events = 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> -d" + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; @@ -104,8 +131,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -114,61 +141,28 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvent (void) +SendEvent (int id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::StructuredEvent event; - - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; - - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; - - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::ULong)count; - count++; - - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; - } + 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 ("c"); + + event.header.variable_header.length (3); + + event.header.variable_header[0].name = CORBA::string_dup ("Id"); + event.header.variable_header[0].value <<= (CORBA::Long)id; + + event.header.variable_header[1].name = + CORBA::string_dup (CosNotification::Priority); + event.header.variable_header[1].value <<= (CORBA::Short) (id); + + event.header.variable_header[2].name = + CORBA::string_dup (CosNotification::Timeout); + event.header.variable_header[2].value <<= (TimeBase::TimeT) (id * 10000); + + supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); } static void @@ -176,10 +170,9 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, PortableServer::POA_ptr poa ACE_ENV_ARG_DECL) { - // startup the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_StructuredPushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -196,77 +189,79 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV + { + Supplier_Client client; + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (use_deadline_ordering) + { + CosNotification::QoSProperties qos (1); + qos.length (1); + qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); + qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder; + ec->set_qos (qos); + } + + sig_impl.reset( new sig_i( client.orb() ) ); + sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + // If the ior_output_file exists, output the ior to it + if (ior_output_file != 0) + { + CORBA::String_var ior = + client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + ACE_ASSERT (output_file != 0); + 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.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events; ++i) + { + ACE_DEBUG((LM_DEBUG, "+")); + SendEvent (i + 1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_output_file); + + supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) - { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (use_deadline_ordering) - { - CosNotification::QoSProperties qos (1); - qos.length (1); - qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); - qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder; - ec->set_qos (qos); - } - - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - 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_DEBUG ((LM_DEBUG, "Supplier sending %d events...\n", max_events)); - - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvent (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Discarding/common.cpp b/TAO/orbsvcs/tests/Notify/Discarding/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/common.cpp +++ b/TAO/orbsvcs/tests/Notify/Discarding/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/Discarding/go.idl b/TAO/orbsvcs/tests/Notify/Discarding/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/go.idl +++ b/TAO/orbsvcs/tests/Notify/Discarding/go.idl @@ -4,4 +4,7 @@ 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/Discarding/notify.conf b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf index 9e16b94ddc1..372ec0ad29c 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf @@ -1,4 +1,4 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -MTListenerEval -ListenerThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -ListenerThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml index 54379f895bd..33ecd35e7db 100644 --- a/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/Discarding/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl b/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl index dfe8731838e..5a361e4a495 100755 --- a/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl @@ -9,6 +9,7 @@ use lib "../../../../../bin"; use PerlACE::Run_Test; $ior = PerlACE::LocalFile ("supplier.ior"); +$namingior = PerlACE::LocalFile ("naming.ior"); $notifyior = PerlACE::LocalFile ("notify.ior"); $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); $status = 0; @@ -29,7 +30,8 @@ unlink $notifyior; $port = PerlACE::uniqueid () + 10001; $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); + "-ORBEndpoint iiop://localhost:$port " . + "-o $namingior"); $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . @@ -45,18 +47,23 @@ $SES = new PerlACE::Process ("Sequence_Supplier", "localhost:$port/NameService"); $SEC = new PerlACE::Process ("Sequence_Consumer"); +unlink $ior; +unlink $notifyior; +unlink $namingior; + $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; -if ($NS->Spawn () == -1) { - exit 1; -} +$NS->Spawn (); -if ($TS->Spawn () == -1) { - $NS->Kill (); - exit 1; +if (PerlACE::waitforfile_timed ($namingior, 5) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); + exit 1; } -if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { +$TS->Spawn (); + +if (PerlACE::waitforfile_timed ($notifyior, 5) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; $TS->Kill (); $NS->Kill (); @@ -71,14 +78,14 @@ if ($deadline) { @server_opts = ("", "", "", " -d"); for($i = 0; $i <= $#policies; $i++) { $discard_policy = $policies[$i]; - print "************* Running Structured Consumer with the " . - "$discard_policy policy ***********\n"; + print "****** Structured Supplier -> Structured Consumer with the " . + "$discard_policy policy ******\n"; unlink $ior; $STS->Arguments($STS->Arguments() . $server_opts[$i]); $STS->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + if (PerlACE::waitforfile_timed ($ior, 5) == -1) { print STDERR "ERROR: waiting for the supplier to start\n"; $STS->Kill (); $TS->Kill (); @@ -88,11 +95,13 @@ for($i = 0; $i <= $#policies; $i++) { } $STC->Arguments($client_args . " -d $discard_policy"); - $client = $STC->SpawnWaitKill (200); - - $STS->Kill (); + $client = $STC->SpawnWaitKill (20); if ($client != 0) { - print STDERR "ERROR: Structured_Consumer did not run properly\n"; + $status = 1; + last; + } + $server = $STS->WaitKill (5); + if ($server != 0) { $status = 1; last; } @@ -101,14 +110,47 @@ for($i = 0; $i <= $#policies; $i++) { if ($status == 0) { for($i = 0; $i <= $#policies; $i++) { $discard_policy = $policies[$i]; - print "************** Running Sequence Consumer with the " . - "$discard_policy policy ************\n"; + print "***** Structured Supplier -> Sequence Consumer with the " . + "$discard_policy policy *****\n"; + + unlink $ior; + $STS->Arguments($STS->Arguments() . $server_opts[$i]); + $STS->Spawn (); + + if (PerlACE::waitforfile_timed ($ior, 5) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + $status = 1; + last; + } + + $SEC->Arguments($client_args . " -d $discard_policy"); + $client = $SEC->SpawnWaitKill (20); + if ($client != 0) { + $status = 1; + last; + } + $server = $STS->WaitKill (5); + if ($server != 0) { + $status = 1; + last; + } + } +} + +if ($status == 0) { + for($i = 0; $i <= $#policies; $i++) { + $discard_policy = $policies[$i]; + print "**** Sequence Supplier -> Sequence Consumer with the " . + "$discard_policy policy ****\n"; unlink $ior; $SES->Arguments($SES->Arguments() . $server_opts[$i]); $SES->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + if (PerlACE::waitforfile_timed ($ior, 5) == -1) { print STDERR "ERROR: waiting for the supplier to start\n"; $SES->Kill (); $TS->Kill (); @@ -118,11 +160,46 @@ if ($status == 0) { } $SEC->Arguments($client_args . " -d $discard_policy"); - $client = $SEC->SpawnWaitKill (200); + $client = $SEC->SpawnWaitKill (20); + if ($client != 0) { + $status = 1; + last; + } + $server = $SES->WaitKill (5); + if ($server != 0) { + $status = 1; + last; + } + } +} + +if ($status == 0) { + for($i = 0; $i <= $#policies; $i++) { + $discard_policy = $policies[$i]; + print "**** Sequence Supplier -> Structured Consumer with the " . + "$discard_policy policy ****\n"; + + unlink $ior; + $SES->Arguments($SES->Arguments() . $server_opts[$i]); + $SES->Spawn (); + + if (PerlACE::waitforfile_timed ($ior, 5) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + $status = 1; + last; + } - $SES->Kill (); + $STC->Arguments($client_args . " -d $discard_policy"); + $client = $STC->SpawnWaitKill (20); if ($client != 0) { - print STDERR "ERROR: Sequence_Consumer did not run properly\n"; + $status = 1; + last; + } + $server = $SES->WaitKill (5); + if ($server != 0) { $status = 1; last; } @@ -134,6 +211,7 @@ $NS->Kill (); unlink $ior; unlink $notifyior; +unlink $namingior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/Driver/main.cpp b/TAO/orbsvcs/tests/Notify/Driver/main.cpp index d50b5365653..dda3410e3f6 100644 --- a/TAO/orbsvcs/tests/Notify/Driver/main.cpp +++ b/TAO/orbsvcs/tests/Notify/Driver/main.cpp @@ -20,8 +20,7 @@ ACE_TMAIN (int argc, char *argv[]) } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - ACE_LIB_TEXT("Failed to run the Notify Testing Driver\n")); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_LIB_TEXT("Error: \n")); return 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf index 6549f739c3a..98c0f0ed303 100644 --- a/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf @@ -1,59 +1,59 @@ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" - +# ##--------- Consumer 1 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c1 -Admin ca1 -POA poa_1 -Proxy c1_proxy -MaxCount 5 -Check_Priority" static Command_Builder "PeriodicConsumer -Subscription c1 +Path1" - +# static Command_Builder "Filter -CreateFilter f_c1 ff" static Command_Builder "Filter -Add_Constraint f_c1 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f_c1 'LaneId = 1'" - +# #static Command_Builder "Filter -Add_Filter f_c1 c1_proxy" - +# ##--------- Consumer 2 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c2 -Admin ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5 -Check_Priority" static Command_Builder "PeriodicConsumer -Subscription c2 +Path2" - +# static Command_Builder "Filter -CreateFilter f_c2 ff" static Command_Builder "Filter -Add_Constraint f_c2 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f_c2 'LaneId = 2'" - +# #static Command_Builder "Filter -Add_Filter f_c2 c2_proxy" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c3 -Admin ca1 -POA poa_1 -Proxy c3_proxy -MaxCount 5 -Check_Priority" - +# static Command_Builder "PeriodicConsumer -Subscription c3 +Path3" - +# static Command_Builder "Filter -CreateFilter f_c3 ff" static Command_Builder "Filter -Add_Constraint f_c3 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f_c3 'LaneId = 3'" - +# static Command_Builder "Filter -Add_Filter f_c3 c3_proxy" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/Lanes/notify.conf b/TAO/orbsvcs/tests/Notify/Lanes/notify.conf index b4c291b741a..85d6b72357e 100644 --- a/TAO/orbsvcs/tests/Notify/Lanes/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Lanes/notify.conf @@ -1,8 +1,8 @@ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_FilterFactory Service_Object* TAO_RT_NotifyTests_Filter:_make_TAO_Notify_Tests_RT_Test_FilterFactory () "" dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () "" diff --git a/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl index f484f45ddbe..7d47e3d10ad 100755 --- a/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl @@ -37,9 +37,7 @@ $Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$s #$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1"; unlink $naming_ior; -if ($Naming->Spawn () == -1) { - exit 1; -} +$Naming->Spawn (); if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) { print STDERR "ERROR: waiting for the naming service to start\n"; diff --git a/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf b/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf index 1d663d5a391..78ecd334aa8 100644 --- a/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf @@ -9,55 +9,55 @@ ## ## Supplier s3 is connected to sa2 ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" static Command_Builder "Filter -CreateFactory ff ec1" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s1 -Admin sa1 -Proxy s1_proxy -EventType Path1 -Priority 1 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " - +# static Command_Builder "Filter -CreateFilter f1 ff" static Command_Builder "Filter -Add_Constraint f1 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f1 'LaneId = 1'" #static Command_Builder "Filter -Add_Filter f1 s1_proxy" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s2 -Admin sa1 -Proxy s2_proxy -EventType Path2 -Priority 2 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " - +# static Command_Builder "Filter -CreateFilter f2 ff" static Command_Builder "Filter -Add_Constraint f2 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f2 'LaneId = 2'" #static Command_Builder "Filter -Add_Filter f2 s2_proxy" - +# ### --- Create Supplier s3 connected to sa2 ---- static Command_Builder "PeriodicSupplier -Create s3 -Admin sa1 -Proxy s3_proxy -EventType Path3 -Priority 3 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " static Command_Builder "Filter -CreateFilter f3 ff" static Command_Builder "Filter -Add_Constraint f3 'PoolId = 1'" static Command_Builder "Filter -Add_Constraint f3 'LaneId = 3'" #static Command_Builder "Filter -Add_Filter f3 s3_proxy" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" 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 index 2e19889b3a7..ce7921b2522 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp @@ -1,28 +1,39 @@ // $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, - CORBA::Boolean& done) - : name_ (name), - expected_ (expected), - count_ (0), - done_ (done) + 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*/) + const CosNotification::StructuredEvent& /*event*/ + ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (++this->count_ == this->expected_) - { - this->done_ = 1; - } + 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 index f3f2205226c..bc4f2933b90 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; class Notify_Structured_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer { @@ -27,7 +28,7 @@ public: Notify_Structured_Push_Consumer ( const char* name, unsigned int expected, - CORBA::Boolean& done); + Notify_Test_Client& client); protected: void push_structured_event (const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL) @@ -36,7 +37,7 @@ protected: ACE_CString name_; unsigned int expected_; unsigned int count_; - CORBA::Boolean& done_; + Notify_Test_Client& client_; }; #endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp index 1486816ff5e..36f14d9c960 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp @@ -18,13 +18,10 @@ // Data Section // ****************************************************************** +static Notify_Structured_Push_Consumer* consumers[1024] = {0}; static const char* ior = "file://supplier.ior"; -static CORBA::Boolean dummy = 0; -static CORBA::Boolean filter = 0; -static unsigned int consumers = 2; -static unsigned int expected = 6; - -#define GRAMMAR "EXTENDED_TCL" +static unsigned int consumer_count = 1; +static unsigned int expected = 1; // ****************************************************************** // Subroutine Section @@ -45,34 +42,29 @@ Consumer_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'k': - ior = get_opts.optarg; - break; - - case 'c': - consumers = ACE_OS::atoi (get_opts.optarg); - break; - - case 'e': - expected = ACE_OS::atoi (get_opts.optarg); - break; - - case 'f': - filter = 1; - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-c <# of consumers> " - "-e <expected events> " - "-f " - "\n", - argv [0]), - -1); - } + { + 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; } @@ -85,38 +77,11 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::ConsumerAdmin_var admin = ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); - if (filter) - { - // Filter Section - CosNotifyFilter::FilterFactory_var ffact = - ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // One Filter - CosNotifyFilter::Filter_var filter = - ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CosNotifyFilter::ConstraintExpSeq constraint_list (1); - constraint_list.length (1); - - constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = - CORBA::string_dup ("count < 6"); - - filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - // End One Filter - } - return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ()); } @@ -126,26 +91,34 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, Notify_Test_Client* client ACE_ENV_ARG_DECL) { - for (unsigned int i = 0; i < consumers; i++) - { - // startup the consumers - char name[64] = ""; - ACE_OS::sprintf (name, "consumer%u", i); - Notify_Structured_Push_Consumer* consumer; - ACE_NEW_THROW_EX (consumer, - Notify_Structured_Push_Consumer ( - name, - expected, - (i + 1 == consumers ? - client->done () : dummy)), - CORBA::NO_MEMORY ()); - - consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - consumer->connect (admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } + 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_PARAMETER) +{ + for (unsigned int i = 0; i < consumer_count; i++) + { + consumers[ i ]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } } // ****************************************************************** @@ -156,74 +129,63 @@ 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) { - Consumer_Client client; + 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); + } - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::ConsumerAdmin_var admin = + create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) - { - // If we are filtering, we will get half as many as originally - // expected - if (filter) - { - expected /= 2; - } - - 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; - - ACE_Time_Value now = ACE_OS::gettimeofday (); - client.ORB_run (); - ACE_Time_Value then = ACE_OS::gettimeofday (); - - static const unsigned int per = 100; - ACE_Time_Value difference = then - now; - double denominator = per / (double)expected; - difference *= denominator; - - ACE_DEBUG ((LM_DEBUG, - "Average of %ds %dus for %u events\n", - difference.sec (), difference.usec (), per)); - } - } + 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, - "Consumer exception: "); - status = 1; - } + { + 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 index f50a5bc3846..c9faead2544 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -23,33 +24,53 @@ static const unsigned int supplier_max = 32; static TAO_Notify_Tests_StructuredPushSupplier* suppliers[supplier_max] = {0}; static unsigned int supplier_count = 1; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; -static CORBA::Boolean filter = 0; -static int max_events = 12; +static int event_count = 1; static const char* ior_output_file = "supplier.ior"; -#define GRAMMAR "EXTENDED_TCL" - // ****************************************************************** // 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 { @@ -66,35 +87,31 @@ Consumer_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) + { + case 'c': + supplier_count = ACE_OS::atoi (get_opts.optarg); + if (supplier_count > supplier_max) { - case 'c': - supplier_count = ACE_OS::atoi (get_opts.optarg); - if (supplier_count > supplier_max) - { - supplier_count = supplier_max; - } - break; - - case 'e': - max_events = ACE_OS::atoi (get_opts.optarg); - break; - - case 'f': - filter = 1; - break; - - case 'o': - ior_output_file = get_opts.optarg; - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile> -e <# of events> -f" - "\n", - argv [0]), - -1); + 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; @@ -108,105 +125,68 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); - // Filter Section - if (filter) - { - CosNotifyFilter::FilterFactory_var ffact = - ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CosNotifyFilter::Filter_var filter = - ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CosNotifyFilter::ConstraintExpSeq constraint_list (1); - constraint_list.length (1); - - constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("type == 'odd'"); - - filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ()); } static void -SendEvent (void) +SendEvent (int id ACE_ENV_ARG_DECL) { - if (start) + 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++) { - static int count = 0; - static const char* types[] = { "odd", "even" }; - CosNotification::StructuredEvent event; - - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("type"); - event.filterable_data[0].value <<= ((count & 1) == 1 ? - types[0] : types[1]); - event.filterable_data[1].name = CORBA::string_dup ("count"); - event.filterable_data[1].value <<= (CORBA::ULong)count; - - count++; - - if (count >= max_events) - { - done = 1; - } - - 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, - "Supplier exception: "); - } - ACE_ENDTRY; + 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, - PortableServer::POA_ptr poa + Notify_Test_Client* client ACE_ENV_ARG_DECL) { for (unsigned int i = 0; i < supplier_count; i++) - { - // startup the supplier - ACE_NEW_THROW_EX (suppliers[i], - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); - suppliers[i]->init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - suppliers[i]->connect (admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } + { + 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 @@ -214,67 +194,76 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { - int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV - { - Consumer_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + { + 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 (status == 0) - { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvent (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + 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); } - ACE_CATCH (CORBA::Exception, e) + + 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_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; + 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 status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl @@ -4,4 +4,7 @@ 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 index 0492d996d89..007cca48967 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf @@ -1,4 +1,4 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 2" +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 index 3fa484a61ad..725528eac0c 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml @@ -2,5 +2,5 @@ <!-- 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="-MTDispatching -DispatchingThreads 2"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 2"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf deleted file mode 100644 index 2259f4b6b9e..00000000000 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf +++ /dev/null @@ -1,2 +0,0 @@ -## $Id$ -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1 -MTListenerEval -ListenerThreads 2" diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf.xml deleted file mode 100644 index ef6df5d0502..00000000000 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_mtlistener.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1 -MTListenerEval -ListenerThreads 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 index 47f4e3e4e44..d8608059bad 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf @@ -1,2 +1,2 @@ ## $Id$ -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1 -MTSourceEval -SourceThreads 2" +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 index 7cc1021457d..fe5182ff88a 100644 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml @@ -2,5 +2,5 @@ <!-- 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="-MTDispatching -DispatchingThreads 1 -MTSourceEval -SourceThreads 2"/> + <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/run_test.pl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl index 45597cce95a..9df3b569d16 100755 --- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl @@ -16,39 +16,33 @@ $naming_ior = PerlACE::LocalFile ("naming.ior"); $supplier_ior = PerlACE::LocalFile ("supplier.ior"); $status = 0; -@tests = +@tests = ( { description => "no threads", - config => "notify_nothreads$PerlACE::svcconf_ext", - supplier => " -c 10 -e 10 -f", - consumer => " -c 2 -f -e 48", + 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 => " ", - consumer => " ", - }, - { - description => "multi-threaded proxy consumers", - config => "notify_mtsource$PerlACE::svcconf_ext", - supplier => " ", - consumer => " -c 2 -f", + config => "notify_mtdispatching$PerlACE::svcconf_ext", + supplier => " -c 10 -e 10 ", + consumer => " -c 2 -e 100 ", }, { - description => "multi-threaded proxy suppliers", - config => "notify_mtlistener$PerlACE::svcconf_ext", - supplier => " -c 10 -f", - consumer => " -c 1 -e 60", + description => "multi-threaded supplier-side", + config => "notify_mtsource$PerlACE::svcconf_ext", + supplier => " -c 10 -e 10 ", + consumer => " -c 2 -e 100 ", }, ); -@tests2 = +@tests2 = ( { description => "multi-threaded dispatching", - config => "notify_mtdispatching$PerlACE::svcconf_ext", + config => "notify_mtdispatching$PerlACE::svcconf_ext", supplier => " ", consumer => " ", } @@ -78,9 +72,6 @@ if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) { for $test (@tests) { - $Supplier->Arguments ("-ORBInitRef NameService=file://$naming_ior "); - $Consumer->Arguments ("-ORBInitRef NameService=file://$naming_ior "); - print STDERR "\nTesting $test->{description} ....\n\n"; unlink $notify_ior; @@ -88,20 +79,20 @@ for $test (@tests) $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 (); @@ -109,13 +100,12 @@ for $test (@tests) $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) + if ($status != 0) { print STDERR "ERROR: Consumer returned $status\n"; $Supplier->Kill (); @@ -124,13 +114,18 @@ for $test (@tests) exit 1; } - $Supplier->WaitKill ($shutdown_timeout); + $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; diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp index fa8e6915799..45a73e63080 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp @@ -2,28 +2,33 @@ #include "ace/OS_NS_unistd.h" #include "Notify_Sequence_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/TimeBaseC.h" #include "common.h" #include "tao/debug.h" Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer ( - const char* name, - CORBA::Short policy, - unsigned int expected, - CORBA::Boolean& done) - : name_ (name), - order_policy_ (policy), - expected_ (expected), - count_ (0), - done_ (done) + const char* name, + CORBA::Short policy, + bool use_ordering, + int expected, + Notify_Test_Client& client) + : name_ (name), + order_policy_ (policy), + use_ordering_ (use_ordering), + expected_ (expected), + count_ (0), + first_ (0), + client_ (client) { + this->client_.consumer_start (this); } void Notify_Sequence_Push_Consumer::_connect ( - CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin - ACE_ENV_ARG_DECL) + CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { CosNotifyComm::SequencePushConsumer_var objref = @@ -32,14 +37,14 @@ Notify_Sequence_Push_Consumer::_connect ( CosNotifyChannelAdmin::ProxySupplier_var proxysupplier = consumer_admin->obtain_notification_push_supplier ( - CosNotifyChannelAdmin::SEQUENCE_EVENT, - proxy_id_ - ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::SEQUENCE_EVENT, + proxy_id_ + ACE_ENV_ARG_PARAMETER); ACE_CHECK; this->proxy_ = CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow ( - proxysupplier.in () ACE_ENV_ARG_PARAMETER); + proxysupplier.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; CosNotification::QoSProperties properties (3); @@ -47,13 +52,19 @@ Notify_Sequence_Push_Consumer::_connect ( properties[0].name = CORBA::string_dup (CosNotification::MaximumBatchSize); properties[0].value <<= (CORBA::Long)5; properties[1].name = CORBA::string_dup (CosNotification::PacingInterval); - properties[1].value <<= (TimeBase::TimeT)4; - properties[2].name = CORBA::string_dup (CosNotification::OrderPolicy); - properties[2].value <<= this->order_policy_; + properties[1].value <<= (TimeBase::TimeT) (1000 * 10000); // 1 secs + if (use_ordering_) + { + properties[2].name = CORBA::string_dup (CosNotification::OrderPolicy); + properties[2].value <<= this->order_policy_; + } + else + { + properties.length(2); + } this->proxy_->set_qos (properties); - this->proxy_->connect_sequence_push_consumer (objref.in () - ACE_ENV_ARG_PARAMETER); + this->proxy_->connect_sequence_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; // give ownership to POA @@ -64,140 +75,63 @@ Notify_Sequence_Push_Consumer::_connect ( void Notify_Sequence_Push_Consumer::push_structured_events ( - const CosNotification::EventBatch& events - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) + const CosNotification::EventBatch& events + ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { - static long previous = 0; - static CORBA::Boolean first = 1; + if (count_ == 0) + { + // Sleep long enough to force the channel to back up, otherwise + // there will be no ordering. + ACE_OS::sleep(2); + } + + count_ += events.length(); + + if (this->count_ > this->expected_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n"))); + } - CORBA::ULong length = events.length (); + if (this->count_ >= this->expected_) + { + this->client_.consumer_done (this); + } - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Received %u events:\n", length)); + ACE_ASSERT(events[0].header.variable_header.length() == 3); + ACE_ASSERT(ACE_OS::strcmp(events[0].header.variable_header[0].name.in(), "id") == 0); + CORBA::Long id1 = 0; + CORBA::Long id2 = 0; + events[0].header.variable_header[0].value >>= id1; + events[events.length() - 1].header.variable_header[0].value >>= id2; - for (CORBA::ULong e = 0; e < length; e++) + ACE_DEBUG((LM_DEBUG, "\n Received id %d-%d\n", id1, id2)); + + for (CORBA::ULong idx = 0; idx < events.length(); ++idx) { - CORBA::ULong hlength = events[e].header.variable_header.length (); - for (CORBA::ULong hi = 0; hi < hlength; hi++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)events[e].header.variable_header[hi].name, - Any_String (events[e].header.variable_header[hi].value))); + CORBA::Long id = 0; - if (this->order_policy_ == CosNotification::PriorityOrder) - { - if (ACE_OS::strcmp ( - events[e].header.variable_header[hi].name, "Priority") == 0) - { - CORBA::Short current; - events[e].header.variable_header[hi].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current > - static_cast<CORBA::Short> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Priority Ordering failed\n"))); - } - } - previous = static_cast<long> (current); - } - } - else if (this->order_policy_ == CosNotification::DeadlineOrder) - { - if (ACE_OS::strcmp ( - events[e].header.variable_header[hi].name, "Timeout") == 0) - { - TimeBase::TimeT current; - events[e].header.variable_header[hi].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current < - static_cast<TimeBase::TimeT> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Deadline Ordering failed\n"))); - } - } -# if defined (ACE_CONFIG_WIN32_H) - previous = static_cast<long> (current); -# else - // Convert ACE_ULong_Long to 32-bit integer - previous = (current / 1); -# endif /* ACE_CONFIG_WIN32_H */ - } - } - } + events[idx].header.variable_header[0].value >>= id; - CORBA::ULong flength = events[e].filterable_data.length (); - for (CORBA::ULong i = 0; i < flength; i++) + // The first batch may be out of order on faster platforms + if (count_ > static_cast<int>(events.length())) { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)events[e].filterable_data[i].name, - Any_String (events[e].filterable_data[i].value))); - - if (this->order_policy_ == CosNotification::FifoOrder) + int eid = idx + count_ - static_cast<int>(events.length()); + if (order_policy_ == CosNotification::PriorityOrder + || order_policy_ == CosNotification::DeadlineOrder) { - if (ACE_OS::strcmp (events[e].filterable_data[i].name, "enum") == 0) - { - CORBA::ULong current; - events[e].filterable_data[i].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current < - static_cast<CORBA::ULong> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: FIFO Ordering failed.\n"))); - } - } - previous = static_cast<long> (current); - } + eid = expected_ - 1; + eid -= (count_ - static_cast<int>(events.length())); + eid -= idx; + if (first_ < static_cast<int>(events.length())) + eid += static_cast<int>(events.length()); } + if (id != eid) + ACE_ERROR((LM_ERROR, "\nError: Expected id:%d Received id:%d\n", eid, id)); + } + else + { + first_ = id1; } - } - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "-------------------------\n")); - - this->count_+= events.length (); - - if (this->count_ > this->expected_) - { - this->done_ = 1; - - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too " - "many events received.\n"))); - - } - else if (this->count_ == this->expected_) - { - this->done_ = 1; - } - else - { - ACE_OS::sleep (1); } } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h index cfc0ffa4b1f..a3d81faedef 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h @@ -20,14 +20,16 @@ #include "Notify_SequencePushConsumer.h" +class Notify_Test_Client; class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer { public: Notify_Sequence_Push_Consumer (const char* name, CORBA::Short policy, - unsigned int expected_count, - CORBA::Boolean& done); + bool use_ordering, + int expected_count, + Notify_Test_Client& client); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL) @@ -40,10 +42,11 @@ protected: ACE_CString name_; CORBA::Short order_policy_; - unsigned int expected_; - - unsigned int count_; - CORBA::Boolean& done_; + bool use_ordering_; + int expected_; + int count_; + int first_; + Notify_Test_Client& client_; }; #endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp index db220185da7..d8e9f5a6552 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp @@ -1,22 +1,30 @@ // $Id$ -#include "ace/OS_NS_unistd.h" #include "Notify_Structured_Push_Consumer.h" -#include "orbsvcs/TimeBaseC.h" +#include "Notify_Test_Client.h" #include "common.h" + +#include "orbsvcs/TimeBaseC.h" + #include "tao/debug.h" +#include "ace/OS_NS_unistd.h" + Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer ( const char* name, CORBA::Short policy, - unsigned int expected, - CORBA::Boolean& done) + bool use_ordering, + int expected, + Notify_Test_Client& client) : name_ (name), order_policy_ (policy), + use_ordering_ (use_ordering), expected_ (expected), count_ (0), - done_ (done) + first_(0), + client_ (client) { + this->client_.consumer_start (this); } @@ -42,12 +50,16 @@ Notify_Structured_Push_Consumer::_connect ( proxysupplier.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - CosNotification::QoSProperties properties (1); - properties.length (1); - properties[0].name = CORBA::string_dup (CosNotification::OrderPolicy); - properties[0].value <<= this->order_policy_; + if (use_ordering_) + { + CosNotification::QoSProperties properties (1); + properties.length (1); + properties[0].name = CORBA::string_dup (CosNotification::OrderPolicy); + properties[0].value <<= this->order_policy_; + + this->proxy_->set_qos (properties); + } - this->proxy_->set_qos (properties); this->proxy_->connect_structured_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -64,133 +76,56 @@ Notify_Structured_Push_Consumer::push_structured_event ( ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { - static long previous = 0; - static CORBA::Boolean first = 1; - // Since the Notification Service begins to dispatch before all the - // events are queued, the first 2 events are not in the "expected" - // order. - static const unsigned int expected_out_of_order = 2; - - if (this->count_ >= expected_out_of_order) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Received event:\n")); - - CORBA::ULong hlength = event.header.variable_header.length (); - for (CORBA::ULong hi = 0; hi < hlength; hi++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)event.header.variable_header[hi].name, - Any_String (event.header.variable_header[hi].value))); - - if (this->order_policy_ == CosNotification::PriorityOrder) - { - if (ACE_OS::strcmp ( - event.header.variable_header[hi].name, "Priority") == 0) - { - CORBA::Short current; - event.header.variable_header[hi].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current > - static_cast<CORBA::Short> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Priority Ordering failed.\n"))); - } - } - previous = static_cast<long> (current); - } - } - else if (this->order_policy_ == CosNotification::DeadlineOrder) - { - if (ACE_OS::strcmp ( - event.header.variable_header[hi].name, "Timeout") == 0) - { - TimeBase::TimeT current; - event.header.variable_header[hi].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current < - static_cast<TimeBase::TimeT> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: Deadline Ordering failed.\n"))); - } - } -# if defined (ACE_CONFIG_WIN32_H) - previous = static_cast<long> (current); -# else - // Convert ACE_ULong_Long to 32-bit integer - previous = (current / 1); -# endif /* ACE_CONFIG_WIN32_H */ - } - } - } - - CORBA::ULong flength = event.filterable_data.length (); - for (CORBA::ULong i = 0; i < flength; i++) - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s = %s\n", - (const char*)event.filterable_data[i].name, - Any_String (event.filterable_data[i].value))); - - if (this->order_policy_ == CosNotification::FifoOrder) - { - if (ACE_OS::strcmp (event.filterable_data[i].name, "enum") == 0) - { - CORBA::ULong current; - event.filterable_data[i].value >>= current; - if (first) - { - first = 0; - } - else - { - if (current < - static_cast<CORBA::ULong> (previous)) - { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: FIFO Ordering failed.\n"))); - } - } - previous = static_cast<long> (current); - } - } - } - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "-------------------------\n")); - } - this->count_++; + ACE_DEBUG((LM_DEBUG, "-")); + if (count_ == 0) + { + // Sleep long enough to force the channel to back up, otherwise + // there will be no ordering. + ACE_OS::sleep(2); + } + + ++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); + } + + CORBA::Long id = 0; + + ACE_ASSERT(event.header.variable_header.length() == 3); + ACE_ASSERT(ACE_OS::strcmp(event.header.variable_header[0].name.in(), "id") == 0); + event.header.variable_header[0].value >>= id; + + // The first event won't necessarilly be in order, because we hadn't yet forced + // the channel to queue events. + if (count_ > 1) + { + if (order_policy_ == CosNotification::PriorityOrder + || order_policy_ == CosNotification::DeadlineOrder) { - this->done_ = 1; - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ERROR: too " - "many events received.\n"))); + int eid = expected_ - count_ + 1; + if (eid <= first_) + --eid; + + if (id != eid) + ACE_ERROR((LM_ERROR, "\nError: ")); + ACE_DEBUG((LM_DEBUG, "Expected id:%d Received id:%d\n", eid, id)); } - else if (this->count_ == this->expected_) + else { - this->done_ = 1; + if (id != count_ - 1) + ACE_ERROR((LM_ERROR, "\nError: Expected id:%d Received id:%d\n", count_ - 1, id)); } + } else - { - ACE_OS::sleep (1); - } + { + ACE_DEBUG((LM_DEBUG, "Ignoring first event. id=%d\n", id)); + first_ = id; + } } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h index 39aaf58786b..01b5b69c922 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; class Notify_Structured_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer { @@ -27,8 +28,9 @@ public: Notify_Structured_Push_Consumer ( const char* name, CORBA::Short policy, - unsigned int expected, - CORBA::Boolean& done); + bool use_ordering, + int expected, + Notify_Test_Client& client); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL) @@ -41,9 +43,11 @@ protected: ACE_CString name_; CORBA::Short order_policy_; - unsigned int expected_; - unsigned int count_; - CORBA::Boolean& done_; + bool use_ordering_; + int expected_; + int count_; + int first_; + Notify_Test_Client& client_; }; #endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp index ca6de9a909a..2381731ea68 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp @@ -1,36 +1,21 @@ // $Id$ - -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" - -#include "orbsvcs/CosNotifyCommC.h" -#include "orbsvcs/CosNamingC.h" #include "Notify_Sequence_Push_Consumer.h" #include "goC.h" #include "Notify_Test_Client.h" -#include "ace/OS_NS_sys_stat.h" -#if !defined (PATH_MAX) -#define PATH_MAX 1024 -#endif /* PATH_MAX */ +#include "orbsvcs/CosNotifyCommC.h" +#include "orbsvcs/CosNamingC.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_sys_stat.h" static const char* ior = "file://supplier.ior"; static CORBA::Short order_policy = CosNotification::FifoOrder; -static unsigned int expected = 6*16; // Look in Sequence_Supplier.cpp, the supplier is sending 6*16 events. -static unsigned int high = expected + 4; // If we go over the expected we're getting more events. - -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static int expected = 30; // Must match the amount sent by supplier +static Notify_Sequence_Push_Consumer* consumer_1; +static bool use_ordering = false; class Consumer_Client : public Notify_Test_Client { @@ -42,66 +27,65 @@ public: int Consumer_Client::parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:l:h:d:"); + ACE_Get_Opt get_opts (argc, argv, "ok:e:d:"); int c; while ((c = get_opts ()) != -1) switch (c) - { - case 'k': - ior = get_opts.optarg; - break; + { + case 'k': + ior = get_opts.optarg; + break; - case 'l': - expected = ACE_OS::atoi (get_opts.optarg); - break; + case 'e': + expected = ACE_OS::atoi (get_opts.optarg); + break; - case 'h': - high = ACE_OS::atoi (get_opts.optarg); - break; + case 'o': + use_ordering = true; + break; - case 'd': + case 'd': { const char* order = get_opts.optarg; if (ACE_OS::strcmp (order, "fifo") == 0) - { - order_policy = CosNotification::FifoOrder; - } + { + order_policy = CosNotification::FifoOrder; + } else if (ACE_OS::strcmp (order, "priority") == 0) - { - order_policy = CosNotification::PriorityOrder; - } + { + order_policy = CosNotification::PriorityOrder; + } else if (ACE_OS::strcmp (order, "deadline") == 0) - { - order_policy = CosNotification::DeadlineOrder; + { + order_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif - } + } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unknown ordering policy: %s\n", - order_policy), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unknown ordering policy: %s\n", + order_policy), + -1); + } break; } - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-l <low expected events> " - "-h <high expected events> " - "-d <fifo|priority|deadline> " - "\n", - argv [0]), - -1); - } + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-e <expected events> " + "-d <fifo|priority|deadline> " + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; } @@ -114,8 +98,8 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::ConsumerAdmin_var admin = ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -128,14 +112,13 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, Notify_Test_Client* client ACE_ENV_ARG_DECL) { - // startup the consumer - Notify_Sequence_Push_Consumer* consumer_1; ACE_NEW_THROW_EX (consumer_1, - Notify_Sequence_Push_Consumer ("consumer1", - order_policy, - expected, - client->done ()), - CORBA::NO_MEMORY ()); + Notify_Sequence_Push_Consumer ("consumer1", + order_policy, + use_ordering, + expected, + *client), + CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -144,96 +127,58 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, ACE_CHECK; } -// ****************************************************************** -// Main Section -// ****************************************************************** - int main (int argc, char* argv[]) { - int status = 0; ACE_TRY_NEW_ENV - { - Consumer_Client client; + { + Consumer_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + ACE_UNUSED_ARG(status); + ACE_ASSERT(status == 0); - if (status == 0) - { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::Object_var object = - 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; - - // Wait until the supplier is done - // before we start receiving events. - ACE_stat buf; - char ior_file[PATH_MAX]; - const char* filepart = ACE_OS::strstr (ior, "file://"); - if (filepart != 0) - { - ACE_OS::strcpy (ior_file, filepart + 7); - while (ACE_OS::stat (ior_file, &buf) == 0) - { - ACE_OS::sleep (1); - } - } - - unsigned int try_count = 0; - unsigned int try_max = (high - expected) * 2; - while (true) - { - // See if we can get any more events - if (client.done ()) - { - ACE_OS::sleep (1); - try_count++; - if (try_count >= try_max) - break; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } - } + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::ORB_ptr orb = client.orb (); + CORBA::Object_var object = + 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; + + ACE_ASSERT(! CORBA::is_nil (sig.in ())); + + CosNotifyChannelAdmin::ConsumerAdmin_var admin = + create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_ASSERT(!CORBA::is_nil (admin.in ())); + create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); + consumer_1->disconnect(); + + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp index f689cb5b866..f2be0c3074e 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp @@ -1,53 +1,67 @@ // $Id$ - -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" - -#include "tao/ORB_Core.h" +#include "Notify_SequencePushSupplier.h" +#include "goS.h" +#include "Notify_Test_Client.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/TimeBaseC.h" -#include "Notify_SequencePushSupplier.h" -#include "goS.h" -#include "Notify_Test_Client.h" +#include "tao/ORB_Core.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_strings.h" +#include "ace/Auto_Ptr.h" static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static CORBA::Short order_policy = CosNotification::FifoOrder; -static int max_events = 6; // 6 sets of 16 +static int num_events = 30; static const char* ior_output_file = "supplier.ior"; - -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static const int BATCH_SIZE = 5; class sig_i : public POA_sig { public: - void go (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + sig_i(CORBA::ORB_ptr orb) + : orb_(orb) + , started_(false) + { + } + void go (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) + void done (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + { + 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 Supplier_Client : public Notify_Test_Client { @@ -55,7 +69,6 @@ public: virtual int parse_args (int argc, char* argv[]); }; - int Supplier_Client::parse_args (int argc, char *argv[]) { @@ -64,61 +77,60 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'd': + { + case 'd': { const char* order = get_opts.optarg; - if (ACE_OS::strcmp (order, "fifo") == 0) - { - order_policy = CosNotification::FifoOrder; - } - else if (ACE_OS::strcmp (order, "priority") == 0) - { - order_policy = CosNotification::PriorityOrder; - } - else if (ACE_OS::strcmp (order, "deadline") == 0) - { - order_policy = CosNotification::DeadlineOrder; + if (ACE_OS::strcasecmp (order, "fifo") == 0) + { + order_policy = CosNotification::FifoOrder; + } + else if (ACE_OS::strcasecmp (order, "priority") == 0) + { + order_policy = CosNotification::PriorityOrder; + } + else if (ACE_OS::strcasecmp (order, "deadline") == 0) + { + order_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif - } + } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unknown order policy: %s\n", - order_policy), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unknown order policy: %s\n", + order_policy), + -1); + } break; } - case 'e': - max_events = 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> -d" - "\n", - argv [0]), - -1); - } + case 'e': + num_events = 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> -d" + "\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) @@ -126,8 +138,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -136,98 +148,35 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvents (void) +SendBatch (int batch_id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::EventBatch events; - - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; - - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; - - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::ULong)count; - - events.length (16); - events[0] = event; - - CosNotification::StructuredEvent revents[15]; - for (int z = 0; z < 15; z++) - { - revents[z].header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - revents[z].header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - revents[z].header.fixed_header.event_name = CORBA::string_dup ("test revents[z]"); - - revents[z].header.variable_header.length (2); - revents[z].header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - revents[z].header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - revents[z].header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - revents[z].header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - - revents[z].filterable_data.length (3); - revents[z].filterable_data[0].name = CORBA::string_dup ("objectId"); - revents[z].filterable_data[0].value <<= (CORBA::Long)z; - - revents[z].filterable_data[1].name = CORBA::string_dup ("type"); - revents[z].filterable_data[1].value <<= types[2 - (count % 3)]; - - revents[z].filterable_data[2].name = CORBA::string_dup ("enum"); - revents[z].filterable_data[2].value <<= (CORBA::ULong)count; - events[z + 1] = revents[z]; - } - count++; - - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + CosNotification::EventBatch events; + events.length(BATCH_SIZE); + for (CORBA::Long i = 0; i < BATCH_SIZE; ++i) + { + int id = batch_id * BATCH_SIZE + i; + + 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 ("c"); + + event.header.variable_header.length (3); + event.header.variable_header[0].name = + CORBA::string_dup ("id"); + event.header.variable_header[0].value <<= (CORBA::Long)id; + event.header.variable_header[1].name = + CORBA::string_dup (CosNotification::Priority); + event.header.variable_header[1].value <<= (CORBA::Short)(id); + event.header.variable_header[2].name = + CORBA::string_dup (CosNotification::Timeout); + event.header.variable_header[2].value <<= (TimeBase::TimeT) (num_events - id); + + events[i] = event; } + supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); + ACE_CHECK; } static void @@ -235,10 +184,9 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, PortableServer::POA_ptr poa ACE_ENV_ARG_DECL) { - // start up the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_SequencePushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_SequencePushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -254,75 +202,83 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { - int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV + { + Supplier_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; + + CosNotification::QoSProperties qos (1); + qos.length (1); + qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); + qos[0].value <<= order_policy; + ec->set_qos (qos 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) { - Supplier_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", 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CosNotification::QoSProperties qos (1); - qos.length (1); - qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); - qos[0].value <<= order_policy; - ec->set_qos (qos ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvents (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - ACE_OS::unlink (ior_output_file); - } - } + 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); } - ACE_CATCH (CORBA::Exception, e) + + CosNotifyChannelAdmin::SupplierAdmin_var admin = + create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_ASSERT(!CORBA::is_nil (admin.in ())); + create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events / BATCH_SIZE; ++i) { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; + ACE_DEBUG((LM_DEBUG, "+")); + SendBatch (i ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_output_file); + + supplier_1->disconnect(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 status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp index b06369cba80..fb1e51cedb2 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp @@ -1,35 +1,19 @@ // $Id$ - -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" - -#include "orbsvcs/CosNotifyCommC.h" -#include "orbsvcs/CosNamingC.h" #include "Notify_Structured_Push_Consumer.h" #include "goC.h" - #include "Notify_Test_Client.h" -#include "ace/OS_NS_sys_stat.h" -#if !defined (PATH_MAX) -#define PATH_MAX 1024 -#endif /* PATH_MAX */ +#include "orbsvcs/CosNotifyCommC.h" +#include "orbsvcs/CosNamingC.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" static const char* ior = "file://supplier.ior"; static CORBA::Short order_policy = CosNotification::FifoOrder; -static unsigned int expected = 20; - -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static int expected = 30; +static Notify_Structured_Push_Consumer* consumer_1; +static bool use_ordering = false; class Consumer_Client : public Notify_Test_Client { @@ -37,70 +21,72 @@ 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:d:"); + ACE_Get_Opt get_opts (argc, argv, "ok:e:d:"); int c; while ((c = get_opts ()) != -1) switch (c) - { - case 'k': - ior = get_opts.optarg; - break; + { + case 'k': + ior = get_opts.optarg; + break; - case 'e': - expected = ACE_OS::atoi (get_opts.optarg); - break; + case 'o': + use_ordering = true; + break; - case 'd': + case 'e': + expected = ACE_OS::atoi (get_opts.optarg); + break; + + case 'd': { const char* order = get_opts.optarg; if (ACE_OS::strcmp (order, "fifo") == 0) - { - order_policy = CosNotification::FifoOrder; - } + { + order_policy = CosNotification::FifoOrder; + } else if (ACE_OS::strcmp (order, "priority") == 0) - { - order_policy = CosNotification::PriorityOrder; - } + { + order_policy = CosNotification::PriorityOrder; + } else if (ACE_OS::strcmp (order, "deadline") == 0) - { - order_policy = CosNotification::DeadlineOrder; + { + order_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message" - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message" + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif - } + } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unknown order policy: %s\n", - order_policy), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unknown order policy: %s\n", + order_policy), + -1); + } break; } - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "-e <expected events> " - "-d <fifo|priority|deadline> " - "\n", - argv [0]), - -1); - } + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-e <expected events> " + "-d <fifo|priority|deadline> " + "\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) @@ -108,28 +94,27 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::ConsumerAdmin_var admin = ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP, - adminid - ACE_ENV_ARG_PARAMETER); + 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) { // startup the first consumer - Notify_Structured_Push_Consumer* consumer_1; ACE_NEW_THROW_EX (consumer_1, - Notify_Structured_Push_Consumer ("consumer1", - order_policy, - expected, - client->done ()), - CORBA::NO_MEMORY ()); + Notify_Structured_Push_Consumer ("consumer1", + order_policy, + use_ordering, + expected, + *client), + CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -137,93 +122,59 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, ACE_CHECK; } -// ****************************************************************** -// Main Section -// ****************************************************************** - int main (int argc, char* argv[]) { - int status = 0; ACE_TRY_NEW_ENV - { - Consumer_Client client; + { + Consumer_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + ACE_UNUSED_ARG(status); + ACE_ASSERT(status == 0); - if (status == 0) - { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::Object_var object = - 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; - - // Wait until the supplier is done - // before we start receiving events. - ACE_stat buf; - char ior_file[PATH_MAX]; - const char* filepart = ACE_OS::strstr (ior, "file://"); - if (filepart != 0) - { - ACE_OS::strcpy (ior_file, filepart + 7); - while (ACE_OS::stat (ior_file, &buf) == 0) - { - ACE_OS::sleep (1); - } - } - - CORBA::Boolean wait_more = 1; - while (!client.done () || wait_more) - { - // See if we can get any more events - if (client.done () && wait_more) - { - ACE_OS::sleep (5); - wait_more = 0; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } - } + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::ORB_ptr orb = client.orb (); + CORBA::Object_var object = + 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; + + ACE_ASSERT(! CORBA::is_nil (sig.in ())); + + CosNotifyChannelAdmin::ConsumerAdmin_var admin = + create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_ASSERT(!CORBA::is_nil (admin.in ())); + + create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); + consumer_1->disconnect(); + + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: "); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp index de8e0d5aae6..cd55f00574f 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp @@ -1,53 +1,66 @@ // $Id$ +#include "Notify_StructuredPushSupplier.h" +#include "goS.h" -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" - -#include "tao/ORB_Core.h" +#include "Notify_Test_Client.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/TimeBaseC.h" -#include "Notify_StructuredPushSupplier.h" -#include "goS.h" -#include "Notify_Test_Client.h" +#include "tao/ORB_Core.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/Auto_Ptr.h" static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static CORBA::Short order_policy = CosNotification::FifoOrder; -static int max_events = 20; +static int num_events = 30; 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -64,56 +77,56 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'd': + { + case 'd': { const char* order = get_opts.optarg; if (ACE_OS::strcmp (order, "fifo") == 0) - { - order_policy = CosNotification::FifoOrder; - } + { + order_policy = CosNotification::FifoOrder; + } else if (ACE_OS::strcmp (order, "priority") == 0) - { - order_policy = CosNotification::PriorityOrder; - } + { + order_policy = CosNotification::PriorityOrder; + } else if (ACE_OS::strcmp (order, "deadline") == 0) - { - order_policy = CosNotification::DeadlineOrder; + { + order_policy = CosNotification::DeadlineOrder; #if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS) - ACE_ERROR_RETURN ((LM_ERROR, - "This order policy requires timed message " - "blocks.\nPlease #define " - "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " - "config.h\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "This order policy requires timed message " + "blocks.\nPlease #define " + "ACE_HAS_TIMED_MESSAGE_BLOCKS in your " + "config.h\n"), -1); #endif - } + } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unknown order policy: %s\n", - order_policy), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unknown order policy: %s\n", + order_policy), + -1); + } break; } - case 'e': - max_events = 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> " - "-d <fifo|priority|deadline>" - "\n", - argv [0]), - -1); - } + case 'e': + num_events = 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> " + "-d <fifo|priority|deadline>" + "\n", + argv [0]), + -1); + } // Indicates sucessful parsing of the command line return 0; @@ -127,8 +140,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -137,61 +150,34 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvent (void) +SendEvent (int id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::StructuredEvent event; - - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - + 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"); + + event.header.variable_header.length (3); + event.header.variable_header[0].name = CORBA::string_dup ("id"); + event.header.variable_header[0].value <<= (CORBA::Long) id; + event.header.variable_header[1].name = + CORBA::string_dup (CosNotification::Priority); + event.header.variable_header[1].value <<= (CORBA::Short) id; + event.header.variable_header[2].name = + CORBA::string_dup (CosNotification::Timeout); + event.header.variable_header[2].value <<= (TimeBase::TimeT) (num_events - id); - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; - - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; - - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::ULong)count; - count++; - - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + ACE_TRY_NEW_ENV + { + supplier_1->send_event (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: "); + } + ACE_ENDTRY; } static void @@ -201,8 +187,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // startup the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_StructuredPushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -211,83 +197,85 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, ACE_CHECK; } - -// ****************************************************************** -// Main Section -// ****************************************************************** - int main (int argc, char* argv[]) { - int status = 0; + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV + { + Supplier_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; + + CosNotification::QoSProperties qos (1); + qos.length (1); + qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); + qos[0].value <<= order_policy; + ec->set_qos (qos 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) { - Supplier_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", 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CosNotification::QoSProperties qos (1); - qos.length (1); - qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy); - qos[0].value <<= order_policy; - ec->set_qos (qos ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvent (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - - ACE_OS::unlink (ior_output_file); - } + 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); } - ACE_CATCH (CORBA::Exception, e) + + CosNotifyChannelAdmin::SupplierAdmin_var admin = + create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_ASSERT(!CORBA::is_nil (admin.in ())); + create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events; ++i) { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; + ACE_DEBUG((LM_DEBUG, "+")); + SendEvent (i ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_output_file); + + supplier_1->disconnect(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 status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Ordering/common.cpp b/TAO/orbsvcs/tests/Notify/Ordering/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/common.cpp +++ b/TAO/orbsvcs/tests/Notify/Ordering/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/Ordering/go.idl b/TAO/orbsvcs/tests/Notify/Ordering/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/go.idl +++ b/TAO/orbsvcs/tests/Notify/Ordering/go.idl @@ -4,4 +4,7 @@ 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/Ordering/notify.conf b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf index 7a531569a88..1a52da7b7ec 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf @@ -1,4 +1,6 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +## DispatchThreads creates a queue for the consumer side +## SourceThreads creates a queue for the supplier side +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1 -SourceThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml index 3cc43635cba..5c15de81fdc 100644 --- a/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/Ordering/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl b/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl index 14d607abc42..c48b9a42e42 100755 --- a/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl @@ -10,6 +10,7 @@ use PerlACE::Run_Test; $ior = PerlACE::LocalFile ("supplier.ior"); $notifyior = PerlACE::LocalFile ("notify.ior"); +$naming_ior = PerlACE::LocalFile ("naming.ior"); $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); $status = 0; $deadline = 0; @@ -25,11 +26,9 @@ foreach my $arg (@ARGV) { } } -unlink $notifyior; - $port = PerlACE::uniqueid () + 10001; $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); + "-ORBEndpoint iiop://localhost:$port -o $naming_ior"); $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . @@ -47,15 +46,18 @@ $SEC = new PerlACE::Process ("Sequence_Consumer"); $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; -if ($NS->Spawn () == -1) { - exit 1; -} - -if ($TS->Spawn () == -1) { - $NS->Kill (); - exit 1; + +unlink $notifyior; +unlink $naming_ior; + +$NS->Spawn (); +if (PerlACE::waitforfile_timed ($naming_ior, 20) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); + exit 1; } +$TS->Spawn (); if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; $TS->Kill (); @@ -63,79 +65,155 @@ if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { exit 1; } -@policies = ("fifo", "priority"); if ($deadline) { - push(@policies, "deadline"); + ## @@todo : Add combinations of deadline ordering. } -for($i = 0; $i <= $#policies; $i++) { - $order_policy = $policies[$i]; - print "************* Running Structured Consumer with the " . - "$order_policy policy ***********\n"; +# Although the TAO notify service supports OrderPolicy on the supplier side +# QoS, this setting typically serves no practical purpose, and is not testable. +# This is because we have no way to force the supplier-side queue to back up, and +# the OrderPolicy will have no affect. +# Therefore we don't test setting this policy on the supplier side. - unlink $ior; - $STS->Arguments($STS->Arguments() . " -d $order_policy"); - $STS->Spawn (); - - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $STS->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; - last; - } - - $STC->Arguments($client_args . " -d $order_policy"); - $client = $STC->SpawnWaitKill (120); - - $STS->Kill (); - if ($client != 0) { - print STDERR "ERROR: Structured_Consumer did not run properly\n"; +print "**** Structured Supplier (fifo) -> Structured Consumer (none) *****\n"; +unlink $ior; +$STS->Arguments($STS->Arguments() . " -d fifo"); +$STS->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); $status = 1; - last; - } + exit 1; +} +$STC->Arguments($client_args . " -d fifo"); +$client = $STC->SpawnWaitKill (20); +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; } -## // pradeep: commented out priority policies temporarily till the sequences implementation is fixed. -@policies_seq = ("fifo"); - -if ($status == 0) { - for($i = 0; $i <= $#policies_seq; $i++) { - $order_policy = $policies_seq[$i]; - print "************** Running Sequence Consumer with the " . - "$order_policy policy ************\n"; - - unlink $ior; - $SES->Arguments($SES->Arguments() . " -d $order_policy"); - $SES->Spawn (); +print "**** Structured Supplier (fifo) -> Structured Consumer (priority) *****\n"; +unlink $ior; +$STS->Arguments($STS->Arguments() . " -d fifo"); +$STS->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + $status = 1; + exit 1; +} +$STC->Arguments($client_args . " -d priority -o"); +$client = $STC->SpawnWaitKill (20); +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $SES->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; - last; - } +print "**** Structured Supplier (fifo) -> Sequence Consumer (priority) *****\n"; +unlink $ior; +$STS->Arguments($STS->Arguments() . " -d fifo"); +$STS->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + $status = 1; + exit 1; +} +$SEC->Arguments($client_args . " -d priority -o"); +$client = $SEC->SpawnWaitKill (20); +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} - $SEC->Arguments($client_args . " -d $order_policy"); - $client = $SEC->SpawnWaitKill (120); +print "**** Sequence Supplier (fifo) -> Structured Consumer (priority) *****\n"; +unlink $ior; +$SES->Arguments($SES->Arguments() . " -d fifo"); +$SES->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + $status = 1; + exit 1; +} +$STC->Arguments($client_args . " -d priority -o"); +$client = $STC->SpawnWaitKill (20); +if ($client != 0) { + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $SES->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} +print "**** Sequence Supplier (fifo) -> Sequence Consumer (priority) *****\n"; +unlink $ior; +$SES->Arguments($SES->Arguments() . " -d fifo"); +$SES->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { $SES->Kill (); - if ($client != 0) { - print STDERR "ERROR: Sequence_Consumer did not run properly\n"; - $status = 1; - last; - } - } + $TS->Kill (); + $NS->Kill (); + $status = 1; + exit 1; +} +$SEC->Arguments($client_args . " -d priority -o"); +$client = $SEC->SpawnWaitKill (20); +if ($client != 0) { + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; } +$server = $SES->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} + $TS->Kill (); $NS->Kill (); unlink $ior; unlink $notifyior; - +unlink $naming_ior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp index 3de985a3ad4..245a9e0b84d 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp @@ -94,7 +94,7 @@ int main(int, char**) CNCA::ChannelID ecid; CNCA::EventChannel_var ec = ecf->create_channel(qos, admin, ecid); - printf("Created channel id=\"%ld\"\n", static_cast<long> (ecid)); + ACE_OS::printf("Created channel id=\"%ld\"\n", static_cast<long>(ecid)); tearDown(); diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf index 63b5faf531b..008cb4abe88 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf @@ -1,3 +1,3 @@ - +# dynamic TopologyFactory Service_Object * NotifyPlugTop:_make_Test_Topology_Factory() "" #dynamic TopologyFactory Service_Object * TAO_CosNotification:_make_XML_Topology_Factory() ""
\ No newline at end of file diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp index 67dd1d85ddb..b87c4f5edd6 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp @@ -13,7 +13,7 @@ ACE_RCSID (Notify_Tests, Consumer_Main, "$Id$") static const char NOTIFY_FACTORY_NAME[] = "NotifyEventChannelFactory"; static const char NAMING_SERVICE_NAME[] = "NameService"; -static const size_t minus_one = static_cast<size_t> (-1); +static const size_t minus_one = ACE_static_cast (size_t, -1); /////////////////////////// // StructuredPushConsumer_i @@ -90,7 +90,7 @@ StructuredPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Structured Consumer received event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -102,7 +102,7 @@ StructuredPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Structured Consumer received correct event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -112,8 +112,8 @@ StructuredPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Structured Consumer: service received event %d; Notify discarded %d*.\n"), - static_cast<int> (seq), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, seq), + ACE_static_cast (int, this->serial_number_) )); } this->received_ += seq - this->serial_number_; @@ -123,8 +123,8 @@ StructuredPushConsumer_i::check_serial_number (CORBA::ULong seq) this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Structured Consumer received notifications out of sequence. Expecting %d received %d.\n"), - static_cast<int> (this->serial_number_), - static_cast<int> (seq) + ACE_static_cast (int, this->serial_number_), + ACE_static_cast (int, seq) )); } this->serial_number_ = seq + 1; @@ -156,7 +156,7 @@ StructuredPushConsumer_i::push_structured_event ( this->may_discard_ = 1; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Structured Consumer failing at event # %d.\n"), - static_cast<int> (this->received_) + ACE_static_cast (int, this->received_) )); ACE_THROW (CORBA::UNKNOWN()); ACE_CHECK; @@ -185,7 +185,7 @@ StructuredPushConsumer_i::push_structured_event ( this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Structured Consumer received wrong filterable data name.%s. Expecting serial_number\n"), - static_cast<const char *> (notification.filterable_data[0].name) + ACE_static_cast (const char *, notification.filterable_data[0].name) )); } } @@ -313,7 +313,7 @@ SequencePushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Sequence Consumer received event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -325,7 +325,7 @@ SequencePushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Sequence Consumer received correct event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -335,8 +335,8 @@ SequencePushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Sequence Consumer: service received event %d; Notify discarded %d*.\n"), - static_cast<int> (seq), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, seq), + ACE_static_cast (int, this->serial_number_) )); } this->received_ += seq - this->serial_number_; @@ -346,8 +346,8 @@ SequencePushConsumer_i::check_serial_number (CORBA::ULong seq) this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Sequence Consumer received notifications out of sequence. Expecting %d received %d.\n"), - static_cast<int> (this->serial_number_), - static_cast<int> (seq) + ACE_static_cast (int, this->serial_number_), + ACE_static_cast (int, seq) )); } this->serial_number_ = seq + 1; @@ -368,7 +368,7 @@ SequencePushConsumer_i::push_structured_events ( { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Sequence Consumer received batch of %d events.\n"), - static_cast<int> (batch_size) + ACE_static_cast (int, batch_size) )); } for (size_t nevent = 0; nevent < batch_size; ++nevent) @@ -389,8 +389,8 @@ SequencePushConsumer_i::push_structured_events ( this->may_discard_ = batch_size; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Sequence Consumer failing at event # %d. Expecting %d duplicates.\n"), - static_cast<int> (this->received_), - static_cast<int> (nevent + 1) + ACE_static_cast (int, this->received_), + ACE_static_cast (int, nevent + 1) )); ACE_THROW (CORBA::UNKNOWN()); ACE_CHECK; @@ -420,7 +420,7 @@ SequencePushConsumer_i::push_structured_events ( this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Sequence Consumer received wrong filterable data name.%s. Expecting serial_number\n"), - static_cast<const char *> (notification.filterable_data[0].name) + ACE_static_cast (const char *, notification.filterable_data[0].name) )); } } @@ -536,7 +536,7 @@ AnyPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Any Consumer received event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -548,7 +548,7 @@ AnyPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Any Consumer received correct event %d.\n"), - static_cast<int> (seq) + ACE_static_cast (int, seq) )); } } @@ -558,8 +558,8 @@ AnyPushConsumer_i::check_serial_number (CORBA::ULong seq) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Any Consumer: service received event %d; Notify discarded %d*.\n"), - static_cast<int> (seq), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, seq), + ACE_static_cast (int, this->serial_number_) )); } this->received_ += seq - this->serial_number_; @@ -569,8 +569,8 @@ AnyPushConsumer_i::check_serial_number (CORBA::ULong seq) this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Any Consumer received notifications out of sequence. Expecting %d received %d.\n"), - static_cast<int> (this->serial_number_), - static_cast<int> (seq) + ACE_static_cast (int, this->serial_number_), + ACE_static_cast (int, seq) )); } this->serial_number_ = seq + 1; @@ -602,7 +602,7 @@ AnyPushConsumer_i::push ( this->may_discard_ = 1; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Any Consumer failing at event # %d.\n"), - static_cast<int> (this->received_) + ACE_static_cast (int, this->received_) )); ACE_THROW (CORBA::UNKNOWN()); ACE_CHECK; @@ -641,7 +641,7 @@ AnyPushConsumer_i::push ( this->problem_ = true; ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) Any Consumer received wrong filterable data name in structured event: %s. Expecting serial_number\n"), - static_cast<const char *> (notification->filterable_data[0].name) + ACE_static_cast (const char *, notification->filterable_data[0].name) )); } } @@ -979,8 +979,8 @@ int Consumer_Main::init (int argc, char *argv[] ACE_ENV_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Consumer: Listening for %d structured events. Failing every %d events.\n"), - static_cast<int> (this->expect_), - static_cast<int> (this->fail_) + ACE_static_cast (int, this->expect_), + ACE_static_cast (int, this->fail_) )); } this->structured_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_); @@ -994,8 +994,8 @@ int Consumer_Main::init (int argc, char *argv[] ACE_ENV_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Consumer: Listening for %d sequence events. Failing every %d events.\n"), - static_cast<int> (this->expect_), - static_cast<int> (this->fail_) + ACE_static_cast (int, this->expect_), + ACE_static_cast (int, this->fail_) )); } this->sequence_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_); @@ -1009,8 +1009,8 @@ int Consumer_Main::init (int argc, char *argv[] ACE_ENV_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Consumer: Listening for %d CORBA::Any events. Failing every %d events.\n"), - static_cast<int> (this->expect_), - static_cast<int> (this->fail_) + ACE_static_cast (int, this->expect_), + ACE_static_cast (int, this->fail_) )); } this->any_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_); @@ -1045,7 +1045,7 @@ Consumer_Main::save_ids() if (idf != 0) { int endflag = 12345; - int imode = static_cast<int> (this->mode_); + int imode = ACE_static_cast (int, this->mode_); ACE_OS::fprintf (idf, "%d,%d,%d,%d,%d,%d,%d,\n", static_cast<int> (imode), @@ -1253,7 +1253,7 @@ Consumer_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Reconnect to event channel %d\n"), - static_cast<int> (this->ec_id_) + ACE_static_cast (int, this->ec_id_) )); } } @@ -1289,7 +1289,7 @@ Consumer_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Connect to Existing event channel %d\n"), - static_cast<int> (this->ec_id_) + ACE_static_cast (int, this->ec_id_) )); } // kill the channel filename so we don't overwrite the file @@ -1362,13 +1362,13 @@ Consumer_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "w"); if (chf != 0) { - fprintf (chf, "%d\n", static_cast<int> (this->ec_id_)); + ACE_OS::fprintf (chf, "%d\n", static_cast<int> (this->ec_id_)); fclose (chf); } } } -CosNotifyChannelAdmin::AdminID default_admin_id = static_cast<CosNotifyChannelAdmin::AdminID> (-1); +CosNotifyChannelAdmin::AdminID default_admin_id = ACE_static_cast (CosNotifyChannelAdmin::AdminID, -1); void Consumer_Main::init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL) @@ -1415,7 +1415,7 @@ Consumer_Main::init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Reconnect to consumer admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast (int, this->sa_id_) )); } } @@ -1482,7 +1482,7 @@ Consumer_Main::init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Create new consumer admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast (int, this->sa_id_) )); } } @@ -1491,7 +1491,7 @@ Consumer_Main::init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: connect to consumer admin failed %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast (int, this->sa_id_) )); } } @@ -1514,7 +1514,7 @@ Consumer_Main::init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy supplier %d\n"), - static_cast<int> (this->structured_proxy_id_) + ACE_static_cast (int, this->structured_proxy_id_) )); } } @@ -1536,7 +1536,7 @@ Consumer_Main::init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Create new structured proxy %d\n"), - static_cast<int> (this->structured_proxy_id_) + ACE_static_cast (int, this->structured_proxy_id_) )); } } @@ -1602,7 +1602,7 @@ Consumer_Main::init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); } } @@ -1632,7 +1632,7 @@ Consumer_Main::init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Create new sequence proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); } } @@ -1644,7 +1644,7 @@ Consumer_Main::init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Consumer: Received wrong type of push supplier proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); ACE_THROW (CORBA::BAD_PARAM()); @@ -1719,30 +1719,30 @@ Consumer_Main::init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); } else { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Get proxy supplier %d returned nil\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); } } ACE_CATCHANY { - ACE_DEBUG ((LM_DEBUG, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Consumer: Get proxy supplier %d threw exception\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT ("To wit:")); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT ("Error:")); } ACE_CATCHALL { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) Consumer: Get proxy supplier %d threw exception\n"), - static_cast<int> (this->any_proxy_id_) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Error: (%P|%t) Consumer: Get proxy supplier %d threw exception\n"), + ACE_static_cast (int, this->any_proxy_id_) )); } ACE_ENDTRY; @@ -1761,7 +1761,7 @@ Consumer_Main::init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Create new Any proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); } } @@ -1773,7 +1773,7 @@ Consumer_Main::init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Consumer: Received wrong type of push supplier proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); ACE_THROW (CORBA::BAD_PARAM()); } @@ -1836,7 +1836,7 @@ int Consumer_Main::fini (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) destroy admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast(int, this->sa_id_) )); } this->sa_->destroy(); @@ -1851,21 +1851,13 @@ int Consumer_Main::run (ACE_ENV_SINGLE_ARG_DECL) { int result = 0; - ////////////////////////////////// - // Run the event loop for the ORB. - // Initial run to initialize the orb - ACE_Time_Value tv(1,0); - this->orb_->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - while (this->structured_push_consumer_.received () < this->expect_ && this->sequence_push_consumer_.received () < this->expect_ && this->any_push_consumer_.received () < this->expect_ ) { - ACE_Time_Value work_tv(1,0); - // keep the orb alive -- listenting for reconnect - this->orb_->perform_work (work_tv ACE_ENV_ARG_PARAMETER); + ACE_Time_Value tv(0, 100 * 1000); + this->orb_->run(tv ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN(-1); } @@ -1902,8 +1894,7 @@ main (int argc, char *argv[]) } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Consumer::main\t\n"); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: Consumer::main\t\n"); result = -1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h index b6326ac31d7..0f21447744e 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h @@ -16,6 +16,11 @@ #ifndef RECONNECTNG_CONSUMER_H #define RECONNECTNG_CONSUMER_H +//#if defined(_MSC_VER) && (_MSC_VER >= 1200) +//#pragma warning(pop) +//#endif /* _MSC_VER */ + + #include "orbsvcs/CosNotifyChannelAdminC.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/NotifyExtS.h" diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp index 6e9f4515a11..5c763c89df3 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp @@ -449,7 +449,7 @@ Supplier_Main::save_ids() if (idf != 0) { int endflag = 12345; - int imode = static_cast<int> (this->mode_); + int imode = ACE_static_cast (int, this->mode_); ACE_OS::fprintf (idf, "%d,%d,%d,%d,%d,%d,%d,\n", static_cast<int> (imode), @@ -643,7 +643,7 @@ Supplier_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Reconnect to event channel %d\n"), - static_cast<int> (this->ec_id_) + ACE_static_cast (int, this->ec_id_) )); } } @@ -679,7 +679,7 @@ Supplier_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Connect to Existing event channel %d\n"), - static_cast<int> (this->ec_id_) + ACE_static_cast (int, this->ec_id_) )); } // kill the channel filename so we don't overwrite the file @@ -752,13 +752,13 @@ Supplier_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "w"); if (chf != 0) { - fprintf (chf, "%d\n", static_cast<int> (this->ec_id_)); + ACE_OS::fprintf (chf, "%d\n", static_cast<int> (this->ec_id_)); fclose (chf); } } } -CosNotifyChannelAdmin::AdminID default_admin_id = static_cast<CosNotifyChannelAdmin::AdminID> (-1); +CosNotifyChannelAdmin::AdminID default_admin_id = ACE_static_cast (CosNotifyChannelAdmin::AdminID, -1); void Supplier_Main::init_supplier_admin (ACE_ENV_SINGLE_ARG_DECL) @@ -777,7 +777,7 @@ Supplier_Main::init_supplier_admin (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Reconnect to supplier admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast (int, this->sa_id_) )); } } @@ -826,7 +826,7 @@ Supplier_Main::init_supplier_admin (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Create new supplier admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast (int, this->sa_id_) )); } } @@ -851,7 +851,7 @@ Supplier_Main::init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy supplier %d\n"), - static_cast<int> (this->structured_proxy_id_) + ACE_static_cast (int, this->structured_proxy_id_) )); } } @@ -873,7 +873,7 @@ Supplier_Main::init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"), - static_cast<int> (this->structured_proxy_id_) + ACE_static_cast (int, this->structured_proxy_id_) )); } } @@ -907,7 +907,7 @@ Supplier_Main::init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"), - static_cast<int> (this->structured_proxy_id_) + ACE_static_cast (int, this->structured_proxy_id_) )); ACE_THROW (CORBA::UNKNOWN()); @@ -937,7 +937,7 @@ Supplier_Main::init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); } } @@ -959,7 +959,7 @@ Supplier_Main::init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); } } @@ -971,7 +971,7 @@ Supplier_Main::init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); ACE_THROW (CORBA::UNKNOWN()); } @@ -995,7 +995,7 @@ Supplier_Main::init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); ACE_THROW (CORBA::UNKNOWN()); } @@ -1024,7 +1024,7 @@ Supplier_Main::init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); } } @@ -1046,7 +1046,7 @@ Supplier_Main::init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); } } @@ -1058,7 +1058,7 @@ Supplier_Main::init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"), - static_cast<int> (this->any_proxy_id_) + ACE_static_cast (int, this->any_proxy_id_) )); ACE_THROW (CORBA::UNKNOWN()); } @@ -1082,7 +1082,7 @@ Supplier_Main::init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"), - static_cast<int> (this->sequence_proxy_id_) + ACE_static_cast (int, this->sequence_proxy_id_) )); ACE_THROW (CORBA::UNKNOWN()); } @@ -1137,7 +1137,7 @@ int Supplier_Main::fini (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) destroy admin %d\n"), - static_cast<int> (this->sa_id_) + ACE_static_cast(int, this->sa_id_) )); } this->sa_->destroy(); @@ -1186,7 +1186,7 @@ void Supplier_Main::send_structured_event (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Supplier push structured event %d\n"), - static_cast<int> (serial_number_) + ACE_static_cast (int, serial_number_) )); } @@ -1236,7 +1236,7 @@ void Supplier_Main::send_sequence_event (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Supplier push sequence events %d\n"), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, this->serial_number_) )); } @@ -1254,7 +1254,7 @@ void Supplier_Main::send_any_event (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P,%t) Supplier push any event %d\n"), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, this->serial_number_) )); } @@ -1272,11 +1272,8 @@ int Supplier_Main::run (ACE_ENV_SINGLE_ARG_DECL) size_t send = 0; while ( send < this->send_) { - // keep the orb alive -- listenting for reconnect - if (this->orb_->work_pending ()) - { - this->orb_->perform_work (); - } + ACE_Time_Value tv(0, 100 * 1000); + orb_->run(tv); if (this->pause_ != 0 && send == this->pause_) { @@ -1284,7 +1281,7 @@ int Supplier_Main::run (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier paused after %d events\n"), - static_cast<int> (this->pause_) + ACE_static_cast (int, this->pause_) )); } reconnections = this->reconnection_callback_.reconnect_count (); @@ -1305,7 +1302,7 @@ int Supplier_Main::run (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Supplier no longer paused. Next s# %d\n"), - static_cast<int> (this->serial_number_) + ACE_static_cast (int, this->serial_number_) )); } paused = false; @@ -1366,8 +1363,7 @@ main (int argc, char *argv[]) } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Supplier::main\t\n"); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: Supplier::main\t\n"); result = -1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf index e9cc17ec979..73faddd571b 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf @@ -1,6 +1,6 @@ - +# static TAO_CosNotify_Service "-AllowReconnect" - +# # This should fail because event perstence requires topology persistence - +# dynamic Event_Persistence Service_Object* TAO_CosNotification:_make_Standard_Event_Persistence() "-v -file_path ./event_persist.db"
\ No newline at end of file diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf index be282852191..47da73eb47f 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf @@ -1,10 +1,7 @@ - +# ## -DispatchingThreads N - creates a thread pool for dispatching and consumer side filter eval ## -SourceThreads M - creates a thread pool for lookup and supplier side filter eval - -## This prevents worker threads from joining the tp reactor -##static Client_Strategy_Factory "-ORBClientConnectionHandler rw" - +# static TAO_CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect" diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf index 827376b2a71..a58f9d9aef7 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf @@ -1,5 +1,5 @@ static TAO_CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect" - +# dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_XML_Topology_Factory() "-base_path ./reconnect_test" dynamic Event_Persistence Service_Object* TAO_CosNotification_Persist:_make_Standard_Event_Persistence() "-file_path ./event_persist.db" diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf index fc890d01fc2..3ff9ed61cbb 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf @@ -1,4 +1,4 @@ - +# static TAO_CosNotify_Service "-AllowReconnect" diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf index 6c07255dcb2..7edf3354d1e 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf @@ -1,4 +1,4 @@ static TAO_CosNotify_Service "-AllowReconnect" - +# dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_XML_Topology_Factory() "-v -base_path ./reconnect_test" dynamic Event_Persistence Service_Object* TAO_CosNotification_Persist:_make_Standard_Event_Persistence() "-v -file_path ./event_persist.db" diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp index 188dc2a032c..81ad459a1fe 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp @@ -2,6 +2,7 @@ #include "ace/OS_NS_unistd.h" #include "Notify_Sequence_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/TimeBaseC.h" #include "common.h" #include "tao/debug.h" @@ -10,13 +11,14 @@ Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer ( const char* name, unsigned int low, unsigned int high, - CORBA::Boolean& done) + Notify_Test_Client& client) : name_ (name), low_ (low), high_ (high), count_ (0), - done_ (done) + client_ (client) { + this->client_.consumer_start (this); } @@ -68,6 +70,8 @@ Notify_Sequence_Push_Consumer::push_structured_events ( ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + ACE_DEBUG((LM_DEBUG, "-")); + CORBA::ULong length = events.length (); if (TAO_debug_level) @@ -103,7 +107,7 @@ Notify_Sequence_Push_Consumer::push_structured_events ( this->count_++; if (this->count_ > this->high_) { - this->done_ = 1; + this->client_.consumer_done (this); ACE_ERROR ((LM_ERROR, ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too " "many events received.\n"))); @@ -111,7 +115,7 @@ Notify_Sequence_Push_Consumer::push_structured_events ( } else if (this->count_ == this->low_) { - this->done_ = 1; + this->client_.consumer_done (this); } else { diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h index ea4ac1dadb6..7a11dd60c37 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_SequencePushConsumer.h" +class Notify_Test_Client; class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer { @@ -27,7 +28,7 @@ public: Notify_Sequence_Push_Consumer (const char* name, unsigned int low, unsigned int high, - CORBA::Boolean& done); + Notify_Test_Client& client); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin ACE_ENV_ARG_DECL) @@ -42,7 +43,7 @@ protected: unsigned int low_; unsigned int high_; unsigned int count_; - CORBA::Boolean& done_; + Notify_Test_Client& client_; }; #endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp index ac2b673cd99..dc0824b8ff0 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp @@ -124,7 +124,7 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, Notify_Sequence_Push_Consumer ("consumer1", low, high, - client->done ()), + *client), CORBA::NO_MEMORY ()); consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER); @@ -183,30 +183,18 @@ int main (int argc, char* argv[]) sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - unsigned int try_count = 0; - unsigned int try_max = (high - low) * 2; - while (true) - { - // See if we can get any more events - if (client.done ()) - { - ACE_OS::sleep (3); - try_count++; - if (try_count >= try_max) - break; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } + client.ORB_run( 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, - "Consumer exception: "); + ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: "); status = 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp index 62127227df9..db0881c717e 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -22,30 +23,53 @@ // ****************************************************************** static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static int max_events = 6; // 6 sets of 16 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -62,23 +86,23 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'e': - max_events = 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); - } + { + case 'e': + max_events = 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; @@ -92,8 +116,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -102,97 +126,86 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvents (void) +SendEvents (int id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::EventBatch events; - - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup ("test event"); - - - event.header.variable_header.length (2); - event.header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - event.header.variable_header[1].name = - CORBA::string_dup (CosNotification::Timeout); - event.header.variable_header[1].value <<= (TimeBase::TimeT) - ((max_events - count) * 60); - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup ("objectId"); - event.filterable_data[0].value <<= (CORBA::Long)0xdad; - - event.filterable_data[1].name = CORBA::string_dup ("type"); - event.filterable_data[1].value <<= types[count % 3]; - - event.filterable_data[2].name = CORBA::string_dup ("enum"); - event.filterable_data[2].value <<= (CORBA::Long) - (count > max_events / 2 ? - -count : count); - - events.length (16); - events[0] = event; - - CosNotification::StructuredEvent revents[15]; - for (int z = 0; z < 15; z++) - { - revents[z].header.fixed_header.event_type.domain_name = - CORBA::string_dup ("Orbix 2000 Demos"); - revents[z].header.fixed_header.event_type.type_name = - CORBA::string_dup ("Extra Events"); - - revents[z].header.fixed_header.event_name = CORBA::string_dup ("test revents[z]"); - - revents[z].header.variable_header.length (1); - revents[z].header.variable_header[0].name = - CORBA::string_dup (CosNotification::Priority); - revents[z].header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - - revents[z].filterable_data.length (3); - revents[z].filterable_data[0].name = CORBA::string_dup ("objectId"); - revents[z].filterable_data[0].value <<= (CORBA::Long)z; - - revents[z].filterable_data[1].name = CORBA::string_dup ("type"); - revents[z].filterable_data[1].value <<= types[2 - (count % 3)]; - - revents[z].filterable_data[2].name = CORBA::string_dup ("enum"); - revents[z].filterable_data[2].value <<= (CORBA::Long) - (count > max_events / 2 ? - -count : count); - events[z + 1] = revents[z]; - } - count++; - - if (count >= max_events) - { - done = 1; - } + static const char* types[] = { "good", "bad", "ugly" }; + CosNotification::EventBatch events; + + CosNotification::StructuredEvent event; + event.header.fixed_header.event_type.domain_name = + CORBA::string_dup ("Orbix 2000 Demos"); + event.header.fixed_header.event_type.type_name = + CORBA::string_dup ("Sequence Notification Push Demo Event"); + + event.header.fixed_header.event_name = CORBA::string_dup ("test event"); + + + event.header.variable_header.length (2); + event.header.variable_header[0].name = + CORBA::string_dup (CosNotification::Priority); + event.header.variable_header[0].value <<= (CORBA::Short) + (id > max_events / 2 ? + -id : id); + event.header.variable_header[1].name = + CORBA::string_dup (CosNotification::Timeout); + event.header.variable_header[1].value <<= (TimeBase::TimeT) + ((max_events - id) * 60); + event.filterable_data.length (3); + event.filterable_data[0].name = CORBA::string_dup ("objectId"); + event.filterable_data[0].value <<= (CORBA::Long)0xdad; + + event.filterable_data[1].name = CORBA::string_dup ("type"); + event.filterable_data[1].value <<= types[id % 3]; + + event.filterable_data[2].name = CORBA::string_dup ("enum"); + event.filterable_data[2].value <<= (CORBA::Long) + (id > max_events / 2 ? + -id : id); + + events.length (16); + events[0] = event; + + CosNotification::StructuredEvent revents[15]; + for (int z = 0; z < 15; z++) + { + revents[z].header.fixed_header.event_type.domain_name = + CORBA::string_dup ("Orbix 2000 Demos"); + revents[z].header.fixed_header.event_type.type_name = + CORBA::string_dup ("Extra Events"); + + revents[z].header.fixed_header.event_name = CORBA::string_dup ("test revents[z]"); + + revents[z].header.variable_header.length (1); + revents[z].header.variable_header[0].name = + CORBA::string_dup (CosNotification::Priority); + revents[z].header.variable_header[0].value <<= (CORBA::Short) + (id > max_events / 2 ? + -id : id); + + revents[z].filterable_data.length (3); + revents[z].filterable_data[0].name = CORBA::string_dup ("objectId"); + revents[z].filterable_data[0].value <<= (CORBA::Long)z; + + revents[z].filterable_data[1].name = CORBA::string_dup ("type"); + revents[z].filterable_data[1].value <<= types[2 - (id % 3)]; + + revents[z].filterable_data[2].name = CORBA::string_dup ("enum"); + revents[z].filterable_data[2].value <<= (CORBA::Long) + (id > max_events / 2 ? + -id : id); + events[z + 1] = revents[z]; + } - ACE_TRY_NEW_ENV - { - supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + ACE_TRY_NEW_ENV + { + supplier_1->send_events (events ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + } + ACE_ENDTRY; } static void @@ -202,8 +215,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // start up the supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_SequencePushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_SequencePushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -219,66 +232,76 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { + ACE_Auto_Ptr< sig_i > sig_impl; int status = 0; ACE_TRY_NEW_ENV + { + Supplier_Client client; + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) + 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 the ior_output_file exists, output the ior to it + 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); + if (!CORBA::is_nil (admin.in ())) + { + create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d events...\n", max_events)); + for (int i = 0; i < max_events; ++i) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER); + ACE_DEBUG((LM_DEBUG, "+")); + SendEvents (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events)); - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sig_impl->wait_for_completion(); - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_OS::unlink (ior_output_file); - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvents (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/common.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/common.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl @@ -4,4 +4,7 @@ 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/Sequence_Multi_ETCL_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf index 7a531569a88..751ea3700a2 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf @@ -1,4 +1,4 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml index 9f391daaefa..d03fcf8be90 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl index 5f25db11995..4cd49864e2f 100755 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl @@ -30,14 +30,8 @@ $SEC = new PerlACE::Process ("Sequence_Consumer"); $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; -if ($NS->Spawn () == -1) { - exit 1; -} - -if ($TS->Spawn () == -1) { - $NS->Kill (); - exit 1; -} +$NS->Spawn (); +$TS->Spawn (); if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; @@ -61,12 +55,16 @@ if (PerlACE::waitforfile_timed ($ior, 20) == -1) { $SEC->Arguments($client_args); $client = $SEC->SpawnWaitKill (60); - -$SES->Kill (); if ($client != 0) { print STDERR "ERROR: Sequence_Consumer did not run properly\n"; $status = 1; } +$server = $SES->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} $TS->Kill (); $NS->Kill (); diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp index 5b3e48d271f..c376bd3114f 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp @@ -2,6 +2,7 @@ #include "ace/OS_NS_unistd.h" #include "Notify_Sequence_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/TimeBaseC.h" #include "common.h" #include "tao/debug.h" @@ -11,14 +12,15 @@ Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer ( CORBA::Short policy, unsigned int low, unsigned int high, - int& done) + Notify_Test_Client& client) : name_ (name), discard_policy_ (policy), low_ (low), high_ (high), count_ (0), - done_ (done) + client_ (client) { + this->client_.consumer_start (this); } @@ -75,6 +77,8 @@ Notify_Sequence_Push_Consumer::push_structured_events( ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { + ACE_DEBUG((LM_DEBUG, "-")); + CORBA::ULong length = events.length(); if (TAO_debug_level) @@ -111,14 +115,14 @@ Notify_Sequence_Push_Consumer::push_structured_events( this->count_++; if (this->count_ > this->high_) { - this->done_ = 2; + this->client_.consumer_done (this); ACE_ERROR((LM_ERROR, ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too " "many events received.\n"))); } else if (this->count_ == this->low_) { - this->done_ = 1; + this->client_.consumer_done (this); } else { diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h index ab563bf0c89..7c673983ebc 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_SequencePushConsumer.h" +class Notify_Test_Client; class Notify_Sequence_Push_Consumer : public TAO_Notify_Tests_SequencePushConsumer { @@ -28,7 +29,7 @@ public: CORBA::Short policy, unsigned int low, unsigned int high, - int& done); + Notify_Test_Client& client); ~Notify_Sequence_Push_Consumer (); @@ -46,7 +47,7 @@ private: unsigned int low_; unsigned int high_; unsigned int count_; - int& done_; + Notify_Test_Client& client_; }; #endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp index 9cc7a728152..b273f6b327b 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp @@ -19,7 +19,6 @@ // ****************************************************************** static const char* ior = "file://supplier.ior"; -static int done = 0; static CORBA::Short discard_policy = CosNotification::FifoOrder; static unsigned int low = 2; // 10 static unsigned int high = 4; // 13 @@ -129,7 +128,7 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, discard_policy, low, high, - done), + *client), CORBA::NO_MEMORY ()); consumer_1->init(client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -218,30 +217,18 @@ int main (int argc, char* argv[]) sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - unsigned int try_count = 0; - unsigned int try_max = (high - low) * 2; - while (done <= 1) - { - // See if we can get any more events - if (done) - { - ACE_OS::sleep (3); - try_count++; - if (try_count >= try_max) - break; - } - if (orb->work_pending ()) - { - orb->perform_work (); - } - } + client.ORB_run( 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, - "Consumer exception: "); + ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: "); status = 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp index c37050f53c7..7c6028d7518 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" // FUZZ: disable check_for_streams_include #include "ace/streams.h" @@ -24,29 +25,53 @@ // ****************************************************************** static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static int max_events = 2; // 6 sets of 16 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -62,23 +87,23 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'e': - max_events = 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); - } + { + case 'e': + max_events = 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; @@ -92,8 +117,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -102,98 +127,87 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvents (void) +SendEvents (int id ACE_ENV_ARG_DECL) { const int MAX_EVENTS = 15; - if (start) - { - static int count = 0; - static const char* types[] = { "good", "bad", "ugly" }; - CosNotification::EventBatch events; - - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup("Sequence Notification Push Demo Event"); - - event.header.fixed_header.event_name = CORBA::string_dup("test event"); - - - event.header.variable_header.length (1); - event.header.variable_header[0].name = - CORBA::string_dup(CosNotification::Priority); - event.header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - - event.filterable_data.length (3); - event.filterable_data[0].name = CORBA::string_dup("Number"); - event.filterable_data[0].value <<= (CORBA::Long)10; - - event.filterable_data[1].name = CORBA::string_dup("Index"); - event.filterable_data[1].value <<= 0; - - event.filterable_data[2].name = CORBA::string_dup("enum"); - event.filterable_data[2].value <<= types[count % 3]; - - events.length(16); - events[0] = event; - - CosNotification::StructuredEvent revents[15]; - for(int z = 0; z < MAX_EVENTS; ++z) { - revents[z].header.fixed_header.event_type.domain_name = - CORBA::string_dup("Orbix 2000 Demos"); - revents[z].header.fixed_header.event_type.type_name = - CORBA::string_dup("Sequence Notification Push Demo Event"); - - revents[z].header.fixed_header.event_name = CORBA::string_dup("test revents[z]"); - - revents[z].header.variable_header.length (1); - revents[z].header.variable_header[0].name = - CORBA::string_dup(CosNotification::Priority); - revents[z].header.variable_header[0].value <<= (CORBA::Short) - (count > max_events / 2 ? - -count : count); - - revents[z].filterable_data.length (3); - revents[z].filterable_data[0].name = CORBA::string_dup("Number"); - - if (z % 2 == 0) { - revents[z].filterable_data[0].value <<= (CORBA::Long)20; - } else { - revents[z].filterable_data[0].value <<= (CORBA::Long)10; - } + static const char* types[] = { "good", "bad", "ugly" }; + CosNotification::EventBatch events; - revents[z].filterable_data[1].name = CORBA::string_dup("Index"); - revents[z].filterable_data[1].value <<= z+1; + CosNotification::StructuredEvent event; + event.header.fixed_header.event_type.domain_name = + CORBA::string_dup("Orbix 2000 Demos"); + event.header.fixed_header.event_type.type_name = + CORBA::string_dup("Sequence Notification Push Demo Event"); - revents[z].filterable_data[2].name = CORBA::string_dup("enum"); - revents[z].filterable_data[2].value <<= types[count % 3]; - events[z + 1] = revents[z]; - } - count++; + event.header.fixed_header.event_name = CORBA::string_dup("test event"); - if (count >= max_events) - { - done = 1; - } - ACE_TRY_NEW_ENV - { - ACE_DEBUG ((LM_DEBUG, "Sending events.\n")); + event.header.variable_header.length (1); + event.header.variable_header[0].name = + CORBA::string_dup(CosNotification::Priority); + event.header.variable_header[0].value <<= (CORBA::Short) + (id > max_events / 2 ? + -id : id); - supplier_1->send_events(events ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + event.filterable_data.length (3); + event.filterable_data[0].name = CORBA::string_dup("Number"); + event.filterable_data[0].value <<= (CORBA::Long)10; + + event.filterable_data[1].name = CORBA::string_dup("Index"); + event.filterable_data[1].value <<= 0; + + event.filterable_data[2].name = CORBA::string_dup("enum"); + event.filterable_data[2].value <<= types[id % 3]; + + events.length(16); + events[0] = event; + + CosNotification::StructuredEvent revents[15]; + for(int z = 0; z < MAX_EVENTS; ++z) { + revents[z].header.fixed_header.event_type.domain_name = + CORBA::string_dup("Orbix 2000 Demos"); + revents[z].header.fixed_header.event_type.type_name = + CORBA::string_dup("Sequence Notification Push Demo Event"); + + revents[z].header.fixed_header.event_name = CORBA::string_dup("test revents[z]"); + + revents[z].header.variable_header.length (1); + revents[z].header.variable_header[0].name = + CORBA::string_dup(CosNotification::Priority); + revents[z].header.variable_header[0].value <<= (CORBA::Short) + (id > max_events / 2 ? + -id : id); + + revents[z].filterable_data.length (3); + revents[z].filterable_data[0].name = CORBA::string_dup("Number"); + + if (z % 2 == 0) { + revents[z].filterable_data[0].value <<= (CORBA::Long)20; + } else { + revents[z].filterable_data[0].value <<= (CORBA::Long)10; + } + + revents[z].filterable_data[1].name = CORBA::string_dup("Index"); + revents[z].filterable_data[1].value <<= z+1; + + revents[z].filterable_data[2].name = CORBA::string_dup("enum"); + revents[z].filterable_data[2].value <<= types[id % 3]; + events[z + 1] = revents[z]; + } + + ACE_TRY_NEW_ENV + { + ACE_DEBUG ((LM_DEBUG, "Sending events.\n")); + + supplier_1->send_events(events ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + } + ACE_ENDTRY; } static void @@ -203,8 +217,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // startup the first supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_SequencePushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_SequencePushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -220,68 +234,78 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { + ACE_Auto_Ptr< sig_i > sig_impl; int status = 0; ACE_TRY_NEW_ENV + { + Supplier_Client client; + + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + 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; - if (status == 0) + CORBA::String_var ior = + orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // If the ior_output_file exists, output the ior to it + 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); + if (!CORBA::is_nil (admin.in ())) + { + create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d events...\n", max_events)); + for (int i = 0; i < max_events; ++i) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 - ACE_ENV_ARG_PARAMETER); + ACE_DEBUG((LM_DEBUG, "+")); + SendEvents (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events)); - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sig_impl->wait_for_completion(); - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_OS::unlink (ior_output_file); - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvents (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/common.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/common.cpp +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl @@ -4,4 +4,7 @@ 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/Sequence_Multi_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf index d953e04618e..0e4ab7e2a46 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf @@ -1,5 +1,5 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml index 722ec7caa7e..829d9ba2935 100644 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl index 2079ccd1d2f..3abd9a03714 100755 --- a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl @@ -30,14 +30,8 @@ $SEC = new PerlACE::Process ("Sequence_Consumer"); $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; -if ($NS->Spawn () == -1) { - exit 1; -} - -if ($TS->Spawn () == -1) { - $NS->Kill (); - exit 1; -} +$NS->Spawn (); +$TS->Spawn (); if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; @@ -83,13 +77,17 @@ foreach $constraintString (@constraintList) { $i = $i + 1; $client = $SEC->SpawnWaitKill (60); - - $SES->Kill (); if ($client != 0) { print STDERR "ERROR: Sequence_Consumer did not run properly\n"; $status = 1; last; } + $server = $SES->WaitKill(5); + if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; + } } } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp index e018c1114ab..18a1c92a0d2 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp @@ -1,91 +1,107 @@ -/* -*- C++ -*- */ // $Id$ - #include "Notify_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "tao/debug.h" -CORBA::Short Notify_Push_Consumer::event_count = 0; - -Notify_Push_Consumer::Notify_Push_Consumer (const char* name) - : name_ (name) +Notify_Push_Consumer::Notify_Push_Consumer (const char* name, + int sent, + bool useFilter, + Notify_Test_Client& client) +: name_ (name) +, sent_(sent) +, received_(0) +, expected_(sent) +, useFilter_(useFilter) +, client_(client) { -} + // By sending multiples of 9, we ensure that all combinations of group and type + // are possible, and that our calculations come out evenly. + ACE_ASSERT(sent % 9 == 0); + // This test currently only supports one expression + if (useFilter) + { + // group != 0 && type != 1 + expected_ = sent_ * 4 / 9; + } -CORBA::Short -Notify_Push_Consumer::get_count () -{ - return event_count; + this->client_.consumer_start (this); } +void +Notify_Push_Consumer::_connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, + CosNotifyChannelAdmin::EventChannel_ptr notify_channel ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_UNUSED_ARG(notify_channel); + CosNotifyComm::StructuredPushConsumer_var objref = + this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + CosNotifyChannelAdmin::ProxySupplier_var proxysupplier = + consumer_admin->obtain_notification_push_supplier ( + CosNotifyChannelAdmin::STRUCTURED_EVENT, + proxy_id_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; -static const char* -Any_String (const CORBA::Any& any) -{ - static char out[256] = ""; - CORBA::Short s; - CORBA::UShort us; - CORBA::Long l; - CORBA::ULong ul; - CORBA::ULongLong ull; - const char* str; + this->proxy_ = + CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow ( + proxysupplier.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - if (any >>= s) - { - ACE_OS::sprintf (out, "%d", s); - } - else if (any >>= us) - { - ACE_OS::sprintf (out, "%u", us); - } - else if (any >>= l) - { - ACE_OS::sprintf (out, "%d", l); - } - else if (any >>= ul) - { - ACE_OS::sprintf (out, "%u", ul); - } - else if (any >>= str) - { - ACE_OS::strcpy (out, str); - } - else if (any >>= ull) - { -#if defined (ACE_LACKS_LONGLONG_T) - ACE_OS::strcpy (out, ull.as_string (out)); -#else - // @@@@ (JP) Need to cast to signed int64 to cast to - // double on Win32, but this hack may not fly on - // other platforms. - double temp = (double) (CORBA::LongLong) ull; - ACE_OS::sprintf (out, "%.0f", temp); -#endif /* ACE_LACKS_LONGLONG_T */ - } - else - { - ACE_OS::strcpy (out, "Unsupported Any Type"); - } + this->proxy_->connect_structured_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - return out; + // give ownership to POA + this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; } +static void validate_expression(bool expr, const char* msg) +{ + if (! expr) + { + ACE_ERROR((LM_ERROR, "Error: %s\n", msg)); + } +} + +#define validate(expr) validate_expression(expr, #expr) void Notify_Push_Consumer::push_structured_event ( - const CosNotification::StructuredEvent& event - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) + const CosNotification::StructuredEvent& event + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s %d (sent recv) %s %s\n", - Any_String (event.filterable_data[1].value), - event_count, - (const char*)event.filterable_data[0].name, - Any_String (event.filterable_data[0].value))); + ACE_DEBUG((LM_DEBUG, "-")); + received_++; + + CORBA::ULong id = 0; + CORBA::ULong group = 0; + CORBA::ULong type = 0; + + ACE_ASSERT(event.filterable_data.length() == 3); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[0].name.in(), "id") == 0); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[1].name.in(), "group") == 0); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[2].name.in(), "type") == 0); + event.filterable_data[0].value >>= id; + event.filterable_data[1].value >>= group; + event.filterable_data[2].value >>= type; + + if (useFilter_) + validate(type != 1 && group != 0); - event_count ++; + if (received_ > expected_) + { + ACE_ERROR((LM_ERROR, "\nError: Expected %d, Received %d\n", expected_, received_)); + this->client_.consumer_done (this); + return; + } + if (received_ >= expected_) + { + ACE_DEBUG((LM_DEBUG, "\nConsumer received %d events.\n", received_)); + this->client_.consumer_done (this); + return; + } } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h index 113fbc3030b..833b1be664b 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h @@ -20,21 +20,27 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; -class Notify_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer +class Notify_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer { public: - Notify_Push_Consumer (const char* name); + Notify_Push_Consumer (const char* name, int sent, bool useFilter, Notify_Test_Client& client); - static CORBA::Short get_count (); + void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, + CosNotifyChannelAdmin::EventChannel_ptr ec ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); private: - void push_structured_event (const CosNotification::StructuredEvent& - ACE_ENV_ARG_DECL) + void push_structured_event (const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - - static CORBA::Short event_count; +private: ACE_CString name_; + CORBA::Long sent_; + CORBA::Long received_; + CORBA::Long expected_; + bool useFilter_; + Notify_Test_Client& client_; }; #endif /* NOTIFY_PUSH_SUPPLIER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc b/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc index 2bfe6d28614..88f7038b442 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc @@ -13,7 +13,7 @@ project(*Ntf Struct Cons): notifytest { exename = Structured_Consumer Source_Files { - controlC.cpp + goC.cpp Notify_Push_Consumer.cpp Structured_Consumer.cpp } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp index 54406640c59..7f41538007e 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp @@ -1,33 +1,25 @@ // $Id$ -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" +#include "goC.h" +#include "Notify_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/CosNotifyChannelAdminC.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" -#include "controlC.h" -#include "Notify_Push_Consumer.h" -#include "Notify_Test_Client.h" -#include "tao/debug.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "tao/debug.h" -static CORBA::Boolean filter = 0; -static CORBA::Short num_events = 0; -static CORBA::Short num_consumers = 0; +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_strings.h" -#define GRAMMAR "EXTENDED_TCL" +static const char* ior = "file://supplier.ior"; +static int numEvents = 90; +static Notify_Push_Consumer* consumer = 0; +static bool useFilter = false; -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static const char* GRAMMAR = "TCL"; class Consumer_Client : public Notify_Test_Client { @@ -35,204 +27,132 @@ 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, "fn:s:c:"); + ACE_Get_Opt get_opts (argc, argv, "fe:"); int x; while ((x = get_opts ()) != -1) switch (x) - { - case 'f': - filter = 1; - break; - - case 'n': - num_events = atoi (get_opts.optarg); - break; + { + case 'e': + numEvents = atoi (get_opts.optarg); + break; - case 'c': - num_consumers = atoi (get_opts.optarg); - break; + case 'f': + useFilter = true; + break; default: ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "[-f] -n <num events> -c <num consumers> " - "-ORBInitRef <Naming Service Location>" - "\n", - argv [0]), - -1); - } + "usage: %s -n <num events> [-f]\n", argv [0]), -1); + } return 0; // successful parse } static void -create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, - Notify_Test_Client* client - ACE_ENV_ARG_DECL) +create_consumer (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, + CosNotifyChannelAdmin::EventChannel_ptr ec, + Notify_Test_Client* client + ACE_ENV_ARG_DECL) { - Notify_Push_Consumer* consumer = 0; ACE_NEW_THROW_EX (consumer, - Notify_Push_Consumer ("Consumer"), - CORBA::NO_MEMORY ()); + Notify_Push_Consumer ("Consumer", numEvents, useFilter, *client), + CORBA::NO_MEMORY ()); consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - consumer->connect (admin ACE_ENV_ARG_PARAMETER); + consumer->_connect (admin, ec ACE_ENV_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); + 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", 1 ACE_ENV_ARG_PARAMETER); - if (status == 0) + CosNotifyChannelAdmin::AdminID adminid = 0; + CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin = + ec->new_for_consumers(CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_ASSERT(! CORBA::is_nil (consumer_admin.in ())); + + if (useFilter) + { + CosNotifyFilter::FilterFactory_var ffact = + ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CosNotifyFilter::Filter_var filter = + ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (filter.in ())) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("NotifyEventChannelFactory", - 1 - ACE_ENV_ARG_PARAMETER); - - - CosNotifyChannelAdmin::AdminID adminid = 0; - CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin = - ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); - - ACE_TRY_CHECK; - - // Filter Section - - if (filter) - { - CosNotifyFilter::FilterFactory_var ffact = - ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CosNotifyFilter::Filter_var filter = - ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (filter.in ())) - { - ACE_ERROR ((LM_ERROR, - " (%P|%t) Consumer unable to initialize filter.\n")); - return 1; - } - - CosNotifyFilter::ConstraintExpSeq constraint_list (1); - constraint_list.length (1); - - constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("Number == 100"); - - filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // apply filter - consumer_admin->add_filter (filter.in ()); - } - - // End Filter Section - - // start server - CosNaming::Name ctrl_name; - ctrl_name.length (1); - ctrl_name[0].id = CORBA::string_dup ("Supplier"); - - CosNaming::NamingContext_ptr naming_context = client.naming_context (); - CORBA::Object_var ctrl_obj = naming_context->resolve (ctrl_name - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (ctrl_obj.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%T) Consumer unable to find " - "Supplier Naming Context.\n")); - return 1; - } - - supplier_ctrl_var supplier = supplier_ctrl::_narrow (ctrl_obj.in ()); - - if (!CORBA::is_nil (consumer_admin.in ())) - { - for ( int ctr = 0; ctr < num_consumers; ctr ++) - create_consumers (consumer_admin.in (), &client ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Start Supplier - supplier->ctrl (1, num_events); - - // wait for Supplier - ACE_OS::sleep (5); - - CORBA::ORB_ptr orb = client.orb (); - while (!client.done ()) - { - if (orb->work_pending ()) - { - orb->perform_work (); - - if (filter) - { - if ((num_events / 3 * num_consumers) == - Notify_Push_Consumer::get_count ()) - client.done () = 1; - } - else - { - if (num_events * num_consumers == Notify_Push_Consumer::get_count ()) - client.done () = 1; - } - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "Consumer received event #%d\n", - Notify_Push_Consumer::get_count ())); - } - } - - // Are there any more events - num_events = Notify_Push_Consumer::get_count (); - - ACE_OS::sleep (5); - if (orb->work_pending ()) - orb->perform_work (); - - if (num_events != Notify_Push_Consumer::get_count ()) - status = 1; - - // cleanup - ec->destroy (); - orb->destroy (); - } + ACE_ERROR ((LM_ERROR, + " (%P|%t) Consumer unable to initialize filter.\n")); + return 1; } - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, "Consumer Exception:"); - status = 1; + CosNotifyFilter::ConstraintExpSeq constraint_list (1); + constraint_list.length (1); + + constraint_list[0].event_types.length (0); + constraint_list[0].constraint_expr = CORBA::string_dup ("type != 1 and group != 0"); + + filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + consumer_admin->add_filter (filter.in ()); } + + CORBA::ORB_ptr orb = client.orb (); + + CORBA::Object_var object = + 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; + + ACE_ASSERT(! CORBA::is_nil (sig.in ())); + + create_consumer (consumer_admin.in (), ec.in (), &client ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n")); + + sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "\nConsumer done.\n")); + + sig->done(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "\nError: Consumer:"); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp index 74a90e7f845..66ff260fb7f 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp @@ -1,50 +1,67 @@ // $Id$ -// ****************************************************************** -// Include Section -// ****************************************************************** +// A Standard simple supplier. +// All filtering is done on the consumer side. + +#include "Notify_StructuredPushSupplier.h" +#include "goS.h" +#include "Notify_Test_Client.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" -#include "Notify_StructuredPushSupplier.h" -#include "controlS.h" -#include "Notify_Test_Client.h" + #include "tao/debug.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_strings.h" +#include "ace/Auto_Ptr.h" -static CORBA::Boolean go = 0; -static CORBA::Short n_events = 1; static const char* ior_file = "supplier.ior"; static TAO_Notify_Tests_StructuredPushSupplier* supplier = 0; +static int num_events = 90; -// ****************************************************************** -// Subroutine Section -// ****************************************************************** - -class supplier_ctrl_i : public POA_supplier_ctrl +class sig_i : public POA_sig { public: - void ctrl (CORBA::Boolean flag, - CORBA::Short num_events - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - + sig_i(CORBA::ORB_ptr orb) + : orb_(orb) + , started_(false) + { + } + + void go (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + + void done (ACE_ENV_SINGLE_ARG_DECL) + 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 -supplier_ctrl_i::ctrl (CORBA::Boolean flag, - CORBA::Short num_events - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - go = flag; - n_events = num_events; -} + void wait_for_completion() + { + while (started_) { + ACE_Time_Value tv(0, 100 * 1000); // 100ms + orb_->run(tv); + } + } +private: + CORBA::ORB_ptr orb_; + bool started_; +}; static CosNotifyChannelAdmin::SupplierAdmin_ptr create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec @@ -53,73 +70,46 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ()); } int -setup_event () +send_event (int id) { - static int count = 0; - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("TAO Test Suite"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Filtered Structured Event Notification Svc test"); + event.header.fixed_header.event_type.domain_name = + CORBA::string_dup ("TAO Test Suite"); + event.header.fixed_header.event_type.type_name = + CORBA::string_dup ("Filtered Structured Event Notification Svc test"); - if (count % 3 == 0) - { - event.header.fixed_header.event_name = CORBA::string_dup ("String test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("String"); - event.filterable_data[0].value <<= "One Hundred"; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else if (count % 3 == 1) - { - event.header.fixed_header.event_name = CORBA::string_dup ("Short test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("Number"); - event.filterable_data[0].value <<= (CORBA::Short) 100; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else - { - event.header.fixed_header.event_name = CORBA::string_dup ("Short test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("Number"); - event.filterable_data[0].value <<= (CORBA::Short) 50; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } + event.header.fixed_header.event_name = CORBA::string_dup ("test"); + event.header.variable_header.length (1); - count++; + event.filterable_data.length (3); + event.filterable_data[0].name = CORBA::string_dup ("id"); + event.filterable_data[0].value <<= static_cast<CORBA::ULong>(id); + event.filterable_data[1].name = CORBA::string_dup ("group"); + event.filterable_data[1].value <<= static_cast<CORBA::ULong>(id % 3); + event.filterable_data[2].name = CORBA::string_dup ("type"); + // Divide by 3 first so that the type and group aren't synched + event.filterable_data[2].value <<= static_cast<CORBA::ULong>(id / 3 % 3); ACE_TRY_NEW_ENV - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "%d sent \n", count)); + { + ACE_DEBUG((LM_DEBUG, "+")); - supplier->send_event (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } + supplier->send_event (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, "Supplier Signal Exception: "); - } + { + ACE_PRINT_EXCEPTION (e, "\nError: Supplier: "); + } ACE_ENDTRY; return 0; @@ -130,8 +120,8 @@ static void create_supplier (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, ACE_ENV_ARG_DECL) { ACE_NEW_THROW_EX (supplier, - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_StructuredPushSupplier (), + CORBA::NO_MEMORY ()); supplier->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -140,90 +130,74 @@ static void create_supplier (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, ACE_CHECK; } -// ****************************************************************** -// Main Section -// ****************************************************************** - int main (int argc, char * argv[]) { - int status = 0; - + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV; - { - Notify_Test_Client client; - client.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + { + Notify_Test_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; + + ACE_ASSERT(! CORBA::is_nil(ec.in())); + + 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; + + CosNotifyChannelAdmin::SupplierAdmin_var admin = + create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); + ACE_ASSERT(! CORBA::is_nil (admin.in ())); - PortableServer::POA_ptr poa = client.root_poa (); + create_supplier (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("NotifyEventChannelFactory", - 0 - ACE_ENV_ARG_PARAMETER); + if (ior_file != 0) + { + CORBA::String_var ior = + client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - // register control with naming service - supplier_ctrl_i controller; - - CosNaming::Name ctrl_name (1); - ctrl_name.length (1); - ctrl_name[0].id = CORBA::string_dup ("Supplier"); - - PortableServer::ObjectId_var oid = - poa->activate_object (&controller); - - CosNaming::NamingContext_ptr naming_context = - client.naming_context (); - - CORBA::Object_var controller_obj = poa->id_to_reference (oid.in ()); - naming_context->bind (ctrl_name, controller_obj.in ()); - - int done = 0; - - CosNotifyChannelAdmin::SupplierAdmin_var admin = - create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); - - if (!CORBA::is_nil (admin.in ())) - { - create_supplier (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - - // Ready. So Write ior to file - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = orb->object_to_string (controller_obj.in ()); - FILE *fd = ACE_OS::fopen (ior_file, "w"); - if (fd == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for " - "writing IOR: %s", - ior_file), - 1); - ACE_OS::fprintf (fd, "%s", ior.in ()); - ACE_OS::fclose (fd); - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Supplier Ready.\n")); - - while ((!done) && (n_events > 0)) - { - if (go) - { - done = setup_event (); - n_events--; - } - - if (orb->work_pending ()) - orb->perform_work (); - } - - orb->destroy (); - } + FILE *output_file= ACE_OS::fopen (ior_file, "w"); + ACE_ASSERT (output_file != 0); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); } - ACE_CATCH (CORBA::Exception, e) + + ACE_DEBUG((LM_DEBUG, "Supplier ready...\n")); + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "Supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events; ++i) { - ACE_PRINT_EXCEPTION (e, "Supplier Exception: "); - status = 1; + ACE_DEBUG((LM_DEBUG, "+")); + send_event (i ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_file); + + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier: "); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/control.idl b/TAO/orbsvcs/tests/Notify/Structured_Filter/control.idl deleted file mode 100644 index a93c3df70da..00000000000 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/control.idl +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -// control.idl - -interface supplier_ctrl { - // start supplier - oneway void ctrl (in boolean flag, in short num_events); -}; diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf index fbe7d7f3a57..c8b44b649f0 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf @@ -1,3 +1,3 @@ ## $Id$ - -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +# +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl index 00236af4af5..53d2f1d82d2 100755 --- a/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl @@ -5,104 +5,108 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- +use strict; + use lib "../../../../../bin"; use PerlACE::Run_Test; -$ior = PerlACE::LocalFile ("supplier.ior"); -$notifyior = PerlACE::LocalFile ("notify.ior"); -$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); +my $ior = PerlACE::LocalFile ("supplier.ior"); +my $namingior = PerlACE::LocalFile ("naming.ior"); +my $notifyior = PerlACE::LocalFile ("notify.ior"); +my $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); -$status = 0; +my $status = 0; -$port = PerlACE::uniqueid () + 10001; -$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); -$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", +my $port = PerlACE::uniqueid () + 10005; +my $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", + "-ORBEndpoint iiop://localhost:$port " . + "-o $namingior"); +my $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . "-IORoutput $notifyior -ORBSvcConf " . "$notify_conf" ); -$STS = new PerlACE::Process ("Structured_Supplier"); +my $STS = new PerlACE::Process ("Structured_Supplier"); -$STC = new PerlACE::Process ("Structured_Consumer"); +my $STC = new PerlACE::Process ("Structured_Consumer"); -$args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService "; -$cargs = "-f -n100 -c2 "; +my $args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService "; -print "*************** Running Structured Client Filter Test ****************\n"; +unlink $ior; +unlink $notifyior; +unlink $namingior; -# Start Naming Service -if ($NS->Spawn () == -1) { +$NS->Spawn (); +if (PerlACE::waitforfile_timed ($namingior, 20) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); exit 1; } -if ($TS->Spawn () == -1) { +$TS->Spawn (); +if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { + print STDERR "ERROR: waiting for the notify service to start\n"; + $TS->Kill (); $NS->Kill (); exit 1; } -sleep 2; +print "\n**** Testing with no filtering ****\n"; $STS->Arguments($args); $STS->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $STS->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; } - -sleep 2; - -$STC->Arguments($args . $cargs); -$client = $STC->SpawnWaitKill(60); - -$STS->Kill(); -if ($client !=0) { + +$STC->Arguments($args); +my $client = $STC->SpawnWaitKill(20); +if ($client != 0) { print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1 + $TS->Kill (); + $NS->Kill (); + $STS->Kill(); + exit 1; +} +my $server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; } - -$TS->Kill (); -$NS->Kill (); - unlink $ior; -unlink $notifyior; - -sleep 2; - -print "*************** Running Structured Client No Filters Test ****************\n"; - -$cargs = "-n100 -c2 "; - -# Start Naming Service -$NS->Spawn (); -$TS->Spawn (); -sleep 2; +print "\n**** Testing with filtering ****\n"; $STS->Arguments($args); $STS->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $STS->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; } - -sleep 2; - -$STC->Arguments($args . $cargs); -$client = $STC->SpawnWaitKill(60); - -$STS->Kill(); -if ($client !=0) { + +$STC->Arguments("-f $args"); +my $client = $STC->SpawnWaitKill(20); +if ($client != 0) { print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1 + $TS->Kill (); + $NS->Kill (); + $STS->Kill(); + exit 1; +} + +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; } $TS->Kill (); @@ -110,5 +114,6 @@ $NS->Kill (); unlink $ior; unlink $notifyior; +unlink $namingior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp index 3aef9fadfda..232c98a0f45 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp @@ -1,21 +1,84 @@ // $Id$ #include "Notify_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "tao/debug.h" -CORBA::Short Notify_Push_Consumer::event_count = 0; - -Notify_Push_Consumer::Notify_Push_Consumer (const char* name) - : name_ (name) +Notify_Push_Consumer::Notify_Push_Consumer (const char* name, + int sent, + NS_FilterType consumerFilter, + NS_FilterType supplierFilter, + Notify_Test_Client& client) +: name_ (name) +, sent_(sent) +, received_(0) +, expected_(sent) +, client_(client) +, consumerFilter_(consumerFilter) +, supplierFilter_(supplierFilter) { + // Calculate the expected number. + ACE_ASSERT(sent % 9 == 0); + + // The supplier side filters combine group != 0 and type != 0, while the + // consumer side combines group != 1 and type != 1 + if (consumerFilter == AndOp && supplierFilter == AndOp) + { + // group != 0 && type != 0 && group != 1 && type != 1 + expected_ = sent_ / 9; + } + else if (consumerFilter == AndOp && supplierFilter == OrOp) + { + // group != 0 || type != 0 && group != 1 && type != 1 + expected_ = sent_ * 3 / 9; + } + else if (consumerFilter == AndOp && supplierFilter == None) + { + // group != 1 && type != 1 + expected_ = sent_ * 4 / 9; + } + else if (consumerFilter == OrOp && supplierFilter == AndOp) + { + // group != 0 && type != 0 && group != 1 || type != 1 + expected_ = sent_ * 3 / 9; + } + else if (consumerFilter == OrOp && supplierFilter == OrOp) + { + // group != 0 || type != 0 && group != 1 || type != 1 + expected_ = sent_ * 7 / 9; + } + else if (consumerFilter == OrOp && supplierFilter == None) + { + // group != 1 || type != 1 + expected_ = sent_ * 8 / 9; + } + else if (consumerFilter == None && supplierFilter == OrOp) + { + // group != 0 && type != 0 + expected_ = sent_ * 8 / 9; + } + else if (consumerFilter == None && supplierFilter == AndOp) + { + // group != 0 && type != 0 + expected_ = sent_ * 4 / 9; + } + else if (consumerFilter == None && supplierFilter == None) + { + expected_ = sent_; + } + else + { + bool unknown_filter_combination = false; + ACE_ASSERT(unknown_filter_combination); + ACE_UNUSED_ARG(unknown_filter_combination); + } + + this->client_.consumer_start (this); } void -Notify_Push_Consumer::_connect ( - CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, - CosNotifyChannelAdmin::EventChannel_ptr notify_channel, - CORBA::Boolean isFilter - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) +Notify_Push_Consumer::_connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, + CosNotifyChannelAdmin::EventChannel_ptr notify_channel ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) { CosNotifyComm::StructuredPushConsumer_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -23,50 +86,42 @@ Notify_Push_Consumer::_connect ( CosNotifyChannelAdmin::ProxySupplier_var proxysupplier = consumer_admin->obtain_notification_push_supplier ( - CosNotifyChannelAdmin::STRUCTURED_EVENT, - proxy_id_ - ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::STRUCTURED_EVENT, + proxy_id_ + ACE_ENV_ARG_PARAMETER); ACE_CHECK; - //add filter - if (isFilter) - { - CosNotifyFilter::FilterFactory_var ffact = - notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + if (consumerFilter_ != None) + { + CosNotifyFilter::FilterFactory_var ffact = + notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; - CosNotifyFilter::Filter_var filter = - ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + CosNotifyFilter::Filter_var filter = + ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - if (CORBA::is_nil (filter.in ())) - { - ACE_ERROR ((LM_ERROR, - " (%P|%t) Consumer unable to initialize filter.\n")); - exit (1); - } + ACE_ASSERT(! CORBA::is_nil (filter.in ())); - CosNotifyFilter::ConstraintExpSeq constraint_list (1); - constraint_list.length (1); + CosNotifyFilter::ConstraintExpSeq constraint_list (1); + constraint_list.length (1); - constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("Number != 100"); + constraint_list[0].event_types.length (0); + constraint_list[0].constraint_expr = CORBA::string_dup ("group != 1"); - filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - // apply filter - proxysupplier->add_filter (filter.in ()); - } + proxysupplier->add_filter (filter.in ()); + } this->proxy_ = CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow ( - proxysupplier.in () ACE_ENV_ARG_PARAMETER); + proxysupplier.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - this->proxy_->connect_structured_push_consumer (objref.in () - ACE_ENV_ARG_PARAMETER); + this->proxy_->connect_structured_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; // give ownership to POA @@ -74,84 +129,57 @@ Notify_Push_Consumer::_connect ( ACE_CHECK; } - - -CORBA::Short -Notify_Push_Consumer::get_count () +static void validate_expression(bool expr, const char* msg) { - return event_count; -} - - - -static const char* -Any_String (const CORBA::Any& any) -{ - static char out[256] = ""; - CORBA::Short s; - CORBA::UShort us; - CORBA::Long l; - CORBA::ULong ul; - CORBA::ULongLong ull; - const char* str; - - if (any >>= s) - { - ACE_OS::sprintf (out, "%d", s); - } - else if (any >>= us) - { - ACE_OS::sprintf (out, "%u", us); - } - else if (any >>= l) - { - ACE_OS::sprintf (out, "%d", l); - } - else if (any >>= ul) - { - ACE_OS::sprintf (out, "%u", ul); - } - else if (any >>= str) - { - ACE_OS::strcpy (out, str); - } - else if (any >>= ull) - { -#if defined (ACE_LACKS_LONGLONG_T) - ACE_OS::strcpy (out, ull.as_string (out)); -#else - double temp = -# if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); -# else - ull; -# endif /* ACE_CONFIG_WIN32_H */ - - ACE_OS::sprintf (out, "%.0f", temp); -#endif /* ACE_LACKS_LONGLONG_T */ - } - else - { - ACE_OS::strcpy (out, "Unsupported Any Type"); - } - - return out; + if (! expr) + { + ACE_ERROR((LM_ERROR, "Error: %s\n", msg)); + } } +#define validate(expr) validate_expression(expr, #expr) void Notify_Push_Consumer::push_structured_event ( - const CosNotification::StructuredEvent& event - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) + const CosNotification::StructuredEvent& event + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "%s %d (sent recv) %s %s\n", - Any_String (event.filterable_data[1].value), - event_count, - (const char*)event.filterable_data[0].name, - Any_String (event.filterable_data[0].value))); - - event_count ++; + ACE_DEBUG((LM_DEBUG, "-")); + received_++; + + CORBA::ULong id = 0; + CORBA::ULong group = 0; + CORBA::ULong type = 0; + + ACE_ASSERT(event.filterable_data.length() == 3); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[0].name.in(), "id") == 0); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[1].name.in(), "group") == 0); + ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[2].name.in(), "type") == 0); + event.filterable_data[0].value >>= id; + event.filterable_data[1].value >>= group; + event.filterable_data[2].value >>= type; + + if (consumerFilter_ == OrOp) + validate(type != 1 || group != 1); + else if (consumerFilter_ == AndOp) + validate(type != 1 && group != 1); + + if (supplierFilter_ == OrOp) + validate(type != 0 || group != 0); + else if (supplierFilter_ == OrOp) + validate(type != 0 && group != 0); + + if (received_ > expected_) + { + ACE_ERROR((LM_ERROR, "\nError: Expected %d, Received %d\n", expected_, received_)); + this->client_.consumer_done (this); + return; + } + if (received_ >= expected_) + { + ACE_DEBUG((LM_DEBUG, "\nConsumer received %d events.\n", received_)); + this->client_.consumer_done (this); + return; + } } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h index a5a4ebf8522..6231ecb69f7 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h @@ -20,27 +20,31 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; -class Notify_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer +enum NS_FilterType {None, AndOp, OrOp}; + +class Notify_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer { public: - Notify_Push_Consumer (const char* name); + Notify_Push_Consumer (const char* name, int sent, NS_FilterType consumerFilter, + NS_FilterType supplierFilter, Notify_Test_Client& client); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin, - CosNotifyChannelAdmin::EventChannel_ptr ec, - CORBA::Boolean isFilter - ACE_ENV_ARG_DECL) + CosNotifyChannelAdmin::EventChannel_ptr ec ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - static CORBA::Short get_count (); - private: - void push_structured_event (const CosNotification::StructuredEvent& - ACE_ENV_ARG_DECL) + void push_structured_event (const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - - static CORBA::Short event_count; +private: ACE_CString name_; + CORBA::Long sent_; + CORBA::Long received_; + CORBA::Long expected_; + Notify_Test_Client& client_; + NS_FilterType consumerFilter_; + NS_FilterType supplierFilter_; }; #endif /* NOTIFY_PUSH_SUPPLIER_H */ diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp index 271f56b2a12..352ef42df08 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp @@ -5,7 +5,7 @@ void Notify_Push_Supplier::_connect ( CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin, CosNotifyChannelAdmin::EventChannel_ptr notify_channel, - CORBA::Boolean isFilter + bool useFilter ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { @@ -20,8 +20,7 @@ Notify_Push_Supplier::_connect ( ACE_ENV_ARG_PARAMETER); ACE_CHECK; - //add filters - if (isFilter) + if (useFilter) { CosNotifyFilter::FilterFactory_var ffact = notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -31,23 +30,17 @@ Notify_Push_Supplier::_connect ( ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (filter.in ())) - { - ACE_ERROR ((LM_ERROR, - " (%P|%t) Consumer unable to initialize filter.\n")); - exit (1); - } + ACE_ASSERT(! CORBA::is_nil (filter.in ())); CosNotifyFilter::ConstraintExpSeq constraint_list (1); constraint_list.length (1); constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("String != 'One Hundred'"); + constraint_list[0].constraint_expr = CORBA::string_dup ("group != 0"); filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); ACE_CHECK; - // apply filter proxyconsumer->add_filter (filter.in ()); } @@ -56,8 +49,7 @@ Notify_Push_Supplier::_connect ( proxyconsumer.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - this->proxy_->connect_structured_push_supplier (objref.in () - ACE_ENV_ARG_PARAMETER); + this->proxy_->connect_structured_push_supplier (objref.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; // give ownership to POA diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h index 42efaa7bd1c..03f5844fb5d 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h @@ -10,7 +10,7 @@ class Notify_Push_Supplier: public TAO_Notify_Tests_StructuredPushSupplier public: void _connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin, CosNotifyChannelAdmin::EventChannel_ptr notify_channel, - CORBA::Boolean isFilter + bool useFilter ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); }; diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc index 2c9b03fe5ca..4d276c66aaf 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc @@ -14,7 +14,7 @@ project(*Ntf Struct Cons): notifytest { exename = Structured_Consumer Source_Files { - controlC.cpp + goC.cpp Notify_Push_Consumer.cpp Structured_Consumer.cpp } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp index 1673dd1975a..be1e4eecf98 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp @@ -1,35 +1,26 @@ // $Id$ -// ****************************************************************** -// Include Section -// ****************************************************************** - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" +#include "goC.h" +#include "Notify_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "orbsvcs/CosNotifyChannelAdminC.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" -#include "controlC.h" -#include "Notify_Push_Consumer.h" -#include "Notify_Test_Client.h" -#include "tao/debug.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "tao/debug.h" -static CORBA::Boolean isFilter = 0; -static CORBA::Boolean sFilter = 0; // supplier has filters -static CORBA::Short num_events = 0; -static CORBA::Short num_consumers = 0; -static CORBA::Short op = 0; // 0 = AND_OP; 1 = OR_OP +#include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_strings.h" -#define GRAMMAR "TCL" +static const char* ior = "file://supplier.ior"; +static NS_FilterType consumerFilter = None; +static NS_FilterType supplierFilter = None; +static int numEvents = 90; // Must be multiple of 9 +static Notify_Push_Consumer* consumer = 0; -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static const char* GRAMMAR = "TCL"; class Consumer_Client : public Notify_Test_Client { @@ -37,227 +28,153 @@ 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, "fsn:c:o:"); + ACE_Get_Opt get_opts (argc, argv, "f:s:e:"); int x; while ((x = get_opts ()) != -1) switch (x) - { - case 'f': - isFilter = 1; - break; - - case 'n': - num_events = atoi (get_opts.optarg); - break; - - case 'c': - num_consumers = atoi (get_opts.optarg); - break; - - case 'o': - if (!ACE_OS::strcmp ("OR_OP", get_opts.optarg)) - op = 1; - break; - - case 's': - sFilter = 1; - break; + { + case 'e': + numEvents = atoi (get_opts.optarg); + break; + + case 'f': + if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0) + consumerFilter = OrOp; + else + consumerFilter = AndOp; + break; + + case 's': + if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0) + supplierFilter = OrOp; + else + supplierFilter = AndOp; + break; default: ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "[-f] [-s] -n <num events> -c <num consumers> " - "-o <AND_OP | OR_OP>" - "\n", - argv [0]), - -1); - } + "usage: %s " + "[-s <AND | OR>] -n <num events> " + "[-f <AND | OR>]" + "\n", + argv [0]), + -1); + } return 0; // successful parse } static void -create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, - CosNotifyChannelAdmin::EventChannel_ptr ec, - Notify_Test_Client* client - ACE_ENV_ARG_DECL) +create_consumer (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, + CosNotifyChannelAdmin::EventChannel_ptr ec, + Notify_Test_Client* client + ACE_ENV_ARG_DECL) { - Notify_Push_Consumer* consumer = 0; ACE_NEW_THROW_EX (consumer, - Notify_Push_Consumer ("Consumer"), - CORBA::NO_MEMORY ()); + Notify_Push_Consumer ("Consumer", numEvents, consumerFilter, + supplierFilter, *client), + CORBA::NO_MEMORY ()); consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - consumer->_connect (admin, ec, isFilter ACE_ENV_ARG_PARAMETER); + consumer->_connect (admin, ec ACE_ENV_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); + int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + if (status != 0) + { + ACE_ERROR((LM_ERROR, "Error: Unable to init consumer.\n")); + return 1; + } + + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("Struct_Multi_Filter", 1 ACE_ENV_ARG_PARAMETER); + + CosNotifyChannelAdmin::AdminID adminid = 0; + CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin = + ec->new_for_consumers ((consumerFilter == OrOp + ? CosNotifyChannelAdmin::OR_OP : CosNotifyChannelAdmin::AND_OP), + adminid ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_ASSERT(! CORBA::is_nil (consumer_admin.in ())); + + if (consumerFilter != None) + { + CosNotifyFilter::FilterFactory_var ffact = + ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CosNotifyFilter::Filter_var filter = + ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; - if (status == 0) + if (CORBA::is_nil (filter.in ())) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("NotifyEventChannelFactory", - 1 - ACE_ENV_ARG_PARAMETER); - - - CosNotifyChannelAdmin::AdminID adminid = 0; - CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin = - ec->new_for_consumers ((op ? CosNotifyChannelAdmin::OR_OP : - CosNotifyChannelAdmin::AND_OP), - adminid - ACE_ENV_ARG_PARAMETER); - - ACE_TRY_CHECK; - - // Filter Section - - if (isFilter) - { - CosNotifyFilter::FilterFactory_var ffact = - ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CosNotifyFilter::Filter_var filter = - ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (filter.in ())) - { - ACE_ERROR ((LM_ERROR, - " (%P|%t) Consumer unable to initialize filter.\n")); - return 1; - } - - CosNotifyFilter::ConstraintExpSeq constraint_list (1); - constraint_list.length (1); - - constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("Number == 50"); - - filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // apply filter - consumer_admin->add_filter (filter.in ()); - } - - // End Filter Section - - // start server - CosNaming::Name ctrl_name; - ctrl_name.length (1); - ctrl_name[0].id = CORBA::string_dup ("Supplier"); - - CosNaming::NamingContext_ptr naming_context = client.naming_context (); - CORBA::Object_var ctrl_obj = naming_context->resolve (ctrl_name - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (ctrl_obj.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%T) Consumer unable to find " - "Supplier Naming Context.\n")); - return 1; - } - - supplier_ctrl_var supplier = supplier_ctrl::_narrow (ctrl_obj.in ()); - - if (!CORBA::is_nil (consumer_admin.in ())) - { - for ( int ctr = 0; ctr < num_consumers; ctr ++) - create_consumers (consumer_admin.in (), - ec.in (), - &client - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Start Supplier - supplier->ctrl (1, num_events); - - // wait for Supplier - ACE_OS::sleep (5); - - CORBA::ORB_ptr orb = client.orb (); - while (!client.done ()) - { - if (orb->work_pending ()) - { - orb->perform_work (); - - if (isFilter || sFilter) - { - if (!op) - { - if ((num_events / 6 * num_consumers) == - Notify_Push_Consumer::get_count ()) - client.done () = 1; - } - else - { - if ((num_events / 3 * num_consumers) == - Notify_Push_Consumer::get_count ()) - client.done () = 1; - } - } - else - { - if (num_events * num_consumers == Notify_Push_Consumer::get_count ()) - client.done () = 1; - } - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, - "Consumer received event #%d\n", - Notify_Push_Consumer::get_count ())); - } - } - - // Are there any more events - num_events = Notify_Push_Consumer::get_count (); - - ACE_OS::sleep (5); - if (orb->work_pending ()) - orb->perform_work (); - - if (num_events != Notify_Push_Consumer::get_count ()) - status = 1; - - // cleanup - ec->destroy (); - orb->destroy (); - } + ACE_ERROR ((LM_ERROR, + " (%P|%t) Consumer unable to initialize filter.\n")); + return 1; } - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, "Consumer Exception:"); - status = 1; + CosNotifyFilter::ConstraintExpSeq constraint_list (1); + constraint_list.length (1); + + constraint_list[0].event_types.length (0); + constraint_list[0].constraint_expr = CORBA::string_dup ("type != 1"); + + filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + consumer_admin->add_filter (filter.in ()); } + + CORBA::ORB_ptr orb = client.orb (); + + CORBA::Object_var object = + 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; + + ACE_ASSERT(! CORBA::is_nil (sig.in ())); + + create_consumer (consumer_admin.in (), ec.in (), &client ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n")); + + sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER ); + ACE_TRY_CHECK; + + ACE_DEBUG((LM_DEBUG, "\nConsumer done.\n")); + + sig->done(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "\nError: Consumer:"); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp index 829bc0b9b08..d3767541a72 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp @@ -1,55 +1,68 @@ // $Id$ -// ****************************************************************** -// Include Section -// ****************************************************************** +#include "Notify_Push_Supplier.h" +#include "goS.h" +#include "Notify_Test_Client.h" -#include "ace/Get_Opt.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" -#include "Notify_Push_Supplier.h" -#include "controlS.h" -#include "Notify_Test_Client.h" + #include "tao/debug.h" -// ****************************************************************** -// Data Section -// ****************************************************************** +#include "ace/Get_Opt.h" +#include "ace/OS_NS_strings.h" +#include "ace/Auto_Ptr.h" -static CORBA::Boolean go = 0; -static CORBA::Short n_events = 1; static const char* ior_file = "supplier.ior"; -static CORBA::Boolean isFilter = 0; +static bool useFilters = false; static Notify_Push_Supplier* supplier = 0; -static CORBA::Short op = 0; // 0 = AND_OP; 1 = OR_OP - -#define GRAMMAR "TCL" +static bool use_or_operator = false; +static int num_events = 90; -// ****************************************************************** -// Subroutine Section -// ****************************************************************** +static const char* GRAMMAR = "TCL"; -class supplier_ctrl_i : public POA_supplier_ctrl +class sig_i : public POA_sig { public: - void ctrl (CORBA::Boolean flag, - CORBA::Short num_events - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - + sig_i(CORBA::ORB_ptr orb) + : orb_(orb) + , started_(false) + { + } + + void go (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + + void done (ACE_ENV_SINGLE_ARG_DECL) + 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 -supplier_ctrl_i::ctrl (CORBA::Boolean flag, - CORBA::Short num_events - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - go = flag; - n_events = num_events; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -61,30 +74,31 @@ public: int Supplier_Client::parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:f"); + ACE_Get_Opt get_opts (argc, argv, "e:f:"); int x; while ((x = get_opts ()) != -1) switch (x) - { - case 'o': - if (!ACE_OS::strcmp ("OR_OP", get_opts.optarg)) - op = 1; - break; + { + case 'f': + useFilters = true; + if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0) + use_or_operator = true; + break; - case 'f': - isFilter = 1; - break; + case 'e': + num_events = ACE_OS::atoi (get_opts.optarg); + break; default: ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "[-f] -o <AND_OP | OR_OP>" - " -ORBInitRef <Naming Service Location>" - "\n", - argv [0]), - -1); - } + "usage: %s " + "[-f] [-e num_events] -o <AND | OR>" + " -ORBInitRef <Naming Service Location>" + "\n", + argv [0]), + -1); + } return 0; // successful parse } @@ -96,108 +110,48 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec { CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = - ec->new_for_suppliers ((op ? CosNotifyChannelAdmin::OR_OP : - CosNotifyChannelAdmin::AND_OP), - adminid - ACE_ENV_ARG_PARAMETER); + ec->new_for_suppliers ((use_or_operator ? CosNotifyChannelAdmin::OR_OP : + CosNotifyChannelAdmin::AND_OP), + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ()); } int -setup_event () +send_event (int id) { - static int count = 0; - CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup ("TAO Test Suite"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup ("Filtered Structured Event Notification Svc test"); + event.header.fixed_header.event_type.domain_name = + CORBA::string_dup ("TAO Test Suite"); + event.header.fixed_header.event_type.type_name = + CORBA::string_dup ("Filtered Structured Event Notification Svc test"); - if (count % 6 == 0) - { - event.header.fixed_header.event_name = CORBA::string_dup ("String test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("String"); - event.filterable_data[0].value <<= "One Hundred"; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else if (count % 6 == 1) - { - event.header.fixed_header.event_name = CORBA::string_dup ("Short test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("Number"); - event.filterable_data[0].value <<= (CORBA::Short) 100; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else if (count % 6 == 2) - { - event.header.fixed_header.event_name = CORBA::string_dup ("String test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("String"); - event.filterable_data[0].value <<= "Fifty"; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else if (count % 6 == 3) - { - event.header.fixed_header.event_name = CORBA::string_dup ("String test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("Number"); - event.filterable_data[0].value <<= (CORBA::Short) 50; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else if (count % 6 == 4) - { - event.header.fixed_header.event_name = CORBA::string_dup ("String test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("String"); - event.filterable_data[0].value <<= "Two Hundred"; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } - else - { - event.header.fixed_header.event_name = CORBA::string_dup ("Short test event"); - event.header.variable_header.length (1); - - event.filterable_data.length (2); - event.filterable_data[0].name = CORBA::string_dup ("Number"); - event.filterable_data[0].value <<= (CORBA::Short) 200; - event.filterable_data[1].name = CORBA::string_dup ("seq"); - event.filterable_data[1].value <<= (CORBA::Short) count; - } + event.header.fixed_header.event_name = CORBA::string_dup ("test"); + event.header.variable_header.length (1); - count++; + event.filterable_data.length (3); + event.filterable_data[0].name = CORBA::string_dup ("id"); + event.filterable_data[0].value <<= static_cast<CORBA::ULong>(id); + event.filterable_data[1].name = CORBA::string_dup ("group"); + event.filterable_data[1].value <<= static_cast<CORBA::ULong>(id % 3); + event.filterable_data[2].name = CORBA::string_dup ("type"); + // Divide by 3 first so that the type and group aren't synched + event.filterable_data[2].value <<= static_cast<CORBA::ULong>(id / 3 % 3); ACE_TRY_NEW_ENV - { - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "%d sent \n", count)); + { + ACE_DEBUG((LM_DEBUG, "+")); - supplier->send_event (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } + supplier->send_event (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, "Supplier Signal Exception: "); - } + { + ACE_PRINT_EXCEPTION (e, "\nError: Supplier: "); + } ACE_ENDTRY; return 0; @@ -209,21 +163,20 @@ static void create_supplier (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, ACE_ENV_ARG_DECL) { ACE_NEW_THROW_EX (supplier, - Notify_Push_Supplier (), - CORBA::NO_MEMORY ()); + Notify_Push_Supplier (), + CORBA::NO_MEMORY ()); supplier->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; - supplier->_connect (admin, ec, isFilter ACE_ENV_ARG_PARAMETER); + supplier->_connect (admin, ec, useFilters ACE_ENV_ARG_PARAMETER); ACE_CHECK; } -void add_filter (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, +void add_admin_filter (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, CosNotifyChannelAdmin::EventChannel_ptr notify_channel ACE_ENV_ARG_DECL) { - // add supplier side filtering CosNotifyFilter::FilterFactory_var ffact = notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -232,122 +185,96 @@ void add_filter (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (filter.in ())) - { - ACE_ERROR ((LM_ERROR, - " (%P|%t) Consumer unable to initialize filter.\n")); - exit (1); - } + ACE_ASSERT(!CORBA::is_nil (filter.in ())); CosNotifyFilter::ConstraintExpSeq constraint_list (1); constraint_list.length (1); constraint_list[0].event_types.length (0); - constraint_list[0].constraint_expr = CORBA::string_dup ("String == 'Fifty'"); + constraint_list[0].constraint_expr = CORBA::string_dup ("type != 0"); filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER); ACE_CHECK; - // apply filter admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; } -// ****************************************************************** -// Main Section -// ****************************************************************** - int main (int argc, char * argv[]) { - int status = 0; - + ACE_Auto_Ptr< sig_i > sig_impl; ACE_TRY_NEW_ENV; + { + Supplier_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 ("Struct_Multi_Filter", 0 ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_ASSERT(! CORBA::is_nil(ec.in())); + + 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; + + CosNotifyChannelAdmin::SupplierAdmin_var admin = + create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); + + if (useFilters) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + add_admin_filter (admin.in (), ec.in () ACE_ENV_ARG_PARAMETER); + } + + ACE_ASSERT(! CORBA::is_nil (admin.in ())); + + create_supplier (admin.in(), ec.in(), client.root_poa() ACE_ENV_ARG_PARAMETER); + + // If the ior_file exists, output the ior to it + if (ior_file != 0) + { + CORBA::String_var ior = + client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) - { - PortableServer::POA_ptr poa = client.root_poa (); - - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("NotifyEventChannelFactory", - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // register control with naming service - supplier_ctrl_i controller; - - CosNaming::Name ctrl_name (1); - ctrl_name.length (1); - ctrl_name[0].id = CORBA::string_dup ("Supplier"); - - PortableServer::ObjectId_var oid = - poa->activate_object (&controller); - - CosNaming::NamingContext_ptr naming_context = - client.naming_context (); - - CORBA::Object_var controller_obj = poa->id_to_reference (oid.in ()); - naming_context->bind (ctrl_name, controller_obj.in ()); - - int done = 0; - - CosNotifyChannelAdmin::SupplierAdmin_var admin = - create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER); - - if (isFilter) - { - add_filter (admin.in (), ec.in () ACE_ENV_ARG_PARAMETER); - } - - if (!CORBA::is_nil (admin.in ())) - { - create_supplier (admin.in (), - ec.in (), - client.root_poa () - ACE_ENV_ARG_PARAMETER); - - // Ready. So Write ior to file - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = orb->object_to_string (controller_obj.in ()); - FILE *fd = ACE_OS::fopen (ior_file, "w"); - if (fd == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for " - "writing IOR: %s", - ior_file), - 1); - ACE_OS::fprintf (fd, "%s", ior.in ()); - ACE_OS::fclose (fd); - - if (TAO_debug_level) - ACE_DEBUG ((LM_DEBUG, "Supplier Ready.\n")); - - while ((!done) && (n_events > 0)) - { - if (go) - { - done = setup_event (); - n_events--; - } - - if (orb->work_pending ()) - orb->perform_work (); - } - - orb->destroy (); - } - } + FILE *output_file= ACE_OS::fopen (ior_file, "w"); + ACE_ASSERT (output_file != 0); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); } - ACE_CATCH (CORBA::Exception, e) + + ACE_DEBUG((LM_DEBUG, "Supplier ready...\n")); + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "Supplier sending %d events...\n", num_events)); + for (int i = 0; i < num_events; ++i) { - ACE_PRINT_EXCEPTION (e, "Supplier Exception: "); - status = 1; + ACE_DEBUG((LM_DEBUG, "+")); + send_event (i ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events)); + + sig_impl->wait_for_completion(); + + ACE_OS::unlink (ior_file); + + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 0; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier: "); + } ACE_ENDTRY; - return status; + return 1; } diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/control.idl b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/control.idl deleted file mode 100644 index a93c3df70da..00000000000 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/control.idl +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -// control.idl - -interface supplier_ctrl { - // start supplier - oneway void ctrl (in boolean flag, in short num_events); -}; diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf index 63aae5f52e2..a1c39a03050 100644 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf @@ -1,4 +1,4 @@ ## $Id$ - -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +# +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl index 415be1478fc..d17cca1d9d9 100755 --- a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl @@ -5,126 +5,107 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- +use strict; + use lib "../../../../../bin"; use PerlACE::Run_Test; -$ior = PerlACE::LocalFile ("supplier.ior"); -$notifyior = PerlACE::LocalFile ("notify.ior"); -$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); +my $ior = PerlACE::LocalFile ("supplier.ior"); +my $namingior = PerlACE::LocalFile ("naming.ior"); +my $notifyior = PerlACE::LocalFile ("notify.ior"); +my $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); -$status = 0; +my $status = 0; -$port = PerlACE::uniqueid () + 10005; -$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); -$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", +my $port = PerlACE::uniqueid () + 10005; +my $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", + "-ORBEndpoint iiop://localhost:$port " . + "-o $namingior"); +my $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . "-IORoutput $notifyior -ORBSvcConf " . "$notify_conf" ); -$STS = new PerlACE::Process ("Structured_Supplier"); - -$STC = new PerlACE::Process ("Structured_Consumer"); +my $STS = new PerlACE::Process ("Structured_Supplier"); -$args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService "; -$cargs = "-n90 -c2 "; -$sfilter = "-s "; -$filter = "-f "; +my $STC = new PerlACE::Process ("Structured_Consumer"); -@ops = ("-oAND_OP ", "-oOR_OP "); +my $args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService "; -$heading = "*************** Running AND_OP Test ****************\n"; +my @ops = (undef, "AND", "OR"); -foreach $ops (@ops) - { - if ($ops eq "-oOR_OP ") - { - $heading = "\n\n*************** Running OR_OP Test ****************\n"; - } +unlink $ior; +unlink $notifyior; +unlink $namingior; - print $heading; +$NS->Spawn (); +if (PerlACE::waitforfile_timed ($namingior, 20) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); + exit 1; +} - print "\n********** Running Structured_Supplier Test\n\n"; +$TS->Spawn (); +if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { + print STDERR "ERROR: waiting for the notify service to start\n"; + $TS->Kill (); + $NS->Kill (); + exit 1; +} - # Start Naming Service - $NS->Spawn (); - $TS->Spawn (); +foreach my $supplier_op (@ops) +{ + foreach my $consumer_op (@ops) + { + my $supplier_args = ""; + if (defined $supplier_op) { + $supplier_args .= " -f $supplier_op"; + } - sleep 2; + my $consumer_args = ""; + if (defined $supplier_op) { + $consumer_args .= " -s $supplier_op"; + } + if (defined $consumer_op) { + $consumer_args .= " -f $consumer_op"; + } - $STS->Arguments($filter . $ops . $args); + print "\n**** Testing with $consumer_args ****\n"; + + $STS->Arguments($supplier_args . $args); $STS->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { print STDERR "ERROR: waiting for the supplier to start\n"; $STS->Kill (); - $TS->Kill (); - $NS->Kill (); $status = 1; + last; } - - sleep 2; - - $STC->Arguments($cargs . $sfilter . $ops . $args); - $client = $STC->SpawnWaitKill(60); - - $STS->Kill(); - if ($client !=0) { + + $STC->Arguments($consumer_args . $args); + my $client = $STC->SpawnWaitKill(20); + if ($client != 0) { print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1 + $status = 1; + last; } - - $TS->Kill (); - $NS->Kill (); - - sleep 2; - - unlink $ior; - unlink $notifyior; - - sleep (2); - - ################# - print "\n********** Running Structured_Consumer Test\n\n"; - - # Start Naming Service - $NS->Spawn (); - $TS->Spawn (); - - sleep 2; - - $STS->Arguments($args); - $STS->Spawn (); - - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $STS->Kill (); + my $server = $STS->WaitKill(5); + if ($server != 0) { $TS->Kill (); $NS->Kill (); - $status = 1; + exit 1; } - sleep 2; - - $STC->Arguments($cargs . $filter . $ops . $args); - $client = $STC->SpawnWaitKill(60); - - $STS->Kill(); - if ($client !=0) { - print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1 - } - - $TS->Kill (); - $NS->Kill (); - - sleep 2; - unlink $ior; - unlink $notifyior; - - sleep (2); } + if ($status == 1) { + last; + } +} + +$TS->Kill (); +$NS->Kill (); +unlink $notifyior; +unlink $namingior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp index b5952bd09c7..7ab11e5aec3 100644 --- a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp +++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp @@ -7,7 +7,7 @@ ACE_RCSID(Notify, TAO_RT_Test_Filter, "$Id$") #include "tao/debug.h" #include "tao/ORB_Core.h" #include "tao/RTCORBA/Thread_Pool.h" -#include "tao/PortableServer/Root_POA.h" +#include "tao/PortableServer/POA.h" TAO_Notify_Tests_RT_Test_Filter::TAO_Notify_Tests_RT_Test_Filter (void) : expected_pool_id_ (0) @@ -161,7 +161,7 @@ TAO_Notify_Tests_RT_Test_Filter::match_structured (const CosNotification::Struct if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_Notify_Tests_RT_Test_Filter (%x) ::match_structured (%t)\n", this)); - TAO_Root_POA *poa = dynamic_cast<TAO_Root_POA*>(this->_default_POA ()); + TAO_POA *poa = this->_default_POA ()->_tao_poa_downcast(); ACE_ASSERT (poa != 0); diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h index f1a741d90b1..4b2e1021bdb 100644 --- a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h +++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h @@ -22,7 +22,9 @@ #include "orbsvcs/CosNotifyFilterS.h" #if defined(_MSC_VER) +#if (_MSC_VER >= 1200) #pragma warning(push) +#endif /* _MSC_VER >= 1200 */ #pragma warning(disable:4250) #endif /* _MSC_VER */ @@ -127,7 +129,7 @@ protected: CORBA::ULong expected_lane_id_; }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(pop) #endif /* _MSC_VER */ diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h index 3da5a3ece41..dd0588a2543 100644 --- a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h +++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h @@ -23,7 +23,9 @@ #include "orbsvcs/Notify/FilterFactory.h" #if defined(_MSC_VER) +#if (_MSC_VER >= 1200) #pragma warning(push) +#endif /* _MSC_VER >= 1200 */ #pragma warning(disable:4250) #endif /* _MSC_VER */ @@ -72,7 +74,7 @@ protected: PortableServer::POA_var filter_poa_; }; -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(pop) #endif /* _MSC_VER */ diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf index 1febbd593e5..872c66654d7 100644 --- a/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf @@ -1,59 +1,59 @@ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object * TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -ThreadPool 1 0" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" static Command_Builder "ConsumerAdmin -Set_QoS ca1 -ThreadPool -Threads 1 -Priority 5" - +# ##--------- Consumer 1 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c1 -Admin ca1 -POA poa_1 -Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy c1_proxy -MaxCount 5 -Check_Priority" - +# static Command_Builder "PeriodicConsumer -Subscription c1 +Path1" - +# static Command_Builder "Filter -CreateFilter f_c1 ff" static Command_Builder "Filter -Add_Constraint f_c1 'PoolId = 5'" static Command_Builder "Filter -Add_Filter f_c1 c1_proxy" - +# ##--------- Consumer 2 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c2 -Admin ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5 -Check_Priority" - +# static Command_Builder "PeriodicConsumer -Subscription c2 +Path2" - +# static Command_Builder "Filter -CreateFilter f_c2 ff" static Command_Builder "Filter -Add_Constraint f_c2 'PoolId = 4'" static Command_Builder "Filter -Add_Filter f_c2 c2_proxy" - +# ##--------- Consumer Admin 2 ------------- static Command_Builder "ConsumerAdmin -Create ca2 ec1 -AND_OP" - +# ##--------- Consumer 3 , connected to CA 2 -------- static Command_Builder "PeriodicConsumer -Create c3 -Admin ca2 -POA poa_1 -Proxy c3_proxy -MaxCount 5 -Check_Priority" - +# static Command_Builder "PeriodicConsumer -Subscription c3 +Path3" - +# static Command_Builder "Filter -CreateFilter f_c3 ff" static Command_Builder "Filter -Add_Constraint f_c3 'PoolId = 1'" static Command_Builder "Filter -Add_Filter f_c3 c3_proxy" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf index b182382c616..f56362f30ea 100644 --- a/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf +++ b/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf @@ -1,8 +1,8 @@ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object * TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_FilterFactory Service_Object* TAO_RT_NotifyTests_Filter:_make_TAO_Notify_Tests_RT_Test_FilterFactory () "" dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () "" diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl b/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl index 9314ad0aacd..d5c758f77b3 100755 --- a/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl @@ -35,9 +35,7 @@ $Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$s #$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1"; unlink $naming_ior; -if ($Naming->Spawn () == -1) { - exit 1; -} +$Naming->Spawn (); if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) { print STDERR "ERROR: waiting for the naming service to start\n"; diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf index d4376d3b1d5..7ef7b0b4b1c 100644 --- a/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf @@ -9,56 +9,56 @@ ## ## Supplier s3 is connected to sa2 ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBPriorityMapping continuous" - +# # Uncomment this line to use SCHED_FIFO #dynamic TAO_RT_ORB_Loader Service_Object * TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -ThreadPool -Threads 1 -Priority 0" static Command_Builder "Filter -CreateFactory ff ec1" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" static Command_Builder "SupplierAdmin -Set_QoS sa1 -ThreadPool -Threads 1 -Priority 2" - +# ### --- Create Supplier s1 connected to sa1. It has its own Thread ---- static Command_Builder "PeriodicSupplier -Create s1 -Admin sa1 -Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy s1_proxy -EventType Path1 -Priority 1 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " - +# static Command_Builder "Filter -CreateFilter f1 ff" static Command_Builder "Filter -Add_Constraint f1 'PoolId = 3'" static Command_Builder "Filter -Add_Filter f1 s1_proxy" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s2 -Admin sa1 -Proxy s2_proxy -EventType Path2 -Priority 3 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " - +# static Command_Builder "Filter -CreateFilter f2 ff" static Command_Builder "Filter -Add_Constraint f2 'PoolId = 2'" static Command_Builder "Filter -Add_Filter f2 s2_proxy" - +# ### --- Create Supplier Admin 2 ---- static Command_Builder "SupplierAdmin -Create sa2 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa2 ---- static Command_Builder "PeriodicSupplier -Create s3 -Admin sa2 -Proxy s3_proxy -EventType Path3 -Priority 6 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 " static Command_Builder "Filter -CreateFilter f3 ff" static Command_Builder "Filter -Add_Constraint f3 'PoolId = 1'" static Command_Builder "Filter -Add_Filter f3 s3_proxy" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp b/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp index 103faefe5ad..6c6bb345b76 100644 --- a/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp +++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp @@ -86,7 +86,7 @@ int main(int ac, char **av) pass2 = true; break; default: - fprintf (stderr, "Illegal -pass command line option. Expecting 1, 2, or 3\n"); + ACE_OS::fprintf (stderr, "Illegal -pass command line option. Expecting 1, 2, or 3\n"); return -1; } } @@ -395,7 +395,7 @@ int main(int ac, char **av) } ACE_CATCHANY { - ACE_PRINT_EXCEPTION(ex, "Unexpected exception caught in main. "); + ACE_PRINT_EXCEPTION(ex, "Error: Unexpected exception caught in main. "); retval = -1; } ACE_CATCHALL diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl b/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl index 5789bf4130d..ef713ea6961 100755 --- a/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl @@ -32,7 +32,7 @@ cleanup(); $ret = 0; $UTEST = new PerlACE::Process("main", "-ORBEndpoint iiop://:$port -pass 3"); -$ret = $UTEST->SpawnWaitKill(10); +$ret = $UTEST->SpawnWaitKill(20); if ($ret != 0) { print "ERROR : main returned $ret\n"; exit $ret; diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf b/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf index b6b6d00ec48..349d679e2cf 100644 --- a/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf +++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf @@ -1,2 +1,2 @@ -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_XML_Topology_Factory() "-save_base_path ./abc -load_base_path ./loadtest -backup_count 2 -no_timestamp" diff --git a/TAO/orbsvcs/tests/Notify/lib/Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Command.cpp index a8028672539..f220c45d691 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Command.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Command.cpp @@ -49,7 +49,7 @@ TAO_Notify_Tests_Command::execute (ACE_ENV_SINGLE_ARG_DECL) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - ACE_LIB_TEXT("Exception running command\n")); + ACE_LIB_TEXT("Error: Exception running command\n")); } ACE_ENDTRY; } diff --git a/TAO/orbsvcs/tests/Notify/lib/Driver.cpp b/TAO/orbsvcs/tests/Notify/lib/Driver.cpp index f2451726531..8d035608147 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Driver.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Driver.cpp @@ -98,7 +98,7 @@ TAO_Notify_Tests_Worker::svc (void) } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ORB run error\n"); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: ORB run error\n"); } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/lib/Driver.h b/TAO/orbsvcs/tests/Notify/lib/Driver.h index 1f927ae6927..610e6b02e79 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Driver.h +++ b/TAO/orbsvcs/tests/Notify/lib/Driver.h @@ -19,14 +19,12 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Driver_Base.h" - -#include "tao/ORB.h" - #include "ace/Service_Config.h" #include "ace/Task.h" -#include "ace/SString.h" +#include "tao/ORB.h" + +#include "Driver_Base.h" class TAO_Notify_Tests_Command_Builder; class TAO_Notify_Tests_Activation_Manager; diff --git a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp index 48933533b09..d1c9c08b71a 100644 --- a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp @@ -119,7 +119,7 @@ TAO_Notify_Tests_EventChannel_Command::create_collocated_ecf (ACE_ENV_SINGLE_ARG LOOKUP_MANAGER->resolve (naming); - notify_service->init (orb.in () ACE_ENV_ARG_PARAMETER); + notify_service->init_service (orb.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; // Activate the factory diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp index 51eee525b4c..c8534f9dfd7 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp @@ -10,7 +10,8 @@ ACE_RCSID (lib, #define NAMING_SERVICE_NAME "NameService" Notify_Test_Client::Notify_Test_Client (void) - : done_ (false) +: num_clients_( 0 ) +, done_( false ) { // @@ Later: accept the inter filter operator as a param. ifgop_ = CosNotifyChannelAdmin::OR_OP; @@ -18,6 +19,10 @@ Notify_Test_Client::Notify_Test_Client (void) Notify_Test_Client::~Notify_Test_Client () { + root_poa_->destroy(1, 1 ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + orb_->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; } int @@ -122,19 +127,43 @@ Notify_Test_Client::resolve_Notify_factory (ACE_ENV_SINGLE_ARG_DECL) } int -Notify_Test_Client::ORB_run (void) +Notify_Test_Client::ORB_run (ACE_ENV_SINGLE_ARG_DECL) { - while (!this->done_) - if (this->orb_->work_pending ()) - this->orb_->perform_work (); + while (! is_done()) + { + ACE_Time_Value tv(0, 10 * 1000); + orb_->run(tv ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + ACE_DEBUG((LM_DEBUG, "\nWaiting for stray events...\n")); + + ACE_Time_Value tv(2); + orb_->run(tv ACE_ENV_ARG_PARAMETER); + ACE_CHECK; return 0; } +void Notify_Test_Client::consumer_start (TAO_Notify_Tests_Peer*) +{ + num_clients_++; +} + void -Notify_Test_Client::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +Notify_Test_Client::consumer_done (TAO_Notify_Tests_Peer*) { - this->done_ = true; + int value = --num_clients_; + if ( value == 0 ) + { + this->done_ = true; + } +} + +bool +Notify_Test_Client::is_done (void) const +{ + return this->done_; } CORBA::ORB_ptr @@ -203,10 +232,3 @@ Notify_Test_Client::create_event_channel (const char* cname, return ec._retn (); } - - -CORBA::Boolean& -Notify_Test_Client::done (void) -{ - return this->done_; -} diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h index 60a1e436d08..a5c22670efc 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h +++ b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h @@ -16,11 +16,15 @@ #ifndef NOTIFY_TEST_CLIENT_H #define NOTIFY_TEST_CLIENT_H +#include "ace/Atomic_Op_T.h" +#include "ace/Thread_Mutex.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/CosNotifyCommC.h" #include "orbsvcs/CosNamingC.h" #include "notify_test_export.h" +class TAO_Notify_Tests_Peer; + class TAO_NOTIFY_TEST_Export Notify_Test_Client { // = TITLE @@ -39,13 +43,16 @@ public: virtual int parse_args (int argc, char* argv[]); // Allow the user to override this empty method - int ORB_run (void); + int ORB_run (ACE_ENV_SINGLE_ARG_DECL); // Call ORB::run to accept requests. - void shutdown (ACE_ENV_SINGLE_ARG_DECL); - // Shutdown the ORB + void consumer_start (TAO_Notify_Tests_Peer*); + // How many clients will call consumer_done. + + void consumer_done (TAO_Notify_Tests_Peer*); + // Callback for clients to unregister themselves. - CORBA::Boolean& done (void); + bool is_done (void) const; // Access the done boolean. CORBA::ORB_ptr orb (void); @@ -101,8 +108,9 @@ protected: CosNotification::AdminProperties initial_admin_; // Initial admin props specified to the factory when creating the EC. - CORBA::Boolean done_; - // Set when we should shutdown. +private: + ACE_Atomic_Op< ACE_Thread_Mutex, int > num_clients_; + bool done_; }; #endif /* NOTIFY_TEST_CLIENT_H */ diff --git a/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp index 0710a60cf9e..86df51f8a20 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp @@ -1,7 +1,6 @@ // $Id$ #include "Options_Parser.h" -#include "ace/Log_Msg.h" ACE_RCSID (lib, TAO_Options_Parser, @@ -104,7 +103,7 @@ TAO_Notify_Tests_Options_Parser::execute (CosNotification::QoSProperties& qos, A NotifyExt::ThreadPoolLanesParams tpl_params; tpl_params.priority_model = NotifyExt::CLIENT_PROPAGATED; - tpl_params.server_priority = default_priority, + tpl_params.server_priority = default_priority; tpl_params.stacksize = 0; tpl_params.lanes.length (lanecount); tpl_params.allow_borrowing = 0; diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp b/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp index c078bdc6c35..e013bd44de0 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp @@ -46,6 +46,8 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Proxy_Traits_PTR proxy, Proxy_Traits_ID proxy_id ACE_ENV_ARG_DECL) { + // This will decr the ref count on exit. + // Clients of this class should use raw pointers, not vars. PortableServer::ServantBase_var servant_var (this); ACE_TYPENAME Peer_Traits::VAR peer_var = @@ -53,6 +55,7 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Proxy_Traits_PTR proxy, ACE_CHECK; this->connect_to_peer (proxy, peer_var.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; // save the proxy this->proxy_ = Proxy_Traits_INTERFACE::_duplicate (proxy); @@ -64,7 +67,6 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Proxy_Traits_PTR proxy, LOOKUP_MANAGER->_register (this->proxy_.in (), this->proxy_name_.c_str () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; } } @@ -84,6 +86,7 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Admin_Traits_PTR admin_ptr this->connect (proxy_var.in (), this->proxy_id_ ACE_ENV_ARG_PARAMETER); + ACE_CHECK; } @@ -169,14 +172,14 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::status (ACE_ENV_SINGLE_ARG_DECL) } ACE_CATCH(CORBA::TRANSIENT, ex) { - ACE_PRINT_EXCEPTION (ex, ""); + ACE_PRINT_EXCEPTION (ex, "Error: "); ACE_DEBUG ((LM_DEBUG, "Peer %s is_equivalent transient exception.", this->name_.c_str ())); } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ""); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: "); ACE_DEBUG ((LM_DEBUG, "Peer %s is_equivanent other exception.", this->name_.c_str ())); @@ -193,10 +196,31 @@ TAO_Notify_Tests_Peer_T<Peer_Traits>::disconnect (ACE_ENV_SINGLE_ARG_DECL) { ACE_ASSERT (!CORBA::is_nil (this->proxy_.in ())); - this->disconnect_from_proxy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + ACE_TRY + { + this->disconnect_from_proxy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, + "Peer %s failed to disconnect from proxy.", + this->name_.c_str ())); + } + ACE_ENDTRY; - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY + { + this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, + "Peer %s failed to deactivate.", + this->name_.c_str ())); + } + ACE_ENDTRY; } template <class Peer_Traits> diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp index fbefb088c45..88674c5d26d 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp @@ -327,12 +327,12 @@ TAO_Notify_Tests_Periodic_Supplier::svc (void) ACE_CATCH (CORBA::UserException, ue) { ACE_PRINT_EXCEPTION (ue, - "Periodic supplier: error sending event. "); + "Error: Periodic supplier: error sending event. "); } ACE_CATCH (CORBA::SystemException, se) { ACE_PRINT_EXCEPTION (se, - "Periodic supplier: error sending event. "); + "Error: Periodic supplier: error sending event. "); } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp index 5446630cc11..eb8655d9f84 100644 --- a/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp @@ -32,6 +32,7 @@ TAO_Notify_Tests_PushConsumer::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Pee void TAO_Notify_Tests_PushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n")); this->proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -39,7 +40,9 @@ void TAO_Notify_Tests_PushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } void diff --git a/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp index 94be0657439..eae01f04313 100644 --- a/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp @@ -41,6 +41,7 @@ TAO_Notify_Tests_PushSupplier::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Pee void TAO_Notify_Tests_PushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n")); this->proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -48,7 +49,9 @@ void TAO_Notify_Tests_PushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp index e8fc625a688..4b7cc341eaf 100644 --- a/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp @@ -33,6 +33,7 @@ TAO_Notify_Tests_SequencePushConsumer::connect_to_peer (Proxy_Traits::PTR proxy_ void TAO_Notify_Tests_SequencePushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n")); this->proxy_->disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -40,7 +41,9 @@ void TAO_Notify_Tests_SequencePushConsumer::disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } void diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp index 5cf499aea62..a86df08fa35 100644 --- a/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp @@ -43,6 +43,7 @@ TAO_Notify_Tests_SequencePushSupplier::connect_to_peer (Proxy_Traits::PTR proxy_ void TAO_Notify_Tests_SequencePushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n")); this->proxy_->disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -50,7 +51,9 @@ void TAO_Notify_Tests_SequencePushSupplier::disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp index 38eaa5b62ad..540ff8474f0 100644 --- a/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp @@ -33,6 +33,7 @@ TAO_Notify_Tests_StructuredPushConsumer::connect_to_peer (Proxy_Traits::PTR prox void TAO_Notify_Tests_StructuredPushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n")); this->proxy_->disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -40,7 +41,9 @@ void TAO_Notify_Tests_StructuredPushConsumer::disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } void diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp index 69108f5a51a..a6f3f9e8a71 100644 --- a/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp +++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp @@ -44,6 +44,7 @@ TAO_Notify_Tests_StructuredPushSupplier::connect_to_peer (Proxy_Traits::PTR prox void TAO_Notify_Tests_StructuredPushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) { + ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n")); this->proxy_->disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -51,7 +52,9 @@ void TAO_Notify_Tests_StructuredPushSupplier::disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + bool this_method_used_only_by_notify_service = false; + ACE_ASSERT(this_method_used_only_by_notify_service); + ACE_UNUSED_ARG(this_method_used_only_by_notify_service); } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h index f494b02ef16..5cef5b953b6 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h +++ b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h @@ -31,7 +31,6 @@ class TAO_Notify_Tests_Periodic_Consumer; class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Task_Callback { public: - virtual ~TAO_Notify_Tests_Task_Callback (void) {} virtual void done (TAO_Notify_Tests_Periodic_Supplier* supplier) = 0; virtual void done (TAO_Notify_Tests_Periodic_Consumer* consumer) = 0; }; diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl index 3be923f7f73..1f1fd62aed5 100644 --- a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl +++ b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl @@ -9,7 +9,8 @@ Task_Stats::diff_sec (ACE_UINT64 before, ACE_UINT64 after) #if defined ACE_LACKS_LONGLONG_T (after - before) / gsf_; #else /* ! ACE_LACKS_LONGLONG_T */ - static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER((after - before) / gsf_)); + ACE_static_cast (double, + ACE_UINT64_DBLCAST_ADAPTER((after - before) / gsf_)); #endif /* ! ACE_LACKS_LONGLONG_T */ seconds /= ACE_HR_SCALE_CONVERSION; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp index 88ea7c9c8e9..a18e90f4c04 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp @@ -1,17 +1,19 @@ // $Id$ #include "Notify_Sequence_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "common.h" Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer ( - const char* name, - unsigned int expected, - CORBA::Boolean& done) - : name_ (name), - expected_ (expected), - count_ (0), - done_ (done) + const char* name, + unsigned int expected, + Notify_Test_Client& client) + : name_ (name), + expected_ (expected), + count_ (0), + client_ (client) { + this->client_.consumer_start (this); } @@ -19,11 +21,10 @@ Notify_Sequence_Push_Consumer::~Notify_Sequence_Push_Consumer () { } - void Notify_Sequence_Push_Consumer::_connect ( - CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin - ACE_ENV_ARG_DECL) + CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { CosNotifyComm::SequencePushConsumer_var objref = @@ -32,14 +33,14 @@ Notify_Sequence_Push_Consumer::_connect ( CosNotifyChannelAdmin::ProxySupplier_var proxysupplier = consumer_admin->obtain_notification_push_supplier ( - CosNotifyChannelAdmin::SEQUENCE_EVENT, - proxy_id_ - ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::SEQUENCE_EVENT, + proxy_id_ + ACE_ENV_ARG_PARAMETER); ACE_CHECK; this->proxy_ = CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow ( - proxysupplier.in () ACE_ENV_ARG_PARAMETER); + proxysupplier.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; CosNotification::QoSProperties properties(1); @@ -49,7 +50,7 @@ Notify_Sequence_Push_Consumer::_connect ( proxy_->set_qos(properties); proxy_->connect_sequence_push_consumer (objref.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_CHECK; // give ownership to POA @@ -60,13 +61,30 @@ Notify_Sequence_Push_Consumer::_connect ( void Notify_Sequence_Push_Consumer::push_structured_events( - const CosNotification::EventBatch& events - ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) + const CosNotification::EventBatch& events + ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { + if ( this->count_ == 0 ) + { + this->first_ = ACE_OS::gettimeofday(); + } + this->count_ += events.length(); - if (this->count_ == this->expected_) - { - this->done_ = 1; - } + + if (this->count_ > this->expected_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("\nError: Expected %d events. Received %d\n"), expected_, count_)); + this->client_.consumer_done (this); + return; + } + + if (this->count_ >= this->expected_) + { + this->client_.consumer_done (this); + ACE_Time_Value totaltime = ( ACE_OS::gettimeofday() - this->first_ ); + double events_per_ms = static_cast<double>(this->count_) / + static_cast<double>(totaltime.msec()); + ACE_DEBUG((LM_DEBUG, "\nConsumer %s received %d at %.2f events/ms\n", name_.c_str(), this->count_, events_per_ms )); + } } diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h index 42e7663f17e..ccd5af92252 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h @@ -20,12 +20,14 @@ #include "Notify_SequencePushConsumer.h" +class Notify_Test_Client; + class Notify_Sequence_Push_Consumer : public TAO_Notify_Tests_SequencePushConsumer { public: Notify_Sequence_Push_Consumer (const char* name, unsigned int expected, - CORBA::Boolean& done); + Notify_Test_Client& client); ~Notify_Sequence_Push_Consumer (); @@ -41,7 +43,8 @@ private: ACE_CString name_; unsigned int expected_; unsigned int count_; - CORBA::Boolean& done_; + Notify_Test_Client& client_; + ACE_Time_Value first_; }; #endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp index 56d4fcbe81a..843883e35d4 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp @@ -1,17 +1,19 @@ // $Id$ #include "Notify_Structured_Push_Consumer.h" +#include "Notify_Test_Client.h" #include "common.h" Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer ( const char* name, unsigned int expected, - CORBA::Boolean& done) + Notify_Test_Client& client) : name_ (name), expected_ (expected), count_ (0), - done_ (done) + client_ (client) { + this->client_.consumer_start (this); } @@ -57,8 +59,26 @@ Notify_Structured_Push_Consumer::push_structured_event( ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) ACE_THROW_SPEC ((CORBA::SystemException)) { - if (++this->count_ == this->expected_) + if ( this->count_ == 0 ) + { + this->first_ = ACE_OS::gettimeofday(); + } + + if (this->count_ == this->expected_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n"))); + } + + //ACE_DEBUG((LM_DEBUG, "-")); + + this->count_++; + + if (this->count_ == this->expected_) { - this->done_ = 1; + this->client_.consumer_done (this); + ACE_Time_Value totaltime = ( ACE_OS::gettimeofday() - this->first_ ); + double events_per_ms = static_cast<double>(this->count_) / + static_cast<double>(totaltime.msec()); + ACE_DEBUG((LM_DEBUG, "Consumer %s received %d at %.2f events/ms\n", name_.c_str(), this->count_, events_per_ms )); } } diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h index c2a9ba31d6f..cd34305133d 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h @@ -20,6 +20,7 @@ #include "Notify_StructuredPushConsumer.h" +class Notify_Test_Client; class Notify_Structured_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer { @@ -27,7 +28,7 @@ public: Notify_Structured_Push_Consumer ( const char* name, unsigned int expected, - CORBA::Boolean& done); + Notify_Test_Client& client); ~Notify_Structured_Push_Consumer (); void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin @@ -42,7 +43,8 @@ private: ACE_CString name_; unsigned int expected_; unsigned int count_; - CORBA::Boolean& done_; + Notify_Test_Client& client_; + ACE_Time_Value first_; }; #endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */ diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp index 280f57077eb..79a6ccd853c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp @@ -20,14 +20,12 @@ // ****************************************************************** static const char* ior = "file://supplier.ior"; -static CORBA::Boolean done = 0; -static CORBA::Boolean dummy = 0; static CORBA::Boolean filter = 0; static unsigned int consumers = 2; static unsigned int batch_size = 10; -static unsigned int expected = 50; // 50 sets of 10 +static unsigned int expected = 100; // 100 sets of 10 -#define GRAMMAR "EXTENDED_TCL" +#define GRAMMAR "TCL" // ****************************************************************** // Subroutine Section @@ -87,7 +85,7 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec { CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::ConsumerAdmin_var admin = - ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP, + ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER); @@ -95,12 +93,12 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec if (filter) { - // Filter Section + ACE_DEBUG((LM_DEBUG, "\nConsumer filter enabled.\n")); + CosNotifyFilter::FilterFactory_var ffact = ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); - // One Filter CosNotifyFilter::Filter_var filter = ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -117,7 +115,6 @@ create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); - // End One Filter } return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ()); @@ -139,7 +136,7 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, Notify_Sequence_Push_Consumer ( name, expected * batch_size, - (i + 1 == consumers ? done : dummy)), + *client), CORBA::NO_MEMORY ()); consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER); @@ -207,33 +204,17 @@ int main (int argc, char* argv[]) sig->go (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - ACE_Time_Value now = ACE_OS::gettimeofday (); - while (!done) - { - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - ACE_Time_Value then = ACE_OS::gettimeofday (); - - static const unsigned int per = 100; - ACE_Time_Value difference = then - now; - double denominator = per / ((double)expected * - (double)batch_size); - difference *= denominator; - - if (TAO_debug_level) - ACE_DEBUG((LM_DEBUG, - "Average of %ds %dus for %u events\n", - difference.sec (), difference.usec (), per)); + client.ORB_run(); + 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, - "Consumer exception: "); + ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: "); status = 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp index 124dca8a155..ec2799ffba1 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -21,30 +22,54 @@ // ****************************************************************** static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; -static int max_events = 50; // 50 sets of 10 +static int max_events = 100; // 100 sets of 10 +static const CORBA::ULong amount = 10; 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client { @@ -61,23 +86,23 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'e': - max_events = 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); - } + { + case 'e': + max_events = 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; @@ -91,8 +116,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -101,49 +126,38 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvents (void) +SendEvents (int id ACE_ENV_ARG_DECL) { - if (start) - { - static const char* types[] = { "odd", "even" }; - static const CORBA::ULong amount = 10; - static int count = 0; - CosNotification::EventBatch events (amount); + ACE_UNUSED_ARG(id); + CosNotification::EventBatch events (amount); - events.length (amount); + events.length (amount); - for(CORBA::ULong z = 0; z < amount; z++) { - events[z].header.fixed_header.event_type.domain_name = - CORBA::string_dup("Orbix 2000 Demos"); - events[z].header.fixed_header.event_type.type_name = - CORBA::string_dup("Sequence Notification Push Demo Event"); + for(CORBA::ULong z = 0; z < amount; z++) + { + const char* type = ( (z & 1) == 1 ? "odd" : "even" ); + events[z].header.fixed_header.event_type.domain_name = + CORBA::string_dup("Orbix 2000 Demos"); + events[z].header.fixed_header.event_type.type_name = + CORBA::string_dup("Sequence Notification Push Demo Event"); - events[z].header.fixed_header.event_name = CORBA::string_dup("test event"); + events[z].header.fixed_header.event_name = CORBA::string_dup("test event"); - events[z].filterable_data.length (1); - events[z].filterable_data[0].name = CORBA::string_dup("type"); - events[z].filterable_data[0].value <<= ((count & 1) == 1 ? - types[0] : types[1]); - } - count++; - - if (count >= max_events) - { - done = 1; - } + events[z].filterable_data.length (1); + events[z].filterable_data[0].name = CORBA::string_dup("type"); + events[z].filterable_data[0].value <<= type; + } - ACE_TRY_NEW_ENV - { - supplier_1->send_events(events ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + ACE_TRY_NEW_ENV + { + supplier_1->send_events(events ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); } + ACE_ENDTRY; } static void @@ -153,8 +167,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // startup the first supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_SequencePushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_SequencePushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -170,68 +184,77 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { + ACE_Auto_Ptr< sig_i > sig_impl; int status = 0; ACE_TRY_NEW_ENV + { + Supplier_Client client; + + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; + 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; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CORBA::String_var ior = + orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) + // If the ior_output_file exists, output the ior to it + 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); + if (!CORBA::is_nil (admin.in ())) + { + create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d events...\n", (max_events*amount))); + for (int i = 0; i < max_events; ++i) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 - ACE_ENV_ARG_PARAMETER); + SendEvents (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", (max_events*amount))); - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sig_impl->wait_for_completion(); - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_OS::unlink (ior_output_file); - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvents (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp index 8c543bd6b44..a45be86190f 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp @@ -19,8 +19,6 @@ // ****************************************************************** static const char* ior = "file://supplier.ior"; -static CORBA::Boolean done = 0; -static CORBA::Boolean dummy = 0; static CORBA::Boolean filter = 0; static unsigned int consumers = 2; static unsigned int expected = 1000; @@ -137,7 +135,7 @@ create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin, Notify_Structured_Push_Consumer ( name, expected, - (i + 1 == consumers ? done : dummy)), + *client), CORBA::NO_MEMORY ()); consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER); @@ -204,38 +202,19 @@ int main (int argc, char* argv[]) // 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; + ACE_DEBUG((LM_DEBUG, "Consumer done.\n")); - ACE_Time_Value now = ACE_OS::gettimeofday (); - while (!done) - { - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - ACE_Time_Value then = ACE_OS::gettimeofday (); - - static const unsigned int per = 100; - ACE_Time_Value difference = then - now; - - if (TAO_debug_level) - ACE_DEBUG((LM_DEBUG, - "Total time: %d seconds\n", difference.sec ())); - - double denominator = per / (double)expected; - difference *= denominator; - - if (TAO_debug_level) - ACE_DEBUG((LM_DEBUG, - "Average of %ds %dus for %u events\n", - difference.sec (), difference.usec (), per)); + sig->done (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } } } ACE_CATCH (CORBA::Exception, e) { - ACE_PRINT_EXCEPTION (e, - "Consumer exception: "); + ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: "); status = 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp index c3cc5ac0f4a..348166d0e44 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp @@ -5,6 +5,7 @@ // ****************************************************************** #include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" #include "tao/ORB_Core.h" @@ -21,29 +22,53 @@ // ****************************************************************** static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0; -static CORBA::Boolean done = 0; -static CORBA::Boolean start = 0; static int max_events = 1000; 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) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = true; + } + void done (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + started_ = false; + } -void -sig_i::go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - start = 1; -} + 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 Supplier_Client : public Notify_Test_Client @@ -61,23 +86,23 @@ Supplier_Client::parse_args (int argc, char *argv[]) while ((c = get_opts ()) != -1) switch (c) - { - case 'e': - max_events = 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); - } + { + case 'e': + max_events = 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; @@ -91,8 +116,8 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec CosNotifyChannelAdmin::AdminID adminid = 0; CosNotifyChannelAdmin::SupplierAdmin_var admin = ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP, - adminid - ACE_ENV_ARG_PARAMETER); + adminid + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); @@ -101,45 +126,33 @@ create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec static void -SendEvent (void) +SendEvent (int id ACE_ENV_ARG_DECL) { - if (start) - { - static int count = 0; - static const char* types[] = { "odd", "even" }; - CosNotification::StructuredEvent event; + const char* type = ( (id & 1) == 1 ? "odd" : "even" ); + CosNotification::StructuredEvent event; - event.header.fixed_header.event_type.domain_name = - CORBA::string_dup("Orbix 2000 Demos"); - event.header.fixed_header.event_type.type_name = - CORBA::string_dup("Sequence Notification Push Demo Event"); + event.header.fixed_header.event_type.domain_name = + CORBA::string_dup("Orbix 2000 Demos"); + event.header.fixed_header.event_type.type_name = + CORBA::string_dup("Sequence Notification Push Demo Event"); - event.header.fixed_header.event_name = CORBA::string_dup("test event"); + event.header.fixed_header.event_name = CORBA::string_dup("test event"); - event.filterable_data.length (1); - event.filterable_data[0].name = CORBA::string_dup("type"); - event.filterable_data[0].value <<= ((count & 1) == 1 ? - types[0] : types[1]); - count++; + event.filterable_data.length (1); + event.filterable_data[0].name = CORBA::string_dup("type"); + event.filterable_data[0].value <<= type; - if (count >= max_events) - { - done = 1; - } - - ACE_TRY_NEW_ENV - { - supplier_1->send_event(event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - } - ACE_ENDTRY; + ACE_TRY_NEW_ENV + { + supplier_1->send_event(event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::Exception, e) + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); } + ACE_ENDTRY; } static void @@ -149,8 +162,8 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, { // startup the first supplier ACE_NEW_THROW_EX (supplier_1, - TAO_Notify_Tests_StructuredPushSupplier (), - CORBA::NO_MEMORY ()); + TAO_Notify_Tests_StructuredPushSupplier (), + CORBA::NO_MEMORY ()); supplier_1->init (poa ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -166,67 +179,76 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin, int main (int argc, char* argv[]) { + ACE_Auto_Ptr< sig_i > sig_impl; int status = 0; ACE_TRY_NEW_ENV + { + Supplier_Client client; + status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status == 0) { - Supplier_Client client; - status = client.init (argc, argv ACE_ENV_ARG_PARAMETER); + CosNotifyChannelAdmin::EventChannel_var ec = + client.create_event_channel ("MyEventChannel", 0 + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (status == 0) + 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 the ior_output_file exists, output the ior to it + 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); + if (!CORBA::is_nil (admin.in ())) + { + create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + sig_impl->wait_for_startup(); + + ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", max_events)); + for (int i = 0; i < max_events; ++i) { - CosNotifyChannelAdmin::EventChannel_var ec = - client.create_event_channel ("MyEventChannel", 0 - ACE_ENV_ARG_PARAMETER); + SendEvent (i ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + } + ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events)); - sig_i sig_impl; - sig_var sig = sig_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sig_impl->wait_for_completion(); - CORBA::ORB_ptr orb = client.orb (); - CORBA::String_var ior = - orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_OS::unlink (ior_output_file); - // If the ior_output_file exists, output the ior to it - 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); - if (!CORBA::is_nil (admin.in ())) - { - create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - while (!done) - { - SendEvent (); - if (orb->work_pending ()) - { - orb->perform_work (); - } - } - } - } + ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } } + } ACE_CATCH (CORBA::Exception, e) - { - ACE_PRINT_EXCEPTION (e, - "Supplier exception: "); - status = 1; - } + { + ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: "); + status = 1; + } ACE_ENDTRY; return status; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/common.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/common.cpp index b842263a6f4..c88d7dc082d 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/common.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/common.cpp @@ -46,7 +46,7 @@ Any_String (const CORBA::Any& any) #else double temp = # if defined (ACE_CONFIG_WIN32_H) - static_cast<double> (static_cast<CORBA::LongLong> (ull)); + ACE_static_cast(double, ACE_static_cast (CORBA::LongLong, ull)); # else ull; # endif /* ACE_CONFIG_WIN32_H */ diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl index ac446a41b00..e24bfd036c7 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl @@ -4,4 +4,7 @@ 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/performance-tests/Filter/notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf index 1901a01c584..93af5f9d812 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf @@ -1,6 +1,6 @@ ## $Id$ - +# ## Load the static Cos Notification Service -static Notify_Default_Event_Manager_Objects_Factory "-MTDispatching -DispatchingThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml index 36663520234..f398f140957 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml @@ -2,5 +2,5 @@ <!-- Converted from ./orbsvcs/tests/Notify/performance-tests/Filter/notify.conf by svcconf-convert.pl --> <ACE_Svc_Conf> <!-- # $Id$ --> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-MTDispatching -DispatchingThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl index 5f9ff405110..7d1e4ff85a7 100755 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl @@ -9,15 +9,15 @@ use lib "../../../../../../bin"; use PerlACE::Run_Test; $ior = PerlACE::LocalFile ("supplier.ior"); +$namingior = PerlACE::LocalFile ("naming.ior"); $notifyior = PerlACE::LocalFile ("notify.ior"); $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext"); $status = 0; -unlink $notifyior; - $port = PerlACE::uniqueid () + 10001; $NS = new PerlACE::Process ("../../../../Naming_Service/Naming_Service", - "-ORBEndpoint iiop://localhost:$port"); + "-ORBEndpoint iiop://localhost:$port " . + "-o $namingior"); $TS = new PerlACE::Process ("../../../../Notify_Service/Notify_Service", "-ORBInitRef NameService=iioploc://" . "localhost:$port/NameService " . @@ -33,13 +33,21 @@ $SES = new PerlACE::Process ("Sequence_Supplier", "localhost:$port/NameService"); $SEC = new PerlACE::Process ("Sequence_Consumer"); +unlink $ior; +unlink $notifyior; +unlink $namingior; + $client_args = "-ORBInitRef NameService=iioploc://localhost:" . "$port/NameService"; + $NS->Spawn (); -print $NS->CommandLine ()."\n"; -$TS->Spawn (); -print $TS->CommandLine ()."\n"; +if (PerlACE::waitforfile_timed ($namingior, 20) == -1) { + print STDERR "ERROR: waiting for the naming service to start\n"; + $NS->Kill (); + exit 1; +} +$TS->Spawn (); if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { print STDERR "ERROR: waiting for the notify service to start\n"; $TS->Kill (); @@ -47,116 +55,149 @@ if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) { exit 1; } -print "********* Running Structured Consumer with two " . - "consumers and no filter *******\n"; +###################################################################### +print "**** Structured Supplier -> 2 Structured Consumers ****\n"; +$STS->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +$STC->Arguments($client_args); +print $STC->CommandLine ()."\n"; +$client = $STC->SpawnWaitKill (300); +print "\n"; +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} + + +###################################################################### +print "**** Structured Supplier -> Structured Consumer (filtered) ****\n"; unlink $ior; -print $STS->CommandLine ()."\n"; $STS->Spawn (); - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { print STDERR "ERROR: waiting for the supplier to start\n"; $STS->Kill (); $TS->Kill (); $NS->Kill (); - $status = 1; + exit 1; } -if ($status == 0) { - $STC->Arguments($client_args); - print $STC->CommandLine ()."\n"; - $client = $STC->SpawnWaitKill (60); - print "\n"; +$STC->Arguments($client_args . " -f -c 1"); +$client = $STC->SpawnWaitKill (60); +print "\n"; +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +###################################################################### +print "**** Structured Supplier -> Sequence Consumer (filtered) ****\n"; +unlink $ior; +$STS->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; $STS->Kill (); - if ($client != 0) { - print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1; - } - - if ($status == 0) { - print "********* Running Structured Consumer with one " . - "consumer and one filter *******\n"; - - unlink $ior; - $STS->Spawn (); - - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $STS->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; - } - - if ($status == 0) { - $STC->Arguments($client_args . " -f -c 1"); - $client = $STC->SpawnWaitKill (60); - print "\n"; - - $STS->Kill (); - if ($client != 0) { - print STDERR "ERROR: Structured_Consumer did not run properly\n"; - $status = 1; - } - } - } -} - -if ($status == 0) { - print "********* Running Sequence Consumer with two " . - "consumers and no filter *******\n"; - - unlink $ior; - $SES->Spawn (); - - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $SES->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; - } + $TS->Kill (); + $NS->Kill (); + exit 1; +} - if ($status == 0) { - $SEC->Arguments($client_args); - $client = $SEC->SpawnWaitKill (60); - print "\n"; +$SEC->Arguments($client_args . " -f -c 1"); +$client = $SEC->SpawnWaitKill (60); +print "\n"; +if ($client != 0) { + $STS->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $STS->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} +###################################################################### +print "**** Sequence Supplier -> 2 Sequence Consumers ****\n"; + +unlink $ior; +$SES->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; $SES->Kill (); - if ($client != 0) { - print STDERR "ERROR: Sequence_Consumer did not run properly\n"; - $status = 1; - } - - if ($status == 0) { - print "********* Running Sequence Consumer with one " . - "consumer and one filter *******\n"; - - unlink $ior; - $SES->Spawn (); - - if (PerlACE::waitforfile_timed ($ior, 20) == -1) { - print STDERR "ERROR: waiting for the supplier to start\n"; - $SES->Kill (); - $TS->Kill (); - $NS->Kill (); - $status = 1; - } - - if ($status == 0) { - $SEC->Arguments($client_args . " -f -c 1"); - $client = $SEC->SpawnWaitKill (60); - print "\n"; - - $SES->Kill (); - if ($client != 0) { - print STDERR "ERROR: Sequence_Consumer did not run properly\n"; - $status = 1; - } - } - } - } + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +$SEC->Arguments($client_args); +$client = $SEC->SpawnWaitKill (60); +print "\n"; +if ($client != 0) { + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $SES->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +###################################################################### +print "**** Sequence Supplier -> Sequence Consumer (filtered) ****\n"; + +unlink $ior; +$SES->Spawn (); +if (PerlACE::waitforfile_timed ($ior, 20) == -1) { + print STDERR "ERROR: waiting for the supplier to start\n"; + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} + +$SEC->Arguments($client_args . " -f -c 1"); +$client = $SEC->SpawnWaitKill (60); +print "\n"; +if ($client != 0) { + $SES->Kill (); + $TS->Kill (); + $NS->Kill (); + exit 1; +} +$server = $SES->WaitKill(5); +if ($server != 0) { + $TS->Kill (); + $NS->Kill (); + exit 1; } $TS->Kill (); @@ -164,6 +205,7 @@ $NS->Kill (); unlink $ior; unlink $notifyior; +unlink $namingior; exit $status; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h index 5ae45042223..a6d83524294 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h @@ -26,7 +26,9 @@ #include "ace/Sched_Params.h" #if defined(_MSC_VER) +#if (_MSC_VER >= 1200) #pragma warning(push) +#endif /* _MSC_VER >= 1200 */ #pragma warning(disable:4250) #endif /* _MSC_VER */ @@ -320,7 +322,7 @@ protected: /*****************************************************************/ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(pop) #endif /* _MSC_VER */ diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf index 8d8b52818ef..4e98def139e 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf @@ -1,5 +1,5 @@ ## $Id$ -static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -MTListenerEval -ListenerThreads 1" +static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -ListenerThreads 1" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml index 07f8d3cabbd..f15ccd92083 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml @@ -1,5 +1,5 @@ <?xml version='1.0'?> <!-- Converted from ./orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf by svcconf-convert.pl --> <ACE_Svc_Conf> - <static id="Notify_Default_Event_Manager_Objects_Factory" params="-AllocateTaskperProxy -MTListenerEval -ListenerThreads 1"/> + <static id="Notify_Default_Event_Manager_Objects_Factory" params="-AllocateTaskperProxy -ListenerThreads 1"/> </ACE_Svc_Conf> diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp index 384ff8b1c17..8d41fd8fe15 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp @@ -21,16 +21,9 @@ main (int argc, char *argv []) client.run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } - ACE_CATCH (CORBA::UserException, ue) + ACE_CATCH (CORBA::Exception, se) { - ACE_PRINT_EXCEPTION (ue, - "Client user error: "); - return 1; - } - ACE_CATCH (CORBA::SystemException, se) - { - ACE_PRINT_EXCEPTION (se, - "system error: "); + ACE_PRINT_EXCEPTION (se, "Error: "); return 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf index 397c4002c18..71ec9c42ce6 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf @@ -1,2 +1 @@ -# $Id$ -static Resource_Factory "-ORBDropRepliesDuringShutdown 0 -ORBReactorMaskSignals 0" +static Resource_Factory "-ORBReactorMaskSignals 0" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp index 24c72c47766..4b8efa1244d 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp @@ -12,8 +12,8 @@ #include "orbsvcs/Notify/Service.h" #include "orbsvcs/Time_Utilities.h" -ACE_RCSID (Notify_Tests, - Throughput, +ACE_RCSID (Notify_Tests, + Throughput, "$Id$") /***************************************************************************/ @@ -616,16 +616,9 @@ main (int argc, char* argv[]) ACE_DEBUG ((LM_DEBUG, "ending main...\n")); } - ACE_CATCH (CORBA::UserException, ue) + ACE_CATCH (CORBA::Exception, se) { - ACE_PRINT_EXCEPTION (ue, - "Events user error: "); - return 1; - } - ACE_CATCH (CORBA::SystemException, se) - { - ACE_PRINT_EXCEPTION (se, - "Events system error: "); + ACE_PRINT_EXCEPTION (se, "Error: "); return 1; } ACE_ENDTRY; diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h index 802054bd6cf..12d22cdb51f 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h +++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h @@ -24,7 +24,9 @@ #include "ace/Sched_Params.h" #if defined(_MSC_VER) +#if (_MSC_VER >= 1200) #pragma warning(push) +#endif /* _MSC_VER >= 1200 */ #pragma warning(disable:4250) #endif /* _MSC_VER */ @@ -221,7 +223,7 @@ private: /***************************************************************************/ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(pop) #endif /* _MSC_VER */ diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf index 41caee79544..81477a4a545 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf index e07288e9ab4..9a4ca3d23f7 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 10 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf index d57a683ce85..5a3ca3273ec 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 15 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf index e8ee9b61181..353afa04682 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 20 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf index 92581d0d9d0..9a8d150acab 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 25 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf index a9c375d4d49..011249c3b88 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 30 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf index 9079f35b318..26514354e70 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 35 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf index 21df10c5c4b..213334fb39e 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 40 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf index f69c5982511..70eaaf4a6b5 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 45 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf index 1fcb9f7ae8b..fa3586d0188 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 5 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf index 3a67f344b30..f44743cf7c2 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf @@ -1,28 +1,28 @@ ## $Id$ - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 50 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf index e090b186840..07249b105c8 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf @@ -1,28 +1,28 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" - +# ##--------- Consumer , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf index f93dfef585b..92db23547f9 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 0 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 0 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 4000 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf index d5527347aa3..38ac8442cec 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 10 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 10 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 10 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf index 6b95b50d776..f7656f36930 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 15 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 15 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 15 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf index e0919772da1..14074a2f482 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 20 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 20 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 20 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf index fc5dd82ca19..b4954b4fd87 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 25 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 25 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 25 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf index 125e165bd91..034fad03e3c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf index 3d4277af7bd..69dfaecb51a 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 35 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 35 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 35 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf index 272165ceeab..f84fd889d57 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 40 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 40 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 40 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf index e574f7fd68d..37d1090a90f 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 45 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 45 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 45 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf index f1decd4075c..1403c8b429e 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 5 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 5 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 5 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf index 171e20bde96..d6d1c14e7d8 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf @@ -1,35 +1,35 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s1 connected to sa1. ----- static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 50 -RunTime 15" - +# ### --- Create Supplier s2 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 50 -RunTime 15" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 50 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf index 38c71b2f4cd..5639b258ca4 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf @@ -1,43 +1,43 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" - +# ##--------- Consumer 1 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_low -Admin ca1 -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_low +L" - +# ##--------- Consumer 2 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_med -Admin ca1 -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_med +M" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" static Command_Builder "Application -WaitForEvents" - +# # Use the -Samples option if you want to dump each sample recorded. #static Command_Builder "Application -DumpStats -Samples" - +# static Command_Builder "Application -DumpStats" static Command_Builder "Application -Shutdown" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf index 24a4c11915e..0f95a246f56 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf @@ -5,17 +5,17 @@ # ##---- Load the Factories------ dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Direct" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf index cef7340e622..fef4d975c5d 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf @@ -3,20 +3,20 @@ # Note that this test is not portable because it does not use RTCORBA. # All priority values are for Linux # - +# ##---- Load the Factories------ dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ### --- Create Supplier connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf index d3847f4b544..d7b6d405f92 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf @@ -1,24 +1,24 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Direct -POA poa_1" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf index 33770a83a3a..3b7a027668c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf @@ -1,22 +1,22 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ### --- Create Supplier connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf index a9c8f1cd29f..8bfc893a7a9 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf @@ -5,19 +5,19 @@ # All priority values are for Linux # ##---- Load the Factories------ - +# dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Direct" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf index 375b7ea1294..de27feabe08 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf @@ -5,19 +5,19 @@ # All priority values are for Linux # ##---- Load the Factories------ - +# dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high_relay -Relay c_high" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -SignalPeer" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf index 0d485effd14..2cdad84a16a 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf @@ -6,17 +6,17 @@ # ##---- Load the Factories------ dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high_relay -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf index d3847f4b544..d7b6d405f92 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf @@ -1,24 +1,24 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Direct -POA poa_1" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf index 1936c15e1d4..15313407835 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf @@ -1,24 +1,24 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high_relay -Relay c_high -POA poa_1" - +# ##------- Run--------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -SignalPeer" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf index 61f8b96c914..e9c9452944a 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf @@ -1,23 +1,23 @@ ## $Id$ ## This file has the following configuration: ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high_relay -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf index cc59624b3fb..26063b38c14 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf @@ -4,43 +4,43 @@ # All priority values are for Linux # dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () "" - +# ##---- Load the Factories------ - +# dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory COLLOCATED" - +# ### ### Configure Supplier and Consumer for the High Priority Path ### ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_high ec1 -AND_OP" - +# ### --- Create Supplier s_high connected to sa_high ----- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa_high -EventType H -Priority 2 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca_high ec1 -AND_OP" - +# ##--------- Consumer 1 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca_high" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##--------- Run ------------- static Command_Builder "Application -Run" static Command_Builder "Application -WaitForEvents" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf index fcaa0f1cc8f..18976ea0ad2 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf @@ -1,53 +1,53 @@ #$Id$ - +# dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () "" - +# dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () "" - +# ##---- Load the Factories------ - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory COLLOCATED" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ### ### Configure Supplier and Consumer for the High Priority Path ### ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_high ec1 -AND_OP" - +# ### --- Create Supplier s_high connected to sa_high ----- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa_high -EventType H -Priority 1 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca_high ec1 -AND_OP" - +# ##--------- Consumer 1 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca_high -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##--------- Run ------------- static Command_Builder "Application -Run" static Command_Builder "Application -WaitForEvents" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf index 1ba5cf1a9f7..4bedda340f5 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf @@ -5,21 +5,21 @@ # ##---- Load the Factories------ dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" - +# ##--------- Consumer , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf index 1f1f223af0c..7a59c06f755 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf @@ -6,25 +6,25 @@ # ##---- Load the Factories------ dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf index 3935e19471c..9b515bcb52c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf @@ -1,28 +1,28 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin 1 ------------- static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP" - +# ##--------- Consumer 3 , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1" static Command_Builder "PeriodicConsumer -Subscription c_high +H" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf index 62e6b68d481..81836c43a5c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf @@ -1,29 +1,29 @@ ## $Id$ ## - +# ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP" - +# ### --- Create Supplier s3 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15" - +# ##--------- Run ------------- static Command_Builder "Application -WaitToStart" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf index 8f41c7907d8..92cead2565b 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf @@ -1,39 +1,39 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP" - +# ### --- Create Supplier 1 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin ------------- static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP" - +# ##--------- Consumer High , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_oth -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth +O" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" static Command_Builder "Application -Run" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf index 4a3e8d5af25..f79dccd419b 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf @@ -1,32 +1,32 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- #static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" #static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP" - +# ### --- Create Supplier 1 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType o1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType o2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" @@ -38,44 +38,44 @@ static Command_Builder "PeriodicSupplier -Create s_oth_7 -Admin sa_oth -EventTyp static Command_Builder "PeriodicSupplier -Create s_oth_8 -Admin sa_oth -EventType o8 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_9 -Admin sa_oth -EventType o9 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_10 -Admin sa_oth -EventType o10 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin ------------- static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP" - +# ##--------- Consumer High , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +o1" - +# static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +o2" - +# static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +o3" - +# static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +o4" - +# static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +o5" - +# static Command_Builder "PeriodicConsumer -Create c_oth_6 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_6 +o6" - +# static Command_Builder "PeriodicConsumer -Create c_oth_7 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_7 +o7" - +# static Command_Builder "PeriodicConsumer -Create c_oth_8 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_8 +o8" - +# static Command_Builder "PeriodicConsumer -Create c_oth_9 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_9 +o9" - +# static Command_Builder "PeriodicConsumer -Create c_oth_10 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_10 +o10" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" #static Command_Builder "Application -WaitToStart" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf index 5ee138807fe..e6de590526f 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf @@ -1,32 +1,32 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- #static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" #static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP" - +# ### --- Create Supplier 1 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType o1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType o2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" @@ -48,74 +48,74 @@ static Command_Builder "PeriodicSupplier -Create s_oth_17 -Admin sa_oth -EventTy static Command_Builder "PeriodicSupplier -Create s_oth_18 -Admin sa_oth -EventType o18 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_19 -Admin sa_oth -EventType o19 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_20 -Admin sa_oth -EventType o20 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin ------------- static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP" - +# ##--------- Consumer High , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +o1" - +# static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +o2" - +# static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +o3" - +# static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +o4" - +# static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +o5" - +# static Command_Builder "PeriodicConsumer -Create c_oth_6 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_6 +o6" - +# static Command_Builder "PeriodicConsumer -Create c_oth_7 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_7 +o7" - +# static Command_Builder "PeriodicConsumer -Create c_oth_8 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_8 +o8" - +# static Command_Builder "PeriodicConsumer -Create c_oth_9 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_9 +o9" - +# static Command_Builder "PeriodicConsumer -Create c_oth_10 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_10 +o10" - +# static Command_Builder "PeriodicConsumer -Create c_oth_11 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_11 +o11" - +# static Command_Builder "PeriodicConsumer -Create c_oth_12 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_12 +o12" - +# static Command_Builder "PeriodicConsumer -Create c_oth_13 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_13 +o13" - +# static Command_Builder "PeriodicConsumer -Create c_oth_14 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_14 +o14" - +# static Command_Builder "PeriodicConsumer -Create c_oth_15 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_15 +o15" - +# static Command_Builder "PeriodicConsumer -Create c_oth_16 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_16 +o16" - +# static Command_Builder "PeriodicConsumer -Create c_oth_17 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_17 +o17" - +# static Command_Builder "PeriodicConsumer -Create c_oth_18 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_18 +o18" - +# static Command_Builder "PeriodicConsumer -Create c_oth_19 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_19 +o19" - +# static Command_Builder "PeriodicConsumer -Create c_oth_20 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_20 +o20" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" #static Command_Builder "Application -WaitToStart" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf index 930e579ce52..4d53387c72f 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf @@ -1,53 +1,53 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- #static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" #static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP" - +# ### --- Create Supplier 1 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType O2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType O3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin ------------- static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP" - +# ##--------- Consumer High , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +O1" - +# static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +O2" - +# static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +O3" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" #static Command_Builder "Application -WaitToStart" diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf index 5d58e1497e3..b3eed2c65d4 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf +++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf @@ -1,61 +1,61 @@ ## $Id$ ##---- Load the Factories------ dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous" - +# dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () "" ##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () "" - +# dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () "" - +# dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () "" - +# dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () "" - +# dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () "" - +# dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () "" - +# ##------- Init the Application Object ---------- static Command_Builder "Application -Init" - +# ##------- Create Event Channel --------------- #static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory" #static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0" - +# ### --- Create Supplier Admin 1 ---- static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP" - +# ### --- Create Supplier 1 connected to sa1 ---- static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType O2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType O3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_4 -Admin sa_oth -EventType O4 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" static Command_Builder "PeriodicSupplier -Create s_oth_5 -Admin sa_oth -EventType O5 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15" - +# ##----------- Create an RT POA to host local consumer objects----------- static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0" - +# ##--------- Consumer Admin ------------- static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP" - +# ##--------- Consumer High , connected to CA 1 -------- static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +O1" - +# static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +O2" - +# static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +O3" - +# static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +O4" - +# static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth" static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +O5" - +# ##------- Run--------- static Command_Builder "Application -SignalPeer" #static Command_Builder "Application -WaitToStart" |