1 #include "Foo_ClientEngine.h"
2 #include "Foo_Statistics.h"
3 #include "TestInf/TestAppExceptionC.h"
4 #include "TestInf/AppHelper.h"
5 #include "ace/Log_Msg.h"
8 Foo_ClientEngine::Foo_ClientEngine(Foo_ptr obj
, unsigned client_id
)
9 : obj_(Foo::_duplicate(obj
)),
15 Foo_ClientEngine::~Foo_ClientEngine()
21 Foo_ClientEngine::execute(unsigned num_loops
)
23 // Make sure the connection is established before making
24 // remote invocations.
25 if (AppHelper::validate_connection(this->obj_
.in()) == false)
28 "(%P|%t)Foo_ClientEngine::execute - "
29 "client %d connect failed.\n", this->client_id_
));
33 // Verify the return values and return the results.
36 for (unsigned loop
= 0; loop
< num_loops
; loop
++)
38 CORBA::Long i
= this->client_id_
;
43 CORBA::Long value
= this->obj_
->op3(i
);
44 success
= (value
!= i
) ? false : success
;
46 for (CORBA::Long j
= 1; j
<= 5; j
++)
48 this->obj_
->op4(495 + (i
* 5) + j
);
51 bool caught_exception
= false;
57 catch (const FooException
&)
60 caught_exception
= true;
63 success
= (!caught_exception
) ? false : success
;
72 Foo_ClientEngine::expected_results(Foo_Statistics
& stats
)