summaryrefslogtreecommitdiff
path: root/TAO/tests/DII_Collocation_Tests/oneway
diff options
context:
space:
mode:
authordai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-06-01 23:18:45 +0000
committerdai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-06-01 23:18:45 +0000
commitec821b49f0cd5b892c2dfe8fc1c65092edc80493 (patch)
tree0140be931494ff09a89d31326b2c08cf9fd57387 /TAO/tests/DII_Collocation_Tests/oneway
parent12d43fc4d12a063f8e324ce74e47ab769aa3f1ad (diff)
downloadATCD-ec821b49f0cd5b892c2dfe8fc1c65092edc80493.tar.gz
Thu Jun 1 23:13:58 UTC 2006 Yan Dai <dai_y@ociweb.com>
Diffstat (limited to 'TAO/tests/DII_Collocation_Tests/oneway')
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp285
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Client_Task.h41
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp140
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/DII_Collocation_Tests.mpc6
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp397
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Hello.h207
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/README55
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp150
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Server_Task.h54
-rw-r--r--TAO/tests/DII_Collocation_Tests/oneway/Test.idl76
-rwxr-xr-xTAO/tests/DII_Collocation_Tests/oneway/run_test.pl77
11 files changed, 1488 insertions, 0 deletions
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp
new file mode 100644
index 00000000000..f7c3f321248
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp
@@ -0,0 +1,285 @@
+//
+// $Id$
+//
+
+#include "tao/DynamicInterface/Request.h" /* This must come first for
+ G++ 3.4 or better */
+#include "Client_Task.h"
+#include "TestC.h"
+#include "tao/Object.h"
+
+ACE_RCSID(DII_Collocation_Tests, Client_Task, "$Id$")
+
+char TEST_STR[] = "This is a DII collocation test.";
+CORBA::Long TEST_BASIC_VALUE = 12345;
+CORBA::Char TEST_SPECIAL_VALUE = 'x';
+CORBA::Short TEST_HOUR = 12;
+CORBA::Short TEST_MINUTE = 59;
+CORBA::Short TEST_SECOND = 59;
+
+Client_Task::Client_Task (const char *ior,
+ const char *simple_test_ior,
+ CORBA::ORB_ptr corb,
+ ACE_Thread_Manager *thr_mgr)
+ : ACE_Task_Base (thr_mgr)
+ , input_ (ior)
+ , simple_test_input_ (simple_test_ior)
+ , corb_ (CORBA::ORB::_duplicate (corb))
+ , error_count_ (0)
+{
+}
+
+int
+Client_Task::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var obj =
+ this->corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ input_),
+ 1);
+ }
+
+ CORBA::Object_var simple_test_obj =
+ this->corb_->string_to_object (simple_test_input_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (simple_test_obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Simple_Test reference <%s>\n",
+ simple_test_input_),
+ 1);
+ }
+
+ Test::Simple_Test_var simple_test
+ = Test::Simple_Test::_narrow (simple_test_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Request_var req (obj->_request ("test_basic_arg" ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+ req->add_in_arg ("basic") <<= TEST_BASIC_VALUE;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_unbounded_string_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("ub_string") <<= TEST_STR;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_bounded_string_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_CString bs (TEST_STR);
+ bs = bs.substr (0, ::Test::BOUNDED_STRING_SIZE);
+
+ req->add_in_arg ("bd_string")
+ <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE);
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_fixed_array_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ::Test::Fixed_Array fixed_array;
+
+ for (CORBA::ULong m = 0 ; m < ::Test::FIX_ARRAY_SIZE; m ++)
+ {
+ fixed_array[m] = m + 999;
+ }
+
+ req->add_in_arg ("fixed_array") <<= ::Test::Fixed_Array_forany (fixed_array);
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_var_array_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ::Test::Var_Array var_array;
+
+ for (CORBA::ULong i = 0; i < ::Test::VAR_ARRAY_SIZE; ++i)
+ {
+ var_array[i] = CORBA::string_dup(TEST_STR);
+ }
+
+ req->add_in_arg ("var_array") <<= var_array;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_bounded_var_size_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_CString bvs (TEST_STR);
+ bvs = bvs.substr (0, ::Test::BOUNDED_VAR_SIZE);
+
+ ::Test::Bounded_Var_Size_Arg* bd_var_size
+ = new ::Test::Bounded_Var_Size_Arg();
+
+ bd_var_size->replace (::Test::BOUNDED_VAR_SIZE,
+ const_cast <CORBA::Char*> (bvs.c_str ()));
+
+ req->add_in_arg ("bd_var_size") <<= bd_var_size;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_unbounded_var_size_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ::Test::Unbounded_Var_Size_Arg* ub_var_size
+ = new ::Test::Unbounded_Var_Size_Arg();
+ ub_var_size->replace (ub_var_size->maximum (),
+ ACE_OS::strlen (TEST_STR),
+ TEST_STR);
+
+ req->add_in_arg ("ub_var_size") <<= ub_var_size;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_fixed_size_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ::Test::TimeOfDay t;
+ t.hour = TEST_HOUR;
+ t.minute = TEST_MINUTE;
+ t.second = TEST_SECOND;
+
+ req->add_in_arg ("fixed_size") <<= t;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_special_basic_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("special") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE);
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_object_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("object") <<= simple_test_obj.in ();
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_objref_arg"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("objref") <<= simple_test.in ();
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_args_1"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("arg1") <<= simple_test_obj.in ();
+ req->add_in_arg ("arg2") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE);
+ req->add_in_arg ("arg3") <<= simple_test.in ();
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_args_2"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->add_in_arg ("arg1") <<= TEST_STR;
+ req->add_in_arg ("arg2") <<= ::Test::Fixed_Array_forany (fixed_array);
+ req->add_in_arg ("arg3") <<= t;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("test_args_3"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ bd_var_size
+ = new ::Test::Bounded_Var_Size_Arg();
+ bd_var_size->replace (::Test::BOUNDED_VAR_SIZE,
+ const_cast <CORBA::Char*> (bvs.c_str ()));
+
+ ub_var_size
+ = new ::Test::Unbounded_Var_Size_Arg();
+ ub_var_size->replace (ub_var_size->maximum (),
+ ACE_OS::strlen (TEST_STR),
+ TEST_STR);
+
+ for (CORBA::ULong j = 0; j < ::Test::VAR_ARRAY_SIZE; ++j)
+ {
+ var_array[j] = CORBA::string_dup(TEST_STR);
+ }
+
+ req->add_in_arg ("arg1")
+ <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE);
+
+ req->add_in_arg ("arg2") <<= bd_var_size;
+ req->add_in_arg ("arg3") <<= ub_var_size;
+ req->add_in_arg ("arg4") <<= var_array;
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ req = obj->_request ("shutdown"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ }
+ ACE_CATCHANY
+ {
+ error_count_ ++;
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_CATCHALL
+ {
+ error_count_ ++;
+ ACE_ERROR ((LM_ERROR, "(%P|%t)Client_Task::svc - caught unknown exception \n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+
+}
+
+CORBA::ULong
+Client_Task::error_count () const
+{
+ return error_count_;
+}
+
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.h b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.h
new file mode 100644
index 00000000000..2659536d7ad
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.h
@@ -0,0 +1,41 @@
+//
+// $Id$
+//
+
+#ifndef COLLOCATED_TEST_CLIENT_TASK_H
+#define COLLOCATED_TEST_CLIENT_TASK_H
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/ORB.h"
+
+
+/// Implement a Task to run the client as a thread
+class Client_Task : public ACE_Task_Base
+{
+public:
+
+ /// Constructor
+ Client_Task (const char *input,
+ const char *simple_test_ior,
+ CORBA::ORB_ptr corb,
+ ACE_Thread_Manager *thr_mgr);
+
+ /// Thread entry point
+ int svc (void);
+
+ CORBA::ULong error_count () const;
+
+private:
+ const char *input_;
+ const char *simple_test_input_;
+
+ CORBA::ORB_var corb_;
+ CORBA::ULong error_count_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* COLLOCATED_TEST_CLIENT_TASK_H */
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp
new file mode 100644
index 00000000000..a67aa4f416e
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp
@@ -0,0 +1,140 @@
+//$Id$
+
+// This include is needed for static builds to initialize DII_Arguments_Converter
+// service object.
+#include "tao/DynamicInterface/DII_Arguments_Converter_Impl.h"
+
+#include "Server_Task.h"
+#include "Client_Task.h"
+#include "ace/Get_Opt.h"
+#include "ace/Argv_Type_Converter.h"
+#include "ace/SString.h"
+#include "ace/Manual_Event.h"
+
+const char *output = "server.ior";
+const char *input = "file://server.ior";
+const char *simple_test_output = "simple_test.ior";
+const char *simple_test_input = "file://simple_test.ior";
+// static int named_orbs = 0;
+ACE_CString server_orb;
+ACE_CString client_orb;
+
+CORBA::Boolean debug = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:o:nd");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ output = get_opts.opt_arg ();
+ break;
+ case 'k':
+ input = get_opts.opt_arg ();
+ break;
+ case 'n':
+ // named_orbs = 1;
+ server_orb.set ("server_orb");
+ client_orb.set ("client_orb");
+ break;
+ case 'd':
+ debug = 1;
+ break;
+ case '?':
+ default:
+ // This is a hack but that is okay!
+ return 0;
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (parse_args (argc,
+ argv) == -1)
+ return -1;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_Argv_Type_Converter satc (argc, argv);
+ CORBA::ORB_var sorb =
+ CORBA::ORB_init (satc.get_argc (),
+ satc.get_TCHAR_argv (),
+ server_orb.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Manual_Event me;
+ Server_Task server_task (output,
+ simple_test_output,
+ sorb.in (),
+ me,
+ ACE_Thread_Manager::instance ());
+
+ if (server_task.activate (THR_NEW_LWP | THR_JOINABLE,
+ 1,
+ 1) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Error activating server task\n"));
+ }
+
+ // Wait for the server thread to do some processing
+ me.wait ();
+
+ ACE_Argv_Type_Converter catc (argc, argv);
+ CORBA::ORB_var corb =
+ CORBA::ORB_init (catc.get_argc (),
+ catc.get_TCHAR_argv (),
+ client_orb.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Client_Task client_task (input,
+ simple_test_input,
+ corb.in (),
+ ACE_Thread_Manager::instance ());
+
+ if (client_task.activate (THR_NEW_LWP | THR_JOINABLE,
+ 1,
+ 1) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Error activating client task\n"));
+ }
+
+ // Wait for the client and server to finish
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // Now that all threads have completed we can destroy the ORB
+ sorb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (server_orb != client_orb)
+ {
+ corb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ CORBA::ULong errors = client_task.error_count () + server_task.error_count ();
+ if (errors == 0)
+ {
+ ACE_DEBUG((LM_DEBUG, "(%P|%t) test passed\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG, "(%P|%t) test failed - error_count=%u\n", errors));
+ return 1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions..
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/DII_Collocation_Tests.mpc b/TAO/tests/DII_Collocation_Tests/oneway/DII_Collocation_Tests.mpc
new file mode 100644
index 00000000000..afa9884eed8
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/DII_Collocation_Tests.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(*oneway) : taoserver, dynamicinterface, minimum_corba{
+ exename = Collocated_Test
+}
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp
new file mode 100644
index 00000000000..dc2030bf61e
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp
@@ -0,0 +1,397 @@
+//
+// $Id$
+//
+#include "Hello.h"
+#include "tao/ORB_Core.h"
+#include "tao/ORB_Table.h"
+
+ACE_RCSID(DII_Collocation_Tests, Hello, "$Id$")
+
+extern CORBA::Boolean debug;
+extern char TEST_STR[];
+extern CORBA::Long TEST_BASIC_VALUE;
+extern CORBA::Char TEST_SPECIAL_VALUE;
+extern CORBA::Short TEST_HOUR;
+extern CORBA::Short TEST_MINUTE;
+extern CORBA::Short TEST_SECOND;
+
+#define ERROR_COUNT(message) \
+{ error_count_ ++; \
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)%s - failed error_count = %u\n"), \
+ message, error_count_)); \
+}
+
+// Implementation skeleton constructor
+Test_Simple_Test_i::Test_Simple_Test_i (void)
+{
+}
+
+// Implementation skeleton destructor
+Test_Simple_Test_i::~Test_Simple_Test_i (void)
+{
+}
+
+void Test_Simple_Test_i::test_method (
+ ::CORBA::ULong & error_count
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ error_count --;
+}
+
+Hello::Hello (CORBA::ORB_ptr orb,
+ ACE_thread_t thrid)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , thr_id_ (thrid)
+ , error_count_ (0)
+{
+}
+
+void
+Hello::test_basic_arg (
+ ::CORBA::Long basic
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (basic != TEST_BASIC_VALUE)
+ ERROR_COUNT ("Hello::test_basic_arg")
+}
+
+void
+Hello::test_unbounded_string_arg(const char* message
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_unbounded_string_arg ")
+ ACE_TEXT("got unbounded string: %s\n"),
+ message));
+ if (ACE_OS::strncmp (message, TEST_STR, strlen (TEST_STR) != 0))
+ {
+ ERROR_COUNT ("Hello::test_unbounded_string_arg")
+ }
+}
+
+
+void
+Hello::test_bounded_string_arg(const char* message
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_bounded_string_arg ")
+ ACE_TEXT("got bounded string: %s\n"),
+ message));
+ if (ACE_OS::strncmp (message, TEST_STR, ::Test::BOUNDED_STRING_SIZE) != 0)
+ {
+ ERROR_COUNT ("Hello::test_bounded_string_arg")
+ }
+}
+
+
+void
+Hello::test_fixed_array_arg(const ::Test::Fixed_Array message
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ for (unsigned i = 0; i < ::Test::FIX_ARRAY_SIZE; i++)
+ {
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_fixed_array_arg ")
+ ACE_TEXT("got fixed array: %d\n"),
+ message[i]));
+ if (message[i] != static_cast<CORBA::Long> (i + 999))
+ ERROR_COUNT ("Hello::test_fixed_array_arg")
+ }
+}
+
+
+void
+Hello::test_bounded_var_size_arg(const ::Test::Bounded_Var_Size_Arg& message
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_bounded_var_size_arg ")
+ ACE_TEXT("got bounded var size arg\n")));
+ if (ACE_OS::strncmp (message.get_buffer (), TEST_STR, ::Test::BOUNDED_VAR_SIZE) != 0)
+ ERROR_COUNT ("Hello::test_bounded_var_size_arg")
+}
+
+
+void
+Hello::test_unbounded_var_size_arg(const ::Test::Unbounded_Var_Size_Arg& message
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_unbounded_var_size_arg ")
+ ACE_TEXT("got unbounded var size arg.\n")));
+ if (ACE_OS::strncmp (message.get_buffer (), TEST_STR, strlen (TEST_STR)) != 0)
+ ERROR_COUNT ("Hello::test_unbounded_var_size_arg")
+}
+
+
+void
+Hello::test_fixed_size_arg(const ::Test::TimeOfDay& t
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_fixed_size_arg ")
+ ACE_TEXT("got timeofday: %d:%d:%d\n"),
+ t.hour, t.minute, t.second));
+
+ if (t.hour != TEST_HOUR
+ || t.minute != TEST_MINUTE
+ || t.second != TEST_SECOND)
+ ERROR_COUNT ("Hello::test_fixed_size_arg")
+}
+
+
+void
+Hello::test_var_array_arg(const Test::Var_Array messages
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0; i != ::Test::VAR_ARRAY_SIZE; i ++)
+ {
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_var_array_arg ")
+ ACE_TEXT("messages[%d] = %s \n"), i, messages[i].in ()));
+ if (ACE_OS::strncmp (messages[i].in (), TEST_STR, strlen (TEST_STR)) != 0)
+ ERROR_COUNT ("Hello::test_var_array_arg")
+ }
+}
+
+
+void
+Hello::test_special_basic_arg(CORBA::Char value
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_special_basic_arg ")
+ ACE_TEXT(" got special basic arg: %c \n"), value));
+ if (value != TEST_SPECIAL_VALUE)
+ ERROR_COUNT ("Hello::test_special_basic_arg")
+}
+
+
+void Hello::test_objref_arg (
+ ::Test::Simple_Test_ptr test
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_objref_arg \n")));
+
+ if (CORBA::is_nil (test))
+ ERROR_COUNT ("Hello::test_objref_arg")
+ else
+ {
+ // Increment the error_count before calling test_method() and decrement
+ // the error_count when the server handling the test_method() call.
+ CORBA::ULong error_count = 0;
+ error_count ++;
+ test->test_method (error_count ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (error_count != 0)
+ {
+ ERROR_COUNT ("Hello::test_objref_arg")
+ }
+ }
+}
+
+void Hello::test_object_arg (
+ ::CORBA::Object_ptr o
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_object_arg \n")));
+ ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (o);
+
+ CORBA::ULong error_count = 0;
+ error_count ++;
+ simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (error_count != 0)
+ {
+ ERROR_COUNT ("Hello::test_object_arg")
+ }
+}
+
+void Hello::test_args_1 (
+ ::CORBA::Object_ptr arg1,
+ ::CORBA::Char arg2,
+ ::Test::Simple_Test_ptr arg3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_1 \n")));
+ ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (arg1);
+
+ CORBA::ULong error_count = 0;
+ error_count ++;
+ simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ error_count ++;
+ arg3->test_method (error_count ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (error_count != 0)
+ {
+ ERROR_COUNT ("Hello::test_args_1")
+ }
+
+ if (arg2 != TEST_SPECIAL_VALUE)
+ ERROR_COUNT ("Hello::test_args_1")
+}
+
+void Hello::test_args_2 (
+ const char * arg1,
+ const ::Test::Fixed_Array arg2,
+ const ::Test::TimeOfDay & arg3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_2 \n")));
+ if (ACE_OS::strncmp (arg1, TEST_STR, strlen (TEST_STR)) != 0 )
+ ERROR_COUNT ("Hello::test_args_2")
+
+ for (unsigned i = 0; i < ::Test::FIX_ARRAY_SIZE; i++)
+ {
+ if (arg2[i] != static_cast<CORBA::Long> (i + 999))
+ ERROR_COUNT ("Hello::test_args_2")
+ }
+
+ if (arg3.hour != TEST_HOUR
+ || arg3.minute != TEST_MINUTE
+ || arg3.second != TEST_SECOND)
+ ERROR_COUNT ("Hello::test_args_2")
+}
+
+void Hello::test_args_3 (
+ const char * arg1,
+ const ::Test::Bounded_Var_Size_Arg & arg2,
+ const ::Test::Unbounded_Var_Size_Arg & arg3,
+ const ::Test::Var_Array arg4
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ if (debug)
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_3 \n")));
+ if (ACE_OS::strncmp (arg1, TEST_STR, strlen (arg1)) != 0)
+ ERROR_COUNT ("Hello::test_args_3")
+ if (ACE_OS::strncmp (arg2.get_buffer (), TEST_STR, ::Test::BOUNDED_VAR_SIZE) != 0)
+ ERROR_COUNT ("Hello::test_args_3")
+ if (ACE_OS::strncmp (arg3.get_buffer (), TEST_STR, strlen (TEST_STR)) != 0)
+ ERROR_COUNT ("Hello::test_args_3")
+ for (CORBA::ULong i = 0; i != ::Test::VAR_ARRAY_SIZE; i ++)
+ {
+ if (ACE_OS::strncmp (arg4[i].in (), TEST_STR, strlen (TEST_STR)) != 0)
+ ERROR_COUNT ("Hello::test_args_3")
+ }
+}
+
+char *
+Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (debug)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Upcall in process ..\n"));
+
+ if (ACE_Thread::self () == this->thr_id_)
+ {
+ if (this->orb_->orb_core ()->optimize_collocation_objects () &&
+ this->orb_->orb_core ()->use_global_collocation ())
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: A remote call has been made "
+ " exiting ..\n"));
+ ACE_OS::abort ();
+ }
+ else if (this->orb_->orb_core ()->optimize_collocation_objects () &&
+ this->orb_->orb_core ()->use_global_collocation () == 0)
+ {
+ TAO::ORB_Table * const orb_table =
+ TAO::ORB_Table::instance ();
+
+ if (orb_table->find ("server_orb") == 0)
+ {
+ // We are running on a single ORB and this is an error.
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: A remote call has been made "
+ " with a single ORB "
+ " exiting ..\n"));
+ ACE_OS::abort ();
+ }
+ }
+ }
+
+ return CORBA::string_dup ("Hello there!");
+}
+
+char *
+Hello::test_unbounded_string (
+ const char * s1,
+ char *& s2,
+ CORBA::String_out s3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ char *retstr = CORBA::string_dup (s1);
+ s3 = CORBA::string_dup (s1);
+ char *tmp = CORBA::string_alloc (2*ACE_OS::strlen (s2));
+ ACE_OS::sprintf (tmp, "%s%s", s2, s2);
+ CORBA::string_free (s2);
+ s2 = tmp;
+ return retstr;
+}
+
+void
+Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Give the client thread time to return from the collocated
+ // call to this method before shutting down the ORB. We sleep
+ // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
+ ACE_OS::sleep (1);
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::ULong Hello::error_count () const
+{
+ return error_count_;
+}
+
+
+
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Hello.h b/TAO/tests/DII_Collocation_Tests/oneway/Hello.h
new file mode 100644
index 00000000000..8dde8446d54
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Hello.h
@@ -0,0 +1,207 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+#include "ace/OS.h"
+
+class Test_Simple_Test_i
+ : public virtual POA_Test::Simple_Test
+{
+public:
+ //Constructor
+ Test_Simple_Test_i (void);
+
+ //Destructor
+ virtual ~Test_Simple_Test_i (void);
+
+ virtual
+ void test_method (
+ ::CORBA::ULong & error_count
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+};
+
+/// Implement the Test::Hello interface
+class Hello
+ : public virtual POA_Test::Hello
+{
+public:
+ /// Constructor
+ Hello (CORBA::ORB_ptr orb,
+ ACE_thread_t thr_id);
+
+ // = The skeleton methods
+ virtual
+ void test_basic_arg (
+ ::CORBA::Long basic
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_unbounded_string_arg (
+ const char * message
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_bounded_string_arg (
+ const char * message
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_fixed_array_arg (
+ const ::Test::Fixed_Array message
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_var_array_arg (
+ const ::Test::Var_Array messages
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_bounded_var_size_arg (
+ const ::Test::Bounded_Var_Size_Arg & message
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_unbounded_var_size_arg (
+ const ::Test::Unbounded_Var_Size_Arg & message
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_fixed_size_arg (
+ const ::Test::TimeOfDay & t
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_special_basic_arg (
+ ::CORBA::Char value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_objref_arg (
+ ::Test::Simple_Test_ptr test
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_object_arg (
+ ::CORBA::Object_ptr o
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_args_1 (
+ ::CORBA::Object_ptr arg1,
+ ::CORBA::Char arg2,
+ ::Test::Simple_Test_ptr arg3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_args_2 (
+ const char * arg1,
+ const ::Test::Fixed_Array arg2,
+ const ::Test::TimeOfDay & arg3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual
+ void test_args_3 (
+ const char * arg1,
+ const ::Test::Bounded_Var_Size_Arg & arg2,
+ const ::Test::Unbounded_Var_Size_Arg & arg3,
+ const ::Test::Var_Array arg4
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual
+ char * test_unbounded_string (
+ const char * s1,
+ char *& s2,
+ CORBA::String_out s3
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong error_count () const;
+
+private:
+ /// Use an ORB reference to conver strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ ACE_thread_t thr_id_;
+
+ CORBA::ULong error_count_;
+};
+
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/README b/TAO/tests/DII_Collocation_Tests/oneway/README
new file mode 100644
index 00000000000..cc947507808
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/README
@@ -0,0 +1,55 @@
+# $Id$
+
+Description:
+This test is used to test the bug fix on collocated dii oneway request
+invocation via send_oneway() crash on get_in_arg() when the request has multiple
+"IN" parameters.
+
+The test.idl defines oneway operations with all sorts SArgument to test the
+conversion of the DII parameters in NVList to the list of arguments.
+It also defines the operations with multiple "IN" arguments to test the
+bug fix.
+
+
+This test is a modification of the Collocation_Tests. The big difference is
+this test invokes the oneway operations using DII while the Collocation_Tests
+invoke a simple twoway operations.
+
+
+Usage:
+=====
+
+The run_test.pl runs several test cases listed below. The test result will be printed
+after the test completes. To debug the test failure, the operation "-d" can be passed
+to have verbose log.
+
+
+======== Running in Default Mode
+
+Collocated_Test -o test.ior -k file://test.ior
+
+
+======== Running with per-orb
+
+Collocated_Test -o test.ior -k file://test.ior -ORBCollocation per-orb
+
+
+======== Running with no collocation
+
+Collocated_Test -o test.ior -k file://test.ior -ORBCollocation no
+
+
+======== Running in default mode and two ORBS
+
+Collocated_Test -o test.ior -k file://test.ior -n
+
+
+======== Running in per-orb mode and two ORBS
+
+Collocated_Test -o test.ior -k file://test.ior -n -ORBCollocation per-orb
+
+
+======== Running in no collocation mode and two ORBS
+
+Collocated_Test -o test.ior -k file://test.ior -n -ORBCollocation per-orb
+
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp
new file mode 100644
index 00000000000..15754f7aaf3
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp
@@ -0,0 +1,150 @@
+//
+// $Id$
+//
+#include "Server_Task.h"
+#include "TestS.h"
+#include "Hello.h"
+
+#include "ace/Manual_Event.h"
+
+ACE_RCSID(DII_Collocation_Tests,
+ Server_Task,
+ "$Id$")
+
+
+Server_Task::Server_Task (const char *output,
+ const char *simple_test_output,
+ CORBA::ORB_ptr sorb,
+ ACE_Manual_Event &me,
+ ACE_Thread_Manager *thr_mgr)
+ : ACE_Task_Base (thr_mgr)
+ , output_ (output)
+ , simple_test_output_ (simple_test_output)
+ , me_ (me)
+ , sorb_ (CORBA::ORB::_duplicate (sorb))
+ , error_count_ (0)
+{
+}
+
+int
+Server_Task::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var poa_object =
+ this->sorb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (this->sorb_.in (),
+ ACE_Thread::self ()),
+ 1);
+
+ PortableServer::ServantBase_var owner_transfer(hello_impl);
+
+ Test::Hello_var hello =
+ hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ this->sorb_->object_to_string (hello.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <this->output_>
+ FILE *output_file= ACE_OS::fopen (this->output_,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing Hello IOR: %s",
+ this->output_),
+ 1);
+
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ Test_Simple_Test_i *simple_impl;
+ ACE_NEW_RETURN (simple_impl,
+ Test_Simple_Test_i (),
+ 1);
+
+ PortableServer::ServantBase_var owner_transfer_simple(simple_impl);
+
+ Test::Simple_Test_var simple_test =
+ simple_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var simple_test_ior =
+ this->sorb_->object_to_string (simple_test.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <this->output_>
+ FILE *simple_test_output_file= ACE_OS::fopen (this->simple_test_output_,
+ "w");
+ if (simple_test_output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing Simple_Test IOR: %s",
+ this->simple_test_output_),
+ 1);
+
+ ACE_OS::fprintf (simple_test_output_file, "%s", simple_test_ior.in ());
+ ACE_OS::fclose (simple_test_output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Signal the main thread before we call orb->run ();
+ this->me_.signal ();
+
+ this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - verifing results\n"));
+
+ CORBA::ULong errors = hello_impl->error_count ();
+
+ error_count_ += errors;
+ }
+ ACE_CATCHANY
+ {
+ error_count_ ++;
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_CATCHALL
+ {
+ error_count_ ++;
+ ACE_ERROR ((LM_ERROR, "(%P|%t)Server_Task::svc - caught unknown exception \n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::ULong
+Server_Task::error_count () const
+{
+ return error_count_;
+}
+
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.h b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.h
new file mode 100644
index 00000000000..cd8b0582e6f
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef COLLOCATED_SERVER_TASK_H
+#define COLLOCATED_SERVER_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+
+class ACE_Manual_Event;
+
+/// Implement a Task to run the server in a single thread
+class Server_Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ Server_Task (const char *output,
+ const char *simple_test_output,
+ CORBA::ORB_ptr sorb,
+ ACE_Manual_Event &me,
+ ACE_Thread_Manager *thr_mgr);
+
+ /// Thread entry point
+ int svc (void);
+
+ CORBA::ULong error_count () const;
+
+private:
+ /// Output file for server IOR
+ const char *output_;
+
+ /// Output file for Simple_Test IOR
+ const char *simple_test_output_;
+
+ /// Manual event to wake up the main thread to create a client
+ /// thread.
+ ACE_Manual_Event &me_;
+
+ CORBA::ORB_var sorb_;
+
+ CORBA::ULong error_count_;
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* COLLOCATED_SERVER_TASK_H */
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Test.idl b/TAO/tests/DII_Collocation_Tests/oneway/Test.idl
new file mode 100644
index 00000000000..3bd69e1642a
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/Test.idl
@@ -0,0 +1,76 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ const unsigned long FIX_ARRAY_SIZE = 10;
+ const unsigned long VAR_ARRAY_SIZE = 3;
+ const unsigned long BOUNDED_STRING_SIZE = 10;
+ const unsigned long BOUNDED_VAR_SIZE = 10;
+
+ typedef sequence<char, BOUNDED_VAR_SIZE> Bounded_Var_Size_Arg;
+ typedef sequence<char> Unbounded_Var_Size_Arg;
+ typedef long Fixed_Array[FIX_ARRAY_SIZE];
+ typedef string Var_Array [VAR_ARRAY_SIZE];
+
+ struct TimeOfDay {
+ short hour; // 0 - 23
+ short minute; // 0 - 59
+ short second; // 0 - 59
+ };
+
+ interface Simple_Test
+ {
+ void test_method(inout unsigned long error_count);
+ };
+
+ /// A very simple interface
+ interface Hello
+ {
+ oneway void test_basic_arg(in long value);
+
+ oneway void test_unbounded_string_arg(in string message);
+
+ oneway void test_bounded_string_arg(in string<BOUNDED_STRING_SIZE> message);
+
+ oneway void test_fixed_array_arg(in Fixed_Array message);
+
+ oneway void test_var_array_arg(in Var_Array messages);
+
+ oneway void test_bounded_var_size_arg(in Bounded_Var_Size_Arg message);
+
+ oneway void test_unbounded_var_size_arg(in Unbounded_Var_Size_Arg message);
+
+ oneway void test_fixed_size_arg (in TimeOfDay t);
+
+ oneway void test_special_basic_arg(in char value);
+
+ oneway void test_objref_arg (in Simple_Test test);
+
+ oneway void test_object_arg (in Object o);
+
+ oneway void test_args_1 (in Object arg1,
+ in char arg2,
+ in Simple_Test arg3);
+
+ oneway void test_args_2 (in string arg1,
+ in Fixed_Array arg2,
+ in TimeOfDay arg3);
+
+ oneway void test_args_3 (in string<BOUNDED_STRING_SIZE> arg1,
+ in Bounded_Var_Size_Arg arg2,
+ in Unbounded_Var_Size_Arg arg3,
+ in Var_Array arg4);
+
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+ };
+};
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/run_test.pl b/TAO/tests/DII_Collocation_Tests/oneway/run_test.pl
new file mode 100755
index 00000000000..592179ac316
--- /dev/null
+++ b/TAO/tests/DII_Collocation_Tests/oneway/run_test.pl
@@ -0,0 +1,77 @@
+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 ("test.ior");
+unlink $iorfile;
+$status = 0;
+
+$SV = new PerlACE::Process ("Collocated_Test");
+
+print STDERR "======== Running in Default Mode \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+print STDERR "======== Running with per-orb \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile -ORBCollocation per-orb");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+print STDERR "======== Running with no collocation \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile -ORBCollocation no");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+print STDERR "======== Running in default mode and two ORBS \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile -n ");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+print STDERR "======== Running in per-orb mode and two ORBS \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile -n -ORBCollocation per-orb");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+print STDERR "======== Running in no collocation mode and two ORBS \n";
+$SV->Arguments ("-o $iorfile -k file://$iorfile -n -ORBCollocation per-orb");
+$sv = $SV->SpawnWaitKill (60);
+
+if ($sv != 0) {
+ print STDERR "ERROR in Collocated_Test\n";
+ $status = 1;
+}
+unlink $iorfile;
+
+exit $status;