summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:04:11 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:04:11 +0000
commitc979767a00db4ea1299af482033a68829cc16675 (patch)
tree3e959cad0a053f1adad663e7c02bc7a239f383d8 /TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
parent0f3847bc7fd735ab88276fee59e2ebd6cb8d1f99 (diff)
downloadATCD-c979767a00db4ea1299af482033a68829cc16675.tar.gz
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp')
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp56
1 files changed, 23 insertions, 33 deletions
diff --git a/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
index 596b32de23e..517abfd04ff 100644
--- a/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
+++ b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
@@ -14,68 +14,63 @@ ACE_RCSID (EC_Tests,
"$Id$")
static void run_test (PortableServer::POA_ptr poa,
- int use_callbacks
- ACE_ENV_ARG_DECL);
+ int use_callbacks);
int
main (int argc, char* argv[])
{
TAO_EC_Default_Factory::init_svcs ();
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// ORB initialization boiler plate...
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var object =
- orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa =
- PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (object.in ());
PortableServer::POAManager_var poa_manager =
poa->the_POAManager ();
poa_manager->activate ();
// ****************************************************************
- run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ run_test (poa.in (), 0);
- run_test (poa.in (), 1 ACE_ENV_ARG_PARAMETER);
+ run_test (poa.in (), 1);
// ****************************************************************
- poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ poa->destroy (1, 1);
orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ ex._tao_print_exception ("Service");
return 1;
}
- ACE_ENDTRY;
return 0;
}
// ****************************************************************
void
-deactivate_servant (PortableServer::Servant servant
- ACE_ENV_ARG_DECL)
+deactivate_servant (PortableServer::Servant servant)
{
PortableServer::POA_var poa =
servant->_default_POA ();
PortableServer::ObjectId_var id =
- poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
- poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ poa->servant_to_id (servant);
+ poa->deactivate_object (id.in ());
}
void
run_test (PortableServer::POA_ptr poa,
- int use_callbacks
- ACE_ENV_ARG_DECL)
+ int use_callbacks)
{
TAO_EC_Event_Channel_Attributes attributes (poa, poa);
attributes.disconnect_callbacks = use_callbacks;
@@ -98,7 +93,7 @@ run_test (PortableServer::POA_ptr poa,
event_channel->destroy ();
- deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ deactivate_servant (&ec_impl);
}
Task::Task (RtecEventChannelAdmin::EventChannel_ptr ec,
@@ -114,15 +109,14 @@ Task::svc ()
{
for (int i = 0; i < 10; ++i)
{
- ACE_TRY_NEW_ENV
+ try
{
this->run_iteration ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
return -1;
}
- ACE_ENDTRY;
}
return 0;
}
@@ -162,19 +156,15 @@ Task::run_iteration (void)
for (int i = 0; i != iterations; ++i)
{
supplier_0.connect (supplier_admin.in (),
- supplier_qos.get_SupplierQOS ()
- ACE_ENV_ARG_PARAMETER);
+ supplier_qos.get_SupplierQOS ());
consumer_0.connect (consumer_admin.in (),
- consumer_qos.get_ConsumerQOS ()
- ACE_ENV_ARG_PARAMETER);
+ consumer_qos.get_ConsumerQOS ());
if (i % 2 == 1)
{
supplier_1.connect (supplier_admin.in (),
- supplier_qos.get_SupplierQOS ()
- ACE_ENV_ARG_PARAMETER);
+ supplier_qos.get_SupplierQOS ());
consumer_1.connect (consumer_admin.in (),
- consumer_qos.get_ConsumerQOS ()
- ACE_ENV_ARG_PARAMETER);
+ consumer_qos.get_ConsumerQOS ());
}
supplier_0.disconnect ();
consumer_0.disconnect ();
@@ -185,9 +175,9 @@ Task::run_iteration (void)
}
}
- deactivate_servant (&supplier_0 ACE_ENV_ARG_PARAMETER);
+ deactivate_servant (&supplier_0);
- deactivate_servant (&consumer_0 ACE_ENV_ARG_PARAMETER);
+ deactivate_servant (&consumer_0);
CORBA::ULong count_0 = 0;
CORBA::ULong count_1 = 0;