From d6c5af054bfa44e7316eec23aaf3e0bf1c6200ac Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 5 Dec 2005 11:06:47 +0000 Subject: [PATCH] PR: clean Naming service directory /containers after tests --- src/NamingService/Test/NamingServiceTest.cxx | 32 ++++++++++++++++++-- src/NamingService/Test/NamingServiceTest.hxx | 2 ++ 2 files changed, 32 insertions(+), 2 deletions(-) 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; -- 2.39.2