diff options
Diffstat (limited to 'TAO/orbsvcs/tests')
14 files changed, 61 insertions, 56 deletions
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp index 567979e64c2..9ecf357818f 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp @@ -11,7 +11,7 @@ Test_Saver::Test_Saver() bool Test_Saver::begin_object(CORBA::Long id, const ACE_CString &type, - const TAO_NOTIFY::NVPList& attrs, + const TAO_Notify::NVPList& attrs, bool changed ACE_ENV_ARG_DECL_NOT_USED) { diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h index ce95cb0781c..287832cf336 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h @@ -18,14 +18,14 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class PLUGTOP_Export Test_Saver : public TAO_NOTIFY::Topology_Saver +class PLUGTOP_Export Test_Saver : public TAO_Notify::Topology_Saver { public: Test_Saver(); virtual bool begin_object (CORBA::Long id, const ACE_CString &type, - const TAO_NOTIFY::NVPList& attrs, + const TAO_Notify::NVPList& attrs, bool changed ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp index fdab5be129c..4363e41b899 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp @@ -7,16 +7,16 @@ Test_Topology_Factory::Test_Topology_Factory() { } -TAO_NOTIFY::Topology_Saver* +TAO_Notify::Topology_Saver* Test_Topology_Factory::create_saver () { - TAO_NOTIFY::Topology_Saver *saver = 0; + TAO_Notify::Topology_Saver *saver = 0; ACE_NEW_RETURN (saver, Test_Saver, 0); return saver; } //virtual -TAO_NOTIFY::Topology_Loader* +TAO_Notify::Topology_Loader* Test_Topology_Factory::create_loader () { return 0; diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h index 6b76b1a2205..e8ac5a5b9dc 100644 --- a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h +++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h @@ -15,14 +15,14 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class PLUGTOP_Export Test_Topology_Factory : public TAO_NOTIFY::Topology_Factory +class PLUGTOP_Export Test_Topology_Factory : public TAO_Notify::Topology_Factory { public: Test_Topology_Factory (); ///////////////////////////////////////////////// // override virtual methods from Topology_Factory - virtual TAO_NOTIFY::Topology_Saver* create_saver (); - virtual TAO_NOTIFY::Topology_Loader* create_loader (); + virtual TAO_Notify::Topology_Saver* create_saver (); + virtual TAO_Notify::Topology_Loader* create_loader (); }; ACE_FACTORY_DECLARE (PLUGTOP, Test_Topology_Factory) diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp index d2837a547b4..f03f1dfa917 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp @@ -786,7 +786,15 @@ Consumer_Main::Consumer_Main () , use_naming_service_ (true) , serial_number_ (0) , disconnect_on_exit_ (false) + , structured_count_(0) + , sequence_count_(0) + , any_count_(0) , id_file_ ("consumer.ids") + , ec_id_ (0) + , sa_id_ (0) + , structured_proxy_id_ (0) + , sequence_proxy_id_ (0) + , any_proxy_id_ (0) , reconnection_callback_ (*this) , reconnecting_ (false) { @@ -1040,13 +1048,13 @@ Consumer_Main::save_ids() int imode = ACE_static_cast (int, this->mode_); ACE_OS::fprintf (idf, "%d,%d,%d,%d,%d,%d,%d,\n", - imode, - ec_id_, - sa_id_, - structured_proxy_id_, - sequence_proxy_id_, - any_proxy_id_, - endflag); + static_cast<int> (imode), + static_cast<int> (ec_id_), + static_cast<int> (sa_id_), + static_cast<int> (structured_proxy_id_), + static_cast<int> (sequence_proxy_id_), + static_cast<int> (any_proxy_id_), + static_cast<int> (endflag) ); ACE_OS::fclose (idf); } } @@ -1056,7 +1064,7 @@ Consumer_Main::load_ids() { bool ok = false; FILE *idf = - ACE_OS::fopen (this->id_file_.c_str (), "w"); + ACE_OS::fopen (this->id_file_.c_str (), "r"); if (idf != 0) { @@ -1106,7 +1114,7 @@ Consumer_Main::load_ids() ok = value == 12345; break; default: - ACE_OS::fprintf (stderr, ACE_TEXT ("Warning: too many fields in saved id file.\n")); + ACE_OS::fprintf (stderr, ACE_TEXT ("Consumer: Warning: too many fields in saved id file.\n")); ok = false; break; } @@ -1347,20 +1355,19 @@ Consumer_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Consumer: Create event channel %d\n"), - ACE_static_cast (int, this->ec_id_) + static_cast<int> (this->ec_id_) )); } } + // save channel id if (ok && this->channel_file_.length() > 0) { - FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "r"); + FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "w"); if (chf != 0) { - char buffer[100]; - ACE_OS::fgets (buffer, sizeof(buffer), chf); - ACE_OS::fclose (chf); - this->ec_id_ = ACE_OS::atoi (buffer); + fprintf (chf, "%d\n", static_cast<int> (this->ec_id_)); + fclose (chf); } } } @@ -1495,14 +1502,6 @@ Consumer_Main::init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL) ACE_ENV_ARG_PARAMETER); ACE_CHECK; ok = ! CORBA::is_nil (proxy.in ()); -#ifdef TEST_SET_QOS - // temporary - if (ok) - { - set_proxy_qos (proxy.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -#endif // TEST_SET_QOS if (ok && this->verbose_) { ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp index 748ee176898..5c0f2757a5b 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp @@ -222,6 +222,11 @@ Supplier_Main::Supplier_Main () , disconnect_on_exit_ (false) , id_file_ (ACE_TEXT ("supplier.ids")) , pause_ (0) + , ec_id_ (0) + , sa_id_(0) + , structured_proxy_id_(0) + , sequence_proxy_id_(0) + , any_proxy_id_(0) , reconnection_callback_ (*this) , reconnecting_ (false) { @@ -447,13 +452,13 @@ Supplier_Main::save_ids() int imode = ACE_static_cast (int, this->mode_); ACE_OS::fprintf (idf, "%d,%d,%d,%d,%d,%d,%d,\n", - imode, - ec_id_, - sa_id_, - structured_proxy_id_, - sequence_proxy_id_, - any_proxy_id_, - endflag); + static_cast <int> (imode), + static_cast <int> (ec_id_), + static_cast <int> (sa_id_), + static_cast <int> (structured_proxy_id_), + static_cast <int> (sequence_proxy_id_), + static_cast <int> (any_proxy_id_), + static_cast <int> (endflag) ); ACE_OS::fclose (idf); } } @@ -463,18 +468,20 @@ Supplier_Main::load_ids() { bool ok = false; FILE *idf = - ACE_OS::fopen (this->id_file_.c_str (), "w"); + ACE_OS::fopen (this->id_file_.c_str (), "r"); if (idf != 0) { int field = 0; - char buffer[100]; + char buffer[100] = ""; ACE_OS::fgets (buffer, sizeof(buffer), idf); ACE_OS::fclose (idf); + char * pb = buffer; - while (*pb != 0) + while (!ok && *pb != 0) { +fprintf (stderr, "Buffer: %s\n" , pb); char * eb = ACE_OS::strchr (pb, ','); char * nb = eb + 1; if (eb == 0) @@ -482,14 +489,13 @@ Supplier_Main::load_ids() eb = pb + ACE_OS::strlen (pb); nb = eb; } - else - { - *eb = 0; - } + *eb = 0; +fprintf (stderr, "PARSE: [%s]\n", pb); if (pb < eb) { int value = ACE_OS::atoi(pb); - switch (field) +fprintf (stderr, "field[%d], %d\n", field, value); + switch (++field) { case 1: this->mode_ = static_cast<Mode_T> (value); @@ -513,7 +519,7 @@ Supplier_Main::load_ids() ok = value == 12345; break; default: - ACE_OS::fprintf (stderr, ACE_TEXT ("Warning: too many fields in saved id file.\n")); + ACE_OS::fprintf (stderr, ACE_TEXT ("Supplier: Warning: too many fields in saved id file.\n")); ok = false; break; } diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf index 04992b13665..e9cc17ec979 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf @@ -1,5 +1,5 @@ -static CosNotify_Service "-AllowReconnect" +static TAO_CosNotify_Service "-AllowReconnect" # This should fail because event perstence requires topology persistence diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf index bb4c2d1f954..be282852191 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf @@ -5,6 +5,6 @@ ## This prevents worker threads from joining the tp reactor ##static Client_Strategy_Factory "-ORBClientConnectionHandler rw" -static CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect" +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 00559411451..f89dd6e8242 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf @@ -1,4 +1,4 @@ -static CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect" +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_mt_topo.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf index 0ab2672941d..ff7dcfe58a9 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf @@ -1,3 +1,3 @@ -static CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect" +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" diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf index 902cc095284..fc890d01fc2 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf @@ -1,4 +1,4 @@ -static CosNotify_Service "-AllowReconnect" +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 5496d663e82..24407926a7b 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 CosNotify_Service "-AllowReconnect" +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/Reconnecting/ns_st_topo.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf index d6f099b3d24..18ee701db12 100644 --- a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf +++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf @@ -1,2 +1,2 @@ -static CosNotify_Service "-AllowReconnect" +static TAO_CosNotify_Service "-AllowReconnect" dynamic Topology_Factory Service_Object* TAO_CosNotification_persist:_make_XML_Topology_Factory() "-v -base_path ./reconnect_test" diff --git a/TAO/orbsvcs/tests/Notify/Unit/TestBasicTypes.cpp b/TAO/orbsvcs/tests/Notify/Unit/TestBasicTypes.cpp index acc0dbb3822..00d3994b752 100644 --- a/TAO/orbsvcs/tests/Notify/Unit/TestBasicTypes.cpp +++ b/TAO/orbsvcs/tests/Notify/Unit/TestBasicTypes.cpp @@ -13,7 +13,7 @@ using namespace CORBA; namespace CN = CosNotification; -using namespace TAO_NOTIFY; +using namespace TAO_Notify; // Tests for simple basic types that don't require the creation // of a Notify Service, or complex setup. |