From: secher Date: Fri, 27 Apr 2007 07:57:42 +0000 (+0000) Subject: add test of FIndOrLoadComponent in TestContainerManager X-Git-Tag: BR_V326p4_20070428 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e38a236a50c9057cc73864919377f9486e220a94;p=modules%2Fkernel.git add test of FIndOrLoadComponent in TestContainerManager --- diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index ca72bd532..d929d7277 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -67,6 +67,7 @@ COMMON_CPPFLAGS=\ -I$(srcdir)/../Basics \ -I$(srcdir)/../SALOMELocalTrace \ -I$(srcdir)/../NamingService \ + -I$(srcdir)/../LifeCycleCORBA \ -I$(srcdir)/../Utils \ -I$(srcdir)/../Registry \ -I$(srcdir)/../Notification \ @@ -81,6 +82,7 @@ COMMON_LIBS =\ ../Notification/libSalomeNotification.la \ ../ResourcesManager/libSalomeResourcesManager.la \ ../NamingService/libSalomeNS.la \ + ../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \ ../Utils/libOpUtil.la \ ../SALOMELocalTrace/libSALOMELocalTrace.la \ ../Basics/libSALOMEBasics.la \ diff --git a/src/Container/TestContainerManager.cxx b/src/Container/TestContainerManager.cxx index 6aca42160..3d991bbdd 100644 --- a/src/Container/TestContainerManager.cxx +++ b/src/Container/TestContainerManager.cxx @@ -32,6 +32,7 @@ #include #include "SALOME_NamingService.hxx" #include "SALOME_ContainerManager.hxx" +#include "SALOME_LifeCycleCORBA.hxx" #include "NamingService_WaitForServerReadiness.hxx" #include "OpUtil.hxx" #include "Utils_ORB_INIT.hxx" @@ -44,6 +45,10 @@ int main (int argc, char * argv[]) { map cycle; map first; + Engines::Container_ptr cont; + Engines::Component_ptr compo; + bool error = false; + bool bestImplemented; // Initializing omniORB ORB_INIT &init = *SINGLETON_::Instance() ; @@ -69,17 +74,27 @@ int main (int argc, char * argv[]) for(int i=0;i<10;i++){ sprintf(st,"cycl_%d",i); p.container_name = CORBA::string_dup(st); - _ContManager->StartContainer(p,Engines::P_CYCL); + cont = _ContManager->StartContainer(p,Engines::P_CYCL); + if(CORBA::is_nil(cont)) error = true; } for(int i=0;i<10;i++){ sprintf(st,"first_%d",i); p.container_name = CORBA::string_dup(st); - _ContManager->StartContainer(p,Engines::P_FIRST); + cont = _ContManager->StartContainer(p,Engines::P_FIRST); + if(CORBA::is_nil(cont)) error = true; } p.container_name = CORBA::string_dup("best"); - _ContManager->StartContainer(p,Engines::P_BEST); + cont = _ContManager->StartContainer(p,Engines::P_BEST); + if(CORBA::is_nil(cont)) bestImplemented = false; + else bestImplemented = true; + + SALOME_LifeCycleCORBA LCC(_NS); + compo = LCC.FindOrLoad_Component("FactoryServer","GEOM"); + if(CORBA::is_nil(compo)) error = true; + compo = LCC.FindOrLoad_Component("FactoryServer","GEOM"); + if(CORBA::is_nil(compo)) error = true; _NS->Change_Directory("/Containers"); @@ -118,8 +133,13 @@ int main (int argc, char * argv[]) if(first[(*iter).first]>fmax) fmax=first[(*iter).first]; } } - if( ((cmax-cmin) <= 1) && (fmax == 10)){ - MESSAGE("TEST OK"); + if( ((cmax-cmin) <= 1) && (fmax == 10) && !error ){ + string msg; + if(bestImplemented) + msg = "TEST OK"; + else + msg = "TEST OK but FindBest not implemented!"; + MESSAGE(msg); return 0; } else{