-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
+#include "utilities.h"
#include <iostream>
#include <fstream>
#endif
#ifdef WIN32
#define setenv Kernel_Utils::setenv
-#endif
+#endif
-#define TRACEFILE "/tmp/traceUnitTest.log"
+std::string
+LifeCycleCORBATest::_getTraceFileName()
+{
+ std::string dir = Kernel_Utils::GetTmpDir();
+ return dir + "traceUnitTest-LifeCycleCORBATest.log";
+}
// ============================================================================
/*!
- * Set Trace mecanism
+ * Set Trace mechanism
* - delete preexisting trace classes if any
* - set trace on file
* Get or initialize the orb
*/
// ============================================================================
-void
+void
LifeCycleCORBATest::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, std::ios::out | std::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();
*/
// ============================================================================
-void
+void
LifeCycleCORBATest::tearDown()
{
/*!
* Check FindOrLoad_Component with a component name not in catalog.
* See list of catalog given to module catalog server.
- * Here, we work with KERNEL_SRC/resources/KERNELCatalog.xml that contains
+ * Here, we work with KERNEL_SRC/resources/KERNELCatalog.xml that contains
* only KERNEL, SalomeTestComponent and SALOME_TestComponentPy
*/
// ============================================================================
// ============================================================================
/*!
- * Check FindOrLoad_Component params = local container
+ * Check FindOrLoad_Component params = local container
*/
// ============================================================================
// ============================================================================
/*!
* Check FindOrLoad_Component with params on remote computer
- * params empty except hostname
+ * params empty except hostname
*/
// ============================================================================
std::string remoteHost = GetRemoteHost();
Engines::ContainerParameters params;
- _LCC.preSet(params);
+ _LCC.preSet(params);
params.resource_params.hostname = remoteHost.c_str();
Engines::EngineComponent_var mycompo1 =
std::string remoteHost = GetRemoteHost();
Engines::ContainerParameters params;
- _LCC.preSet(params);
+ _LCC.preSet(params);
params.resource_params.hostname = remoteHost.c_str();
params.container_name = "anotherContainer";
{
SALOME_LifeCycleCORBA _LCC(&_NS);
std::string origFileName = getenv("KERNEL_ROOT_DIR");
+#ifdef __APPLE__
+ origFileName += "/lib/salome/libSalomeLifeCycleCORBA.dylib";
+#else
origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0";
+#endif
SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(),
origFileName);
std::string local = transfer.getLocalFile();
{
SALOME_LifeCycleCORBA _LCC(&_NS);
std::string origFileName = getenv("KERNEL_ROOT_DIR");
+#ifdef __APPLE__
+ origFileName += "/lib/salome/libSalomeContainer.dylib";
+#else
origFileName += "/lib/salome/libSalomeContainer.so.0.0.0";
+#endif
SALOME_FileTransferCORBA transfer( GetRemoteHost(),
origFileName);
std::string local = transfer.getLocalFile();