diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/tests/Bug_2174_Regression | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tests/Bug_2174_Regression')
-rw-r--r-- | TAO/tests/Bug_2174_Regression/Bug_2174_Regression.mpc | 18 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/README | 3 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/client.cpp | 103 | ||||
-rwxr-xr-x | TAO/tests/Bug_2174_Regression/run_test.pl | 81 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/server.cpp | 122 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/test.idl | 12 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/test_i.cpp | 37 | ||||
-rw-r--r-- | TAO/tests/Bug_2174_Regression/test_i.h | 46 |
8 files changed, 0 insertions, 422 deletions
diff --git a/TAO/tests/Bug_2174_Regression/Bug_2174_Regression.mpc b/TAO/tests/Bug_2174_Regression/Bug_2174_Regression.mpc deleted file mode 100644 index c01584c3559..00000000000 --- a/TAO/tests/Bug_2174_Regression/Bug_2174_Regression.mpc +++ /dev/null @@ -1,18 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*Server): taoserver { - Source_Files { - test_i.cpp - server.cpp - } -} - -project(*Client): taoclient, anytypecode, minimum_corba { - after += *Server - Source_Files { - testC.cpp - client.cpp - } -} - diff --git a/TAO/tests/Bug_2174_Regression/README b/TAO/tests/Bug_2174_Regression/README deleted file mode 100644 index 53ae592673c..00000000000 --- a/TAO/tests/Bug_2174_Regression/README +++ /dev/null @@ -1,3 +0,0 @@ -This test contains regression tests for fixes to bug #2174 -"Object::_non_existent never returns true, but raises OBJECT_NOT_EXIST" -See the bugzilla record for details. diff --git a/TAO/tests/Bug_2174_Regression/client.cpp b/TAO/tests/Bug_2174_Regression/client.cpp deleted file mode 100644 index dc0b7923d30..00000000000 --- a/TAO/tests/Bug_2174_Regression/client.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// $Id$ - -#include "testC.h" -#include "ace/Get_Opt.h" - -ACE_RCSID(Bug_2174_Regression, client, "$Id$") - -const char *ior = "file://test.ior"; -int min_timeout = 0; -int max_timeout = 20; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "k:l:h:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-k <ior> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int result = 1; -// 1 : fault in test -// 2 : _non_existent() returned false -// 3 : _non_existent() returned true -// 4 : CORBA::OBJECT_NOT_EXIST exception -// 5 : CORBA::TRANSIENT exception - -int main (int argc, char* argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - Simple_Server_var server = - Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Object reference <%s> is nil\n", - ior), - 1); - } - - CORBA::Boolean non_existent = server->_non_existent (); - ACE_TRY_CHECK; - - if (non_existent) - result = 3; - else - result = 2; - - ACE_DEBUG ((LM_DEBUG, - "client (%P) _non_existent() returned %d\n", - static_cast<int>(non_existent) )); - - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ERROR: Exception caught:"); - result = 4; - } - ACE_CATCH (CORBA::TRANSIENT, ex) - { - result = 5; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "ERROR: Exception caught:"); - result = 6; - } - ACE_ENDTRY; - return result; -} diff --git a/TAO/tests/Bug_2174_Regression/run_test.pl b/TAO/tests/Bug_2174_Regression/run_test.pl deleted file mode 100755 index 02366a5ebb4..00000000000 --- a/TAO/tests/Bug_2174_Regression/run_test.pl +++ /dev/null @@ -1,81 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../bin'; -use PerlACE::Run_Test; - -$iorfile = PerlACE::LocalFile ("server.ior"); -unlink $iorfile; - -# Test A: object exists (_non_existent() returns false) - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior"); -} -else { - $SV = new PerlACE::Process ("server", "-o $iorfile"); -} -$CL = new PerlACE::Process ("client", "-k file://$iorfile"); - -$server = $SV->Spawn (); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - exit 1; -} - -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (10); -$SV->Kill (); -unlink $iorfile; -if ($client != 2) { - print STDERR "ERROR: client returned $client in test A, expected 2\n"; - # (see comment about result value in client.cpp) - exit 1; -} - -# Test B: object does not exist (_non_existent() returns true) - -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", "-o server.ior -r"); -} -else { - $SV = new PerlACE::Process ("server", "-o $iorfile -r"); -} - -$SV->Spawn (); -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (10); -$SV->Kill (); -if ($client != 3) { - print STDERR "ERROR: client returned $client in test B, expected 3\n"; - # (see comment about result value in client.cpp) - unlink $iorfile; - exit 1; -} - -# Test C: server does not run (_non_existent() throws TRANSIENT) - -$client = $CL->SpawnWaitKill (10); -unlink $iorfile; -if ($client != 5) { - print STDERR "ERROR: client returned $client in test C, expected 5\n"; - # (see comment about result value in client.cpp) - exit 1; -} - -exit 0; diff --git a/TAO/tests/Bug_2174_Regression/server.cpp b/TAO/tests/Bug_2174_Regression/server.cpp deleted file mode 100644 index bc39027c4ac..00000000000 --- a/TAO/tests/Bug_2174_Regression/server.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// $Id$ - -#include "test_i.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" - -ACE_RCSID(Bug_2174_Regression, server, "$Id$") - -const char *ior_output_file = 0; -bool remove_object = false; - -int -parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:r"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - - case 'r': - remove_object = true; - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile>" - "\n", - argv [0]), - -1); - } - - // Indicates sucessful parsing of the command line - return 0; -} - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var poa_object = - orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - Simple_Server_i server_impl (orb.in ()); - - Simple_Server_var server = - server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var ior = - orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (remove_object) - { - PortableServer::ObjectId_var oid = root_poa->reference_to_id(server.in()); - root_poa->deactivate_object(oid.in()); - ACE_DEBUG ((LM_DEBUG, - "server (%P) deactivated object immediately\n" - )); - } - ACE_TRY_CHECK; - - - // ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); - - // If the ior_output_file exists, output the ior to it - if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); - return 1; - } - ACE_ENDTRY; - return 0; -} diff --git a/TAO/tests/Bug_2174_Regression/test.idl b/TAO/tests/Bug_2174_Regression/test.idl deleted file mode 100644 index 946bd383938..00000000000 --- a/TAO/tests/Bug_2174_Regression/test.idl +++ /dev/null @@ -1,12 +0,0 @@ -// -// $Id$ -// - -interface Simple_Server { - - // Returns <x>, but sleep for <msecs> milliseconds before returning - long echo (in long x, in long msecs); - - // Shutdown the ORB - oneway void shutdown (); -}; diff --git a/TAO/tests/Bug_2174_Regression/test_i.cpp b/TAO/tests/Bug_2174_Regression/test_i.cpp deleted file mode 100644 index 9f1bd8537bc..00000000000 --- a/TAO/tests/Bug_2174_Regression/test_i.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// $Id$ - -#include "test_i.h" - -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(Timeout, test_i, "$Id$") - -Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb) - : orb_ (CORBA::ORB::_duplicate (orb)) -{ - -} - -CORBA::Long -Simple_Server_i::echo (CORBA::Long x, - CORBA::Long msecs - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_Time_Value tv (msecs / 1000, (msecs % 1000) * 1000); - - // ACE_DEBUG ((LM_DEBUG, "server (%P) Sleeping for %d msecs\n", - // tv.msec ())); - ACE_OS::sleep (tv); - - return x; -} - -void -Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "server (%P) Received shutdown request from client\n")); - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/tests/Bug_2174_Regression/test_i.h b/TAO/tests/Bug_2174_Regression/test_i.h deleted file mode 100644 index 00018fa25d8..00000000000 --- a/TAO/tests/Bug_2174_Regression/test_i.h +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Timeout -// -// = FILENAME -// test_i.h -// -// = AUTHOR -// Carlos O'Ryan -// -// ============================================================================ - -#ifndef TAO_TIMEOUT_TEST_I_H -#define TAO_TIMEOUT_TEST_I_H - -#include "testS.h" - -class Simple_Server_i : public POA_Simple_Server -{ - // = TITLE - // Simpler Server implementation - // - // = DESCRIPTION - // Implements the Simple_Server interface in test.idl - // -public: - Simple_Server_i (CORBA::ORB_ptr orb); - // ctor - - // = The Simple_Server methods. - CORBA::Long echo (CORBA::Long x, - CORBA::Long msecs - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - CORBA::ORB_var orb_; - // The ORB -}; - -#endif /* TAO_TIMEOUT_TEST_I_H */ |