diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 16:53:27 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 16:53:27 +0000 |
commit | e173ad0583f6dfa2ce58b777c434c0906e1be292 (patch) | |
tree | 4232a1221f83956ea047668a0ff601d1a5547462 /TAO/tests | |
parent | 6327ce1265bd35827064d920c9d9bc4e05be6cd4 (diff) | |
download | ATCD-e173ad0583f6dfa2ce58b777c434c0906e1be292.tar.gz |
ChangeLogTag:Sat Jan 24 10:30:40 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tests')
41 files changed, 2167 insertions, 210 deletions
diff --git a/TAO/tests/Cubit/TAO/DII_Cubit/Makefile b/TAO/tests/Cubit/TAO/DII_Cubit/Makefile index d8868023a64..1016e9635ff 100644 --- a/TAO/tests/Cubit/TAO/DII_Cubit/Makefile +++ b/TAO/tests/Cubit/TAO/DII_Cubit/Makefile @@ -41,18 +41,13 @@ include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU #include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +include $(TAO_ROOT)/taoconfig.mk # Local modifications to variables imported by includes above. #LDFLAGS += -L../../../proto/lib #CPPFLAGS += -I../../../proto/include -DUSE_ACE_EVENT_HANDLING -DDEBUG -ifndef TAO_ROOT -TAO_ROOT = $(ACE_ROOT)/TAO -endif -TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE DCFLAGS = -g OCFLAGS = -LDFLAGS += -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H svr: $(addprefix $(VDIR),$(CUBIT_SVR_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile b/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile index 608cba34505..396b2f46575 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/Makefile @@ -9,7 +9,7 @@ # Local macros #---------------------------------------------------------------------------- -LDLIBS = -lTAO +LDLIBS = -lTAO IDL_SRC = cubitC.cpp cubitS.cpp PROG_SRCS = $(IDL_SRC) svr.cpp clnt.cpp tmplinst.cpp @@ -17,7 +17,7 @@ PROG_SRCS = $(IDL_SRC) svr.cpp clnt.cpp tmplinst.cpp LSRC = $(PROG_SRCS) CUBIT_SVR_OBJS = cubitC.o cubitS.o svr.o cubit_i.o tmplinst.o -CUBIT_CLT_OBJS = cubitC.o clnt.o tmplinst.o +CUBIT_CLT_OBJS = cubitC.o cubitS.o clnt.o tmplinst.o BIN = svr clnt BUILD = $(BIN) @@ -30,21 +30,17 @@ VBIN = $(BIN:%=%$(VAR)) include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU #include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +include $(TAO_ROOT)/taoconfig.mk -ifndef TAO_ROOT -TAO_ROOT = $(ACE_ROOT)/TAO -endif -TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE DCFLAGS = -g -LDFLAGS += -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H -$(IDL_SRC): cubit.idl - $(TAO_ROOT)/TAO_IDL/tao_idl cubit.idl +#$(IDL_SRC): cubit.idl +# $(TAO_ROOT)/TAO_IDL/tao_idl cubit.idl svr: $(addprefix $(VDIR),$(CUBIT_SVR_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) @@ -80,11 +76,12 @@ check: $(TESTS) @./clnt -n250 -O `cat obj.5` -x @echo '' -clean: - -/bin/rm -rf *.o Log $(BIN) obj.* core Templates.DB .make.state +#clean: +# -/bin/rm -rf *.o Log $(BIN) obj.* core Templates.DB .make.state realclean: clean -/bin/rm -rf cubitC.* cubitS.* + # DO NOT DELETE THIS LINE -- g++dep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp index d96f6d8740e..fdec90f5a97 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp @@ -28,21 +28,14 @@ #define quote(x) #x Cubit_Client::Cubit_Client (void) - : cubit_factory_key_ ("factory"), + : cubit_factory_key_ (0), cubit_key_ ("key0"), - hostname_ (ACE_DEFAULT_SERVER_HOST), loop_count_ (250), exit_later_ (0), - factory_ (Cubit_Factory::_nil ()), - objref_ (CORBA::Object::_nil ()), cubit_ (Cubit::_nil ()), - orb_ptr_ (0), call_count_ (0), error_count_ (0) { - ACE_Env_Value<CORBA::UShort> defport(quote(TAO_DEFAULT_SERVER_PORT), - TAO_DEFAULT_SERVER_PORT); - portnum_ = defport; } // Simple function that returns the substraction of 117 from the @@ -59,7 +52,7 @@ Cubit_Client::func (u_int i) int Cubit_Client::parse_args (void) { - ACE_Get_Opt get_opts (argc_, argv_, "dn:h:p:k:x"); + ACE_Get_Opt get_opts (argc_, argv_, "dn:f:k:x"); int c; while ((c = get_opts ()) != -1) @@ -71,13 +64,10 @@ Cubit_Client::parse_args (void) case 'n': // loop count loop_count_ = (u_int) ACE_OS::atoi (get_opts.optarg); break; - case 'h': - hostname_ = ACE_OS::strdup (get_opts.optarg); - break; - case 'p': - portnum_ = ACE_OS::atoi (get_opts.optarg); - break; - case 'k': // stringified objref + case 'f': + cubit_factory_key_ = ACE_OS::strdup (get_opts.optarg); + break; + case 'k': cubit_key_ = ACE_OS::strdup (get_opts.optarg); break; case 'x': @@ -89,9 +79,8 @@ Cubit_Client::parse_args (void) "usage: %s" " [-d]" " [-n loopcount]" + " [-f cubit_factory-obj-ref-key]" " [-k cubit-obj-ref-key]" - " [-h hostname]" - " [-p port]" " [-x]" "\n", this->argv_ [0]), @@ -670,10 +659,12 @@ Cubit_Client::run (void) Cubit_Client::~Cubit_Client (void) { // Free resources - CORBA::release (this->orb_ptr_); - CORBA::release (this->objref_); - CORBA::release (this->factory_); CORBA::release (this->cubit_); + + if (this->cubit_factory_key_ != 0) + ACE_OS::free (this->cubit_factory_key_); + if (this->cubit_key_ != 0) + ACE_OS::free (this->cubit_key_); } int @@ -682,76 +673,62 @@ Cubit_Client::init (int argc, char **argv) this->argc_ = argc; this->argv_ = argv; - // Retrieve the ORB. - this->orb_ptr_ = CORBA::ORB_init (this->argc_, - this->argv_, - "internet", - this->env_); + TAO_TRY + { + // Retrieve the ORB. + this->orb_ = CORBA::ORB_init (this->argc_, + this->argv_, + "internet", + TAO_TRY_ENV); + TAO_CHECK_ENV; - // Parse command line and verify parameters. - if (this->parse_args () == -1) - return -1; + // Parse command line and verify parameters. + if (this->parse_args () == -1) + return -1; - if (this->env_.exception () != 0) - { - this->env_.print_exception ("ORB initialization"); - return -1; - } + if (this->cubit_factory_key_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "%s: no cubit factory key specified\n", + this->argv_[0]), + -1); - if (this->cubit_key_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "%s: must specify an object reference using -k <key>\n", - this->argv_[0]), - -1); - // Retrieve a factory objref. - this->objref_ = Cubit_Factory::_bind (this->hostname_, - this->portnum_, - this->cubit_factory_key_, - this->env_); + CORBA::Object_var factory_object = + this->orb_->string_to_object (this->cubit_factory_key_, + TAO_TRY_ENV); + TAO_CHECK_ENV; - if (this->env_.exception () != 0) - { - this->env_.print_exception ("Cubit_Factory::_bind"); - return -1; - } + this->factory_ = + Cubit_Factory::_narrow (factory_object, TAO_TRY_ENV); + TAO_CHECK_ENV; - if (CORBA::is_nil (this->objref_) == CORBA::B_TRUE) - ACE_ERROR_RETURN ((LM_ERROR, - " _bind returned null object for key (%s), host (%s), port (%d)\n", - this->cubit_factory_key_, - this->hostname_, - this->portnum_), - -1); - - // Narrow the CORBA::Object reference to the stub object, checking - // the type along the way using _is_a. There is really no need to - // narrow <objref> because <_bind> will return us the - // <Cubit_Factory> pointer. However, we do it so that we can - // explicitly test the _narrow function. - this->factory_ = Cubit_Factory::_narrow (this->objref_, this->env_); - //CORBA::release (this->objref_); - this->objref_->Release (); - - if (this->factory_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to narrow object reference to a Cubit_Factory_ptr.\n"), - -1); - - // Now retrieve the Cubit obj ref corresponding to the key. - this->cubit_ = - this->factory_->make_cubit (this->cubit_key_, this->env_); + if (CORBA::is_nil (this->factory_.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "invalid factory key <%s>\n", + this->cubit_factory_key_), + -1); + } - if (this->env_.exception () != 0) + ACE_DEBUG ((LM_DEBUG, "Factory received OK\n")); + + // Now retrieve the Cubit obj ref corresponding to the key. + this->cubit_ = + this->factory_->make_cubit (this->cubit_key_, + TAO_TRY_ENV); + TAO_CHECK_ENV; + + if (CORBA::is_nil (this->cubit_)) + ACE_ERROR_RETURN ((LM_ERROR, + "null cubit objref returned by factory\n"), + -1); + } + TAO_CATCHANY { - this->env_.print_exception ("string2object"); + TAO_TRY_ENV.print_exception ("Cubit::init"); return -1; } - - if (CORBA::is_nil (this->cubit_)) - ACE_ERROR_RETURN ((LM_ERROR, - "null cubit objref returned by factory\n"), - -1); + TAO_ENDTRY; return 0; } @@ -765,8 +742,8 @@ main (int argc, char **argv) if (cubit_client.init (argc, argv) == -1) return 1; - else - return cubit_client.run (); + + return cubit_client.run (); } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.h b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.h index 8c7c5ee3f8a..2ba3f7e50b8 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.h +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.h @@ -85,37 +85,28 @@ private: char **argv_; // arguments from command line. - const char *cubit_factory_key_; + char *cubit_factory_key_; // Key of factory obj ref. char *cubit_key_; // Key of the obj ref to be retrieved via the factory. - char *hostname_; - // Hostname of server. - - CORBA::UShort portnum_; - // default port number of server. - u_int loop_count_; // Number of times to do the cube operations. int exit_later_; // Flag to tell server to not exit immediately - Cubit_Factory_ptr factory_; + Cubit_Factory_var factory_; // factory pointer for cubit. - CORBA::Object_ptr objref_; - // storage of the factory objref - CORBA::Environment env_; // Environment variable Cubit_ptr cubit_; // Cubit obj ref - CORBA::ORB_ptr orb_ptr_; + CORBA::ORB_var orb_; // Remember our orb u_int call_count_; diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp index 0e057ae5815..5092f41b31e 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp @@ -14,61 +14,31 @@ // ============================================================================ #include "tao/corba.h" +#include "ace/Auto_Ptr.h" #include "cubit_i.h" // Constructor -Cubit_Factory_i::Cubit_Factory_i (const char *key, int numobjs) - : POA_Cubit_Factory (key) +Cubit_Factory_i::Cubit_Factory_i (void) { - // Create implementation object with user specified key. - - this->numobjs_ = numobjs; - this->my_cubit_ = new Cubit_i_ptr [this->numobjs_]; - - static char obj_str [MAXNAMELEN]; - - for (u_int i = 0; i < this->numobjs_; i++) - { - ACE_OS::memset (obj_str, '\0', MAXNAMELEN); - ACE_OS::sprintf (obj_str, "key%d", i); - - my_cubit_[i] = new Cubit_i (obj_str); - - if (my_cubit_[i] == 0) - ACE_ERROR ((LM_ERROR, - " (%P|%t) Unable to create implementation object%d\n", - i)); - - } } // Destructor Cubit_Factory_i::~Cubit_Factory_i (void) { - delete [] this->my_cubit_; } Cubit_ptr -Cubit_Factory_i::make_cubit (const char *key, CORBA::Environment &env) +Cubit_Factory_i::make_cubit (const char *, + CORBA::Environment &env) { - for (size_t i = 0; i < this->numobjs_; i++) - { - const char *obj_str = this->my_cubit_[i]->_get_name (env); - - // Keys matched. - if (!ACE_OS::strcmp (obj_str, key)) - return Cubit::_duplicate (this->my_cubit_ [i]); - } - - return Cubit::_nil (); + return my_cubit_._this (env); } // Constructor -Cubit_i::Cubit_i (const char *obj_name) - : POA_Cubit (obj_name) +Cubit_i::Cubit_i (const char *) { } @@ -135,16 +105,16 @@ Cubit_i::cube_union (const Cubit::oneof &values, ACE_UNUSED_ARG (env); switch (values._d ()) { - case e_0th: + case Cubit::e_0th: temp.o (values.o () * values.o () * values.o ()); break; - case e_1st: + case Cubit::e_1st: temp.s (values.s () * values.s () * values.s ()); break; - case e_2nd: + case Cubit::e_2nd: temp.l (values.l () * values.l () * values.l ()); break; - case e_3rd: + case Cubit::e_3rd: default: temp._d (values._d ()); // set the discriminant // use the read/write accessor diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.h b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.h index c62db28337b..800283c268e 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.h +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.h @@ -82,7 +82,7 @@ class Cubit_Factory_i: public POA_Cubit_Factory // factory object returning the cubit objrefs { public: - Cubit_Factory_i (const char *key, int numobjs); + Cubit_Factory_i (void); // constructor ~Cubit_Factory_i (void); @@ -92,8 +92,7 @@ public: // make the cubit object whose key is "key" private: - Cubit_i_ptr *my_cubit_; - u_int numobjs_; + Cubit_i my_cubit_; }; #endif /* _CUBIT_I_HH */ diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/svr.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/svr.cpp index c716c0b1467..7b82c142e95 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/svr.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/svr.cpp @@ -55,63 +55,97 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - CORBA::Environment env; - char *orb_name = "internet"; - - CORBA::ORB_ptr orb_ptr = CORBA::ORB_init (argc, argv, orb_name, env); - - if (env.exception () != 0) + TAO_TRY { - env.print_exception ("ORB init"); - return 1; + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, TAO_TRY_ENV); + TAO_CHECK_ENV; + + // Initialize the Object Adapter + 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, TAO_TRY_ENV); + TAO_CHECK_ENV; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (TAO_TRY_ENV); + TAO_CHECK_ENV; + + PortableServer::PolicyList policies (2); + policies.length (2); + policies[0] = + root_poa->create_id_assignment_policy (PortableServer::USER_ID, + TAO_TRY_ENV); + policies[1] = + root_poa->create_lifespan_policy (PortableServer::PERSISTENT, + TAO_TRY_ENV); + + // We use a different POA, otherwise the user would have to + // change the object key each time it invokes the server. + PortableServer::POA_var good_poa = + root_poa->create_POA ("RootPOA_is_BAD", + poa_manager.in (), + policies, + TAO_TRY_ENV); + TAO_CHECK_ENV; + + // Parse remaining command line and verify parameters. + parse_args (argc, argv); + + // create a factory implementation + Cubit_Factory_i factory_impl; + + PortableServer::ObjectId_var id = + PortableServer::string_to_ObjectId ("factory"); + good_poa->activate_object_with_id (id.in (), + &factory_impl, + TAO_TRY_ENV); + TAO_CHECK_ENV; + + if (TAO_debug_level > 0) + { + CORBA::Object_var obj = + good_poa->id_to_reference (id.in (), TAO_TRY_ENV); + TAO_CHECK_ENV; + + CORBA::String_var str = + orb->object_to_string (obj.in (), + TAO_TRY_ENV); + TAO_CHECK_ENV; + + ACE_DEBUG ((LM_DEBUG, + "The IOR is: <%s>\n", str.in ())); + } + + poa_manager->activate (TAO_TRY_ENV); + TAO_CHECK_ENV; + + // Handle requests for this object until we're killed, or one of + // the methods asks us to exit. + if (orb->run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), -1); + + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + TAO_TRY_ENV); + TAO_CHECK_ENV } - - // Initialize the Object Adapter - CORBA::POA_ptr oa_ptr = orb_ptr->POA_init (argc, argv, "POA"); - - if (oa_ptr == 0) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - // Parse remaining command line and verify parameters. - parse_args (argc, argv); - - // create a factory implementation - Cubit_Factory_ptr factory; - - ACE_NEW_RETURN (factory, Cubit_Factory_i ("factory", num_of_objs), 1); - - if (TAO_debug_level > 0) + TAO_CATCH (CORBA::SystemException, sysex) { - // Stringify the objref we'll be implementing, and print it to - // stdout. Someone will take that string and give it to a - // client. Then release the object. - - CORBA::String str; - - str = orb_ptr->object_to_string (factory, env); - - if (env.exception () != 0) - { - env.print_exception ("object2string"); - return 1; - } - - ACE_OS::puts ((char *) str); - ACE_OS::fflush (stdout); - //dmsg1 ("Object Created at: '%ul'", obj); - dmsg1 ("listening as object '%s'", str); + TAO_TRY_ENV.print_exception ("System Exception"); + return -1; } - - // Handle requests for this object until we're killed, or one of the - // methods asks us to exit. - if (orb_ptr->run () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), -1); - - // Free resources - CORBA::release (oa_ptr); - CORBA::release (orb_ptr); + TAO_CATCH (CORBA::UserException, userex) + { + TAO_TRY_ENV.print_exception ("User Exception"); + return -1; + } + TAO_ENDTRY; return 0; } diff --git a/TAO/tests/Makefile b/TAO/tests/Makefile index 77a74e3b28c..f88d505c6d0 100644 --- a/TAO/tests/Makefile +++ b/TAO/tests/Makefile @@ -8,7 +8,10 @@ # Local macros #---------------------------------------------------------------------------- -DIRS = Cubit \ +DIRS = \ + Cubit \ + POA \ + Param_Test \ Thruput # The following test hasn't been updated yet diff --git a/TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw b/TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw new file mode 100644 index 00000000000..293f7320fc8 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "server"=.\server.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/Explicit_Activation/server.cpp b/TAO/tests/POA/Explicit_Activation/server.cpp new file mode 100644 index 00000000000..6dec3921a4a --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation/server.cpp @@ -0,0 +1,159 @@ +#include "ace/streams.h" +#include "MyFooServant.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::the_POAManager"); + return -1; + } + + // CORBA::PolicyList policies (2); + PortableServer::PolicyList policies (2); + policies.length (2); + policies[0] = root_poa->create_id_assignment_policy (PortableServer::USER_ID, env); + policies[1] = root_poa->create_lifespan_policy (PortableServer::PERSISTENT, env); + + ACE_CString name = "firstPOA"; + PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), + poa_manager.in (), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + for (CORBA::ULong i = 0; + i < policies.length () && env.exception () == 0; + ++i) + { + PortableServer::Policy_ptr policy = policies[i]; + policy->destroy (env); + } + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + MyFooServant first_foo_impl (root_poa, 27); + MyFooServant second_foo_impl (first_poa, 28); + + PortableServer::ObjectId_var first_oid = root_poa->activate_object (&first_foo_impl, env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::activate_object"); + return -1; + } + + Foo_var first_foo = first_foo_impl._this (env); + if (env.exception () != 0) + { + env.print_exception ("POA_Foo::_this"); + return -1; + } + + PortableServer::ObjectId_var second_oid = PortableServer::string_to_ObjectId ("secondFoo"); + first_poa->activate_object_with_id (second_oid.in (), + &second_foo_impl, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::activate_object_with_id"); + return -1; + } + + Foo_var second_foo = second_foo_impl._this (env); + if (env.exception () != 0) + { + env.print_exception ("POA_Foo::_this"); + return -1; + } + + PortableServer::ObjectId_var third_oid = PortableServer::string_to_ObjectId ("thirdFoo"); + CORBA::Object_var third_foo = first_poa->create_reference_with_id (third_oid.in (), "IDL:Foo:1.0", env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_reference_with_id"); + return -1; + } + + CORBA::String_var first_ior = orb->object_to_string (first_foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + CORBA::String_var second_ior = orb->object_to_string (second_foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + CORBA::String_var third_ior = orb->object_to_string (third_foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + cout << first_ior.in () << endl; + cout << second_ior.in () << endl; + cout << third_ior.in () << endl; + + MyFooServant third_foo_impl (first_poa, 29); + first_poa->activate_object_with_id (third_oid.in (), + &third_foo_impl, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::activate_object_with_id"); + return -1; + } + + poa_manager->activate (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::activate"); + return -1; + } + + if (orb->run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1); + + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::destroy"); + return -1; + } + + return 0; +} diff --git a/TAO/tests/POA/Explicit_Activation/server.dsp b/TAO/tests/POA/Explicit_Activation/server.dsp new file mode 100644 index 00000000000..0421abf651e --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation/server.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=server - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "server - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /I "..\Generic_Servant\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 tao.lib ace.lib ..\Generic_Servant\server.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "server - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /I "..\Generic_Servant\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib ..\Generic_Servant\server.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "server - Win32 Release"
+# Name "server - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\server.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Explicit_Activation/svc.conf b/TAO/tests/POA/Explicit_Activation/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/tests/POA/FindPOA/FindPOA.cpp b/TAO/tests/POA/FindPOA/FindPOA.cpp new file mode 100644 index 00000000000..c907a58f650 --- /dev/null +++ b/TAO/tests/POA/FindPOA/FindPOA.cpp @@ -0,0 +1,120 @@ +#include "ace/streams.h" +#include "tao/corba.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in(), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + TAO_Adapter_Activator activator_impl; + PortableServer::AdapterActivator_var activator = activator_impl._this (env); + if (env.exception () != 0) + { + env.print_exception ("TAO_Adapter_Activator::_this"); + return -1; + } + + root_poa->the_activator (activator.in (), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::the_activator"); + return -1; + } + + ACE_CString name = "firstPOA"; + PortableServer::POA_var first_poa = root_poa->find_POA (name.c_str (), + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::find_POA"); + return -1; + } + + name += TAO_POA::name_separator (); + name += "secondPOA"; + PortableServer::POA_var second_poa = root_poa->find_POA (name.c_str (), + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::find_POA"); + return -1; + } + + name = "thirdPOA"; + name += TAO_POA::name_separator (); + name += "forthPOA"; + name += TAO_POA::name_separator (); + name += "fifthPOA"; + + PortableServer::POA_var fifth_poa = root_poa->find_POA (name.c_str (), + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::find_POA"); + return -1; + } + + CORBA::String_var root_poa_name = root_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var first_poa_name = first_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var second_poa_name = second_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var fifth_poa_name = fifth_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + cout << root_poa_name.in () << endl; + cout << first_poa_name.in () << endl; + cout << second_poa_name.in () << endl; + cout << fifth_poa_name.in () << endl; + + // This should destroy all its children + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::destroy"); + return -1; + } + + return 0; +} diff --git a/TAO/tests/POA/FindPOA/FindPOA.dsp b/TAO/tests/POA/FindPOA/FindPOA.dsp new file mode 100644 index 00000000000..77859c2e61d --- /dev/null +++ b/TAO/tests/POA/FindPOA/FindPOA.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="FindPOA" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=FindPOA - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "FindPOA.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "FindPOA.mak" CFG="FindPOA - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "FindPOA - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "FindPOA - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "FindPOA - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "FindPOA - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "FindPOA - Win32 Release"
+# Name "FindPOA - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\FindPOA.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/FindPOA/FindPOA.dsw b/TAO/tests/POA/FindPOA/FindPOA.dsw new file mode 100644 index 00000000000..f63bde91efd --- /dev/null +++ b/TAO/tests/POA/FindPOA/FindPOA.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "FindPOA"=.\FindPOA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/FindPOA/Makefile b/TAO/tests/POA/FindPOA/Makefile new file mode 100644 index 00000000000..731b7853b13 --- /dev/null +++ b/TAO/tests/POA/FindPOA/Makefile @@ -0,0 +1,45 @@ +# +# $Id$ +# + +BIN = FindPOA + +LSRC = $(addsuffix .cpp,$(BIN)) + +CPPFLAGS += -I$(TAO_ROOT) + +LDLIBS = -lTAO +LDFLAGS += -L$(TAO_ROOT)/tao + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +BUILD = $(VBIN) + +INSTALL = + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/tests/POA/Generic_Servant/Foo.idl b/TAO/tests/POA/Generic_Servant/Foo.idl new file mode 100644 index 00000000000..9e248115e9c --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/Foo.idl @@ -0,0 +1,4 @@ +interface Foo +{ + long doit(); +}; diff --git a/TAO/tests/POA/Generic_Servant/Generic_Servant.dsw b/TAO/tests/POA/Generic_Servant/Generic_Servant.dsw new file mode 100644 index 00000000000..f6006d20cb7 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/Generic_Servant.dsw @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "client"=.\client.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "server"=.\server.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/Generic_Servant/MyFooServant.cpp b/TAO/tests/POA/Generic_Servant/MyFooServant.cpp new file mode 100644 index 00000000000..91f748c1900 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/MyFooServant.cpp @@ -0,0 +1,25 @@ +#include "MyFooServant.h" + +MyFooServant::MyFooServant (PortableServer::POA_ptr poa, + CORBA::Long value) + : poa_ (PortableServer::POA::_duplicate (poa)), + value_ (value) +{ +} + +MyFooServant::~MyFooServant (void) +{ +} + +PortableServer::POA_ptr +MyFooServant::_default_POA (CORBA::Environment &env) +{ + return PortableServer::POA::_duplicate (this->poa_); +} + +CORBA::Long +MyFooServant::doit (CORBA::Environment &env) +{ + return this->value_; +} + diff --git a/TAO/tests/POA/Generic_Servant/MyFooServant.h b/TAO/tests/POA/Generic_Servant/MyFooServant.h new file mode 100644 index 00000000000..3b7502cb466 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/MyFooServant.h @@ -0,0 +1,23 @@ +#if !defined (MYFOOSERVANT_H) +#define MYFOOSERVANT_H + +#include "FooS.h" + +class MyFooServant : public POA_Foo +{ +public: + MyFooServant (PortableServer::POA_ptr poa, + CORBA::Long value); + + virtual ~MyFooServant (void); + + virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env); + + virtual CORBA::Long doit (CORBA::Environment &env); + +protected: + PortableServer::POA_var poa_; + CORBA::Long value_; +}; + +#endif /* MYFOOSERVANT_H */ diff --git a/TAO/tests/POA/Generic_Servant/client.cpp b/TAO/tests/POA/Generic_Servant/client.cpp new file mode 100644 index 00000000000..e307cae1552 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/client.cpp @@ -0,0 +1,78 @@ +#include "ace/streams.h" +#include "ace/Get_Opt.h" +#include "FooC.h" + +char *ior = 0; + +static int +parse_args (int argc, char **argv) +{ + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s" + "-k IOR" + "\n", + argv [0]), + -1); + } + + if (ior == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Please specify the IOR for the servant"), -1); + + // Indicates successful parsing of command line. + return 0; +} + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + parse_args (argc, argv); + + CORBA::Object_var object = orb->string_to_object (ior, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::string_to_object"); + return -1; + } + + Foo_var foo = Foo::_narrow (object.in (), env); + if (env.exception () != 0) + { + env.print_exception ("Foo::_bind"); + return -1; + } + + CORBA::Long result = foo->doit (env); + if (env.exception () != 0) + { + env.print_exception ("Foo::doit"); + return -1; + } + + cout << result << endl; + + CORBA::release (orb); + + return 0; +} + diff --git a/TAO/tests/POA/Generic_Servant/client.dsp b/TAO/tests/POA/Generic_Servant/client.dsp new file mode 100644 index 00000000000..87dfc4c3983 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/client.dsp @@ -0,0 +1,99 @@ +# Microsoft Developer Studio Project File - Name="client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=client - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak" CFG="client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "client - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "client - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "client - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib tao.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "client - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "client__"
+# PROP BASE Intermediate_Dir "client__"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "client - Win32 Release"
+# Name "client - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FooC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FooS.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Generic_Servant/server.dsp b/TAO/tests/POA/Generic_Servant/server.dsp new file mode 100644 index 00000000000..48a9adfa460 --- /dev/null +++ b/TAO/tests/POA/Generic_Servant/server.dsp @@ -0,0 +1,90 @@ +# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=server - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+
+!IF "$(CFG)" == "server - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "server - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "server - Win32 Release"
+# Name "server - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\FooC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\FooS.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MyFooServant.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Makefile b/TAO/tests/POA/Makefile new file mode 100644 index 00000000000..e71ba4edacc --- /dev/null +++ b/TAO/tests/POA/Makefile @@ -0,0 +1,30 @@ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 10/18/96 +# +# Makefile for the TAO tests +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +DIRS = Explicit_Activation \ + FindPOA \ + Generic_Servant \ + NewPOA \ + On_Demand_Activation \ + RootPOA + +# The following test hasn't been updated yet +# Demux_Test + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU + diff --git a/TAO/tests/POA/NewPOA/Makefile b/TAO/tests/POA/NewPOA/Makefile new file mode 100644 index 00000000000..eece9f148e9 --- /dev/null +++ b/TAO/tests/POA/NewPOA/Makefile @@ -0,0 +1,45 @@ +# +# $Id$ +# + +BIN = NewPOA + +LSRC = $(addsuffix .cpp,$(BIN)) + +CPPFLAGS += -I$(TAO_ROOT) + +LDLIBS = -lTAO +LDFLAGS += -L$(TAO_ROOT)/tao + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +BUILD = $(VBIN) + +INSTALL = + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/tests/POA/NewPOA/NewPOA.cpp b/TAO/tests/POA/NewPOA/NewPOA.cpp new file mode 100644 index 00000000000..628b6f52041 --- /dev/null +++ b/TAO/tests/POA/NewPOA/NewPOA.cpp @@ -0,0 +1,127 @@ +#include "ace/streams.h" +#include "tao/corba.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in(), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + // CORBA::PolicyList policies (2); + PortableServer::PolicyList policies (2); + policies.length (2); + policies[0] = root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, env); + policies[1] = root_poa->create_lifespan_policy (PortableServer::TRANSIENT, env); + + ACE_CString name = "firstPOA"; + PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (), + PortableServer::POAManager::_nil(), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + name += TAO_POA::name_separator (); + name += "secondPOA"; + PortableServer::POA_var second_poa = root_poa->create_POA (name.c_str (), + PortableServer::POAManager::_nil(), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + name = "thirdPOA"; + name += TAO_POA::name_separator (); + name += "forthPOA"; + name += TAO_POA::name_separator (); + name += "fifthPOA"; + + PortableServer::POA_var fifth_poa = root_poa->create_POA (name.c_str (), + PortableServer::POAManager::_nil(), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + for (CORBA::ULong i = 0; + i < policies.length () && env.exception () == 0; + ++i) + { + PortableServer::Policy_ptr policy = policies[i]; + policy->destroy (env); + } + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + CORBA::String_var root_poa_name = root_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var first_poa_name = first_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var second_poa_name = second_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var fifth_poa_name = fifth_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + cout << root_poa_name.in () << endl; + cout << first_poa_name.in () << endl; + cout << second_poa_name.in () << endl; + cout << fifth_poa_name.in () << endl; + + // This should destroy all its children + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::destroy"); + return -1; + } + + return 0; +} diff --git a/TAO/tests/POA/NewPOA/NewPOA.dsp b/TAO/tests/POA/NewPOA/NewPOA.dsp new file mode 100644 index 00000000000..8ebd8d2b115 --- /dev/null +++ b/TAO/tests/POA/NewPOA/NewPOA.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="NewPOA" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=NewPOA - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "NewPOA.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "NewPOA.mak" CFG="NewPOA - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "NewPOA - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "NewPOA - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "NewPOA - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib tao.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "NewPOA - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "NewPOA - Win32 Release"
+# Name "NewPOA - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\NewPOA.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/NewPOA/NewPOA.dsw b/TAO/tests/POA/NewPOA/NewPOA.dsw new file mode 100644 index 00000000000..e7ce2ae3196 --- /dev/null +++ b/TAO/tests/POA/NewPOA/NewPOA.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "NewPOA"=.\NewPOA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw b/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw new file mode 100644 index 00000000000..293f7320fc8 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "server"=.\server.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp new file mode 100644 index 00000000000..ddecaad4177 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp @@ -0,0 +1,33 @@ +#include "Servant_Activator.h" +#include "MyFooServant.h" + +PortableServer::Servant +MyFooServantActivator::incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + CORBA::Environment &env) +{ + CORBA::String_var s = PortableServer::ObjectId_to_string (oid); + if (ACE_OS::strstr (s.in (), "Foo") != 0) + { + return new MyFooServant (poa, 27); + } + else + { + CORBA::Exception *exception = new CORBA::OBJECT_NOT_EXIST (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } +} + +void +MyFooServantActivator::etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations, + CORBA::Environment &env) +{ + if (remaining_activations == CORBA::B_FALSE) + delete servant; +} + diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h new file mode 100644 index 00000000000..1792284649b --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h @@ -0,0 +1,17 @@ +#include "tao/corba.h" + +class MyFooServantActivator : public POA_PortableServer::ServantActivator +{ +public: + virtual PortableServer::Servant incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + CORBA::Environment &env); + + virtual void etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations, + CORBA::Environment &env); +}; + diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Locator.cpp b/TAO/tests/POA/On_Demand_Activation/Servant_Locator.cpp new file mode 100644 index 00000000000..6b5df82f885 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Locator.cpp @@ -0,0 +1,43 @@ +#include "Servant_Locator.h" +#include "MyFooServant.h" + +MyFooServantLocator::MyFooServantLocator (void) + : counter_ (0) +{ +} + + +PortableServer::Servant +MyFooServantLocator::preinvoke (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + const char *operation, + PortableServer::ServantLocator::Cookie &cookie, + CORBA::Environment &env) +{ + CORBA::String_var s = PortableServer::ObjectId_to_string (oid); + if (ACE_OS::strstr (s.in (), "Foo") != 0) + { + PortableServer::Servant servant = new MyFooServant (poa, ++this->counter_); + cookie = servant; + return servant; + } + else + { + CORBA::Exception *exception = new CORBA::OBJECT_NOT_EXIST (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } +} + +void +MyFooServantLocator::postinvoke (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + const char *operation, + PortableServer::ServantLocator::Cookie cookie, + PortableServer::Servant servant, + CORBA::Environment &env) +{ + PortableServer::Servant my_servant = (PortableServer::Servant) cookie; + ACE_ASSERT (servant == my_servant); + delete servant; +} diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Locator.h b/TAO/tests/POA/On_Demand_Activation/Servant_Locator.h new file mode 100644 index 00000000000..6abfb278eb5 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Locator.h @@ -0,0 +1,24 @@ +#include "tao/corba.h" + +class MyFooServantLocator : public POA_PortableServer::ServantLocator +{ +public: + MyFooServantLocator (void); + + virtual PortableServer::Servant preinvoke (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + const char *operation, + PortableServer::ServantLocator::Cookie &the_cookie, + CORBA::Environment &env); + + virtual void postinvoke (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + const char *operation, + PortableServer::ServantLocator::Cookie the_cookie, + PortableServer::Servant the_servant, + CORBA::Environment &env); +private: + + int counter_; +}; + diff --git a/TAO/tests/POA/On_Demand_Activation/server.cpp b/TAO/tests/POA/On_Demand_Activation/server.cpp new file mode 100644 index 00000000000..a167064d1a2 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/server.cpp @@ -0,0 +1,186 @@ +#include "ace/streams.h" +#include "Servant_Activator.h" +#include "Servant_Locator.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj, env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::the_POAManager"); + return -1; + } + + PortableServer::POA_var first_poa; + { + // CORBA::PolicyList policies (4); + PortableServer::PolicyList policies (4); + policies.length (4); + policies[0] = root_poa->create_id_assignment_policy (PortableServer::USER_ID, env); + policies[1] = root_poa->create_lifespan_policy (PortableServer::PERSISTENT, env); + policies[2] = root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER, env); + policies[3] = root_poa->create_servant_retention_policy (PortableServer::RETAIN, env); + + ACE_CString name = "firstPOA"; + first_poa = root_poa->create_POA (name.c_str (), + poa_manager.in (), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + for (CORBA::ULong i = 0; + i < policies.length () && env.exception () == 0; + ++i) + { + PortableServer::Policy_ptr policy = policies[i]; + policy->destroy (env); + } + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + } + + PortableServer::POA_var second_poa; + { + // CORBA::PolicyList policies (4); + PortableServer::PolicyList policies (4); + policies.length (4); + policies[0] = root_poa->create_id_assignment_policy (PortableServer::USER_ID, env); + policies[1] = root_poa->create_lifespan_policy (PortableServer::PERSISTENT, env); + policies[2] = root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER, env); + policies[3] = root_poa->create_servant_retention_policy (PortableServer::NON_RETAIN, env); + + ACE_CString name = "secondPOA"; + second_poa = root_poa->create_POA (name.c_str (), + poa_manager.in (), + policies, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + + for (CORBA::ULong i = 0; + i < policies.length () && env.exception () == 0; + ++i) + { + PortableServer::Policy_ptr policy = policies[i]; + policy->destroy (env); + } + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + } + + MyFooServantActivator servant_activator_impl; + PortableServer::ServantActivator_var servant_activator = servant_activator_impl._this (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::_this"); + return -1; + } + + first_poa->set_servant_manager (servant_activator.in (), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::set_servant_manager"); + return -1; + } + + PortableServer::ObjectId_var first_foo_oid = PortableServer::string_to_ObjectId ("firstFoo"); + CORBA::Object_var first_foo = first_poa->create_reference_with_id (first_foo_oid.in (), "IDL:Foo:1.0", env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_reference_with_id"); + return -1; + } + + MyFooServantLocator servant_locator_impl; + PortableServer::ServantLocator_var servant_locator = servant_locator_impl._this (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::_this"); + return -1; + } + + second_poa->set_servant_manager (servant_locator.in (), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::set_servant_manager"); + return -1; + } + + PortableServer::ObjectId_var second_foo_oid = PortableServer::string_to_ObjectId ("secondFoo"); + CORBA::Object_var second_foo = second_poa->create_reference_with_id (second_foo_oid.in (), "IDL:Foo:1.0", env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_reference_with_id"); + return -1; + } + + CORBA::String_var first_foo_ior = orb->object_to_string (first_foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + CORBA::String_var second_foo_ior = orb->object_to_string (second_foo, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB::object_to_string"); + return -1; + } + + cout << first_foo_ior.in () << endl; + cout << second_foo_ior.in () << endl; + + poa_manager->activate (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POAManager::activate"); + return -1; + } + + if (orb->run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1); + + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::destroy"); + return -1; + } + + return 0; +} diff --git a/TAO/tests/POA/On_Demand_Activation/server.dsp b/TAO/tests/POA/On_Demand_Activation/server.dsp new file mode 100644 index 00000000000..2d22f5a98a9 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/server.dsp @@ -0,0 +1,99 @@ +# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=server - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "server - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /I "..\Generic_Servant\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 tao.lib ace.lib ..\Generic_Servant\server.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "server - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /I "..\Generic_Servant\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib ..\Generic_Servant\server.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "server - Win32 Release"
+# Name "server - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\Servant_Activator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Servant_Locator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\server.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/On_Demand_Activation/svc.conf b/TAO/tests/POA/On_Demand_Activation/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/tests/POA/RootPOA/Makefile b/TAO/tests/POA/RootPOA/Makefile new file mode 100644 index 00000000000..66687935b3b --- /dev/null +++ b/TAO/tests/POA/RootPOA/Makefile @@ -0,0 +1,44 @@ +# +# $Id$ +# + +BIN = RootPOA + +LSRC = $(addsuffix .cpp,$(BIN)) + +CPPFLAGS += -I$(TAO_ROOT) + +LDLIBS = -lTAO +LDFLAGS += -L$(TAO_ROOT)/tao + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +BUILD = $(VBIN) + +INSTALL = + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/tests/POA/RootPOA/RootPOA.cpp b/TAO/tests/POA/RootPOA/RootPOA.cpp new file mode 100644 index 00000000000..40acaf4b170 --- /dev/null +++ b/TAO/tests/POA/RootPOA/RootPOA.cpp @@ -0,0 +1,44 @@ +#include "ace/streams.h" +#include "tao/corba.h" + +int +main (int argc, char **argv) +{ + CORBA::Environment env; + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); + if (env.exception () != 0) + { + env.print_exception ("CORBA::ORB_init"); + return -1; + } + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in(), env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + CORBA::String_var poa_name = root_poa->the_name (env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::_narrow"); + return -1; + } + + cout << poa_name.in () << endl; + + root_poa->destroy (CORBA::B_TRUE, + CORBA::B_TRUE, + env); + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::destroy"); + return -1; + } + + return 0; +} diff --git a/TAO/tests/POA/RootPOA/RootPOA.dsp b/TAO/tests/POA/RootPOA/RootPOA.dsp new file mode 100644 index 00000000000..cd00fd9b073 --- /dev/null +++ b/TAO/tests/POA/RootPOA/RootPOA.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="RootPOA" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=RootPOA - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "RootPOA.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "RootPOA.mak" CFG="RootPOA - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "RootPOA - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "RootPOA - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "RootPOA - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib tao.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "RootPOA - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 tao.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "RootPOA - Win32 Release"
+# Name "RootPOA - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\RootPOA.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/POA/RootPOA/RootPOA.dsw b/TAO/tests/POA/RootPOA/RootPOA.dsw new file mode 100644 index 00000000000..a14deafc332 --- /dev/null +++ b/TAO/tests/POA/RootPOA/RootPOA.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "RootPOA"=.\RootPOA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/README b/TAO/tests/README index 86825081c8e..bc68c840e63 100644 --- a/TAO/tests/README +++ b/TAO/tests/README @@ -13,3 +13,11 @@ The individual directories contain READMEs on how to run the tests. Cubit example. The servant returns the cube of the number sent to it by the client. + + . POA + + Contains various small tests of POA features. + + . Param_Test + + Tests features of the typecode interpreter. |