2 #include "Client_Task.h"
4 Client_Task::Client_Task (const ACE_TCHAR
*ior
,
6 ACE_Thread_Manager
*thr_mgr
)
7 : ACE_Task_Base (thr_mgr
)
9 , corb_ (CORBA::ORB::_duplicate (corb
))
14 Client_Task::test_system_exception (
15 Test::Hello_ptr hello_ptr
)
19 hello_ptr
->system_exception_test ();
21 catch (const CORBA::INTERNAL
& )
23 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - Caught internal exception as expected\n"));
26 catch (const CORBA::Exception
& ex
)
28 ex
._tao_print_exception (
29 "Unexpected exception caught in test_system_exception:");
35 Client_Task::test_user_exception_expected (
36 Test::Hello_ptr hello_ptr
)
40 hello_ptr
->user_exception_expected ();
42 catch (const ::Test::Hello::A
& )
44 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - Caught user A exception as expected\n"));
47 catch (const CORBA::Exception
& ex
)
49 ex
._tao_print_exception (
50 "Unexpected exception caught in test_user_exception_expected:");
56 Client_Task::test_user_exception_not_expected (
57 Test::Hello_ptr hello_ptr
)
61 hello_ptr
->user_exception_not_expected ();
63 catch (const CORBA::UNKNOWN
& ex
)
65 if ((ex
.minor() & 0xFFFU
) == 1)
67 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - Caught unknown exception as expected\n"));
71 ex
._tao_print_exception (
72 "Unexpected exception caught in user_exception_not_expected:");
77 catch (const CORBA::Exception
& ex
)
79 ex
._tao_print_exception (
80 "Unexpected exception caught in user_exception_not_expected:");
90 CORBA::Object_var tmp
= this->corb_
->string_to_object (input_
);
92 Test::Hello_var hello
= Test::Hello::_narrow(tmp
.in ());
94 if (CORBA::is_nil (hello
.in ()))
96 ACE_ERROR_RETURN ((LM_DEBUG
,
97 "Nil Test::Hello reference <%s>\n",
102 CORBA::String_var the_string
= hello
->get_string ();
104 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - string returned <%C>\n",
107 this->test_system_exception (hello
.in ());
109 this->test_user_exception_expected (hello
.in ());
111 this->test_user_exception_not_expected (hello
.in ());
115 catch (const CORBA::Exception
& ex
)
117 ex
._tao_print_exception ("Exception caught:");