diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-08-28 23:39:11 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-08-28 23:39:11 +0000 |
commit | 903e87e4a1d9262a7dd18ca4e0bf74f0619ea168 (patch) | |
tree | 590fb7bed3a69cc32c2ada405a02bf2f4e01b4f7 | |
parent | 8b82191cb5498d4ea4395c8dd1700a12267fd657 (diff) | |
download | ATCD-903e87e4a1d9262a7dd18ca4e0bf74f0619ea168.tar.gz |
ChangeLogTag:Thu Aug 28 18:36:29 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
7 files changed, 126 insertions, 24 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref index 940b95dfd65..03234d134b5 100644 --- a/TAO/ChangeLog_ref +++ b/TAO/ChangeLog_ref @@ -1,3 +1,14 @@ +Thu Aug 28 18:36:29 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tests/Portable_Interceptors/Dynamic/client.cpp: + * tests/Portable_Interceptors/Dynamic/interceptors.cpp: + * tests/Portable_Interceptors/Dynamic/test.idl: + * tests/Portable_Interceptors/Dynamic/test_i.cpp: + * tests/Portable_Interceptors/Dynamic/test_i.h: Test "out" + arguments in the IDL. There was no support for out arguments + before in interceptors. With the new architecture this shold + work. + Thu Aug 28 17:51:57 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp: diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp index ba7cc997692..3f05ba17672 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp @@ -41,7 +41,11 @@ void run_test (Test_Interceptors::Visual_ptr server ACE_ENV_ARG_DECL) { - server->normal (10 ACE_ENV_ARG_PARAMETER); + CORBA::String_var msg; + + server->normal (10, + msg.out () + ACE_ENV_ARG_PARAMETER); ACE_CHECK; CORBA::Long one = 1, two = 1, result = 0; diff --git a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp index cc7bc8877e7..235c79f5db1 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/interceptors.cpp @@ -1,6 +1,7 @@ // $Id$ #include "interceptors.h" +#include "ace/streams.h" ACE_RCSID (Dynamic, interceptors, @@ -59,20 +60,41 @@ Echo_Client_Request_Interceptor::send_request ( "\"%s\"\n", op.in ())); - if (ACE_OS::strcmp (op.in (), "normal") == 0) + // For the "normal" operation, get the argument list. + if (ACE_OS::strcmp (op.in (), + "normal") == 0) { Dynamic::ParameterList_var paramlist = ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - CORBA::Long param; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i].argument >>= param; - - ACE_DEBUG ((LM_DEBUG, - "The arg is %d\n", - param)); + if (paramlist->length () != 2) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) All parameters not available \n")); + + } + + CORBA::ULong first = 0, second = 1; // If you dont understand + // why this is done, then + // try changing it. + if (paramlist[first].mode != CORBA::PARAM_IN || + paramlist[second].mode != CORBA::PARAM_OUT) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR in the extracted argument list \n")); + } + + CORBA::Long param = 0; + paramlist[first].argument >>= param; + + if (param != 10) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR in send_request while checking ", + "the value of the extracted ", + "arguments \n")); + } } } @@ -108,21 +130,58 @@ Echo_Client_Request_Interceptor::receive_reply ( "from \"%s\"\n", op.in ())); - if (ACE_OS::strcmp (op.in (), "normal") == 0) + // For the "normal" operation, get the argument list. + if (ACE_OS::strcmp (op.in (), + "normal") == 0) { Dynamic::ParameterList_var paramlist = ri->arguments (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - CORBA::Long param; - CORBA::ULong i = 0; // index -- explicitly used to avoid - // overloaded operator ambiguity. - paramlist[i].argument >>= param; - - ACE_DEBUG ((LM_DEBUG, - "The arg is %d\n", - param)); + if (paramlist->length () != 2) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) All parameters not available \n")); + + } + + CORBA::ULong first = 0, second = 1; // If you dont understand + // why this is done, then + // try changing it. + if (paramlist[first].mode != CORBA::PARAM_IN || + paramlist[second].mode != CORBA::PARAM_OUT) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR in the extracted argument list \n")); + } + + CORBA::Long param = 0; + paramlist[first].argument >>= param; + + if (param != 10) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR in send_request while checking ", + "the value of the extracted ", + "arguments \n")); + } + + const char *str = 0; + + paramlist[second].argument >>= str; + + CORBA::String_var transfer (str); + + if (ACE_OS::strcmp (str, + "DO_NOT_INSULT_MY_INTELLIGENCE") != 0) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR in send_request while checking ", + "the value of the extracted ", + "out arguments \n")); + } } + if (ACE_OS::strcmp (op.in (), "calculate") == 0) { Dynamic::ParameterList_var paramlist = @@ -135,9 +194,11 @@ Echo_Client_Request_Interceptor::receive_reply ( paramlist[i++].argument >>= param1; paramlist[i].argument >>= param2; + cout << "Here" << endl; CORBA::Any_var result_any = ri->result (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; + cout << "Here ***" << endl; (result_any.in ()) >>= result; ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test.idl b/TAO/tests/Portable_Interceptors/Dynamic/test.idl index 1b610a71d40..b1ac5f81ce5 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/test.idl +++ b/TAO/tests/Portable_Interceptors/Dynamic/test.idl @@ -29,7 +29,7 @@ module Test_Interceptors // = DESCRIPTION // - void normal (in long arg); + void normal (in long arg, out string msg); // Normal operation. long calculate (in long one, in long two); @@ -44,7 +44,5 @@ module Test_Interceptors oneway void shutdown (); // shutdown the ORB - - }; }; diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp index d760688fb6d..7108b2052c6 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.cpp @@ -11,11 +11,13 @@ Visual_i::Visual_i (CORBA::ORB_ptr orb) // ctor void -Visual_i::normal (CORBA::Long arg +Visual_i::normal (CORBA::Long arg, + CORBA::String_out msg ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_DEBUG ((LM_DEBUG, "Visual::normal called with %d\n", arg)); + msg = CORBA::string_dup ("DO_NOT_INSULT_MY_INTELLIGENCE"); } CORBA::Long diff --git a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h index f31756fb10a..93152be70a5 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/test_i.h +++ b/TAO/tests/Portable_Interceptors/Dynamic/test_i.h @@ -27,7 +27,8 @@ public: Visual_i (CORBA::ORB_ptr orb); // ctor - void normal (CORBA::Long arg + void normal (CORBA::Long arg, + CORBA::String_out msg ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp index f1463742537..53174f887a5 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/interceptors.cpp @@ -71,12 +71,16 @@ Echo_Client_Request_Interceptor::send_request ( this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; +#if 0 ACE_DEBUG ((LM_DEBUG, "%s.send_request " "from \"%s\" on object: %s\n", this->myname_, operation.in (), ior.in ())); +#endif /*if 0*/ + + // Populate target member of the ClientRequestInfo. @@ -139,12 +143,14 @@ Echo_Client_Request_Interceptor::receive_reply ( this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; +#if 0 ACE_DEBUG ((LM_DEBUG, "%s.receive_reply from " "\"%s\" on object: %s\n", this->myname_, operation.in (), ior.in ())); +#endif /*if 0*/ // Check that the reply service context was received as // expected. @@ -154,9 +160,11 @@ Echo_Client_Request_Interceptor::receive_reply ( const char *buf = ACE_reinterpret_cast (const char *, sc->context_data.get_buffer ()); +#if 0 ACE_DEBUG ((LM_DEBUG, " Received reply service context: %s\n", buf)); +#endif /*if 0*/ if (ACE_OS::strcmp (buf, reply_msg) != 0) { @@ -222,12 +230,14 @@ Echo_Client_Request_Interceptor::receive_exception ( this->orb_->object_to_string (target.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; +#if 0 ACE_DEBUG ((LM_DEBUG, "%s.received_exception " "from \"%s\" on object: %s\n", this->myname_, operation.in (), ior.in ())); +#endif /*if 0*/ // Check that the reply service context was received as // expected. @@ -237,9 +247,12 @@ Echo_Client_Request_Interceptor::receive_exception ( const char *buf = ACE_reinterpret_cast (const char *, sc->context_data.get_buffer ()); + +#if 0 ACE_DEBUG ((LM_DEBUG, " Received reply service context: %s\n", buf)); +#endif /*if 0*/ if (ACE_OS::strcmp (buf, reply_msg) != 0) { @@ -318,9 +331,11 @@ Echo_Server_Request_Interceptor::receive_request_service_contexts ( const char *buf = ACE_reinterpret_cast (const char *, sc->context_data.get_buffer ()); +#if 0 ACE_DEBUG ((LM_DEBUG, " Received service context: %s\n", buf)); +#endif /*if 0*/ if (ACE_OS::strcmp (buf, request_msg) != 0) { @@ -368,10 +383,12 @@ Echo_Server_Request_Interceptor::send_reply ( CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; +#if 0 ACE_DEBUG ((LM_DEBUG, "%s.send_reply from \"%s\"\n", this->myname_, ri->operation ())); +#endif /*if 0*/ // Check that the reply service context is set as expected. IOP::ServiceContext_var sc = @@ -380,9 +397,12 @@ Echo_Server_Request_Interceptor::send_reply ( const char *buf = ACE_reinterpret_cast (const char *, sc->context_data.get_buffer ()); + +#if 0 ACE_DEBUG ((LM_DEBUG, " Reply service context: %s\n", buf)); +#endif /*if 0*/ if (ACE_OS::strcmp (buf, reply_msg) != 0) { @@ -422,10 +442,12 @@ Echo_Server_Request_Interceptor::send_exception ( CORBA::String_var operation = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; +#if 0 ACE_DEBUG ((LM_DEBUG, "%s.send_exception from \"%s\"\n", this->myname_, operation.in ())); +#endif /*if 0*/ // Check that the reply service context is set as expected. IOP::ServiceContext_var sc = @@ -434,9 +456,12 @@ Echo_Server_Request_Interceptor::send_exception ( const char *buf = ACE_reinterpret_cast (const char *, sc->context_data.get_buffer ()); + +#if 0 ACE_DEBUG ((LM_DEBUG, " Reply service context: %s\n", buf)); +#endif /*if 0*/ if (ACE_OS::strcmp (buf, reply_msg) != 0) { |