diff options
Diffstat (limited to 'TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp')
-rw-r--r-- | TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp | 121 |
1 files changed, 44 insertions, 77 deletions
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp index f7c3f321248..f4a02e95052 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp @@ -36,8 +36,7 @@ Client_Task::svc (void) { CORBA::Object_var obj = this->corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -48,8 +47,7 @@ Client_Task::svc (void) CORBA::Object_var simple_test_obj = this->corb_->string_to_object (simple_test_input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (simple_test_obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -58,42 +56,34 @@ Client_Task::svc (void) 1); } - Test::Simple_Test_var simple_test + Test::Simple_Test_var simple_test = Test::Simple_Test::_narrow (simple_test_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Request_var req (obj->_request ("test_basic_arg" ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; req->add_in_arg ("basic") <<= TEST_BASIC_VALUE; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_unbounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("ub_string") <<= TEST_STR; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_bounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + ACE_CString bs (TEST_STR); bs = bs.substr (0, ::Test::BOUNDED_STRING_SIZE); - req->add_in_arg ("bd_string") + req->add_in_arg ("bd_string") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_fixed_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Fixed_Array fixed_array; @@ -103,159 +93,136 @@ Client_Task::svc (void) } req->add_in_arg ("fixed_array") <<= ::Test::Fixed_Array_forany (fixed_array); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_var_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Var_Array var_array; for (CORBA::ULong i = 0; i < ::Test::VAR_ARRAY_SIZE; ++i) - { + { var_array[i] = CORBA::string_dup(TEST_STR); } req->add_in_arg ("var_array") <<= var_array; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_bounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ACE_CString bvs (TEST_STR); bvs = bvs.substr (0, ::Test::BOUNDED_VAR_SIZE); - ::Test::Bounded_Var_Size_Arg* bd_var_size + ::Test::Bounded_Var_Size_Arg* bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); req->add_in_arg ("bd_var_size") <<= bd_var_size; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_unbounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - ::Test::Unbounded_Var_Size_Arg* ub_var_size + ::Test::Unbounded_Var_Size_Arg* ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); req->add_in_arg ("ub_var_size") <<= ub_var_size; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_fixed_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::TimeOfDay t; - t.hour = TEST_HOUR; + t.hour = TEST_HOUR; t.minute = TEST_MINUTE; t.second = TEST_SECOND; req->add_in_arg ("fixed_size") <<= t; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_special_basic_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("special") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_object_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("object") <<= simple_test_obj.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_objref_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("objref") <<= simple_test.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_1" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= simple_test_obj.in (); req->add_in_arg ("arg2") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); req->add_in_arg ("arg3") <<= simple_test.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_2" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= TEST_STR; req->add_in_arg ("arg2") <<= ::Test::Fixed_Array_forany (fixed_array); req->add_in_arg ("arg3") <<= t; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_3" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - bd_var_size + bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); - ub_var_size + ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); for (CORBA::ULong j = 0; j < ::Test::VAR_ARRAY_SIZE; ++j) - { + { var_array[j] = CORBA::string_dup(TEST_STR); } - req->add_in_arg ("arg1") + req->add_in_arg ("arg1") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); req->add_in_arg ("arg2") <<= bd_var_size; req->add_in_arg ("arg3") <<= ub_var_size; req->add_in_arg ("arg4") <<= var_array; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("shutdown" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + } ACE_CATCHANY @@ -277,7 +244,7 @@ Client_Task::svc (void) } -CORBA::ULong +CORBA::ULong Client_Task::error_count () const { return error_count_; |