-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "utilities.h"
#ifdef WIN32
#define setenv Kernel_Utils::setenv
-#endif
-
-#define TRACEFILE "/tmp/traceUnitTest.log"
+#endif
// ============================================================================
/*!
*/
// ============================================================================
-void
+std::string
+NamingServiceTest::_getTraceFileName()
+{
+ std::string dir = Kernel_Utils::GetTmpDir();
+ return dir + "traceUnitTest-NamingServiceTest.log";
+}
+
+void
NamingServiceTest::setUp()
{
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
bp1->deleteInstance(bp1);
// --- trace on file
- const char *theFileName = TRACEFILE;
+ std::string theFileName = _getTraceFileName();
std::string s = "file:";
s += theFileName;
std::ofstream traceFile;
// traceFile.open(theFileName, ios::out | ios::trunc);
- traceFile.open(theFileName, std::ios::out | std::ios::app);
+ traceFile.open(theFileName.c_str(), std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
_factoryRef = _myFactory->_this();
_pman->activate();
_myFactory->_remove_ref();
-
+
}
// ============================================================================
*/
// ============================================================================
-void
+void
NamingServiceTest::tearDown()
{
* 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
+ * ResolveFirst echo with a relative path /nstestfirstrel must give
* /nstestfirst/echo_i, corresponding to the first object.
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test with a false number nbproc.
+ * 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.
*/
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
NSTEST::echo_var anEchoRef4 = myFactory->createInstance();
_NS.Register(anEchoRef4,
"/Containers/anHostName/oneContainerName/theComponentName");
-
+
_NS.Change_Directory("/Containers/theHostName/otherContainerName");
obj = _NS.Resolve("theComponentName");
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
-
+
NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj);
CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa));
CPPUNIT_ASSERT(anEchoRefa->getId() == anEchoRef3->getId());
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
}
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================
{
CORBA::String_var root = _NS.getIORaddr();
CORBA::Object_var obj = _orb->string_to_object(root);
- CPPUNIT_ASSERT(!CORBA::is_nil(obj));
+ CPPUNIT_ASSERT(!CORBA::is_nil(obj));
}
// ============================================================================
/*!
- * Test
+ * Test
*/
// ============================================================================