Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Bug_2241_Regression / Client_Task.cpp
blobf0a1d3f3180dcb1e925c551f327afd9b8772b1f7
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 CORBA::Boolean exception = false;
19 try
21 CORBA::Object_var tmp =
22 this->corb_->string_to_object (input_);
23 Test::Hello_var hello =
24 Test::Hello::_narrow(tmp.in ());
26 if (CORBA::is_nil (hello.in ()))
28 ACE_ERROR_RETURN ((LM_DEBUG,
29 "Nil Test::Hello reference <%s>\n",
30 input_),
31 1);
33 try
35 CORBA::String_var the_string = hello->get_string ();
37 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n",
38 the_string.in ()));
40 hello->shutdown ();
42 catch (const CORBA::INTERNAL&)
44 exception = true;
45 ACE_DEBUG ((LM_DEBUG, "OK: Client_Task Expected exception received\n"));
46 corb_->destroy ();
47 return 0;
50 catch (const CORBA::Exception& ex)
52 ex._tao_print_exception ("Exception caught:");
53 return 1;
55 if (!exception)
57 ACE_ERROR ((LM_ERROR, "(ERROR: Client_Task::svc Expected exception not received\n"));
59 return 0;