diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2007-01-25 18:04:11 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2007-01-25 18:04:11 +0000 |
commit | bae2cc6fda8827396cadd4e4c64d1c4c1145cb44 (patch) | |
tree | 3e959cad0a053f1adad663e7c02bc7a239f383d8 /TAO/orbsvcs/tests/Property | |
parent | f8976a1649fc57ae453644f1f4498824cd2eb65b (diff) | |
download | ATCD-bae2cc6fda8827396cadd4e4c64d1c4c1145cb44.tar.gz |
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/tests/Property')
-rw-r--r-- | TAO/orbsvcs/tests/Property/client.cpp | 109 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Property/client.h | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Property/main.cpp | 75 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Property/server.cpp | 28 |
4 files changed, 81 insertions, 140 deletions
diff --git a/TAO/orbsvcs/tests/Property/client.cpp b/TAO/orbsvcs/tests/Property/client.cpp index 10680104a94..bbeff9780f7 100644 --- a/TAO/orbsvcs/tests/Property/client.cpp +++ b/TAO/orbsvcs/tests/Property/client.cpp @@ -27,13 +27,11 @@ ACE_RCSID(CosPropertyService, client, "$Id$") int Client::init (int argc, - char *argv[] - ACE_ENV_ARG_DECL) + char *argv[]) { // Init the ORB. manager_.init (argc, - argv - ACE_ENV_ARG_PARAMETER); + argv); // Initialize the naming services if (my_name_client_.init (manager_.orb()) != 0) @@ -47,11 +45,9 @@ Client::init (int argc, CosNaming::Name propsetdef_name (1); propsetdef_name.length (1); propsetdef_name [0].id = CORBA::string_dup ("PropertySetDef"); - CORBA::Object_var propsetdef_obj = my_name_client_->resolve (propsetdef_name - ACE_ENV_ARG_PARAMETER); + CORBA::Object_var propsetdef_obj = my_name_client_->resolve (propsetdef_name); - this->propsetdef_ = CosPropertyService::PropertySetDef::_narrow (propsetdef_obj.in () - ACE_ENV_ARG_PARAMETER); + this->propsetdef_ = CosPropertyService::PropertySetDef::_narrow (propsetdef_obj.in ()); if (CORBA::is_nil (this->propsetdef_.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -81,7 +77,7 @@ Client::property_tester (void) this->test_get_property_value (); // Testing delete property. - this->test_delete_property ("no_property" ACE_ENV_ARG_PARAMETER); + this->test_delete_property ("no_property"); // Testing get_properties. this->test_get_properties (); @@ -126,8 +122,7 @@ Client::test_define_property (void) anyval >>= CORBA::Any::to_char (ch); this->propsetdef_->define_property ("char_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Short and "define" that in the PropertySet. CORBA::Short s = 3; @@ -136,8 +131,7 @@ Client::test_define_property (void) anyval >>= s; propsetdef_->define_property ("short_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Long and "define" that in the PropertySet. CORBA::Long l = 931232; @@ -146,8 +140,7 @@ Client::test_define_property (void) anyval >>= l; CORBA::Any newany(anyval); propsetdef_->define_property ("long_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Float and "define" that in the PropertySet. CORBA::Float f = 3.14F; @@ -156,8 +149,7 @@ Client::test_define_property (void) anyval >>= f; propsetdef_->define_property ("float_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a String and "define" that in the PropertySet. @@ -166,8 +158,7 @@ Client::test_define_property (void) const char * newstr; anyval >>= newstr; propsetdef_->define_property ("string_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); return 0; @@ -197,8 +188,7 @@ Client::test_get_all_property_names (void) propsetdef_->get_all_property_names (how_many, names_out, - iterator_out - ACE_ENV_ARG_PARAMETER); + iterator_out); // Get the values back to var. names_var = names_out.ptr (); @@ -226,7 +216,7 @@ Client::test_get_all_property_names (void) CosPropertyService::PropertyName_out name_out (name_ptr); // Call the function. - CORBA::Boolean next_one_result = iterator_var->next_one (name_out ACE_ENV_ARG_PARAMETER); + CORBA::Boolean next_one_result = iterator_var->next_one (name_out); // Get the values back on a _var variable. CosPropertyService::PropertyName_var name_var = name_out.ptr (); @@ -236,7 +226,7 @@ Client::test_get_all_property_names (void) 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_ENV_ARG_PARAMETER); + next_one_result = iterator_var->next_one (name_out); // Get the values back on a _var variable. name_var = name_out.ptr (); @@ -277,8 +267,7 @@ Client::test_get_properties (void) // Get the properties. CORBA::Boolean return_val = propsetdef_->get_properties (names.in (), - properties_out - ACE_ENV_ARG_PARAMETER); + properties_out); ACE_UNUSED_ARG (return_val); @@ -358,27 +347,24 @@ Client::test_get_number_of_properties (void) // Test delete_property. int -Client::test_delete_property (const char *property_name - ACE_ENV_ARG_DECL) +Client::test_delete_property (const char *property_name) { - ACE_TRY + try { CORBA::String_var property_name_var (property_name); - this->propsetdef_->delete_property (property_name_var.in () - ACE_ENV_ARG_PARAMETER); + this->propsetdef_->delete_property (property_name_var.in ()); } - ACE_CATCH (CORBA::UserException, ex) + catch (const CORBA::UserException& ex) { // For no property, it is ok to get the user exception. return 0; } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ex, "Not an user exception"); + ex._tao_print_exception ("Not an user exception"); return -1; } - ACE_ENDTRY; return 0; } @@ -397,8 +383,7 @@ Client::test_delete_properties (void) prop_names [1] = CORBA::string_dup ("short_property"); prop_names [2] = CORBA::string_dup ("long_property"); // prop_names [3] = CORBA::string_dup ("no_property"); - this->propsetdef_->delete_properties (prop_names - ACE_ENV_ARG_PARAMETER); + this->propsetdef_->delete_properties (prop_names); return 0; } @@ -445,7 +430,7 @@ Client::test_define_properties (void) nproperties[3].property_value <<= f; // Define this sequence of properties now. - this->propsetdef_->define_properties (nproperties ACE_ENV_ARG_PARAMETER); + this->propsetdef_->define_properties (nproperties); return 0; } @@ -471,8 +456,7 @@ Client::test_get_all_properties (void) propsetdef_->get_all_properties (how_many, properties_out, - iterator_out - ACE_ENV_ARG_PARAMETER); + iterator_out); // Get these values to the _var's. CosPropertyService::Properties_var properties = properties_out.ptr (); @@ -527,8 +511,7 @@ Client::test_get_all_properties (void) CosPropertyService::Property_out property_out (property_ptr); // Call the funtion. - CORBA::Boolean next_one_result = iterator->next_one (property_out - ACE_ENV_ARG_PARAMETER); + CORBA::Boolean next_one_result = iterator->next_one (property_out); // Get the value to the _var variable. CosPropertyService::Property_var property = property_out.ptr (); @@ -576,8 +559,7 @@ Client::test_get_all_properties (void) } // Call the function for the next iteraton. - next_one_result = iterator->next_one (property_out - ACE_ENV_ARG_PARAMETER); + next_one_result = iterator->next_one (property_out); // Get the value to the _var variable. property = property_out.ptr (); @@ -602,8 +584,7 @@ Client::test_define_property_with_mode (void) this->propsetdef_->define_property_with_mode ("char_property", anyval, - CosPropertyService::normal - ACE_ENV_ARG_PARAMETER); + CosPropertyService::normal); // Prepare a Short and "define" that in the PropertySet. CORBA::Short s = 3; @@ -613,8 +594,7 @@ Client::test_define_property_with_mode (void) propsetdef_->define_property_with_mode ("short_property", anyval, - CosPropertyService::read_only - ACE_ENV_ARG_PARAMETER); + CosPropertyService::read_only); // Prepare a Long and "define" that in the PropertySet. CORBA::Long l = 931232; @@ -624,8 +604,7 @@ Client::test_define_property_with_mode (void) CORBA::Any newany(anyval); propsetdef_->define_property_with_mode ("long_property", anyval, - CosPropertyService::fixed_normal - ACE_ENV_ARG_PARAMETER); + CosPropertyService::fixed_normal); // Prepare a Float and "define" that in the PropertySet. @@ -635,8 +614,7 @@ Client::test_define_property_with_mode (void) anyval >>= f; propsetdef_->define_property_with_mode ("float_property", anyval, - CosPropertyService::fixed_readonly - ACE_ENV_ARG_PARAMETER); + CosPropertyService::fixed_readonly); // Prepare a String and "define" that in the PropertySet. CORBA::String_var strvar (CORBA::string_dup ("Test_String")); @@ -645,8 +623,7 @@ Client::test_define_property_with_mode (void) anyval >>= newstr; propsetdef_->define_property ("string_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); return 0; } @@ -654,47 +631,41 @@ Client::test_define_property_with_mode (void) int Client::test_get_property_value (void) { - ACE_TRY + try { // Get the ior property. - CORBA::Any_ptr any_ptr = this->propsetdef_->get_property_value ("PropertySetDef_IOR" - ACE_ENV_ARG_PARAMETER); + CORBA::Any_ptr any_ptr = this->propsetdef_->get_property_value ("PropertySetDef_IOR"); // Check whether the IOR is fine. CORBA::Object_var propsetdef_object; (*any_ptr) >>= CORBA::Any::to_object (propsetdef_object.out ()); CosPropertyService::PropertySetDef_var propsetdef = - CosPropertyService::PropertySetDef::_narrow (propsetdef_object.in () - ACE_ENV_ARG_PARAMETER); + CosPropertyService::PropertySetDef::_narrow (propsetdef_object.in ()); if (CORBA::is_nil (propsetdef.in ())) ACE_ERROR_RETURN ((LM_ERROR, "invalid object reference\n"), -1); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "get_property_value"); + ex._tao_print_exception ("get_property_value"); return -1; } - ACE_ENDTRY; return 0; } int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { Client client; if (client.init (argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) + argv) == -1) return 1; // client.run (); @@ -704,13 +675,11 @@ main (int argc, char **argv) else ACE_DEBUG ((LM_DEBUG, "Test succeeded\n")); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "PropertyService Test : client"); + ex._tao_print_exception ("PropertyService Test : client"); return -1; } - ACE_ENDTRY; return 0; } diff --git a/TAO/orbsvcs/tests/Property/client.h b/TAO/orbsvcs/tests/Property/client.h index 56c94b9de27..d32b218b952 100644 --- a/TAO/orbsvcs/tests/Property/client.h +++ b/TAO/orbsvcs/tests/Property/client.h @@ -45,8 +45,7 @@ public: // Constructor. int init (int argc, - char **argv - ACE_ENV_ARG_DECL); + char **argv); // Initialize the ORB etc, and bind the MMDevices. int run (void); @@ -57,8 +56,7 @@ public: protected: int bind_to_remote_mmdevice (int argc, - char *argv[] - ACE_ENV_ARG_DECL); + char *argv[]); // Bind to the remote MMDevice. // = Property Testing. @@ -81,8 +79,7 @@ protected: int test_get_all_properties (void); // Testing get_all_properties. - int test_delete_property (const char *property_name - ACE_ENV_ARG_DECL); + int test_delete_property (const char *property_name); // Testing delete_property. int test_delete_properties (void); diff --git a/TAO/orbsvcs/tests/Property/main.cpp b/TAO/orbsvcs/tests/Property/main.cpp index 668cb2909f1..11880dad81d 100644 --- a/TAO/orbsvcs/tests/Property/main.cpp +++ b/TAO/orbsvcs/tests/Property/main.cpp @@ -46,8 +46,7 @@ public: int test_get_number_of_properties (void); // Gets the number of properties currently defined in the PropertySet. - int test_delete_property (const char *property_name - ACE_ENV_ARG_DECL); + int test_delete_property (const char *property_name); // Delete a given property. int test_is_property_defined (void); @@ -96,7 +95,7 @@ public: int test_reset (void); // Test the reset method. - int test_next_n (size_t n ACE_ENV_ARG_DECL); + int test_next_n (size_t n); // Test the next_n method. private: TAO_PropertyNamesIterator iterator_; @@ -132,8 +131,7 @@ TAO_PropertySet_Tester::test_define_property (void) "Main : Char ch = %c\n", ch)); property_set_.define_property ("char_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Short and "define" that in the PropertySet. CORBA::Short s = 3; @@ -144,8 +142,7 @@ TAO_PropertySet_Tester::test_define_property (void) "Main : Short s = %d\n", s)); property_set_.define_property ("short_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Long and "define" that in the PropertySet. @@ -159,8 +156,7 @@ TAO_PropertySet_Tester::test_define_property (void) CORBA::Any newany(anyval); property_set_.define_property ("long_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a Float and "define" that in the PropertySet. CORBA::Float f = 3.14; @@ -171,8 +167,7 @@ TAO_PropertySet_Tester::test_define_property (void) "Main : Float f = %f\n", f)); property_set_.define_property ("float_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); // Prepare a String and "define" that in the PropertySet. ACE_DEBUG ((LM_DEBUG, @@ -186,8 +181,7 @@ TAO_PropertySet_Tester::test_define_property (void) strvar.in (), newstr)); property_set_.define_property ("string_property", - anyval - ACE_ENV_ARG_PARAMETER); + anyval); return 0; } @@ -206,12 +200,10 @@ TAO_PropertySet_Tester::test_get_number_of_properties (void) // Testing the delete_property. Delets property, with the given name, // if that exsists. int -TAO_PropertySet_Tester::test_delete_property (const char *property_name - ACE_ENV_ARG_DECL) +TAO_PropertySet_Tester::test_delete_property (const char *property_name) { ACE_DEBUG ((LM_DEBUG, "\nChecking delete_property\n")); - property_set_.delete_property (property_name - ACE_ENV_ARG_PARAMETER); + property_set_.delete_property (property_name); return 0; } @@ -224,8 +216,7 @@ TAO_PropertySet_Tester::test_get_property_value (void) ACE_DEBUG ((LM_DEBUG, "\nChecking get_property_value\n")); - CORBA::Any_ptr anyptr = property_set_.get_property_value ("short_property" - ACE_ENV_ARG_PARAMETER); + CORBA::Any_ptr anyptr = property_set_.get_property_value ("short_property"); // Get the short value. if (anyptr != 0) @@ -240,8 +231,7 @@ TAO_PropertySet_Tester::test_get_property_value (void) ACE_DEBUG ((LM_DEBUG, "Short property not found\n")); // Get the string. - anyptr = property_set_.get_property_value ("string_property" - ACE_ENV_ARG_PARAMETER); + anyptr = property_set_.get_property_value ("string_property"); if (anyptr != 0) { CORBA::String str; @@ -263,22 +253,19 @@ TAO_PropertySet_Tester::test_is_property_defined (void) { ACE_DEBUG ((LM_DEBUG, "\nChecking is_property_defined ()\n")); - if (property_set_.is_property_defined ("short_property" - ACE_ENV_ARG_PARAMETER) == 0) + if (property_set_.is_property_defined ("short_property") == 0) ACE_DEBUG ((LM_DEBUG, "short_property not defined\n")); else ACE_DEBUG ((LM_DEBUG, "short_property defined\n")); - if (property_set_.is_property_defined ("string_property" - ACE_ENV_ARG_PARAMETER) == 0) + if (property_set_.is_property_defined ("string_property") == 0) ACE_DEBUG ((LM_DEBUG, "string_property not defined\n")); else ACE_DEBUG ((LM_DEBUG, "string_property defined\n")); - if (property_set_.is_property_defined ("char_property" - ACE_ENV_ARG_PARAMETER) == 0) + if (property_set_.is_property_defined ("char_property") == 0) ACE_DEBUG ((LM_DEBUG, "char_property not defined\n")); else @@ -306,8 +293,7 @@ TAO_PropertySet_Tester::test_delete_properties (void) "Length of sequence %d, Maxlength : %d\n", prop_names.length (), prop_names.maximum ())); - property_set_.delete_properties (prop_names - ACE_ENV_ARG_PARAMETER); + property_set_.delete_properties (prop_names); return 0; } @@ -363,7 +349,7 @@ TAO_PropertySet_Tester::test_define_properties (void) nproperties[4].property_value <<= strvar.in (); // Define this sequence of properties now. - property_set_.define_properties (nproperties ACE_ENV_ARG_PARAMETER); + property_set_.define_properties (nproperties); return 0; } @@ -405,11 +391,11 @@ TAO_PropertyNamesIterator_Tester::test_next_one (void) ACE_DEBUG ((LM_DEBUG, "\nTesting next_one of NamesIterator, Iterating thru names.\n")); // Let us iterate, now. - int ret = iterator_.next_one (strvar.out () ACE_ENV_ARG_PARAMETER); + int ret = iterator_.next_one (strvar.out ()); while (ret != 0) { ACE_DEBUG ((LM_DEBUG, "Str : %s\n", strvar.in ())); - ret = iterator_.next_one (strvar.out () ACE_ENV_ARG_PARAMETER); + ret = iterator_.next_one (strvar.out ()); } return 0; } @@ -426,14 +412,13 @@ TAO_PropertyNamesIterator_Tester::test_reset (void) // Test the next_n method. Get the next n names and print them all. int -TAO_PropertyNamesIterator_Tester::test_next_n (size_t n - ACE_ENV_ARG_DECL) +TAO_PropertyNamesIterator_Tester::test_next_n (size_t n) { CosPropertyService::PropertyNames_var pnames_var; ACE_DEBUG ((LM_DEBUG, "Checking next_n (), next %d\n", n)); - int ret = iterator_.next_n (n, pnames_var.out () ACE_ENV_ARG_PARAMETER); + int ret = iterator_.next_n (n, pnames_var.out ()); if (ret == 0) { // Return if no more items in the iterator. @@ -451,12 +436,11 @@ TAO_PropertyNamesIterator_Tester::test_next_n (size_t n int main (int argc, char *argv []) { - ACE_TRY + try { CORBA::ORB_var orb_var = CORBA::ORB_init (argc, argv, - "internet" - ACE_ENV_ARG_PARAMETER); + "internet"); // = Checking PropertySet interface. @@ -472,7 +456,7 @@ main (int argc, char *argv []) propertyset_tester.test_get_number_of_properties (); // Test delete property. Delete "string_property" - propertyset_tester.test_delete_property ("string_property" ACE_ENV_ARG_PARAMETER); + propertyset_tester.test_delete_property ("string_property"); // Test the number of properties and print it out. propertyset_tester.test_get_number_of_properties (); @@ -527,21 +511,20 @@ main (int argc, char *argv []) names_iterator_tester.test_reset (); // Checking next_n. Prints out all the names it has got. - names_iterator_tester.test_next_n (6 ACE_ENV_ARG_PARAMETER); + names_iterator_tester.test_next_n (6); // Try next_n without resetting. - names_iterator_tester.test_next_n (6 ACE_ENV_ARG_PARAMETER); + names_iterator_tester.test_next_n (6); } - ACE_CATCH (CORBA::SystemException, sysex) + catch (const CORBA::SystemException& sysex) { - ACE_ENV_ARG_PARAMETER.print_exception ("System Exception"); +.print_exception ("System Exception"); return -1; } - ACE_CATCH (CORBA::UserException, userex) + catch (const CORBA::UserException& userex) { - ACE_ENV_ARG_PARAMETER.print_exception ("User Exception"); +.print_exception ("User Exception"); return -1; } - ACE_ENDTRY; return 0; } diff --git a/TAO/orbsvcs/tests/Property/server.cpp b/TAO/orbsvcs/tests/Property/server.cpp index 51cea140346..3dd1774a9b9 100644 --- a/TAO/orbsvcs/tests/Property/server.cpp +++ b/TAO/orbsvcs/tests/Property/server.cpp @@ -25,17 +25,15 @@ ACE_RCSID(CosPropertyService, server, "$Id$") int main (int argc, char ** argv) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { TAO_ORB_Manager m; // Initialize the ORB. m.init_child_poa (argc, argv, - "child_poa" - ACE_ENV_ARG_PARAMETER); + "child_poa"); // Using naming server. TAO_Naming_Client my_name_client; @@ -54,8 +52,7 @@ main (int argc, char ** argv) propsetdef_name.length (1); propsetdef_name[0].id = CORBA::string_dup ("PropertySetDef"); my_name_client->bind (propsetdef_name, - propsetdef.in () - ACE_ENV_ARG_PARAMETER); + propsetdef.in ()); CORBA::Any any_val; // Make this IOR as one of the properties in there. @@ -67,12 +64,11 @@ main (int argc, char ** argv) // any_val.replace (CORBA::_tc_Object, // &ior_ptr, // 1 - // ACE_ENV_ARG_PARAMETER); + //); propsetdef_impl->define_property_with_mode ("PropertySetDef_IOR", any_val, - CosPropertyService::fixed_readonly - ACE_ENV_ARG_PARAMETER); + CosPropertyService::fixed_readonly); // Create PropertySet factory and then register. TAO_PropertySetFactory *propset_factory_impl; @@ -86,25 +82,21 @@ main (int argc, char ** argv) propset_factory_name.length (1); propset_factory_name[0].id = CORBA::string_dup ("PropertySetFactory"); my_name_client->bind (propset_factory_name, - propset_factory.in () - ACE_ENV_ARG_PARAMETER); + propset_factory.in ()); // Run the ORB Event loop. m.run (); } - ACE_CATCH (CORBA::SystemException, sysex) + catch (const CORBA::SystemException& sysex) { - ACE_PRINT_EXCEPTION (sysex, - "System Exception"); + sysex._tao_print_exception ("System Exception"); return 1; } - ACE_CATCH (CORBA::UserException, userex) + catch (const CORBA::UserException& userex) { - ACE_PRINT_EXCEPTION (userex, - "User Exception"); + userex._tao_print_exception ("User Exception"); return 1; } - ACE_ENDTRY; ACE_DEBUG ((LM_DEBUG, "\nServer is terminating")); return 0; |