summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Property/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Property/client.cpp')
-rw-r--r--TAO/orbsvcs/tests/Property/client.cpp366
1 files changed, 175 insertions, 191 deletions
diff --git a/TAO/orbsvcs/tests/Property/client.cpp b/TAO/orbsvcs/tests/Property/client.cpp
index 2a564b1e9dc..e669856bdcb 100644
--- a/TAO/orbsvcs/tests/Property/client.cpp
+++ b/TAO/orbsvcs/tests/Property/client.cpp
@@ -1,4 +1,4 @@
- // $Id$
+// $Id$
// ============================================================================
//
@@ -27,13 +27,13 @@ ACE_RCSID(CosPropertyService, client, "$Id$")
int
Client::init (int argc,
char *argv[],
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &env)
{
// Init the ORB.
manager_.init (argc,
argv,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Open the ORB.
manager_.orb ()->open ();
@@ -51,91 +51,91 @@ Client::init (int argc,
propsetdef_name.length (1);
propsetdef_name [0].id = CORBA::string_dup ("PropertySetDef");
CORBA::Object_var propsetdef_obj = my_name_client_->resolve (propsetdef_name,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (1);
+ env);
+ TAO_CHECK_ENV_RETURN (env, 1);
ACE_DEBUG ((LM_DEBUG, "Naming resolve done\n"));
this->propsetdef_ = CosPropertyService::PropertySetDef::_narrow (propsetdef_obj.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
if (CORBA::is_nil (this->propsetdef_.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
"Couldnot resolve propsetdef in Naming server"),
-1);
-
+
return 0;
}
// Testing the methods of the property service.
int
-Client::property_tester (CORBA::Environment &ACE_TRY_ENV)
+Client::property_tester (CORBA::Environment &env)
{
// = Testing PropertySet & Iterators.
// Testing define_property () of PropertySet interface.
- this->test_define_property (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_define_property (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Test the number of properties.
- this->test_get_number_of_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_number_of_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing get_all_property_names.
- this->test_get_all_property_names (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_all_property_names (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Test get_property_value.
- this->test_get_property_value (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_property_value (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing delete property.
- this->test_delete_property ("no_property",ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_delete_property ("no_property",env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing get_properties.
- this->test_get_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing delete_properties.
- this->test_delete_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_delete_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Test the number of properties.
- this->test_get_number_of_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_number_of_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing define_properties.
- this->test_define_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_define_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Test the number of properties.
- this->test_get_number_of_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_number_of_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing get_all_property_names.
- this->test_get_all_property_names (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_all_property_names (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Testing get_all_properties.
- this->test_get_all_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ this->test_get_all_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// = Testing PropertySetDef & Iterators.
// Testing define_property_with_mode.
- this->test_define_property_with_mode (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
-
+ this->test_define_property_with_mode (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
+
return 0;
}
// Testing define_property.
int
-Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
+Client::test_define_property (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nChecking define_property\n"));
@@ -152,15 +152,15 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
"Main : Char ch = %c\n",
ch));
this->propsetdef_->define_property ("char_property",
- anyval,
- ACE_TRY_ENV);
+ anyval,
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("char_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ env.clear ();
}
// Prepare a Short and "define" that in the PropertySet.
@@ -173,15 +173,15 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
"Main : Short s = %d\n",
s));
propsetdef_->define_property ("short_property",
- anyval,
- ACE_TRY_ENV);
+ anyval,
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("char_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ env.clear ();
}
// Prepare a Long and "define" that in the PropertySet.
@@ -194,15 +194,15 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
l));
CORBA::Any newany(anyval);
propsetdef_->define_property ("long_property",
- anyval,
- ACE_TRY_ENV);
+ anyval,
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("char_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ env.clear ();
}
// Prepare a Float and "define" that in the PropertySet.
@@ -214,15 +214,15 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
"Main : Float f = %f\n",
f));
propsetdef_->define_property ("float_property",
- anyval,
- ACE_TRY_ENV);
+ anyval,
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("char_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ env.clear ();
}
// Prepare a String and "define" that in the PropertySet.
@@ -237,15 +237,15 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
strvar.in (),
newstr));
propsetdef_->define_property ("string_property",
- anyval,
- ACE_TRY_ENV);
+ anyval,
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("string_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("string_property");
+ env.clear ();
}
return 0;
@@ -254,39 +254,39 @@ Client::test_define_property (CORBA::Environment &ACE_TRY_ENV)
// Testing get_all_property_names of the PropertySet.
int
-Client::test_get_all_property_names (CORBA::Environment &ACE_TRY_ENV)
+Client::test_get_all_property_names (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nTesting get_all_property_names ()\n"));
// Get the size.
CORBA::ULong num_of_properties =
- propsetdef_->get_number_of_properties (ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
+ propsetdef_->get_number_of_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Get half on the names and half of on the iterator.
CORBA::ULong how_many = num_of_properties / 2;
-
+
// The extra ptr's and out's required to avoind SunnCC's warning
// when foo.out () is passed to a funtion.
CosPropertyService::PropertyNames_var names_var;
CosPropertyService::PropertyNames_ptr names_ptr = 0;
CosPropertyService::PropertyNames_out names_out (names_ptr);
-
+
CosPropertyService::PropertyNamesIterator_var iterator_var;
CosPropertyService::PropertyNamesIterator_ptr iterator_ptr;
CosPropertyService::PropertyNamesIterator_out iterator_out (iterator_ptr);
-
+
propsetdef_->get_all_property_names (how_many,
names_out,
iterator_out,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
-
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
+
// Get the values back to var.
names_var = names_out.ptr ();
iterator_var = iterator_out.ptr ();
-
+
// Print out the names in the names-sequence.
if (names_var.ptr () != 0)
{
@@ -302,31 +302,31 @@ Client::test_get_all_property_names (CORBA::Environment &ACE_TRY_ENV)
if (iterator_var.ptr () != 0)
{
// Helper variables to stop the SunCC warnings on on foo.out
- // ().
+ // ().
CosPropertyService::PropertyName name_ptr = 0;
CosPropertyService::PropertyName_out name_out (name_ptr);
-
+
// Call the function.
- CORBA::Boolean next_one_result = iterator_var->next_one (name_out, ACE_TRY_ENV);
-
+ CORBA::Boolean next_one_result = iterator_var->next_one (name_out, env);
+
// Get the values back on a _var variable.
CosPropertyService::PropertyName_var name_var = name_out.ptr ();
-
+
while (next_one_result == 1)
{
- ACE_CHECK_RETURN (-1);
+ TAO_CHECK_ENV_RETURN (env, -1);
ACE_DEBUG ((LM_DEBUG, "%s\n", name_var.in ()));
-
+
// Call the function to iterate again.
- next_one_result = iterator_var->next_one (name_out, ACE_TRY_ENV);
-
+ next_one_result = iterator_var->next_one (name_out, env);
+
// Get the values back on a _var variable.
name_var = name_out.ptr ();
}
- ACE_CHECK_RETURN (-1);
+ TAO_CHECK_ENV_RETURN (env, -1);
}
-
+
return 0;
}
@@ -334,7 +334,7 @@ Client::test_get_all_property_names (CORBA::Environment &ACE_TRY_ENV)
// properties.
int
-Client::test_get_properties (CORBA::Environment &ACE_TRY_ENV)
+Client::test_get_properties (CORBA::Environment &env)
{
// Get float_property, string_property and no_property. If return
// value is false and type is tc_void then that name is not there in
@@ -362,13 +362,12 @@ Client::test_get_properties (CORBA::Environment &ACE_TRY_ENV)
// Get the properties.
CORBA::Boolean return_val = propsetdef_->get_properties (names.in (),
properties_out,
- ACE_TRY_ENV);
- ACE_UNUSED_ARG (return_val);
- ACE_CHECK_RETURN (-1);
-
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
+
// Get the value to the _var.
CosPropertyService::Properties_var properties = properties_out.ptr ();
-
+
if (properties.ptr () != 0)
{
// Go thru the properties and print them out, if they are not
@@ -392,12 +391,12 @@ Client::test_get_properties (CORBA::Environment &ACE_TRY_ENV)
// Testing, get_number_of_properties.
int
-Client::test_get_number_of_properties (CORBA::Environment &ACE_TRY_ENV)
+Client::test_get_number_of_properties (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nNumber of props : %d\n",
- this->propsetdef_->get_number_of_properties (ACE_TRY_ENV)));
- ACE_CHECK_RETURN (-1);
+ this->propsetdef_->get_number_of_properties (env)));
+ TAO_CHECK_ENV_RETURN (env, -1);
return 0;
}
@@ -406,29 +405,26 @@ Client::test_get_number_of_properties (CORBA::Environment &ACE_TRY_ENV)
int
Client::test_delete_property (CORBA::String property_name,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &env)
{
- ACE_UNUSED_ARG (ACE_TRY_ENV);
-
ACE_DEBUG ((LM_DEBUG, "\nDeleting %s\n",property_name));
- ACE_TRY
+ TAO_TRY
{
- this->propsetdef_->delete_property (property_name,
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ this->propsetdef_->delete_property (property_name, TAO_TRY_ENV);
+ TAO_CHECK_ENV;
}
- ACE_CATCH (CORBA::UserException, ex)
+ TAO_CATCH (CORBA::UserException, ex)
{
- ACE_PRINT_EXCEPTION (ex, "User exception");
+ TAO_TRY_ENV.print_exception ("User exception");
return -1;
}
- ACE_CATCHANY
+ TAO_CATCHANY
{
- ACE_PRINT_EXCEPTION (ex, "Not an user exception");
+ TAO_TRY_ENV.print_exception ("Not an user exception");
return -1;
}
- ACE_ENDTRY;
+ TAO_ENDTRY;
return 0;
}
@@ -439,7 +435,7 @@ Client::test_delete_property (CORBA::String property_name,
// properties.
int
-Client::test_delete_properties (CORBA::Environment &ACE_TRY_ENV)
+Client::test_delete_properties (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nChecking delete_properties\n"));
@@ -454,8 +450,8 @@ Client::test_delete_properties (CORBA::Environment &ACE_TRY_ENV)
prop_names.length (),
prop_names.maximum ()));
this->propsetdef_->delete_properties (prop_names,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN ( 0);
+ env);
+ TAO_CHECK_ENV_RETURN (env, 0);
return 0;
}
@@ -464,7 +460,7 @@ Client::test_delete_properties (CORBA::Environment &ACE_TRY_ENV)
// float in the property set.
int
-Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
+Client::test_define_properties (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nChecking define_properties\n"));
@@ -476,7 +472,7 @@ Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
anyval <<= CORBA::Any::from_char (ch);
ch = '*';
anyval >>= CORBA::Any::to_char (ch);
- nproperties[0].property_name = CORBA::string_dup ("char_property");
+ nproperties[0].property_name = CORBA::string_copy ("char_property");
nproperties[0].property_value <<= CORBA::Any::from_char (ch);
// Prepare a Short and "define" that in the PropertySet.
@@ -484,7 +480,7 @@ Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
anyval <<= s;
s = 7;
anyval >>= s;
- nproperties[1].property_name = CORBA::string_dup ("short_property");
+ nproperties[1].property_name = CORBA::string_copy ("short_property");
nproperties[1].property_value <<= s;
// Prepare a Long and "define" that in the PropertySet.
@@ -492,7 +488,7 @@ Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
anyval <<= l;
l = 931233;
anyval >>= l;
- nproperties[2].property_name = CORBA::string_dup ("long_property");
+ nproperties[2].property_name = CORBA::string_copy ("long_property");
nproperties[2].property_value <<= l;
// Prepare a Float and "define" that in the PropertySet.
@@ -500,12 +496,12 @@ Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
anyval <<= f;
f = 4.14F;
anyval >>= f;
- nproperties[3].property_name = CORBA::string_dup ("float_property");
+ nproperties[3].property_name = CORBA::string_copy ("float_property");
nproperties[3].property_value <<= f;
// Define this sequence of properties now.
- this->propsetdef_->define_properties (nproperties, ACE_TRY_ENV);
- ACE_CHECK_RETURN ( -1);
+ this->propsetdef_->define_properties (nproperties, env);
+ TAO_CHECK_ENV_RETURN (env, -1);
return 0;
}
@@ -513,15 +509,14 @@ Client::test_define_properties (CORBA::Environment &ACE_TRY_ENV)
// Test get_all_properties.
int
-Client::test_get_all_properties (CORBA::Environment &ACE_TRY_ENV)
+Client::test_get_all_properties (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nTesting get_all_properties\n"));
// Get the number of current properties.
CORBA::ULong num_of_properties =
- this->propsetdef_->get_number_of_properties (ACE_TRY_ENV);
- ACE_UNUSED_ARG (num_of_properties);
- ACE_CHECK_RETURN ( -1);
+ this->propsetdef_->get_number_of_properties (env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Get half on the properties and half of on the iterator.
CORBA::ULong how_many = 1;
@@ -531,17 +526,17 @@ Client::test_get_all_properties (CORBA::Environment &ACE_TRY_ENV)
CosPropertyService::Properties_out properties_out (properties_ptr);
CosPropertyService::PropertiesIterator_ptr iterator_ptr = 0;
CosPropertyService::PropertiesIterator_out iterator_out (iterator_ptr);
-
+
propsetdef_->get_all_properties (how_many,
properties_out,
iterator_out,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN ( -1);
-
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
+
// Get these values to the _var's.
CosPropertyService::Properties_var properties = properties_out.ptr ();
CosPropertyService::PropertiesIterator_var iterator = iterator_out.ptr ();
-
+
// Print out the properties now.
if (properties.ptr () != 0)
{
@@ -587,18 +582,18 @@ Client::test_get_all_properties (CORBA::Environment &ACE_TRY_ENV)
// Helper variables to avoid warnings with .out () in SunCC.
CosPropertyService::Property* property_ptr = 0;
CosPropertyService::Property_out property_out (property_ptr);
-
+
// Call the funtion.
CORBA::Boolean next_one_result = iterator->next_one (property_out,
- ACE_TRY_ENV);
-
+ env);
+
// Get the value to the _var variable.
CosPropertyService::Property_var property = property_out.ptr ();
while (next_one_result != 0)
{
ACE_DEBUG ((LM_DEBUG, "Iteration over PropertyIterartor"));
- ACE_CHECK_RETURN ( -1);
+ TAO_CHECK_ENV_RETURN (env, -1);
ACE_DEBUG ((LM_DEBUG,
"%s : ",
property->property_name.in ()));
@@ -638,23 +633,22 @@ Client::test_get_all_properties (CORBA::Environment &ACE_TRY_ENV)
property->property_value >>= l;
ACE_DEBUG ((LM_DEBUG,"%d\n", l));
}
-
+
// Call the function for the next iteraton.
next_one_result = iterator->next_one (property_out,
- ACE_TRY_ENV);
-
+ env);
+
// Get the value to the _var variable.
property = property_out.ptr ();
}
- ACE_CHECK_RETURN ( -1);
+ TAO_CHECK_ENV_RETURN (env, -1);
}
- return 0;
}
// Testing define property with mode.
// Defines char, short, long and float properties with different modes.
int
-Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
+Client::test_define_property_with_mode (CORBA::Environment &env)
{
ACE_DEBUG ((LM_DEBUG,
"\nChecking define_property_with_mode\n"));
@@ -673,13 +667,13 @@ Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
this->propsetdef_->define_property_with_mode ("char_property",
anyval,
CosPropertyService::normal,
- ACE_TRY_ENV);
+ env);
// Check if that is an user exception, if so, print it out.
- if ((ACE_TRY_ENV.exception () != 0) &&
- (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0))
+ if ((env.exception () != 0) &&
+ (CORBA::UserException::_narrow (env.exception ()) != 0))
{
- ACE_TRY_ENV.print_exception ("char_property");
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ env.clear ();
}
// Prepare a Short and "define" that in the PropertySet.
@@ -694,13 +688,13 @@ Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
propsetdef_->define_property_with_mode ("short_property",
anyval,
CosPropertyService::read_only,
- ACE_TRY_ENV);
+ env);
// Check if that is an user exception, if so, print it out.
- if (ACE_TRY_ENV.exception () != 0)
+ if (env.exception () != 0)
{
- ACE_TRY_ENV.print_exception ("char_property");
- if (CORBA::UserException::_narrow (ACE_TRY_ENV.exception ()) != 0)
- ACE_TRY_ENV.clear ();
+ env.print_exception ("char_property");
+ if (CORBA::UserException::_narrow (env.exception ()) != 0)
+ env.clear ();
else
return -1;
}
@@ -716,10 +710,10 @@ Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
l));
CORBA::Any newany(anyval);
propsetdef_->define_property_with_mode ("long_property",
- anyval,
- CosPropertyService::fixed_normal,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN ( -1);
+ anyval,
+ CosPropertyService::fixed_normal,
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Prepare a Float and "define" that in the PropertySet.
@@ -731,10 +725,10 @@ Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
"Main : Float f = %f\n",
f));
propsetdef_->define_property_with_mode ("float_property",
- anyval,
- CosPropertyService::fixed_readonly,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN ( -1);
+ anyval,
+ CosPropertyService::fixed_readonly,
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
// Prepare a String and "define" that in the PropertySet.
ACE_DEBUG ((LM_DEBUG,
@@ -750,36 +744,34 @@ Client::test_define_property_with_mode (CORBA::Environment &ACE_TRY_ENV)
newstr));
propsetdef_->define_property ("string_property",
anyval,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN ( -1);
-
+ env);
+ TAO_CHECK_ENV_RETURN (env, -1);
+
return 0;
}
int
-Client::test_get_property_value (CORBA::Environment &ACE_TRY_ENV)
+Client::test_get_property_value (CORBA::Environment &env)
{
- ACE_UNUSED_ARG (ACE_TRY_ENV);
-
ACE_DEBUG ((LM_DEBUG, "Testing get_property_value\n"));
- ACE_TRY
+ TAO_TRY
{
// Get the ior property.
CORBA::Any_ptr any_ptr = this->propsetdef_->get_property_value ("PropertySetDef_IOR",
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
ACE_DEBUG ((LM_DEBUG, "Property value received successfully\n"));
// Check whether the IOR is fine.
CORBA::Object_var propsetdef_object;
- (*any_ptr) >>= CORBA::Any::to_object (propsetdef_object.out ());
-
+ (*any_ptr) >>= CORBA::Any::to_object (propsetdef_object);
+
CosPropertyService::PropertySetDef_var propsetdef =
CosPropertyService::PropertySetDef::_narrow (propsetdef_object.in (),
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
if (CORBA::is_nil (propsetdef.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -788,46 +780,38 @@ Client::test_get_property_value (CORBA::Environment &ACE_TRY_ENV)
ACE_DEBUG ((LM_DEBUG, "IOR retrieved\n"));
}
- ACE_CATCHANY
+ TAO_CATCHANY
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "get_property_value");
+ TAO_TRY_ENV.print_exception ("get_property_value");
return -1;
}
- ACE_ENDTRY;
- ACE_CHECK_RETURN (1);
- return 0;
+ TAO_ENDTRY;
}
int
main (int argc, char **argv)
{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- ACE_TRY
+ TAO_TRY
{
Client client;
if (client.init (argc,
argv,
- ACE_TRY_ENV) == -1)
+ TAO_TRY_ENV) == -1)
return 1;
- ACE_TRY_CHECK;
+ TAO_CHECK_ENV;
- // client.run (ACE_TRY_ENV);
- if (client.property_tester (ACE_TRY_ENV) != 0)
+ // client.run (TAO_TRY_ENV);
+ if (client.property_tester (TAO_TRY_ENV) != 0)
ACE_DEBUG ((LM_DEBUG, "Test failed\n"));
else
ACE_DEBUG ((LM_DEBUG, "Test succeeded\n"));
- ACE_TRY_CHECK;
+ TAO_CHECK_ENV;
}
- ACE_CATCHANY
+ TAO_CATCHANY
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "PropertyService Test : client");
+ TAO_TRY_ENV.print_exception ("PropertyService Test : client");
return -1;
}
- ACE_ENDTRY;
-
- return 0;
+ TAO_ENDTRY;
}