1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef _NAMINGSERVICETEST_HXX_
23 #define _NAMINGSERVICETEST_HXX_
25 #include <cppunit/extensions/HelperMacros.h>
26 #include "SALOME_NamingService.hxx"
28 #include <SALOMEconfig.h>
29 #include CORBA_SERVER_HEADER(nstest)
31 class NSTEST_echo_i : public virtual POA_NSTEST::echo,
32 public virtual PortableServer::ServantBase
36 NSTEST_echo_i(CORBA::Long num);
43 class NSTEST_aFactory_i : public virtual POA_NSTEST::aFactory,
44 public virtual PortableServer::ServantBase
49 NSTEST::echo_ptr createInstance();
54 class NamingServiceTest : public CppUnit::TestFixture
56 CPPUNIT_TEST_SUITE( NamingServiceTest );
57 CPPUNIT_TEST( testConstructorDefault );
58 CPPUNIT_TEST( testConstructorOrb );
59 CPPUNIT_TEST( testRegisterResolveAbsNoPath );
60 CPPUNIT_TEST( testRegisterResolveRelativeNoPath );
61 CPPUNIT_TEST( testRegisterResolveAbsWithPath );
62 CPPUNIT_TEST( testRegisterResolveRelativeWithPath );
63 CPPUNIT_TEST( testResolveBadName );
64 CPPUNIT_TEST( testResolveBadNameRelative );
65 CPPUNIT_TEST( testResolveFirst );
66 CPPUNIT_TEST( testResolveFirstRelative );
67 CPPUNIT_TEST( testResolveFirstUnknown );
68 CPPUNIT_TEST( testResolveFirstUnknownRelative );
69 CPPUNIT_TEST( testResolveComponentOK );
70 CPPUNIT_TEST( testResolveComponentEmptyHostname );
71 CPPUNIT_TEST( testResolveComponentUnknownHostname );
72 CPPUNIT_TEST( testResolveComponentEmptyContainerName );
73 CPPUNIT_TEST( testResolveComponentUnknownContainerName );
74 CPPUNIT_TEST( testResolveComponentEmptyComponentName );
75 CPPUNIT_TEST( testResolveComponentUnknownComponentName );
76 CPPUNIT_TEST( testResolveComponentFalseNbproc );
77 CPPUNIT_TEST( testContainerName );
78 CPPUNIT_TEST( testContainerNameParams );
79 CPPUNIT_TEST( testBuildContainerNameForNS );
80 CPPUNIT_TEST( testBuildContainerNameForNSParams );
81 CPPUNIT_TEST( testFind );
82 CPPUNIT_TEST( testCreateDirectory );
83 CPPUNIT_TEST( testChangeDirectory );
84 CPPUNIT_TEST( testCurrentDirectory );
85 CPPUNIT_TEST( testList );
86 CPPUNIT_TEST( testListDirectory );
87 CPPUNIT_TEST( testListDirectoryRecurs );
88 CPPUNIT_TEST( testListSubdirs );
89 CPPUNIT_TEST( testDestroyName );
90 CPPUNIT_TEST( testDestroyDirectory );
91 CPPUNIT_TEST( testDestroyFullDirectory );
92 CPPUNIT_TEST( testGetIorAddr );
97 CPPUNIT_TEST_SUITE_END();
104 void testConstructorDefault();
105 void testConstructorOrb();
106 void testRegisterResolveAbsNoPath();
107 void testRegisterResolveRelativeNoPath();
108 void testRegisterResolveAbsWithPath();
109 void testRegisterResolveRelativeWithPath();
110 void testResolveBadName();
111 void testResolveBadNameRelative();
112 void testResolveFirst();
113 void testResolveFirstRelative();
114 void testResolveFirstUnknown();
115 void testResolveFirstUnknownRelative();
116 void testResolveComponentOK();
117 void testResolveComponentEmptyHostname();
118 void testResolveComponentUnknownHostname();
119 void testResolveComponentEmptyContainerName();
120 void testResolveComponentUnknownContainerName();
121 void testResolveComponentEmptyComponentName();
122 void testResolveComponentUnknownComponentName();
123 void testResolveComponentFalseNbproc();
124 void testContainerName();
125 void testContainerNameParams();
126 void testBuildContainerNameForNS();
127 void testBuildContainerNameForNSParams();
129 void testCreateDirectory();
130 void testChangeDirectory();
131 void testCurrentDirectory();
133 void testListDirectory();
134 void testListDirectoryRecurs();
135 void testListSubdirs();
136 void testDestroyName();
137 void testDestroyDirectory();
138 void testDestroyFullDirectory();
139 void testGetIorAddr();
142 void _destroyDirectoryRecurs(std::string path);
145 SALOME_NamingService _NS;
147 PortableServer::POA_var _root_poa;
148 PortableServer::POAManager_var _pman;
149 PortableServer::ObjectId_var _myFactoryId;
150 NSTEST_aFactory_i * _myFactory;
151 CORBA::Object_var _factoryRef;