summaryrefslogtreecommitdiff
path: root/TAO/tests/CORBA_e_Implicit_Activation/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/CORBA_e_Implicit_Activation/server.cpp')
-rw-r--r--TAO/tests/CORBA_e_Implicit_Activation/server.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/tests/CORBA_e_Implicit_Activation/server.cpp b/TAO/tests/CORBA_e_Implicit_Activation/server.cpp
new file mode 100644
index 00000000000..524ff30f63f
--- /dev/null
+++ b/TAO/tests/CORBA_e_Implicit_Activation/server.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "Hello.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ int status = 1;
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ Hello *hello_impl = 0;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (),
+ 1);
+ PortableServer::ServantBase_var owner_transfer(hello_impl);
+
+ Test::Hello_var hello = hello_impl->_this ();
+
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: Implicit activation should have "
+ "thrown an exception with CORBA e compact.\n"));
+
+ root_poa->destroy (1, 1);
+ orb->destroy ();
+ }
+ catch (const CORBA::INV_POLICY&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "This test passes.\n"));
+ status = 0;
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ }
+
+ return status;
+}