Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Collocated_DerivedIF / Client_Task.cpp
blob01fc08696f7136d1a1ddfa6680148445c3e66ef7
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::HelloAgain_var hello_again =
26 Test::HelloAgain::_narrow(tmp.in ());
28 if (CORBA::is_nil (hello_again.in()))
30 ACE_ERROR_RETURN ((LM_DEBUG,
31 "Nil Test::HelloAgain reference <%s>\n",
32 input_),
33 1);
36 CORBA::String_var the_string = hello_again->get_string ();
37 if (ACE_OS::strcmp (the_string.in (), "Hello there!") != 0)
39 ACE_ERROR ((LM_ERROR, "(%P|%t) - Error, incorrect string returned <%C>\n",
40 the_string.in ()));
41 status = 1;
43 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string from hello_again returned <%C>\n",
44 the_string.in ()));
45 the_string = hello_again->get_string_again ();
47 if (ACE_OS::strcmp (the_string.in (), "Bye!") != 0)
49 ACE_ERROR ((LM_ERROR, "(%P|%t) - Error, incorrect string returned <%C>\n",
50 the_string.in ()));
51 status = 1;
54 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string from hello_again returned <%C>\n",
55 the_string.in ()));
56 hello_again->shutdown ();
58 catch (const CORBA::Exception& ex)
60 ex._tao_print_exception ("Exception caught:");
61 status = 1;
64 return status;