summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-11-01 12:32:06 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-11-01 12:32:06 +0000
commit263d54fcb4f0ed808cb0b4ab4ac03f27223f4adc (patch)
tree624645182c407056a117581557d664381690cc7d /TAO/orbsvcs/tests
parent0321f40be0fe2ed61e6b2b19579d517e2afd007c (diff)
downloadATCD-263d54fcb4f0ed808cb0b4ab4ac03f27223f4adc.tar.gz
ChangeLogTag: Tue Nov 1 11:47:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc10
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp64
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h25
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl27
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp22
5 files changed, 148 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc b/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc
new file mode 100644
index 00000000000..17c136be499
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Test): taoclient, messaging, naming {
+ exename = test
+ Source_Files {
+ test.cpp
+ ORB_Task.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp
new file mode 100644
index 00000000000..41e64a4dd51
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp
@@ -0,0 +1,64 @@
+/**
+ * @file ORB_Task.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ *
+ */
+#include "ORB_Task.h"
+#include "tao/Messaging/Messaging.h"
+#include "orbsvcs/CosNamingC.h"
+
+ACE_RCSID(Bug_2074_Regression, ORB_Task, "$Id$")
+
+ORB_Task::ORB_Task (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int
+ORB_Task::svc (void)
+{
+ try
+ {
+ CORBA::Object_var ncRef =
+ orb_->string_to_object(
+ "corbaloc:iiop:10.175.12.99:15025/NameService" );
+
+ CORBA::PolicyList policies;
+
+ TimeBase::TimeT timeout = 5000 * 10000;
+
+ CORBA::Any timeoutAny;
+ timeoutAny <<= timeout;
+
+ policies.length(1);
+ policies[0] = orb_->create_policy(
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ timeoutAny );
+
+ CORBA::Object_var object = ncRef->_set_policy_overrides(
+ policies, CORBA::SET_OVERRIDE );
+
+ policies[0]->destroy();
+
+ CosNaming::NamingContext_var namingContext =
+ CosNaming::NamingContext::_narrow( object.in() );
+ namingContext->_non_existent();
+ }
+ catch ( const CORBA::TRANSIENT&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Caught transient\n"));
+ }
+ catch ( const CORBA::TIMEOUT&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Caught timeout\n"));
+ }
+ catch ( const CORBA::Exception& e )
+ {
+ ACE_PRINT_EXCEPTION (e, "Exception caught");
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h
new file mode 100644
index 00000000000..cae39cbce9f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h
@@ -0,0 +1,25 @@
+#ifndef ORB_Task__h_
+#define ORB_Task__h_
+/**
+ * @file ORB_Task.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ *
+ */
+#include "tao/ORB.h"
+#include "ace/Task.h"
+
+class ORB_Task : public ACE_Task_Base
+{
+public:
+ ORB_Task(CORBA::ORB_ptr orb);
+
+ virtual int svc (void);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif /* ORB_Task__h_ */
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl
new file mode 100755
index 00000000000..5ec75486be2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl
@@ -0,0 +1,27 @@
+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;
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("test", "");
+}
+else {
+ $SV = new PerlACE::Process ("test", "");
+}
+
+$SV->Spawn ();
+
+$server = $SV->WaitKill (120);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp b/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp
new file mode 100644
index 00000000000..915e7419e76
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "tao/corba.h"
+#include "ORB_Task.h"
+
+int main( int argc, char* argv[] )
+{
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ ORB_Task worker (orb.in ());
+ worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ 10);
+
+ ACE_Time_Value tv (20, 0);
+ orb->run(tv);
+
+ orb->destroy ();
+
+ worker.thr_mgr ()->wait ();
+
+ return 0;
+}