Version: 8.3.0
NamingServiceTest Class Reference

#include <NamingServiceTest.hxx>

Inheritance diagram for NamingServiceTest:

Public Member Functions

void setUp ()
 
void tearDown ()
 
void testConstructorDefault ()
 Test default constructor: must be followed by a call to init_orb(ORB) More...
 
void testConstructorOrb ()
 Test constructor with ORB parameter. More...
 
void testRegisterResolveAbsNoPath ()
 Test Register and resolve of a single CORBA object with absolute pathname, without subdirectories. More...
 
void testRegisterResolveRelativeNoPath ()
 Test Register and resolve of a single CORBA object with relative pathname, without subdirectories. More...
 
void testRegisterResolveAbsWithPath ()
 Test Register and resolve of a single CORBA object with absolute pathname, in a subdirectory. More...
 
void testRegisterResolveRelativeWithPath ()
 Test Register and resolve of a single CORBA object with relative pathname, in a subdirectory. More...
 
void testResolveBadName ()
 Test resolve with a name not known. More...
 
void testResolveBadNameRelative ()
 Test resolve with a name not known, with a relative path. More...
 
void testResolveFirst ()
 
void testResolveFirstRelative ()
 Test register and resolve multiple objects, test resolveFirst, relative path Register a few objects in /nstestfirstrel/echo_n where n is the object id. More...
 
void testResolveFirstUnknown ()
 Test resolveFirst with unknown name. More...
 
void testResolveFirstUnknownRelative ()
 Test resolveFirst with unknown name, relative Path. More...
 
void testResolveComponentOK ()
 Test ResolveComponent works as specified. More...
 
void testResolveComponentEmptyHostname ()
 Test ResolveComponent gives nil pointer if hostname is not given (empty) More...
 
void testResolveComponentUnknownHostname ()
 Test ResolveComponent gives nil pointer if hostname is unknown. More...
 
void testResolveComponentEmptyContainerName ()
 Test ResolveComponent when containerName is empty. More...
 
void testResolveComponentUnknownContainerName ()
 Test. More...
 
void testResolveComponentEmptyComponentName ()
 Test. More...
 
void testResolveComponentUnknownComponentName ()
 Test. More...
 
void testResolveComponentFalseNbproc ()
 Test with a false number nbproc. More...
 
void testContainerName ()
 Test. More...
 
void testContainerNameParams ()
 Test. More...
 
void testBuildContainerNameForNS ()
 Test. More...
 
void testBuildContainerNameForNSParams ()
 Test. More...
 
void testFind ()
 Test. More...
 
void testCreateDirectory ()
 Test. More...
 
void testChangeDirectory ()
 Test. More...
 
void testCurrentDirectory ()
 Test. More...
 
void testList ()
 Test. More...
 
void testListDirectory ()
 Test. More...
 
void testListDirectoryRecurs ()
 Test. More...
 
void testListSubdirs ()
 Test. More...
 
void testDestroyName ()
 Test. More...
 
void testDestroyDirectory ()
 Test. More...
 
void testDestroyFullDirectory ()
 
void testGetIorAddr ()
 Test. More...
 

Protected Member Functions

void _destroyDirectoryRecurs (std::string path)
 DestroyFullDirectory is not recursive Need Housekeeping of /Containers for further tests ! More...
 

Protected Attributes

CORBA::ORB_var _orb
 
SALOME_NamingService _NS
 
PortableServer::POA_var _root_poa
 
PortableServer::POAManager_var _pman
 
PortableServer::ObjectId_var _myFactoryId
 
NSTEST_aFactory_i_myFactory
 
CORBA::Object_var _factoryRef
 

Private Member Functions

 CPPUNIT_TEST_SUITE (NamingServiceTest)
 
 CPPUNIT_TEST (testConstructorDefault)
 
 CPPUNIT_TEST (testConstructorOrb)
 
 CPPUNIT_TEST (testRegisterResolveAbsNoPath)
 
 CPPUNIT_TEST (testRegisterResolveRelativeNoPath)
 
 CPPUNIT_TEST (testRegisterResolveAbsWithPath)
 
 CPPUNIT_TEST (testRegisterResolveRelativeWithPath)
 
 CPPUNIT_TEST (testResolveBadName)
 
 CPPUNIT_TEST (testResolveBadNameRelative)
 
 CPPUNIT_TEST (testResolveFirst)
 
 CPPUNIT_TEST (testResolveFirstRelative)
 
 CPPUNIT_TEST (testResolveFirstUnknown)
 
 CPPUNIT_TEST (testResolveFirstUnknownRelative)
 
 CPPUNIT_TEST (testResolveComponentOK)
 
 CPPUNIT_TEST (testResolveComponentEmptyHostname)
 
 CPPUNIT_TEST (testResolveComponentUnknownHostname)
 
 CPPUNIT_TEST (testResolveComponentEmptyContainerName)
 
 CPPUNIT_TEST (testResolveComponentUnknownContainerName)
 
 CPPUNIT_TEST (testResolveComponentEmptyComponentName)
 
 CPPUNIT_TEST (testResolveComponentUnknownComponentName)
 
 CPPUNIT_TEST (testResolveComponentFalseNbproc)
 
 CPPUNIT_TEST (testContainerName)
 
 CPPUNIT_TEST (testContainerNameParams)
 
 CPPUNIT_TEST (testBuildContainerNameForNS)
 
 CPPUNIT_TEST (testBuildContainerNameForNSParams)
 
 CPPUNIT_TEST (testFind)
 
 CPPUNIT_TEST (testCreateDirectory)
 
 CPPUNIT_TEST (testChangeDirectory)
 
 CPPUNIT_TEST (testCurrentDirectory)
 
 CPPUNIT_TEST (testList)
 
 CPPUNIT_TEST (testListDirectory)
 
 CPPUNIT_TEST (testListDirectoryRecurs)
 
 CPPUNIT_TEST (testListSubdirs)
 
 CPPUNIT_TEST (testDestroyName)
 
 CPPUNIT_TEST (testDestroyDirectory)
 
 CPPUNIT_TEST (testDestroyFullDirectory)
 
 CPPUNIT_TEST (testGetIorAddr)
 
 CPPUNIT_TEST_SUITE_END ()
 
std::string _getTraceFileName ()
 Set Trace mecanism. More...
 

Member Function Documentation

void NamingServiceTest::_destroyDirectoryRecurs ( std::string  path)
protected

DestroyFullDirectory is not recursive Need Housekeeping of /Containers for further tests !

References _NS, SALOME_NamingService::Change_Directory(), SALOME_NamingService::Destroy_FullDirectory(), SALOME_NamingService::list_subdirs(), and SCRUTE.

Referenced by testDestroyFullDirectory().

std::string NamingServiceTest::_getTraceFileName ( )
private

Set Trace mecanism.

  • delete preexisting trace classes if any
  • set trace on file Get or initialize the orb Create a SALOME_NamingService instance

References Kernel_Utils::GetTmpDir().

Referenced by setUp().

NamingServiceTest::CPPUNIT_TEST ( testConstructorDefault  )
private
NamingServiceTest::CPPUNIT_TEST ( testConstructorOrb  )
private
NamingServiceTest::CPPUNIT_TEST ( testRegisterResolveAbsNoPath  )
private
NamingServiceTest::CPPUNIT_TEST ( testRegisterResolveRelativeNoPath  )
private
NamingServiceTest::CPPUNIT_TEST ( testRegisterResolveAbsWithPath  )
private
NamingServiceTest::CPPUNIT_TEST ( testRegisterResolveRelativeWithPath  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveBadName  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveBadNameRelative  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveFirst  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveFirstRelative  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveFirstUnknown  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveFirstUnknownRelative  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentOK  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentEmptyHostname  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentUnknownHostname  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentEmptyContainerName  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentUnknownContainerName  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentEmptyComponentName  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentUnknownComponentName  )
private
NamingServiceTest::CPPUNIT_TEST ( testResolveComponentFalseNbproc  )
private
NamingServiceTest::CPPUNIT_TEST ( testContainerName  )
private
NamingServiceTest::CPPUNIT_TEST ( testContainerNameParams  )
private
NamingServiceTest::CPPUNIT_TEST ( testBuildContainerNameForNS  )
private
NamingServiceTest::CPPUNIT_TEST ( testBuildContainerNameForNSParams  )
private
NamingServiceTest::CPPUNIT_TEST ( testFind  )
private
NamingServiceTest::CPPUNIT_TEST ( testCreateDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testChangeDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testCurrentDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testList  )
private
NamingServiceTest::CPPUNIT_TEST ( testListDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testListDirectoryRecurs  )
private
NamingServiceTest::CPPUNIT_TEST ( testListSubdirs  )
private
NamingServiceTest::CPPUNIT_TEST ( testDestroyName  )
private
NamingServiceTest::CPPUNIT_TEST ( testDestroyDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testDestroyFullDirectory  )
private
NamingServiceTest::CPPUNIT_TEST ( testGetIorAddr  )
private
NamingServiceTest::CPPUNIT_TEST_SUITE ( NamingServiceTest  )
private
NamingServiceTest::CPPUNIT_TEST_SUITE_END ( )
private
void NamingServiceTest::tearDown ( )
void NamingServiceTest::testBuildContainerNameForNS ( )
void NamingServiceTest::testBuildContainerNameForNSParams ( )
void NamingServiceTest::testChangeDirectory ( )
void NamingServiceTest::testConstructorDefault ( )

Test default constructor: must be followed by a call to init_orb(ORB)

References _orb, SALOME_NamingService::getIORaddr(), and SALOME_NamingService::init_orb().

void NamingServiceTest::testConstructorOrb ( )

Test constructor with ORB parameter.

References _orb, and SALOME_NamingService::getIORaddr().

void NamingServiceTest::testContainerName ( )
void NamingServiceTest::testContainerNameParams ( )
void NamingServiceTest::testDestroyName ( )
void NamingServiceTest::testGetIorAddr ( )

Test.

References _NS, _orb, and SALOME_NamingService::getIORaddr().

void NamingServiceTest::testList ( )
void NamingServiceTest::testListDirectory ( )
void NamingServiceTest::testListDirectoryRecurs ( )
void NamingServiceTest::testListSubdirs ( )
void NamingServiceTest::testRegisterResolveAbsNoPath ( )

Test Register and resolve of a single CORBA object with absolute pathname, without subdirectories.

References _factoryRef, _NS, SALOME_NamingService::Register(), and SALOME_NamingService::Resolve().

void NamingServiceTest::testRegisterResolveAbsWithPath ( )

Test Register and resolve of a single CORBA object with absolute pathname, in a subdirectory.

References _NS, SALOME_NamingService::Register(), and SALOME_NamingService::Resolve().

void NamingServiceTest::testRegisterResolveRelativeNoPath ( )

Test Register and resolve of a single CORBA object with relative pathname, without subdirectories.

References _NS, SALOME_NamingService::Change_Directory(), SALOME_NamingService::Create_Directory(), SALOME_NamingService::Register(), and SALOME_NamingService::Resolve().

void NamingServiceTest::testRegisterResolveRelativeWithPath ( )

Test Register and resolve of a single CORBA object with relative pathname, in a subdirectory.

Relative Path is changed to the created subdirectory when Register()

References _NS, SALOME_NamingService::Change_Directory(), SALOME_NamingService::Create_Directory(), SALOME_NamingService::Register(), and SALOME_NamingService::Resolve().

void NamingServiceTest::testResolveBadName ( )

Test resolve with a name not known.

References _NS, and SALOME_NamingService::Resolve().

void NamingServiceTest::testResolveBadNameRelative ( )

Test resolve with a name not known, with a relative path.

References _NS, SALOME_NamingService::Change_Directory(), SALOME_NamingService::Create_Directory(), and SALOME_NamingService::Resolve().

void NamingServiceTest::testResolveComponentEmptyComponentName ( )
void NamingServiceTest::testResolveComponentEmptyContainerName ( )

Test ResolveComponent when containerName is empty.

check bad hostname gives nil pointer. If componentName registered on a container from hostname, a component reference is found (the first one). Else give nil pointer.

References _NS, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), and SALOME_NamingService::ResolveComponent().

void NamingServiceTest::testResolveComponentEmptyHostname ( )

Test ResolveComponent gives nil pointer if hostname is not given (empty)

References _NS, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), and SALOME_NamingService::ResolveComponent().

void NamingServiceTest::testResolveComponentFalseNbproc ( )

Test with a false number nbproc.

A positive number not corresponding to a registered component gives nil ref. A negative number is not taken into account and may give a non nil ref.

References _NS, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), and SALOME_NamingService::ResolveComponent().

void NamingServiceTest::testResolveComponentOK ( )
void NamingServiceTest::testResolveComponentUnknownComponentName ( )
void NamingServiceTest::testResolveComponentUnknownContainerName ( )
void NamingServiceTest::testResolveComponentUnknownHostname ( )

Test ResolveComponent gives nil pointer if hostname is unknown.

References _NS, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), and SALOME_NamingService::ResolveComponent().

void NamingServiceTest::testResolveFirstRelative ( )

Test register and resolve multiple objects, test resolveFirst, relative path Register a few objects in /nstestfirstrel/echo_n where n is the object id.

Resolve all the objects. ResolveFirst echo with a relative path /nstestfirstrel must give /nstestfirst/echo_i, corresponding to the first object.

References _NS, SALOME_NamingService::Change_Directory(), NB_OBJS, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), and SALOME_NamingService::ResolveFirst().

void NamingServiceTest::testResolveFirstUnknown ( )

Test resolveFirst with unknown name.

References _NS, and SALOME_NamingService::ResolveFirst().

void NamingServiceTest::testResolveFirstUnknownRelative ( )

Field Documentation

CORBA::Object_var NamingServiceTest::_factoryRef
protected
NSTEST_aFactory_i* NamingServiceTest::_myFactory
protected

Referenced by setUp().

PortableServer::ObjectId_var NamingServiceTest::_myFactoryId
protected

Referenced by setUp().

CORBA::ORB_var NamingServiceTest::_orb
protected
PortableServer::POAManager_var NamingServiceTest::_pman
protected

Referenced by setUp().

PortableServer::POA_var NamingServiceTest::_root_poa
protected

Referenced by setUp().