1 // Copyright (C) 2007-2012 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
23 #ifndef _NAMINGSERVICETEST_HXX_
24 #define _NAMINGSERVICETEST_HXX_
26 #include <cppunit/extensions/HelperMacros.h>
27 #include "SALOME_NamingService.hxx"
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(nstest)
32 class NSTEST_echo_i : public virtual POA_NSTEST::echo,
33 public virtual PortableServer::ServantBase
37 NSTEST_echo_i(CORBA::Long num);
44 class NSTEST_aFactory_i : public virtual POA_NSTEST::aFactory,
45 public virtual PortableServer::ServantBase
50 NSTEST::echo_ptr createInstance();
55 class NamingServiceTest : public CppUnit::TestFixture
57 CPPUNIT_TEST_SUITE( NamingServiceTest );
58 CPPUNIT_TEST( testConstructorDefault );
59 CPPUNIT_TEST( testConstructorOrb );
60 CPPUNIT_TEST( testRegisterResolveAbsNoPath );
61 CPPUNIT_TEST( testRegisterResolveRelativeNoPath );
62 CPPUNIT_TEST( testRegisterResolveAbsWithPath );
63 CPPUNIT_TEST( testRegisterResolveRelativeWithPath );
64 CPPUNIT_TEST( testResolveBadName );
65 CPPUNIT_TEST( testResolveBadNameRelative );
66 CPPUNIT_TEST( testResolveFirst );
67 CPPUNIT_TEST( testResolveFirstRelative );
68 CPPUNIT_TEST( testResolveFirstUnknown );
69 CPPUNIT_TEST( testResolveFirstUnknownRelative );
70 CPPUNIT_TEST( testResolveComponentOK );
71 CPPUNIT_TEST( testResolveComponentEmptyHostname );
72 CPPUNIT_TEST( testResolveComponentUnknownHostname );
73 CPPUNIT_TEST( testResolveComponentEmptyContainerName );
74 CPPUNIT_TEST( testResolveComponentUnknownContainerName );
75 CPPUNIT_TEST( testResolveComponentEmptyComponentName );
76 CPPUNIT_TEST( testResolveComponentUnknownComponentName );
77 CPPUNIT_TEST( testResolveComponentFalseNbproc );
78 CPPUNIT_TEST( testContainerName );
79 CPPUNIT_TEST( testContainerNameParams );
80 CPPUNIT_TEST( testBuildContainerNameForNS );
81 CPPUNIT_TEST( testBuildContainerNameForNSParams );
82 CPPUNIT_TEST( testFind );
83 CPPUNIT_TEST( testCreateDirectory );
84 CPPUNIT_TEST( testChangeDirectory );
85 CPPUNIT_TEST( testCurrentDirectory );
86 CPPUNIT_TEST( testList );
87 CPPUNIT_TEST( testListDirectory );
88 CPPUNIT_TEST( testListDirectoryRecurs );
89 CPPUNIT_TEST( testListSubdirs );
90 CPPUNIT_TEST( testDestroyName );
91 CPPUNIT_TEST( testDestroyDirectory );
92 CPPUNIT_TEST( testDestroyFullDirectory );
93 CPPUNIT_TEST( testGetIorAddr );
98 CPPUNIT_TEST_SUITE_END();
105 void testConstructorDefault();
106 void testConstructorOrb();
107 void testRegisterResolveAbsNoPath();
108 void testRegisterResolveRelativeNoPath();
109 void testRegisterResolveAbsWithPath();
110 void testRegisterResolveRelativeWithPath();
111 void testResolveBadName();
112 void testResolveBadNameRelative();
113 void testResolveFirst();
114 void testResolveFirstRelative();
115 void testResolveFirstUnknown();
116 void testResolveFirstUnknownRelative();
117 void testResolveComponentOK();
118 void testResolveComponentEmptyHostname();
119 void testResolveComponentUnknownHostname();
120 void testResolveComponentEmptyContainerName();
121 void testResolveComponentUnknownContainerName();
122 void testResolveComponentEmptyComponentName();
123 void testResolveComponentUnknownComponentName();
124 void testResolveComponentFalseNbproc();
125 void testContainerName();
126 void testContainerNameParams();
127 void testBuildContainerNameForNS();
128 void testBuildContainerNameForNSParams();
130 void testCreateDirectory();
131 void testChangeDirectory();
132 void testCurrentDirectory();
134 void testListDirectory();
135 void testListDirectoryRecurs();
136 void testListSubdirs();
137 void testDestroyName();
138 void testDestroyDirectory();
139 void testDestroyFullDirectory();
140 void testGetIorAddr();
143 void _destroyDirectoryRecurs(std::string path);
146 SALOME_NamingService _NS;
148 PortableServer::POA_var _root_poa;
149 PortableServer::POAManager_var _pman;
150 PortableServer::ObjectId_var _myFactoryId;
151 NSTEST_aFactory_i * _myFactory;
152 CORBA::Object_var _factoryRef;