diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-11-06 19:33:40 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-11-06 19:33:40 +0000 |
commit | 3f77203e79a8454842c08602d48cbf4c16c212a2 (patch) | |
tree | 730d36b72b3fa149950f111fbe6e4e2f89b934e2 /TAO/tests/Bug_2134_Regression | |
parent | dae4230da6e911194b33c006b480918148740586 (diff) | |
download | ATCD-3f77203e79a8454842c08602d48cbf4c16c212a2.tar.gz |
ChangeLogTag: Mon Nov 6 19:33:15 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tests/Bug_2134_Regression')
-rw-r--r-- | TAO/tests/Bug_2134_Regression/Bug_2134_Regression.mpc | 2 | ||||
-rw-r--r-- | TAO/tests/Bug_2134_Regression/Hello.cpp | 43 |
2 files changed, 38 insertions, 7 deletions
diff --git a/TAO/tests/Bug_2134_Regression/Bug_2134_Regression.mpc b/TAO/tests/Bug_2134_Regression/Bug_2134_Regression.mpc index 2a3a953d97a..82d305b5af4 100644 --- a/TAO/tests/Bug_2134_Regression/Bug_2134_Regression.mpc +++ b/TAO/tests/Bug_2134_Regression/Bug_2134_Regression.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project (*Test) : taoserver, iortable, minimum_corba { +project (*Test) : taoserver, iortable, minimum_corba, messaging { Source_Files { Hello.cpp } diff --git a/TAO/tests/Bug_2134_Regression/Hello.cpp b/TAO/tests/Bug_2134_Regression/Hello.cpp index 53eb63216e5..e5979299664 100644 --- a/TAO/tests/Bug_2134_Regression/Hello.cpp +++ b/TAO/tests/Bug_2134_Regression/Hello.cpp @@ -2,6 +2,8 @@ #include "tao/corba.h" #include "tao/IORTable/IORTable.h" +#include "tao/Messaging/Messaging.h" +#include "tao/AnyTypeCode/Any.h" #include "ace/OS_NS_string.h" #include "ace/SString.h" @@ -19,6 +21,7 @@ public: int main(int argc, char* argv[]) { + int status = 0; CORBA::ORB_var orb = CORBA::ORB::_nil(); ACE_TRY_NEW_ENV @@ -82,13 +85,41 @@ int main(int argc, char* argv[]) CORBA::Object_var obj = orb->string_to_object (friendly_corbaloc.c_str ()); ACE_TRY_CHECK; - Test::Hello_var hello2 = Test::Hello::_narrow (obj.in ()); - ACE_TRY_CHECK; + TimeBase::TimeT timeout = 10000000; + + CORBA::Any timeout_any; + timeout_any <<= timeout; + + CORBA::PolicyList policy_list (1); + policy_list.length (1); + + policy_list[0] = orb->create_policy ( + Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, + timeout_any); + + CORBA::Object_var rtt_obj = obj->_set_policy_overrides ( + policy_list, + CORBA::SET_OVERRIDE); + + policy_list[0]->destroy(); - hello2->say_hello (); + Test::Hello_var hello2 = Test::Hello::_narrow (rtt_obj.in ()); ACE_TRY_CHECK; - ACE_DEBUG ((LM_DEBUG, "Test succeeded !!!\n")); + if (CORBA::is_nil (hello2.in ())) + { + ACE_ERROR ((LM_ERROR, + "Unable to narrow from " + "corbaloc with policy override\n")); + status = 1; + } + else + { + hello2->say_hello (); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Test succeeded !!!\n")); + } orb->destroy(); ACE_TRY_CHECK; @@ -97,9 +128,9 @@ int main(int argc, char* argv[]) { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error - test failed - exception caught:"); - return 1; + status = 1; } ACE_ENDTRY; - return 0; + return status; } |