summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-02-21 14:23:17 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-02-21 14:23:17 +0000
commit199c11b72d4d8606778b25c9ac4662532372db00 (patch)
tree86fd252f8b8a49528e14351153553b2072ffad82
parent6baee09cbc1fcc66ed9672dafdee71125db22230 (diff)
downloadATCD-199c11b72d4d8606778b25c9ac4662532372db00.tar.gz
-rw-r--r--TAO/ChangeLog11
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/Bug_1592_Regression.mpc39
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/README9
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/ServantLocator.cpp88
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/ServantLocator.h85
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.cpp39
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.h54
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.cpp117
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.h92
-rwxr-xr-xTAO/tests/POA/Bug_1592_Regression/run_test.pl48
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/server.cpp144
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/test.idl35
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/test_i.cpp40
-rw-r--r--TAO/tests/POA/Bug_1592_Regression/test_i.h53
-rw-r--r--TAO/tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc2
-rw-r--r--TAO/tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc2
16 files changed, 855 insertions, 3 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 16ceb60e5dd..1e0a66718ee 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,7 +1,16 @@
+Wed Feb 21 14:21:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/POA/Bug_1592_Regression/*:
+ New test program for bug 1592, not fixed yet.
+
+ * tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc:
+ * tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc:
+ Simplified
+
Wed Feb 21 14:15:38 UTC 2007 Jaiganesh B <jai.dre.vanderbilt.edu>
* tao/RTPortableServer/RT_Servant_Dispatcher.cpp:
-
+
Modified the pre_invoke_remote_request () method
to add checks specific to the DiffServ policy,
to add DiffServ codepoints on the server replies.
diff --git a/TAO/tests/POA/Bug_1592_Regression/Bug_1592_Regression.mpc b/TAO/tests/POA/Bug_1592_Regression/Bug_1592_Regression.mpc
new file mode 100644
index 00000000000..745471417ef
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/Bug_1592_Regression.mpc
@@ -0,0 +1,39 @@
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+
+project(*Server): taoserver, pi_server {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ Server_ORBInitializer.cpp
+ Server_Request_Interceptor.cpp
+ ServantLocator.cpp
+ server.cpp
+ }
+ Source_Files {
+ TestC.cpp
+ TestS.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, pi {
+ after += *idl
+ Source_Files {
+ client.cpp
+ }
+ Source_Files {
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/tests/POA/Bug_1592_Regression/README b/TAO/tests/POA/Bug_1592_Regression/README
new file mode 100644
index 00000000000..d707901a31e
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/README
@@ -0,0 +1,9 @@
+# $Id$
+
+This test verifies that server side interceptor flow is correct when a
+PortableServer::ServantLocator is in use.
+
+Test output should be similar to the following:
+
+==== Running PortableInterceptor / ServantLocator test
+
diff --git a/TAO/tests/POA/Bug_1592_Regression/ServantLocator.cpp b/TAO/tests/POA/Bug_1592_Regression/ServantLocator.cpp
new file mode 100644
index 00000000000..c01c2ef4188
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/ServantLocator.cpp
@@ -0,0 +1,88 @@
+#include "ServantLocator.h"
+
+
+ACE_RCSID (ServantLocator,
+ ServantLocator,
+ "$Id$")
+
+
+#include "test_i.h"
+
+
+extern CORBA::Boolean receive_request_service_contexts_called;
+extern CORBA::Boolean ending_interception_point_called;
+
+ServantLocator::ServantLocator (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ servant_ (),
+ error_status_ (false)
+{
+}
+
+ServantLocator::~ServantLocator (void)
+{
+}
+
+PortableServer::Servant
+ServantLocator::preinvoke (
+ const PortableServer::ObjectId & /* oid */,
+ PortableServer::POA_ptr /* adapter */,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie & /* the_cookie */)
+{
+ if (ACE_OS::strcmp (operation, "shutdown") != 0)
+ {
+ if (receive_request_service_contexts_called == 0)
+ {
+ error_status_ = true;
+ ACE_ERROR ((LM_ERROR,
+ "PortableInterceptor::ServerRequestInterceptor:: "
+ "receive_request_service_contexts() not called\n"
+ "prior to "
+ "PortableServer::ServantLocator::preinvoke().\n"));
+
+ throw CORBA::INTERNAL ();
+ }
+
+ if (this->servant_.in () == 0)
+ {
+ test_i * servant;
+
+ ACE_NEW_THROW_EX (servant,
+ test_i (this->orb_.in ()),
+ CORBA::NO_MEMORY ());
+
+ this->servant_ = servant;
+ }
+ }
+
+ return this->servant_.in ();
+}
+
+
+void
+ServantLocator::postinvoke (
+ const PortableServer::ObjectId & /* oid */,
+ PortableServer::POA_ptr /* adapter */,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie /* the_cookie */,
+ PortableServer::Servant /* the_servant */)
+{
+ if (ACE_OS::strcmp (operation, "shutdown") != 0)
+ {
+ // Ending interception points should be called after postinvoke().
+ if (::ending_interception_point_called != 0)
+ {
+ error_status_ = true;
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: PortableInterceptor::ServerRequestInterceptor"
+ "\n"
+ "ERROR: ending interception point incorrectly "
+ "called prior to\n"
+ "ERROR: "
+ "PortableServer::ServantLocator::postinvoke().\n"));
+
+ throw CORBA::INTERNAL ();
+ }
+ }
+}
diff --git a/TAO/tests/POA/Bug_1592_Regression/ServantLocator.h b/TAO/tests/POA/Bug_1592_Regression/ServantLocator.h
new file mode 100644
index 00000000000..3ff37066256
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/ServantLocator.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file ServantLocator.h
+ *
+ * $Id$
+ *
+ * Implementation header for the PortableServer::ServantLocator for
+ * the PortableInterceptor / ServantLocator test.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef SERVANT_LOCATOR_H
+#define SERVANT_LOCATOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantLocatorC.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/LocalObject.h"
+#include "tao/ORB.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class ServantLocator
+ *
+ * @brief Test PortableServer::ServantLocator.
+ *
+ * PortableServer::ServantLocator used for this test.
+ */
+class ServantLocator
+ : public virtual PortableServer::ServantLocator,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ ServantLocator (CORBA::ORB_ptr orb);
+
+ virtual PortableServer::Servant preinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie & the_cookie);
+
+ virtual void postinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie the_cookie,
+ PortableServer::Servant the_servant);
+
+ bool error_status_;
+protected:
+
+ /// Destructor.
+ ~ServantLocator (void);
+
+private:
+
+ /// Pseudo-reference to the ORB.
+ CORBA::ORB_var orb_;
+
+ /// Pointer to the test servant.
+ PortableServer::ServantBase_var servant_;
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SERVANT_LOCATOR_H */
diff --git a/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.cpp b/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.cpp
new file mode 100644
index 00000000000..0c22259babf
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.cpp
@@ -0,0 +1,39 @@
+#include "Server_ORBInitializer.h"
+
+ACE_RCSID (ServantLocator,
+ Server_ORBInitializer,
+ "$Id$")
+
+#include "tao/ORB_Constants.h"
+#include "Server_Request_Interceptor.h"
+
+Server_ORBInitializer::Server_ORBInitializer (void)
+{
+}
+
+void
+Server_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+void
+Server_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info)
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr interceptor;
+
+ ACE_NEW_THROW_EX (interceptor,
+ Server_Request_Interceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ PortableInterceptor::ServerRequestInterceptor_var safe_interceptor =
+ interceptor;
+
+ // Install the server request interceptor.
+ info->add_server_request_interceptor (interceptor);
+}
diff --git a/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.h b/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.h
new file mode 100644
index 00000000000..fce0e29d4a3
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/Server_ORBInitializer.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * Implementation header for the PortableInterceptor/ServantLocator
+ * test server side ORB initializer.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SERVER_ORB_INITIALIZER_H
+#define TAO_SERVER_ORB_INITIALIZER_H
+
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/// Server side ORB initializer.
+class Server_ORBInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_ORBInitializer (void);
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_SERVER_ORB_INITIALIZER_H */
diff --git a/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.cpp b/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.cpp
new file mode 100644
index 00000000000..c0c45fc1907
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.cpp
@@ -0,0 +1,117 @@
+#include "Server_Request_Interceptor.h"
+
+
+ACE_RCSID (ServantLocator,
+ Server_Request_Interceptor,
+ "$Id$")
+
+
+CORBA::Boolean receive_request_service_contexts_called = 0;
+CORBA::Boolean receive_request_called = 0;
+CORBA::Boolean ending_interception_point_called = 0;
+
+
+Server_Request_Interceptor::Server_Request_Interceptor (void)
+{
+}
+
+Server_Request_Interceptor::~Server_Request_Interceptor (void)
+{
+}
+
+char *
+Server_Request_Interceptor::name (void)
+{
+ return CORBA::string_dup (""); // Anonymous
+}
+
+void
+Server_Request_Interceptor::destroy (void)
+{
+}
+
+void
+Server_Request_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ CORBA::String_var op = ri->operation ();
+
+ if (ACE_OS::strcmp (op.in (), "shutdown") != 0)
+ {
+ if (::receive_request_service_contexts_called != 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+
+ ::receive_request_service_contexts_called = 1;
+ }
+}
+
+void
+Server_Request_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ CORBA::String_var op = ri->operation ();
+
+ if (ACE_OS::strcmp (op.in (), "shutdown") != 0)
+ {
+ if (::receive_request_called != 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+
+ ::receive_request_called = 1;
+ }
+}
+
+void
+Server_Request_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ CORBA::String_var op = ri->operation ();
+
+ if (ACE_OS::strcmp (op.in (), "shutdown") != 0)
+ {
+ ACE_ASSERT (::ending_interception_point_called == 0);
+ if (::ending_interception_point_called != 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+
+ ::ending_interception_point_called = 1;
+ }
+}
+
+void
+Server_Request_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ CORBA::String_var op = ri->operation ();
+
+ if (ACE_OS::strcmp (op.in (), "shutdown") != 0)
+ {
+ if (::ending_interception_point_called != 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+
+ ::ending_interception_point_called = 1;
+ }
+}
+
+void
+Server_Request_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri)
+{
+ CORBA::String_var op = ri->operation ();
+
+ if (ACE_OS::strcmp (op.in (), "shutdown") != 0)
+ {
+ if (::ending_interception_point_called != 0)
+ {
+ throw CORBA::INTERNAL ();
+ }
+
+ ::ending_interception_point_called = 1;
+ }
+}
diff --git a/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.h b/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.h
new file mode 100644
index 00000000000..01860e44c06
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/Server_Request_Interceptor.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_Request_Interceptor.h
+ *
+ * $Id$
+ *
+ * Implementation header for the server request interceptor for the
+ * PortableInterceptor / ServantLocator test.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef SERVER_REQUEST_INTERCEPTOR_H
+#define SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class Server_Request_Interceptor
+ *
+ * @brief Simple concrete server request interceptor.
+ *
+ * This server request interceptor merely sets global flags when
+ * specific interception points are called. Those flags are checked
+ * at various points in the test.
+ */
+class Server_Request_Interceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_Request_Interceptor (void);
+
+ /**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+ //@{
+ /// Return the name of this ServerRequestinterceptor.
+ virtual char * name (void);
+
+ virtual void destroy (void);
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+
+ virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri);
+ //@}
+
+protected:
+
+ /// Destructor.
+ ~Server_Request_Interceptor (void);
+
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/tests/POA/Bug_1592_Regression/run_test.pl b/TAO/tests/POA/Bug_1592_Regression/run_test.pl
new file mode 100755
index 00000000000..d2ceb53c33f
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/run_test.pl
@@ -0,0 +1,48 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+#
+# $Id$
+
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$file = PerlACE::LocalFile ("test.ior");
+
+unlink $file;
+
+$SV = new PerlACE::Process ("server", "-o $file");
+$CL = new PerlACE::Process ("client", "-k file://$file");
+
+$status = 0;
+
+print STDERR "\n\n==== Running PortableInterceptor / ServantLocator test\n";
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $file;
+
+exit $status;
diff --git a/TAO/tests/POA/Bug_1592_Regression/server.cpp b/TAO/tests/POA/Bug_1592_Regression/server.cpp
new file mode 100644
index 00000000000..aa073c2d452
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/server.cpp
@@ -0,0 +1,144 @@
+// -*- C++ -*-
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "ServantLocator.h"
+#include "Server_ORBInitializer.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (ServantLocator,
+ server,
+ "$Id$")
+
+const char * ior_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_file = get_opts.opt_arg ();
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-o IOR\n",
+ argv[0]),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ try
+ {
+ Server_ORBInitializer *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB");
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA");
+
+ 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 ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ // Create a child POA configured to use a ServantLocator.
+ CORBA::PolicyList policies (2);
+
+ policies.length (2);
+ policies[0] =
+ root_poa->create_request_processing_policy (
+ PortableServer::USE_SERVANT_MANAGER);
+
+ policies[1] =
+ root_poa->create_servant_retention_policy (PortableServer::NON_RETAIN);
+
+ PortableServer::POA_var child_poa =
+ root_poa->create_POA ("child",
+ poa_manager.in (),
+ policies);
+
+ ServantLocator* sl = 0;
+ ACE_NEW_THROW_EX (sl,
+ ServantLocator (orb.in ()),
+ CORBA::NO_MEMORY ());
+
+ PortableServer::ServantLocator_var servant_locator = sl;
+
+ child_poa->set_servant_manager (servant_locator.in ());
+
+ poa_manager->activate ();
+
+ CORBA::Object_var obj =
+ child_poa->create_reference ("IDL:test:1.0");
+
+ CORBA::String_var ior = orb->object_to_string (obj.in ());
+
+ if (::parse_args (argc, argv) != 0)
+ return -1;
+
+ // Write IOR to a file.
+ FILE *output_file= ACE_OS::fopen (ior_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file <%s> for writing "
+ "IOR:\n%s\n",
+ ior_file,
+ ior.in ()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ // Run the ORB event loop.
+ orb->run ();
+
+ root_poa->destroy (1, 1);
+
+ orb->destroy ();
+
+ if (sl->error_status_ == false)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "PortableInterceptor / ServantLocator test passed.\n"));
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "PortableInterceptor / ServantLocator test failed.\n"));
+ return 1;
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Caught exception:");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/POA/Bug_1592_Regression/test.idl b/TAO/tests/POA/Bug_1592_Regression/test.idl
new file mode 100644
index 00000000000..57b9f37c17f
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/test.idl
@@ -0,0 +1,35 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file test.idl
+ *
+ * $Id$
+ *
+ * Simple IDL file to test PortableInterceptor / ServantLocator
+ * support.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TEST_IDL
+#define TEST_IDL
+
+/**
+ * @interface test
+ *
+ * @brief PortableInterceptor/ServantLocator test interface.
+ *
+ * Simple interface that provides an operation to invoke.
+ */
+interface test
+{
+ /// Dummy operation.
+ void op ();
+
+ /// Shutdown the server.
+ oneway void shutdown ();
+};
+
+#endif /* TEST_IDL */
diff --git a/TAO/tests/POA/Bug_1592_Regression/test_i.cpp b/TAO/tests/POA/Bug_1592_Regression/test_i.cpp
new file mode 100644
index 00000000000..470979302c0
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/test_i.cpp
@@ -0,0 +1,40 @@
+#include "test_i.h"
+
+
+ACE_RCSID (ServantLocator,
+ test_i,
+ "$Id$")
+
+
+extern CORBA::Boolean receive_request_called;
+
+test_i::test_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+test_i::~test_i (void)
+{
+}
+
+void
+test_i::op (void)
+{
+ // PortableInterceptor::ServerRequestInterceptor::receive_request()
+ // should have been invoked.
+ if (::receive_request_called == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "PortableInterceptor::ServerRequestInterceptor::"
+ "receive_request() not called \n"
+ "prior to target operation execution.\n"));
+
+ throw CORBA::INTERNAL ();
+ }
+}
+
+void
+test_i::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/tests/POA/Bug_1592_Regression/test_i.h b/TAO/tests/POA/Bug_1592_Regression/test_i.h
new file mode 100644
index 00000000000..7e6c896933f
--- /dev/null
+++ b/TAO/tests/POA/Bug_1592_Regression/test_i.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file test_i.h
+ *
+ * $Id$
+ *
+ * Implementation header for the "test" IDL interface for the
+ * "PortableInterceptor / ServantLocator" test.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TEST_I_H
+#define TEST_I_H
+
+#include "testS.h"
+
+/**
+ * @class test_i
+ *
+ * @brief Simple test class.
+ *
+ * This class implements the "test" interface used in this test.
+ */
+class test_i
+ : public virtual POA_test
+{
+public:
+
+ /// Constructor.
+ test_i (CORBA::ORB_ptr orb);
+
+ virtual void op (void);
+
+ /// Shutdown the ORB.
+ virtual void shutdown (void);
+
+protected:
+
+ /// Destructor.
+ ~test_i (void);
+
+private:
+
+ /// Pseudo-reference to the ORB.
+ CORBA::ORB_var orb_;
+
+};
+
+#endif /* TEST_I_H */
diff --git a/TAO/tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc b/TAO/tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc
index 6136555334d..403f82749a7 100644
--- a/TAO/tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc
+++ b/TAO/tests/POA/Excessive_Object_Deactivations/Excessive_Object_Deactivations.mpc
@@ -1,5 +1,5 @@
// -*- MPC -*-
// $Id$
-project(POA*): taoexe, portableserver, avoids_corba_e_micro {
+project(POA*): taoserver, avoids_corba_e_micro {
}
diff --git a/TAO/tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc b/TAO/tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc
index a2ddf365db4..91146f271ff 100644
--- a/TAO/tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc
+++ b/TAO/tests/POA/MT_Servant_Locator/MT_Servant_Locator.mpc
@@ -1,5 +1,5 @@
// -*- MPC -*-
// $Id$
-project(POA*): taoexe, portableserver, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
+project(POA*): taoserver, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
}