Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Portable_Interceptors / Collocated / Dynamic / Client_Task.cpp
blobb09c3d471ea89c4c82329af0ab6042bebcbf25c6
1 #include "Client_Task.h"
2 #include "testC.h"
3 #include "interceptors.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 try
20 CORBA::Object_var object =
21 corb_->string_to_object (input_);
23 Test_Interceptors::Visual_var server =
24 Test_Interceptors::Visual::_narrow (object.in ());
26 if (CORBA::is_nil (server.in ()))
28 ACE_ERROR_RETURN ((LM_ERROR,
29 "Object reference <%s> is nil\n",
30 this->input_),
31 1);
34 run_test (server.in ());
36 server->shutdown ();
38 catch (const CORBA::Exception& ex)
40 ex._tao_print_exception ("Exception caught in client task:");
41 return 1;
44 return 0;
48 void
49 Client_Task::run_test (Test_Interceptors::Visual_ptr server)
51 server->normal (10);
53 CORBA::Long one = 1, two = 1;
54 (void) server->calculate (one,
55 two);
57 try
59 (void) server->user ();
61 catch (const Test_Interceptors::Silly&)
63 ACE_DEBUG ((LM_DEBUG, "Caught Silly\n"));
66 try
68 server->system ();
70 catch (const CORBA::INV_OBJREF&)
72 ACE_DEBUG ((LM_DEBUG, "Caught CORBA::INV_OBJREF\n"));