diff options
Diffstat (limited to 'modules/CIAO/DAnCE/tests/RedirectionServiceTest')
7 files changed, 0 insertions, 272 deletions
diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl deleted file mode 100644 index 5925a4ceeba..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -#ifndef DUMMY_IDL -#define DUMMY_IDL - -module Test -{ - interface Dummy { - string sayHello(); - }; -}; - -#endif /* DUMMY_IDL */ - diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp deleted file mode 100644 index 1ad8cec1ee8..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ -#include "DummyImpl.h" - -namespace Test - { - - char * DummyImpl::sayHello ( - ) - { - return CORBA::string_dup (this->helloSentence); - } - - } // namespace ObjectLocatorTest - diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h deleted file mode 100644 index 272611eedba..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ -#ifndef DUMMYIMPL_H_ -#define DUMMYIMPL_H_ - -#include "DummyS.h" - -namespace Test - { - class DummyImpl - : public virtual POA_Test::Dummy - { - public: - DummyImpl() : helloSentence ("A dummy hello sentence.") {}; - - virtual char * sayHello ( - ); - - private: - const char * helloSentence; - }; - - } // namespace POA_ObjectLocatorTest - -#endif /*DUMMYIMPL_H_*/ diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc deleted file mode 100644 index 08700809ca2..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ -project (RedirectionServiceTestServer): dance, taoserver, iortable, naming, dance_redirectionservice, dance_logger, naming_serv, avoids_minimum_corba { - exename = RedirectionServiceTestServer - - IDL_Files { - Dummy.idl - } - - Source_Files { - srv_main.cpp - DummyC.cpp - DummyS.cpp - DummyImpl.cpp - } -} - -project (RedirectionServiceTestClient): dance, taoclient, naming, dance_logger, naming, portableserver, anytypecode, avoids_minimum_corba { - after = RedirectionServiceTestServer - exename = RedirectionServiceTestClient - - Source_Files { - clt_main.cpp - DummyC.cpp - } -} diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h deleted file mode 100644 index a470d19c36d..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h +++ /dev/null @@ -1,11 +0,0 @@ -// $Id$ -#ifndef REGISTRATIONPATH_H_ -#define REGISTRATIONPATH_H_ -#include "ace/SString.h" - -const ACE_CString node_name = "MyNode"; -const ACE_CString app_name = "app1"; -const ACE_CString inst_name = "inst1"; -const ACE_CString port_name = "port1"; - -#endif /*REGISTRATIONPATH_H_*/ diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp deleted file mode 100644 index 84ecb82f476..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// $Id$ -#include "ace/String_Base.h" -#include <orbsvcs/orbsvcs/CosNamingC.h> -#include "DAnCE/Logger/Log_Macros.h" -#include "RegistrationPath.h" -#include "DummyC.h" -#include "ace/SString.h" - -using namespace Test; - -CORBA::ORB_var orb; -CORBA::Object_var naming_obj; - -void inspect () - { - CORBA::Object_var obj = orb->resolve_initial_references("NameService"); - CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow(obj.in()); - CosNaming::BindingList_var bl; - CosNaming::BindingIterator_var bi; - //naming->list(10L, bl.out(), bi.out()); - CosNaming::Name name(1); - name.length(2); - name[0].id = CORBA::string_dup("Host1");//CORBA::string_dup("CcmDance1Test"); - name[1].id = CORBA::string_dup ("CcmDance2_1@Host1"); - name[1].kind = CORBA::string_dup ("DeploymentPlan"); - //name[2].id = CORBA::string_dup("ASSEMBLYANDDEPLOYMENT"); - obj = naming->resolve(name); - DANCE_DEBUG((LM_DEBUG, "[%M] create_external_connections - After resolve\n")); - CosNaming::NamingContext_var CcmDance1Test = CosNaming::NamingContext::_narrow(obj.in()); - CcmDance1Test->list(10L, bl.out(), bi.out()); - bool exit = false; - while (!exit) - { - DANCE_DEBUG((LM_DEBUG, "[%M] create_external_connections - naming size is %u\n", bl->length())); - for ( size_t i = 0; i< bl->length(); i++ ) - { - for ( size_t j = 0; j < (*bl)[i].binding_name.length(); j++ ) - { - DANCE_DEBUG((LM_DEBUG, "create_external_connections - Binding name %s, binding kind %s, binding type %i\n" - , (*bl)[i].binding_name[j].id.in() - , (*bl)[i].binding_name[j].kind.in() - , (*bl)[i].binding_type)); - } - } - if(!bi->next_n(10L, bl.out())) - { - exit = true; - } - } - - } -bool test (const ACE_CString& url) -{ - bool res = false; - try - { - DANCE_DEBUG((LM_DEBUG, "[%M] URL : %s\n", url.c_str())); - - CORBA::Object_var obj = orb->string_to_object (url.c_str()); - if (CORBA::is_nil (obj)) - { - DANCE_ERROR((LM_ERROR, "[%M] Failed to convert url to object. The test failed.\n")); - return 1; - } - DANCE_DEBUG((LM_DEBUG, "[%M] URL -> object : ok.\n")); - - Dummy_var dummy_obj = Dummy::_narrow (obj); - if (CORBA::is_nil (dummy_obj)) - { - DANCE_ERROR((LM_ERROR, "[%M] Failed to narrow the object to custom type. The test failed.\n")); - return 1; - } - DANCE_DEBUG((LM_DEBUG, "[%M] object -> dummy : ok.\n")); - - DANCE_DEBUG((LM_DEBUG, "[%M] Dummy object returned : %s.\n", dummy_obj->sayHello())); - DANCE_DEBUG((LM_DEBUG, "[%M] The test succeeded.\n")); - res = true; - } - catch (CORBA::Exception & e) - { - DANCE_ERROR((LM_ERROR, "[%M] A CORBA exception \"%s\" (%s) was thrown. The test failed." - , e._name(), e._info().c_str())); - } - catch (...) - { - DANCE_ERROR((LM_ERROR, "[%M] An exception was thrown. The test failed.\n")); - } - - return res; -} - - -int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) -{ - orb = CORBA::ORB_init (argc, argv); - - //naming_obj = orb->resolve_initial_references("NameService"); - //glasgow.headquarters.eclipsesp.com:12345 - ACE_CString url = "corbaname::glasgow:12345#" + node_name + "/" + app_name + ".DeploymentPlan" + "/" + inst_name + "/" + port_name + ".Port"; - test (url); - url = "corbaname::glasgow:12345#" + node_name + "/" + app_name + ".DeploymentPlan" + "/" + inst_name + ".Component"; - test (url); - //node_name + "/" + %14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00 - url = "corbaloc:iiop:1.2@glasgow.headquarters.eclipsesp.com:12345/%14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00" + app_name + "/" + inst_name + "/" + port_name; - test (url); - url = "corbaloc:iiop:1.2@glasgow.headquarters.eclipsesp.com:12345/%14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00" + app_name + "/" + inst_name; - test (url); - - return 0; -} diff --git a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp b/modules/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp deleted file mode 100644 index fa44d6b8b2f..00000000000 --- a/modules/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ -#include "ace/OS_NS_stdio.h" -#include "ace/Get_Opt.h" -#include <orbsvcs/orbsvcs/Naming/Naming_Loader.h> -#include "DAnCE/Logger/Log_Macros.h" -#include "RedirectionService/RedirectionService.h" - -#include "DummyC.h" -#include "DummyImpl.h" -#include "RegistrationPath.h" - -using namespace Test; - -int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) -{ -// try - { - int argcm = argc + 2; - ACE_TCHAR ** argvm = new ACE_TCHAR* [argcm+1]; - for (int i = 0; i < argc; ++i) - { - argvm[i] = argv[i]; - } - ACE_TCHAR buf1[32]; - ACE_OS::sprintf (buf1, ACE_TEXT("-ORBListenEndpoints")); - argvm[argcm-2] = buf1; - ACE_TCHAR buf2[32]; - ACE_OS::sprintf (buf2, ACE_TEXT("iiop://:12345")); - argvm[argcm-1] = buf2; - argvm[argcm] = 0; - - CORBA::ORB_var orb = CORBA::ORB_init (argcm, argvm); - - CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); - PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in ()); - - PortableServer::POAManager_var poa_manager = root_poa->the_POAManager(); - poa_manager->activate(); - - DummyImpl servant; - - PortableServer::ObjectId_var id = root_poa->activate_object (&servant); - - Dummy_var dummy_obj = Dummy::_narrow (root_poa->id_to_reference (id)); - - TAO_Naming_Loader loader; - - CORBA::Object_var obj_tmp = loader.create_object (orb.in(), argcm, argvm); - CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService"); - CosNaming::NamingContext_var naming = - CosNaming::NamingContext::_narrow (naming_obj.in()); - - DAnCE::RedirectionService redirection (orb.in(), - root_poa.in(), - naming.in(), - CosNaming::NamingContext::_nil(), - true, - true); - - redirection.registration_start (node_name, app_name); - redirection.registration (node_name, app_name, inst_name, port_name, dummy_obj.in()); - DANCE_DEBUG((LM_DEBUG, "[%M] Registration for port have finished.\n\n")); - redirection.registration (node_name, app_name, inst_name, dummy_obj.in()); - DANCE_DEBUG((LM_DEBUG, "[%M] Registration for component have finished.\n\n")); - redirection.registration_finish (node_name, app_name); - orb->run(); - } -// catch (...) -// { -// DANCE_ERROR((LM_ERROR, "[%M] An error has occured.")); -// } - return 0; -} - |