Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Collocated_NoColl / Client_Task.cpp
blobebd3d169b4a325d2c21afa5198356ce12e040fdf
2 #include "Client_Task.h"
3 #include "TestC.h"
5 Client_Task::Client_Task (const ACE_TCHAR *ior,
6 CORBA::ORB_ptr corb,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , input_ (ior)
10 , corb_ (CORBA::ORB::_duplicate (corb))
15 int
16 Client_Task::svc ()
18 int status = 0;
20 try
22 CORBA::Object_var tmp =
23 this->corb_->string_to_object (input_);
25 Test::Hello_var hello =
26 Test::Hello::_narrow(tmp.in ());
28 if (CORBA::is_nil (hello.in ()))
30 ACE_ERROR_RETURN ((LM_DEBUG,
31 "Nil Test::Hello reference <%s>\n",
32 input_),
33 1);
36 CORBA::String_var the_string =
37 hello->get_string ();
39 if (ACE_OS::strcmp (the_string.in (), "Hello there!") != 0)
41 ACE_ERROR ((LM_ERROR, "(%P|%t) - Error, incorrect string returned <%C>\n",
42 the_string.in ()));
43 status = 1;
46 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n",
47 the_string.in ()));
49 hello->shutdown ();
51 catch (const CORBA::Exception& ex)
53 ex._tao_print_exception ("Exception caught:");
54 status = 1;
57 return status;