diff options
-rw-r--r-- | TAO/ChangeLog | 36 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp | 2 | ||||
-rwxr-xr-x | TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl | 118 |
7 files changed, 171 insertions, 21 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index f5d27fb9b69..5ebbbb9e797 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,21 +1,39 @@ +Sat Oct 15 00:42:36 2005 Steve Totten <totten_s@ociweb.com> + + * orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp: + * orbsvcs/examples/CosEC/TypedSimple/Country.idl: + * orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr: + * orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp: + * orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp: + * orbsvcs/examples/CosEC/TypedSimple/run_test.pl: + + Merge changes from OCI TAO 1.4a to fix build errors for exceptions=0 + builds, remove the hard-coded repository IDs and the unneeded pragma + prefix from this test, add various missing #includes for Windows + builds, disable use of IFR persistence, add a new test script for + this example, and make some changes to Consumer.cpp to make the + script reliable. Thanks to Paul Calabrese <calabrese_p@ociweb.com> + and Chad Elliott <elliott_c@ociweb.com> for originating these + changes. + Fri Oct 14 09:35:33 2005 J.T. Conklin <jtc@acorntoolworks.com> - * orbsvcs/orbsvcs/Makefile.am: + * orbsvcs/orbsvcs/Makefile.am: - Regenerate. + Regenerate. - * orbsvcs/orbsvcs/CosEvent.mpc: + * orbsvcs/orbsvcs/CosEvent.mpc: - Split out separate project for generating IDL files. + Split out separate project for generating IDL files. - * orbsvcs/orbsvcs/ec_typed_event.mpb: + * orbsvcs/orbsvcs/ec_typed_event.mpb: - Remove IDL Files section from project, they've been moved - to ec_typed_event_idl.mpb. + Remove IDL Files section from project, they've been moved + to ec_typed_event_idl.mpb. - * orbsvcs/orbsvcs/ec_typed_event_idl.mpb: + * orbsvcs/orbsvcs/ec_typed_event_idl.mpb: - New base project containing Typed Event IDL files. + New base project containing Typed Event IDL files. Fri Oct 14 11:25:17 2005 Paul Calabrese <calabrese_p@ociweb.com> diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp index b1858fb720a..db6437a39bd 100644 --- a/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Consumer.cpp @@ -3,6 +3,7 @@ #include "orbsvcs/CosNamingC.h" #include "orbsvcs/CosTypedEventChannelAdminC.h" #include "Country_i.h" +#include "ace/OS_NS_stdio.h" ACE_RCSID (CosEC_Examples, Consumer, @@ -66,12 +67,28 @@ main (int argc, char* argv[]) ACE_TRY_CHECK; CosEventChannelAdmin::ProxyPushSupplier_var proxy_push_supplier = - typed_consumer_admin->obtain_typed_push_supplier ("IDL:jon.com/Country:1.0" + typed_consumer_admin->obtain_typed_push_supplier (_tc_Country->id() ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; proxy_push_supplier->connect_push_consumer (typed_consumer.in () ); + CORBA::String_var str = + orb->object_to_string (typed_consumer.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + const char* ior_file_name = "Consumer.ior"; + FILE *output_file= + ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(ior_file_name), + ACE_LIB_TEXT("w")); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_file_name), + 1); + ACE_OS::fprintf (output_file, "%s", str.in ()); + ACE_OS::fclose (output_file); + // Wait for events. ACE_DEBUG ((LM_DEBUG, "Waiting on orb->run for events...\n")); orb->run (); diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl index 77c68564272..00424bfa608 100644 --- a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl @@ -6,7 +6,6 @@ #define TAO_COUNTRY_IDL #include "orbsvcs/CosTypedEventComm.idl" -#pragma prefix "jon.com" interface Country : ::CosTypedEventComm::TypedPushConsumer { diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr index 25f2545f2ee..220d3c09aa0 100644 --- a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country.idl.for_ifr @@ -6,7 +6,6 @@ #define TAO_COUNTRY_IDL //#include "orbsvcs/CosEventComm.idl" -#pragma prefix "jon.com" interface Country //: ::CosTypedEventComm::TypedPushConsumer { diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp index ffcb16ae0ab..bbf4b03a030 100644 --- a/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Country_i.cpp @@ -27,7 +27,7 @@ void Country_i::update_population (const char * country, } CORBA::Object_ptr -Country_i::get_typed_consumer (ACE_ENV_SINGLE_ARG_DECL) +Country_i::get_typed_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { @@ -66,16 +66,15 @@ Country_i::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; PortableServer::ObjectId_var t_id = - t_poa->servant_to_id (this - ACE_ENV_ARG_PARAMETER); + t_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER); ACE_CHECK; - t_poa->deactivate_object (t_id.in () - ACE_ENV_ARG_PARAMETER); + t_poa->deactivate_object (t_id.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG ((LM_DEBUG, "Country_i::disconnect_push_consumer, calling ORB shutdown...\n")); - orb_->shutdown (0 - ACE_ENV_ARG_PARAMETER); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Country_i::disconnect_push_consumer, ") + ACE_TEXT ("calling ORB shutdown...\n"))); + orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); ACE_CHECK; } diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp b/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp index c908d935e80..d384fad33cf 100644 --- a/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/Supplier.cpp @@ -48,7 +48,7 @@ main (int argc, char* argv[]) ACE_TRY_CHECK; CosTypedEventChannelAdmin::TypedProxyPushConsumer_var typed_proxy_push_consumer = - typed_supplier_admin->obtain_typed_push_consumer ("IDL:jon.com/Country:1.0" + typed_supplier_admin->obtain_typed_push_consumer (_tc_Country->id() ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; diff --git a/TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl b/TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl new file mode 100755 index 00000000000..d6d585ce8a9 --- /dev/null +++ b/TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl @@ -0,0 +1,118 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib '../../../../../bin'; +use PerlACE::Run_Test; + +$status = 0; + +$nsiorfile = PerlACE::LocalFile ("ns.ior"); +$ifriorfile = PerlACE::LocalFile ("ifr.ior"); +$eciorfile = PerlACE::LocalFile ("ec.ior"); +$consiorfile = PerlACE::LocalFile ("Consumer.ior"); + +unlink $nsiorfile; +unlink $ifriorfile; +unlink $eciorfile; +unlink $consiorfile; + + +$IF = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/IFR_Service/IFR_Service", + "-o $ifriorfile"); +$TI = new PerlACE::Process ($ENV{"ACE_ROOT"}."/bin/tao_ifr", + "-ORBInitRef InterfaceRepository=file://$ifriorfile " . + "-I".$ENV{"TAO_ROOT"}."/orbsvcs Country.idl"); +$NS = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/Naming_Service/Naming_Service", + "-o $nsiorfile"); +$CE = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/CosEvent_Service/CosEvent_Service", + "-n CountryEventChannel -r -t -d -o $eciorfile " . + "-ORBInitRef InterfaceRepository=file://$ifriorfile " . + "-ORBInitRef NameService=file://$nsiorfile "); +$C = new PerlACE::Process ("Consumer", "-ORBInitRef NameService=file://$nsiorfile "); +$S = new PerlACE::Process ("Supplier", "-ORBInitRef NameService=file://$nsiorfile "); + +$IF->Spawn (); + +if (PerlACE::waitforfile_timed ($ifriorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$ifriorfile>\n"; + $IF->Kill (); + exit 1; +} + +$TI->SpawnWaitKill (60); + +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($nsiorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$nsiorfile>\n"; + $IF->Kill (); + $NS->Kill (); + exit 1; +} + +$CE->Spawn (); + +if (PerlACE::waitforfile_timed ($eciorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$eciorfile>\n"; + $IF->Kill (); + $NS->Kill (); + $CE->Kill (); + exit 1; +} + +$C->Spawn (); + +if (PerlACE::waitforfile_timed ($consiorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$consiorfile>\n"; + $IF->Kill (); + $NS->Kill (); + $CE->Kill (); + $C->Kill (); + exit 1; +} + +$supplier = $S->SpawnWaitKill (120); + +if ($supplier != 0) { + print STDERR "ERROR: supplier returned $supplier\n"; + $status = 1; +} + +$server = $C->WaitKill (15); + +if ($server != 0) { + print STDERR "ERROR: consumer returned $server\n"; + $status = 1; +} + +$server = $CE->WaitKill (15); + +if ($server != 0) { + print STDERR "ERROR: CosEvent_Service returned $server\n"; + $status = 1; +} + +$server = $NS->TerminateWaitKill (15); + +if ($server != 0) { + print STDERR "ERROR: name service returned $server\n"; + $status = 1; +} + +$server = $IF->TerminateWaitKill (15); + +if ($server != 0) { + print STDERR "ERROR: IFR_Service returned $server\n"; + $status = 1; +} + +unlink $nsiorfile; +unlink $ifriorfile; +unlink $eciorfile; +unlink $consiorfile; + +exit $status; |