summaryrefslogtreecommitdiff
path: root/TAO/tests/IORManipulation/IORTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/IORManipulation/IORTest.cpp')
-rw-r--r--TAO/tests/IORManipulation/IORTest.cpp126
1 files changed, 41 insertions, 85 deletions
diff --git a/TAO/tests/IORManipulation/IORTest.cpp b/TAO/tests/IORManipulation/IORTest.cpp
index 29313aad9b1..e47bdae2f2e 100644
--- a/TAO/tests/IORManipulation/IORTest.cpp
+++ b/TAO/tests/IORManipulation/IORTest.cpp
@@ -33,51 +33,38 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n"));
ACE_DEBUG ((LM_DEBUG, "Running the IORManipulation Tests.\n"));
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// Retrieve the ORB.
CORBA::ORB_var orb_ = CORBA::ORB_init (argc,
argv,
- ""
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ "");
// **********************************************************************
// Get an object reference for the ORBs IORManipulation object!
CORBA::Object_var IORM =
- orb_->resolve_initial_references ("IORManipulation"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->resolve_initial_references ("IORManipulation");
TAO_IOP::TAO_IOR_Manipulation_var iorm =
- TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ());
// **********************************************************************
// Create a few fictitious IORs
CORBA::Object_var name1 =
- orb_->string_to_object ("corbaloc:iiop:macarena.cs.wustl.edu:6060/xyz"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->string_to_object ("corbaloc:iiop:macarena.cs.wustl.edu:6060/xyz");
CORBA::Object_var name2 =
- orb_->string_to_object ("corbaloc:iiop:tango.cs.wustl.edu:7070/xyz"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->string_to_object ("corbaloc:iiop:tango.cs.wustl.edu:7070/xyz");
// **********************************************************************
CORBA::String_var name1_ior =
- orb_->object_to_string (name1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (name1.in ());
ACE_DEBUG ((LM_DEBUG, "\tFirst made up IOR = %s\n", name1_ior.in ()));
CORBA::String_var name2_ior =
- orb_->object_to_string (name2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (name2.in ());
ACE_DEBUG ((LM_DEBUG, "\tSecond made up IOR = %s\n", name2_ior.in ()));
// **********************************************************************
@@ -88,22 +75,16 @@ main (int argc, char *argv[])
iors [0] = name1;
iors [1] = name2;
- CORBA::Object_var merged = iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::Object_var merged = iorm->merge_iors (iors);
CORBA::String_var merged_ior =
- orb_->object_to_string (merged.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (merged.in ());
- CORBA::ULong count1 = iorm->get_profile_count (iors [0] ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ULong count1 = iorm->get_profile_count (iors [0]);
- CORBA::ULong count2 = iorm->get_profile_count (iors [1] ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ULong count2 = iorm->get_profile_count (iors [1]);
- CORBA::ULong count = iorm->get_profile_count (merged.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ULong count = iorm->get_profile_count (merged.in ());
if (count != (count1 + count2))
ACE_DEBUG ((LM_ERROR,
@@ -117,9 +98,7 @@ main (int argc, char *argv[])
// is_in_ior throws an exception if the intersection of the two
// IORs is NULL.
CORBA::ULong in_count = iorm->is_in_ior (merged.in (),
- name1.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ name1.in ());
if (count1 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -128,9 +107,7 @@ main (int argc, char *argv[])
in_count));
in_count = iorm->is_in_ior (merged.in (),
- name2.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ name2.in ());
if (count2 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -143,15 +120,12 @@ main (int argc, char *argv[])
// Verify ability to remove profiles from an IOR
// First remove the second IOR from the merged IOR
CORBA::Object_var just1 =
- iorm->remove_profiles (merged.in (), name2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ iorm->remove_profiles (merged.in (), name2.in ());
CORBA::String_var just1_ior =
- orb_->object_to_string (just1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (just1.in ());
- count = iorm->get_profile_count (just1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ count = iorm->get_profile_count (just1.in ());
if (count1 != count)
ACE_DEBUG ((LM_ERROR,
@@ -163,8 +137,7 @@ main (int argc, char *argv[])
count,
just1_ior.in ()));
- in_count = iorm->is_in_ior (just1.in (), name1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ in_count = iorm->is_in_ior (just1.in (), name1.in ());
if (count1 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -176,19 +149,16 @@ main (int argc, char *argv[])
// Now try the add_profiles interface.
CORBA::Object_var merged2 =
- iorm->add_profiles (just1.in (), name2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ iorm->add_profiles (just1.in (), name2.in ());
- count = iorm->get_profile_count (merged2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ count = iorm->get_profile_count (merged2.in ());
if (count != (count1 + count2))
ACE_DEBUG ((LM_ERROR,
"**ERROR: add_profile failed profile count test!\n"));
CORBA::String_var merged2_ior =
- orb_->object_to_string (merged2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (merged2.in ());
ACE_DEBUG ((LM_DEBUG,
"\tAdding 2 back in IOR(%d) = %s\n",
@@ -197,8 +167,7 @@ main (int argc, char *argv[])
// is_in_ior throws an exception if the intersection of the two
// IORs is NULL.
- in_count = iorm->is_in_ior (merged2.in (), name1. in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ in_count = iorm->is_in_ior (merged2.in (), name1. in ());
if (count1 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -206,8 +175,7 @@ main (int argc, char *argv[])
"count bad (%d)!\n",
in_count));
- in_count = iorm->is_in_ior (merged2.in (), name2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ in_count = iorm->is_in_ior (merged2.in (), name2.in ());
if (count2 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -217,15 +185,12 @@ main (int argc, char *argv[])
// **********************************************************************
CORBA::Object_var just2 =
- iorm->remove_profiles (merged2.in (), name1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ iorm->remove_profiles (merged2.in (), name1.in ());
CORBA::String_var just2_ior =
- orb_->object_to_string (just2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->object_to_string (just2.in ());
- count = iorm->get_profile_count (just2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ count = iorm->get_profile_count (just2.in ());
if (count2 != count)
ACE_DEBUG ((LM_ERROR,
@@ -235,8 +200,7 @@ main (int argc, char *argv[])
count,
just2_ior.in ()));
- in_count = iorm->is_in_ior (just2.in (), name2.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ in_count = iorm->is_in_ior (just2.in (), name2.in ());
if (count2 != in_count)
ACE_DEBUG ((LM_ERROR,
@@ -248,17 +212,15 @@ main (int argc, char *argv[])
Status = 1;
// Finally generate an exception and quit.
// This will generate a NotFound exception.
- in_count = iorm->is_in_ior (just2.in (), name1.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ in_count = iorm->is_in_ior (just2.in (), name1.in ());
}
- ACE_CATCH (TAO_IOP::EmptyProfileList, userex)
+ catch (const TAO_IOP::EmptyProfileList& userex)
{
- ACE_PRINT_EXCEPTION (userex,
- "Unexpected EmptyProfileList Exception!\n");
+ userex._tao_print_exception ("Unexpected EmptyProfileList Exception!\n");
return -1;
}
- ACE_CATCH (TAO_IOP::NotFound, userex)
+ catch (const TAO_IOP::NotFound& userex)
{
if (Status == 1)
{
@@ -276,36 +238,30 @@ main (int argc, char *argv[])
}
else
{
- ACE_PRINT_EXCEPTION (userex,
- "Unexpected NotFound Exception!\n");
+ userex._tao_print_exception ("Unexpected NotFound Exception!\n");
return -1;
}
}
- ACE_CATCH (TAO_IOP::Duplicate, userex)
+ catch (const TAO_IOP::Duplicate& userex)
{
- ACE_PRINT_EXCEPTION (userex,
- "Unexpected Duplicate Exception!\n");
+ userex._tao_print_exception ("Unexpected Duplicate Exception!\n");
return -1;
}
- ACE_CATCH (TAO_IOP::Invalid_IOR, userex)
+ catch (const TAO_IOP::Invalid_IOR& userex)
{
- ACE_PRINT_EXCEPTION (userex,
- "Unexpected Invalid_IOR Exception!\n");
+ userex._tao_print_exception ("Unexpected Invalid_IOR Exception!\n");
return -1;
}
- ACE_CATCH (CORBA::SystemException, sysex)
+ catch (const CORBA::SystemException& sysex)
{
- ACE_PRINT_EXCEPTION (sysex,
- "Unexpected system Exception!!\n");
+ sysex._tao_print_exception ("Unexpected system Exception!!\n");
return -1;
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Unexpected ACE_CATCHANY Exception!\n");
+ ex._tao_print_exception ("Unexpected CORBA Exception!\n");
return -1;
}
- ACE_ENDTRY;
if (Status == 1)
{