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