diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-01-06 19:06:30 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-01-06 19:06:30 +0000 |
commit | d4db00e4f636789aab999a90f25c37b5524d0608 (patch) | |
tree | 0adaa5e6141cfaa61b884aa25b5e320c870c430c | |
parent | 44e4ee4acfb4197472e69ca348b6485ac3f2d3f1 (diff) | |
download | ATCD-d4db00e4f636789aab999a90f25c37b5524d0608.tar.gz |
Sun Jan 6 19:05:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/tests/Abstract_Interface/client.cpp | 40 | ||||
-rwxr-xr-x | TAO/tests/Abstract_Interface/run_test.pl | 25 | ||||
-rw-r--r-- | TAO/tests/Abstract_Interface/server.cpp | 12 | ||||
-rw-r--r-- | TAO/tests/Abstract_Interface/test.idl | 3 | ||||
-rw-r--r-- | TAO/tests/Abstract_Interface/test_i.cpp | 11 | ||||
-rw-r--r-- | TAO/tests/Abstract_Interface/test_i.h | 4 | ||||
-rw-r--r-- | TAO/tests/Bug_2234_Regression/client.cpp | 6 | ||||
-rw-r--r-- | TAO/tests/Bug_3108_Regression/client.cpp | 2 | ||||
-rw-r--r-- | TAO/tests/DII_AMI_Forward/DII_ReplyHandler.cpp | 2 | ||||
-rwxr-xr-x | TAO/tests/Multiple/run_test.pl | 2 |
10 files changed, 59 insertions, 48 deletions
diff --git a/TAO/tests/Abstract_Interface/client.cpp b/TAO/tests/Abstract_Interface/client.cpp index 6fed6c27f20..41c9079ca63 100644 --- a/TAO/tests/Abstract_Interface/client.cpp +++ b/TAO/tests/Abstract_Interface/client.cpp @@ -161,13 +161,25 @@ test_operation (base_ptr abs) void test_exception (base_ptr abs) { - CORBA::String_var retval = abs->base_op ("bad_name"); + try + { + CORBA::String_var retval = abs->base_op ("bad_name"); - if (debug) + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "%s\n", + retval.in ())); + } + } + catch (const BadInput& ex) { - ACE_DEBUG ((LM_DEBUG, - "%s\n", - retval.in ())); + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "%s\n", + ex.message.in ())); + } } } @@ -273,23 +285,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) test_exception (package.in ()); } - orb->destroy (); - } - catch (const BadInput& ex) - { - if (which_test != TEST_EXCEPTION) - { - ex._tao_print_exception ("Client: exception caught - "); + objref->shutdown (); - return 1; - } - - if (debug) - { - ACE_DEBUG ((LM_DEBUG, - "%s\n", - ex.message.in ())); - } + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Abstract_Interface/run_test.pl b/TAO/tests/Abstract_Interface/run_test.pl index 11ab58f549b..786664cb9fa 100755 --- a/TAO/tests/Abstract_Interface/run_test.pl +++ b/TAO/tests/Abstract_Interface/run_test.pl @@ -10,6 +10,7 @@ use PerlACE::Run_Test; $debug = ""; $which_test = ""; +$status = 0; foreach $i (@ARGV) { if ($i eq "-d") { @@ -20,14 +21,15 @@ foreach $i (@ARGV) { } } -$iorfile = PerlACE::LocalFile ("test.ior"); +$iorfilebase = "test.ior"; +$iorfile = PerlACE::LocalFile ("$iorfilebase"); unlink $iorfile; if (PerlACE::is_vxworks_test()) { $SV = new PerlACE::ProcessVX ("server", "-ORBDottedDecimalAddresses 1 " - . " -o test.ior"); + . " -o $iorfilebase"); } else { $SV = new PerlACE::Process ("server", @@ -45,17 +47,24 @@ if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_cr $CL = new PerlACE::Process ("client", " -k file://$iorfile " - . " $debug " - . " $which_test"); + . " $debug " + . " $which_test"); + +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} -$client = $CL->SpawnWaitKill (20); $server = $SV->WaitKill (20); unlink $iorfile; -if ($server != 0 || $client != 0) { - exit 1; +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } -exit 0; +exit $status; diff --git a/TAO/tests/Abstract_Interface/server.cpp b/TAO/tests/Abstract_Interface/server.cpp index 743f40c92a7..949a842739b 100644 --- a/TAO/tests/Abstract_Interface/server.cpp +++ b/TAO/tests/Abstract_Interface/server.cpp @@ -41,9 +41,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { try { - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - ""); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); // Create and register factory for BaseNode. BaseNode_init *bn_factory = 0; @@ -96,7 +94,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) return 1; } - passer_i servant (root_poa.in ()); + passer_i servant (orb.in (), root_poa.in ()); PortableServer::ObjectId_var id = root_poa->activate_object (&servant); @@ -133,12 +131,10 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) poa_manager->activate (); - ACE_Time_Value tv (10); - orb->run (tv); + orb->run (); // Destroy the POA, waiting until the destruction terminates - root_poa->destroy (1, - 1); + root_poa->destroy (1, 1); orb->destroy (); } diff --git a/TAO/tests/Abstract_Interface/test.idl b/TAO/tests/Abstract_Interface/test.idl index 0b7bf4f636f..c5b5643405a 100644 --- a/TAO/tests/Abstract_Interface/test.idl +++ b/TAO/tests/Abstract_Interface/test.idl @@ -21,6 +21,7 @@ interface passer { void pass_ops (out base outarg); void pass_state (out base outarg); + oneway void shutdown (); }; valuetype BaseNode @@ -29,7 +30,7 @@ valuetype BaseNode public BaseNode right; }; -valuetype StringNode : BaseNode +valuetype StringNode : BaseNode { public string name; }; diff --git a/TAO/tests/Abstract_Interface/test_i.cpp b/TAO/tests/Abstract_Interface/test_i.cpp index 285f5ef5f68..be6ce3926e9 100644 --- a/TAO/tests/Abstract_Interface/test_i.cpp +++ b/TAO/tests/Abstract_Interface/test_i.cpp @@ -43,12 +43,19 @@ foo_i::base_op (const char * inarg) return retval._retn (); } -passer_i::passer_i (PortableServer::POA_ptr poa) - : poa_ (PortableServer::POA::_duplicate (poa)) +passer_i::passer_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa) + : orb_ (CORBA::ORB::_duplicate (orb)) + , poa_ (PortableServer::POA::_duplicate (poa)) { } void +passer_i::shutdown (void) +{ + this->orb_->shutdown (0); +} + +void passer_i::pass_ops (base_out outarg) { foo_i *servant = 0; diff --git a/TAO/tests/Abstract_Interface/test_i.h b/TAO/tests/Abstract_Interface/test_i.h index 28fcc41464c..f6be5487bd4 100644 --- a/TAO/tests/Abstract_Interface/test_i.h +++ b/TAO/tests/Abstract_Interface/test_i.h @@ -15,14 +15,16 @@ class foo_i : public virtual POA_foo class passer_i : public virtual POA_passer { public: - passer_i (PortableServer::POA_ptr poa); + passer_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa); virtual void pass_ops (base_out outarg); virtual void pass_state (base_out outarg); + virtual void shutdown (void); private: PortableServer::POA_var poa_; + CORBA::ORB_var orb_; }; #endif /* TAO_TEST_I_H */ diff --git a/TAO/tests/Bug_2234_Regression/client.cpp b/TAO/tests/Bug_2234_Regression/client.cpp index 50b720cf485..4ac4885d0b7 100644 --- a/TAO/tests/Bug_2234_Regression/client.cpp +++ b/TAO/tests/Bug_2234_Regression/client.cpp @@ -298,7 +298,7 @@ main( arr_c[0][0] = 23; arr_c[1].length (1); arr_c[1][0] = 9; - + ACE_DEBUG( (LM_INFO, ". MyArray() ") ); Test::MyArray_var arr_ret = foo->TestArray (arr_a, arr_b.out (), arr_c); CORBA::ULong zero (0), one (1); //Use ULong to avoid ambiguity @@ -332,9 +332,9 @@ main( //----------------------------------------------------------------------- { - CORBA::Object_var a = CORBA::Object::_duplicate (foo); + CORBA::Object_var a = CORBA::Object::_duplicate (foo.in ()); CORBA::Object_var b; - CORBA::Object_var c = CORBA::Object::_duplicate (a); + CORBA::Object_var c = CORBA::Object::_duplicate (a.in ()); CORBA::Object_var ret = foo->TestObject (a.in (), b.out (), c.inout ()); } diff --git a/TAO/tests/Bug_3108_Regression/client.cpp b/TAO/tests/Bug_3108_Regression/client.cpp index c38c996b75c..e9f1d4dfda5 100644 --- a/TAO/tests/Bug_3108_Regression/client.cpp +++ b/TAO/tests/Bug_3108_Regression/client.cpp @@ -82,7 +82,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) return 1; CORBA::Object_var obj = orb->string_to_object(ior); - test_var server = test::_narrow(obj); + test_var server = test::_narrow(obj.in ()); if (CORBA::is_nil(server)) { ACE_ERROR_RETURN ((LM_DEBUG, diff --git a/TAO/tests/DII_AMI_Forward/DII_ReplyHandler.cpp b/TAO/tests/DII_AMI_Forward/DII_ReplyHandler.cpp index 4dcd0ac4c5b..4071f759535 100644 --- a/TAO/tests/DII_AMI_Forward/DII_ReplyHandler.cpp +++ b/TAO/tests/DII_AMI_Forward/DII_ReplyHandler.cpp @@ -108,7 +108,7 @@ DII_ReplyHandler::handle_location_forward (TAO_InputCDR &incoming, char **argv = 0; CORBA::ORB_var orb = CORBA::ORB_init(argc,argv); - CORBA::String_var iorstr = orb->object_to_string(fwd); + CORBA::String_var iorstr = orb->object_to_string(fwd.in ()); bool is_perm = reply_status == TAO_AMI_REPLY_LOCATION_FORWARD_PERM; ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/tests/Multiple/run_test.pl b/TAO/tests/Multiple/run_test.pl index 8d601878a17..328d8984aab 100755 --- a/TAO/tests/Multiple/run_test.pl +++ b/TAO/tests/Multiple/run_test.pl @@ -15,8 +15,6 @@ $iorfile = PerlACE::LocalFile ("$iorbase"); unlink $iorfile; -my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : - 'PerlACE::Process'); if (PerlACE::is_vxworks_test()) { $SV = new PerlACE::ProcessVX ("server", "-o $iorbase"); $direct_colloc = "-ORBCollocationStrategy direct -o $iorbase"; |