diff options
author | stanleyk <stanleyk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-02-05 21:11:03 +0000 |
---|---|---|
committer | stanleyk <stanleyk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-02-05 21:11:03 +0000 |
commit | 5e030faf84086ab02059fcbcc3faed224bd57b95 (patch) | |
tree | 3a62df45ac6ccf599fb07cf6a03d672456ce2e3d /TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp | |
parent | 9d296f7fa51116ff7040ecb2ad18612cd94b5fd1 (diff) | |
download | ATCD-5e030faf84086ab02059fcbcc3faed224bd57b95.tar.gz |
Merge in OCI_Reliability_Enhancements branch.
Diffstat (limited to 'TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp')
-rwxr-xr-x | TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp new file mode 100755 index 00000000000..042b552b16d --- /dev/null +++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp @@ -0,0 +1,58 @@ +// $Id$ + +#include "test_i.h" +#include "tao/Invocation_Utils.h" + +extern int raise_exception; + +Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb, int num_exceptions_to_throw) + : orb_ (CORBA::ORB::_duplicate (orb)) + , num_exceptions_to_throw_(num_exceptions_to_throw) + , num_exceptions_thrown_(0) + , raise_exception_ (TAO::FOE_NON) +{ +} + +CORBA::Boolean +Simple_Server_i::test_is_a (const char * /* type */) +{ + if (this->num_exceptions_thrown_ == + this->num_exceptions_to_throw_) + return 0; + + if ((raise_exception & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST) + { + //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called and raise OBJECT_NOT_EXIST\n")); + ++this->num_exceptions_thrown_; + throw ::CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); + } + + if ((raise_exception & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE) + { + //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called and raise COMM_FAILURE\n")); + ++this->num_exceptions_thrown_; + throw ::CORBA::COMM_FAILURE (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); + } + + if ((raise_exception & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT) + { + //ACE_DEBUG ((LM_DEBUG, "(%P|%t) \t called and raise TRANSIENT\n")); + ++this->num_exceptions_thrown_; + throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); + } + + if ((raise_exception & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF) + { + //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise INV_OBJREF\n", ncalls_)); + ++this->num_exceptions_thrown_; + throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); + } + + return 0; +} + +void +Simple_Server_i::shutdown (void) +{ + this->orb_->shutdown (0); +} |