summaryrefslogtreecommitdiff
path: root/TAO/tests/Bug_2345_Regression
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-12-30 12:29:57 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-12-30 12:29:57 +0000
commit8ba0ee6269bbceff0296cd613518c0b22d75a3eb (patch)
treeb4d07b6d04fdb5415b7c69c020dcd7386d8fb0ca /TAO/tests/Bug_2345_Regression
parent39947701acda060adcd5dc76ee3cd2ea346c5948 (diff)
downloadATCD-8ba0ee6269bbceff0296cd613518c0b22d75a3eb.tar.gz
ChangeLogTag: Fri Dec 30 11:56:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tests/Bug_2345_Regression')
-rw-r--r--TAO/tests/Bug_2345_Regression/Bug_2345_Regression.mpc8
-rwxr-xr-xTAO/tests/Bug_2345_Regression/run_test.pl22
-rw-r--r--TAO/tests/Bug_2345_Regression/server.cpp40
3 files changed, 70 insertions, 0 deletions
diff --git a/TAO/tests/Bug_2345_Regression/Bug_2345_Regression.mpc b/TAO/tests/Bug_2345_Regression/Bug_2345_Regression.mpc
new file mode 100644
index 00000000000..e6f52fa1508
--- /dev/null
+++ b/TAO/tests/Bug_2345_Regression/Bug_2345_Regression.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Server) : taoserver {
+ Source_Files {
+ server.cpp
+ }
+}
diff --git a/TAO/tests/Bug_2345_Regression/run_test.pl b/TAO/tests/Bug_2345_Regression/run_test.pl
new file mode 100755
index 00000000000..fa8e977afd2
--- /dev/null
+++ b/TAO/tests/Bug_2345_Regression/run_test.pl
@@ -0,0 +1,22 @@
+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;
+
+$status = 0;
+
+$SV = new PerlACE::Process ("server", "-ORBUseIMR 1 -ORBDefaultInitRef corbaloc:iiop:localhost:12345");
+
+$server = $SV->SpawnWaitKill (30);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/tests/Bug_2345_Regression/server.cpp b/TAO/tests/Bug_2345_Regression/server.cpp
new file mode 100644
index 00000000000..16de6ec52e2
--- /dev/null
+++ b/TAO/tests/Bug_2345_Regression/server.cpp
@@ -0,0 +1,40 @@
+// $Id$
+
+#include "tao/PortableServer/PortableServer.h"
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB::_nil();
+
+ // Initialize the ORB.
+ //
+ orb = CORBA::ORB_init(argc, argv);
+ CORBA::Object_var poa_obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(poa_obj);
+
+ // Create a PERSISTENT POA
+ //
+ // Create the policy list
+ CORBA::PolicyList policies(2);
+ policies.length(2);
+ policies[0] = root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
+ policies[1] = root_poa->create_id_assignment_policy(PortableServer::USER_ID);
+
+ // create the poa.
+ // for ORBUseIMR=1 -ORBDefaultInitRef corbaloc:iiop:<HOST>:<PORT>
+ // this will cause an access violation if no IMR server is found.
+ // The access violation WILL NOT HAPPEN if a POAManager is created and
+ // given as a parameter to create_POA (instead of a nil POAManager)
+ PortableServer::POA_var persistent_poa =
+ root_poa->create_POA("myPoa", PortableServer::POAManager::_nil(), policies);
+
+ return 0;
+ }
+ catch (CORBA::Exception& e)
+ {
+ // ... normally print an error here
+ }
+ return 1;
+}