diff options
Diffstat (limited to 'tests/CIAO_ComponentServer/SimpleComponent')
6 files changed, 0 insertions, 567 deletions
diff --git a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl b/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl deleted file mode 100644 index dcf676fb276..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl +++ /dev/null @@ -1,21 +0,0 @@ -//$Id$ - -#include <Components.idl> - -module Foo -{ - interface Simple - { - void trigger (); - }; - - component SimpleComponent supports Simple - { - readonly attribute string creationtype_; - }; - - home SimpleHome manages SimpleComponent - { - }; -}; - diff --git a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc b/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc deleted file mode 100644 index cf6400373a5..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc +++ /dev/null @@ -1,112 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl SimpleComponent" - -project(SimpleComponent_idl_gen) : componentidldefaults { - custom_only = 1 - idlflags += -Wb,stub_export_macro=SIMPLECOMPONENT_STUB_Export \ - -Wb,stub_export_include=SimpleComponent_stub_export.h \ - -Wb,skel_export_macro=SIMPLECOMPONENT_SVNT_Export \ - -Wb,skel_export_include=SimpleComponent_svnt_export.h \ - -Wb,exec_export_macro=SIMPLECOMPONENT_EXEC_Export \ - -Wb,exec_export_include=SimpleComponent_exec_export.h - - IDL_Files { - SimpleComponent.idl - } -} - -project(SimpleComponent_lem_gen) : ciaoidldefaults { - custom_only = 1 - after += SimpleComponent_idl_gen - idlflags += -Wb,export_macro=SIMPLECOMPONENT_EXEC_Export \ - -Wb,export_include=SimpleComponent_exec_export.h \ - -SS - - IDL_Files { - SimpleComponentE.idl - } -} - -project(SimpleComponent_stub) : ccm_stub { - after += SimpleComponent_idl_gen - - sharedname = SimpleComponent_stub - dynamicflags = SIMPLECOMPONENT_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - SimpleComponentC.cpp - } - - Header_Files { - SimpleComponentC.h - SimpleComponent_stub_export.h - } - - Inline_Files { - SimpleComponentC.inl - } -} - -project(SimpleComponent_exec) : ciao_executor { - after += SimpleComponent_lem_gen SimpleComponent_stub - sharedname = SimpleComponent_exec - libs += SimpleComponent_stub - - dynamicflags = SIMPLECOMPONENT_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - SimpleComponentEC.cpp - SimpleComponent_exec.cpp - } - - Header_Files { - SimpleComponentEC.h - SimpleComponent_exec.h - SimpleComponent_exec_export.h - } - - Inline_Files { - SimpleComponentEC.inl - } -} - - -project(SimpleComponent_svnt) : ciao_servant { - sharedname = SimpleComponent_svnt - libs += SimpleComponent_stub SimpleComponent_exec - after += SimpleComponent_stub SimpleComponent_exec - dynamicflags = SIMPLECOMPONENT_SVNT_BUILD_DLL - - IDL_Files { - } - Source_Files { - SimpleComponentS.cpp - SimpleComponent_svnt.cpp - } - - Header_Files { - SimpleComponentS.h - SimpleComponent_svnt.h - SimpleComponent_svnt_export.h - } - - Inline_Files { - SimpleComponentS.inl - } -} - -project (SimpleComp_CIAOComponentServer_Tst) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client, ciao_logger { - after += SimpleComponent_stub SimpleComponent_svnt - libs += SimpleComponent_stub - IDL_Files { - } - Source_Files { - client.cpp - } -} diff --git a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp b/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp deleted file mode 100644 index 60d0a6eebf7..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// $Id$ - -#include "SimpleComponent_exec.h" -#include "ciao/Logger/Log_Macros.h" - -namespace CIAO_Foo_SimpleComponent_Impl -{ - //================================================================== - // Component Executor Implementation Class: SimpleComponent_exec_i - //================================================================== - - SimpleComponent_exec_i::SimpleComponent_exec_i (const char *type) - : type_ (CORBA::string_dup (type)) - { - } - - SimpleComponent_exec_i::~SimpleComponent_exec_i (void) - { - } - - // Supported or inherited operations. - - void - SimpleComponent_exec_i::trigger () - { - ACE_DEBUG ((LM_EMERGENCY, "Hello, world!!!!!!!!\n")); - } - - // Attribute operations. - - char * - SimpleComponent_exec_i::creationtype_ () - { - return CORBA::string_dup (this->type_.in ()); - } - - // Port operations. - - // Operations from Components::SessionComponent - - void - SimpleComponent_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::Foo::CCM_SimpleComponent_Context::_narrow (ctx); - - if (CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - SimpleComponent_exec_i::configuration_complete () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_activate () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_passivate () - { - // Your code here. - } - - void - SimpleComponent_exec_i::ccm_remove () - { - // Your code here. - } - - //================================================================== - // Home Executor Implementation Class: SimpleHome_exec_i - //================================================================== - - SimpleHome_exec_i::SimpleHome_exec_i (void) - { - CIAO_TRACE ("SimpleHome_exec_i::SimpleHome_exec_i"); - ACE_DEBUG ((LM_NOTICE, CLINFO "SimpleHome_exec_i::SimpleHome_exec_i - " - "Home constructed\n")); - } - - SimpleHome_exec_i::~SimpleHome_exec_i (void) - { - } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - SimpleHome_exec_i::create () - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - SimpleComponent_exec_i ("HomeCreated"), - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Foo_SimpleHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_RETURN ( - retval, - SimpleHome_exec_i, - ::Components::HomeExecutorBase::_nil ()); - - return retval; - } -} - diff --git a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h b/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h deleted file mode 100644 index 04afe9ffc2c..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h +++ /dev/null @@ -1,90 +0,0 @@ -// $Id$ - -#ifndef CIAO_SIMPLECOMPONENT_EXEC_H -#define CIAO_SIMPLECOMPONENT_EXEC_H - -#include /**/ "ace/pre.h" - -#include "SimpleComponentEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "SimpleComponent_exec_export.h" -#include "tao/LocalObject.h" - -namespace CIAO_Foo_SimpleComponent_Impl -{ - class SIMPLECOMPONENT_EXEC_Export SimpleComponent_exec_i - : public virtual SimpleComponent_Exec, - public virtual ::CORBA::LocalObject - { - public: - SimpleComponent_exec_i (const char *CreateType); - virtual ~SimpleComponent_exec_i (void); - - // Supported or inherited operations. - - virtual void - trigger (); - - // Attribute operations. - - virtual char * - creationtype_ () - ; - - // Port operations. - - // Operations from Components::SessionComponent - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void configuration_complete (); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - private: - ::Foo::CCM_SimpleComponent_Context_var context_; - - CORBA::String_var type_; - - }; - - class SIMPLECOMPONENT_EXEC_Export SimpleHome_exec_i - : public virtual SimpleHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - SimpleHome_exec_i (void); - virtual ~SimpleHome_exec_i (void); - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - }; - - extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr - create_Foo_SimpleHome_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_SIMPLECOMPONENT_EXEC_H */ - diff --git a/tests/CIAO_ComponentServer/SimpleComponent/client.cpp b/tests/CIAO_ComponentServer/SimpleComponent/client.cpp deleted file mode 100644 index bdcdf022d1a..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/client.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ciao/ComponentServer/CIAO_CS_ClientS.h" -#include "ciao/ComponentServer/CIAO_ComponentServerC.h" -#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" -#include "ciao/ComponentServer/CIAO_ComponentInstallation_Impl.h" -#include "ciao/ComponentServer/CIAO_PropertiesC.h" -#include "ciao/Valuetype_Factories/ConfigValue.h" -#include "ciao/Logger/Logger_Service.h" - -#include "SimpleComponentC.h" - -const char *cs_path = "ciao_componentserver"; -CORBA::ULong spawn_delay = 30; - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("s:d:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 's': - cs_path = ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ()); - break; - - case 'd': - spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-s <path> " - "-d <uint> " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR **argv) -{ - using namespace CIAO::Deployment; - - CIAO::Logger_Service logger; - - logger.init (argc, argv); - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - ACE_DEBUG ((LM_DEBUG, "foo\n")); - - CIAO::Deployment::ComponentInstallation_Impl *tmp_ci = 0; - - ACE_NEW_THROW_EX (tmp_ci, - CIAO::Deployment::ComponentInstallation_Impl (), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var safe_servant = tmp_ci; - - root_poa->activate_object (tmp_ci); - - CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, - cs_path, - 0, - false, - tmp_ci->_this (), - orb.in (), - root_poa.in ()); - - PortableServer::ServantBase_var safe = sa_tmp; - - ServerActivator_var sa = sa_tmp->_this (); - - //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); - // Make a componentserver with no configvalues - ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (0))); - - if (CORBA::is_nil (server1.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Nil componentserver references"), -1); - } - - Components::Deployment::Container_var tmp = server1->create_container (0); - Container_var cont1a = Container::_narrow (tmp.in ()); - - if (CORBA::is_nil (cont1a.in ())) - { - ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", - tmp.in (), cont1a.in ())); - return -1; - } - - // Make our configvalues - // ::Components::ConfigValues_var configs = new - CORBA::Any val; - ::Components::ConfigValues configs(3); - configs.length (3); - - val <<= "create_Foo_SimpleHome_Servant"; - configs[0] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ENTRYPT, - val); - val <<= "SimpleComponent_svnt"; - configs[1] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ARTIFACT, - val); - tmp_ci->install ("SimpleComponent_svnt", "SimpleComponent_svnt"); - val <<= "SimpleComponent_exec"; - configs[2] = new CIAO::ConfigValue_impl (CIAO::Deployment::EXEC_ARTIFACT, - val); - tmp_ci->install ("SimpleComponent_exec", "SimpleComponent_exec"); - - // Install Home - Components::CCMHome_var home = cont1a->install_home ("MyNameIsEarl", - "create_Foo_SimpleHome_Impl", - configs); - - if (CORBA::is_nil (home)) - { - ACE_ERROR ((LM_ERROR, "Got back a nil home ref from install_home\n")); - return -1; - } - - Foo::SimpleHome_var shome = Foo::SimpleHome::_narrow (home.in ()); - - if (CORBA::is_nil (shome)) - { - ACE_ERROR ((LM_ERROR, "Narrow failed from CCM_Home to SimpleHome\n")); - return -1; - } - - - Foo::SimpleComponent_var sc = shome->create (); - - if (CORBA::is_nil (sc)) - { - ACE_ERROR ((LM_ERROR, "Home failed to make a component\n")); - return -1; - } - - sc->trigger (); - - cont1a->remove_home (home.in ()); - - server1->remove_container (cont1a.in ()); - - //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); - sa->remove_component_server (server1.in ()); - //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); - - orb->destroy (); - } - catch (::Components::CreateFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); - } - catch (::Components::RemoveFailure &) - { - ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); - } - return 0; -} diff --git a/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl b/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl deleted file mode 100755 index d382c821cea..00000000000 --- a/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl +++ /dev/null @@ -1,26 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; -$ciao_root = "$ENV{CIAO_ROOT}"; - -my $target = PerlACE::TestTarget::create_target (1); - -$TG = $target->CreateProcess ("client", "-s " . $target->GetArchDir("$ciao_root/bin/") . "ciao_componentserver -d 120"); -$server_status = $TG->SpawnWaitKill ($target->ProcessStartWaitInterval ()); - -if ($server_status != 0) { - print STDERR "ERROR: process returned $server_status\n"; - exit 1; -} - -$target->GetStderrLog(); - -exit $status; |