diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-07-21 13:23:05 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-07-21 13:23:05 +0000 |
commit | 584c51abc9629e4908d903d05ce5f73f6cb225ff (patch) | |
tree | c27fd9d4d43f607a5d176b00eca94d752c24a373 | |
parent | 7a26f072383349c5282cf8f12013e5e511bf0383 (diff) | |
download | ATCD-584c51abc9629e4908d903d05ce5f73f6cb225ff.tar.gz |
ChangeLogTag: Fri Jul 21 12:05:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/tests/Bug_2503_Regression/Test.idl | 2 | ||||
-rw-r--r-- | TAO/tests/Bug_2503_Regression/client.cpp | 19 | ||||
-rw-r--r-- | TAO/tests/Bug_2503_Regression/server.cpp | 6 | ||||
-rw-r--r-- | TAO/tests/Bug_2503_Regression/test_i.cpp | 20 | ||||
-rw-r--r-- | TAO/tests/Bug_2503_Regression/test_i.h | 9 |
5 files changed, 42 insertions, 14 deletions
diff --git a/TAO/tests/Bug_2503_Regression/Test.idl b/TAO/tests/Bug_2503_Regression/Test.idl index 8e4193d12b7..f1988af976b 100644 --- a/TAO/tests/Bug_2503_Regression/Test.idl +++ b/TAO/tests/Bug_2503_Regression/Test.idl @@ -3,4 +3,6 @@ interface Test { void the_operation(out long x); + + oneway void shutdown (); }; diff --git a/TAO/tests/Bug_2503_Regression/client.cpp b/TAO/tests/Bug_2503_Regression/client.cpp index d7f3a8b5c9b..67bbc811fcd 100644 --- a/TAO/tests/Bug_2503_Regression/client.cpp +++ b/TAO/tests/Bug_2503_Regression/client.cpp @@ -13,12 +13,18 @@ main(int argc, char * argv[]) { try { + ACE_DEBUG ((LM_DEBUG, "Starting client\n")); CORBA::ORB_var orb = initialize_orb_and_poa(argc, argv); parse_args(argc, argv); + ACE_DEBUG ((LM_DEBUG, "Testing remote\n")); test_remote_calls(orb.in()); + + ACE_DEBUG ((LM_DEBUG, "Testing colocated\n")); test_colocated_calls(orb.in()); + + ACE_DEBUG ((LM_DEBUG, "Testing ready\n")); } catch(...) { @@ -59,7 +65,8 @@ parse_args (int argc, char *argv[]) void test_impl( CORBA::ORB_ptr orb, - char const * ior) + char const * ior, + bool shutdown) { CORBA::Object_var object = orb->string_to_object(ior); Test_var test = Test::_narrow(object.in()); @@ -76,17 +83,21 @@ void test_impl( ACE_Time_Value wait_for_responses_interval(1, 0); orb->run(wait_for_responses_interval); + + if (shutdown) + test->shutdown (); } void test_remote_calls(CORBA::ORB_ptr orb) { - test_impl(orb, ior_argument); + test_impl(orb, ior_argument, true); } void test_colocated_calls(CORBA::ORB_ptr orb) { + test_i servant (orb); CORBA::String_var ior = - test_i::create_and_activate_server(orb); + servant.create_and_activate_server(); - test_impl(orb, ior.in()); + test_impl(orb, ior.in(), false); } diff --git a/TAO/tests/Bug_2503_Regression/server.cpp b/TAO/tests/Bug_2503_Regression/server.cpp index 7ffeceb406e..558335e4e37 100644 --- a/TAO/tests/Bug_2503_Regression/server.cpp +++ b/TAO/tests/Bug_2503_Regression/server.cpp @@ -17,13 +17,13 @@ main(int argc, char * argv[]) parse_args(argc, argv); + test_i servant (orb.in()); CORBA::String_var ior = - test_i::create_and_activate_server(orb.in()); + servant.create_and_activate_server(); write_ior_to_file(ior.in()); - ACE_Time_Value timeout (10, 0); - orb->run(timeout); + orb->run(); } catch(...) { diff --git a/TAO/tests/Bug_2503_Regression/test_i.cpp b/TAO/tests/Bug_2503_Regression/test_i.cpp index eabea6fb241..c610f1d4768 100644 --- a/TAO/tests/Bug_2503_Regression/test_i.cpp +++ b/TAO/tests/Bug_2503_Regression/test_i.cpp @@ -5,8 +5,9 @@ #include "tao/Utils/Servant_Var.h" test_i:: -test_i() +test_i(CORBA::ORB_ptr orb) { + this->orb_ = CORBA::ORB::_duplicate (orb); } void test_i:: @@ -16,13 +17,22 @@ the_operation(CORBA::Long & x) x = 42; } -char * test_i:: -create_and_activate_server(CORBA::ORB_ptr orb) +char * +test_i:: +create_and_activate_server() { TAO::Utils::Servant_Var<test_i> impl( - new test_i); + new test_i (this->orb_.in ())); Test_var ref = impl->_this(); - return orb->object_to_string(ref.in()); + return this->orb_->object_to_string(ref.in()); +} + +void +test_i::shutdown (void) + throw (CORBA::SystemException) +{ + if (!CORBA::is_nil (this->orb_.in ())) + this->orb_->shutdown (0); } diff --git a/TAO/tests/Bug_2503_Regression/test_i.h b/TAO/tests/Bug_2503_Regression/test_i.h index e90082479f9..9c5f2e07fa3 100644 --- a/TAO/tests/Bug_2503_Regression/test_i.h +++ b/TAO/tests/Bug_2503_Regression/test_i.h @@ -9,12 +9,17 @@ class test_i : public POA_Test { public: - test_i(); + test_i(CORBA::ORB_ptr); virtual void the_operation(CORBA::Long & x) throw(CORBA::SystemException); - static char * create_and_activate_server(CORBA::ORB_ptr); + virtual void shutdown (void) + throw (CORBA::SystemException); + + char * create_and_activate_server(void); +private: + CORBA::ORB_var orb_; }; #endif // test_i_h |