From: prascle Date: Mon, 5 Dec 2005 11:16:00 +0000 (+0000) Subject: PR: merge from BR_UT_V310a3 tag mergeto_trunk_06dec05 X-Git-Tag: BR_3_1_0_deb~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8b445897890ae1f9b2a5e6fb98909119d94af0fb;p=modules%2Fkernel.git PR: merge from BR_UT_V310a3 tag mergeto_trunk_06dec05 --- diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index e0ad5fcd5..bce5f2338 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -1293,7 +1293,7 @@ throw(ServiceUnreachable) void SALOME_NamingService::Destroy_Directory(const char* Path) throw(ServiceUnreachable) { - MESSAGE("BEGIN OF Destroy_Directory" << Path); + MESSAGE("BEGIN OF Destroy_Directory " << Path); Utils_Locker lock (&_myMutex); @@ -1468,6 +1468,7 @@ throw(ServiceUnreachable) void SALOME_NamingService::Destroy_FullDirectory(const char* Path) throw(ServiceUnreachable) { + MESSAGE("begin of Destroy_FullDirectory " << Path); if( Change_Directory(Path) ) { vector contList = list_directory(); @@ -1476,8 +1477,6 @@ throw(ServiceUnreachable) Destroy_Name(contList[ind].c_str()); Destroy_Directory(Path); - - Destroy_Name(Path); } } diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index deedb2b61..dcad83bc7 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -729,7 +729,7 @@ NamingServiceTest::testResolveComponentUnknownComponentName() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContaine:rName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("theHostName", "theContainerName", @@ -1134,16 +1134,44 @@ NamingServiceTest::testDestroyDirectory() // ============================================================================ /*! - * Test + * DestroyFullDirectory is not recursive + * Need Housekeeping of /Containers for further tests ! */ // ============================================================================ +void NamingServiceTest::_destroyDirectoryRecurs(string path) +{ + string current = path; + SCRUTE(path); + if (_NS.Change_Directory(path.c_str())) + { + vector subdirs = _NS.list_subdirs(); + for (int i=0; i subdirs = _NS.list_subdirs(); + CPPUNIT_ASSERT(subdirs.size() >0); + _NS.list_directory_recurs(); + string path = "/Containers"; + _destroyDirectoryRecurs(path); + CPPUNIT_ASSERT( ! _NS.Change_Directory("/Containers")); _NS.Change_Directory("/"); _NS.list_subdirs(); + _NS.list_directory_recurs(); } // ============================================================================ diff --git a/src/NamingService/Test/NamingServiceTest.hxx b/src/NamingService/Test/NamingServiceTest.hxx index 3630c1043..52909c5d7 100644 --- a/src/NamingService/Test/NamingServiceTest.hxx +++ b/src/NamingService/Test/NamingServiceTest.hxx @@ -119,6 +119,8 @@ public: void testGetIorAddr(); protected: + void _destroyDirectoryRecurs(std::string path); + CORBA::ORB_var _orb; SALOME_NamingService _NS;