//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author: Guillaume Boulant (EDF/R&D)
+// Author: Guillaume Boulant (EDF/R&D)
#include "SALOME_KernelServices.hxx"
#include "Basics_Utils.hxx"
if ( ns == NULL ) {
LOG("TEST_Corba: ns ERROR");
return false;
-
+
}
SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
if ( lcc == NULL ) {
bool TEST_getLifeCycleCORBA() {
Engines::EngineComponent_var component =
KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
-
+
Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
char * coucou_res = engine->Coucou(123.);
const char * coucou_ref = "L = 123";
// ============================================================================
/*!
- * - delete
+ * - delete
*/
// ============================================================================
CORBA::ORB_var orb = KERNEL::getORB();
CPPUNIT_ASSERT(!CORBA::is_nil(orb));
-
+
SALOME_NamingService * ns = KERNEL::getNamingService();
CPPUNIT_ASSERT(ns!=NULL);
void KernelHelpersUnitTests::TEST_getLifeCycleCORBA() {
Engines::EngineComponent_var component =
KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
-
+
Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
char * coucou_res = engine->Coucou(123.);
const char * coucou_ref = "TestComponent_i : L = 123";
}
void KernelHelpersUnitTests::TEST_getStudyManager() {
- SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
+ SALOMEDS::StudyManager_var studyManager = KERNEL::getStudyManager();
+
+ #ifndef ALLOW_MULTI_STUDIES
+ SALOMEDS::ListOfOpenStudies_var _list_open_studies = studyManager->GetOpenStudies();
+ for (unsigned int ind = 0; ind < _list_open_studies->length();ind++)
+ {
+ LOG("Close study : " << _list_open_studies[ind]);
+ SALOMEDS::Study_var study = studyManager->GetStudyByName(_list_open_studies[0]);
+ if(study)
+ studyManager->Close(study);
+ }
+ #endif
+
+ SALOMEDS::Study_ptr myTestStudy = studyManager->NewStudy("kerneltest");
CPPUNIT_ASSERT(!CORBA::is_nil(myTestStudy));
// One can use the study to store some general properties
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
+import setenv
import orbmodule
import TestKiller
-import setenv
# get SALOME environment :
# execute Unit Test
command = ['./TestKernelHelpers']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
-# kill Test process
+# kill Test process
TestKiller.killProcess(runSalome.process_id)
+TestKiller.closeSalome()
exit(ret)
CPPUNIT_TEST( testFindOrLoad_Component_ParamsEmpty );
CPPUNIT_TEST( testFindOrLoad_Component_ParamsLocalContainer );
CPPUNIT_TEST( testFindOrLoad_Component_ParamsContainerName );
+#ifdef SALOME_TEST_REMOTE
CPPUNIT_TEST( testFindOrLoad_Component_RemoteComputer );
CPPUNIT_TEST( testFindOrLoad_Component_ParamsRemoteComputer );
CPPUNIT_TEST( testFindOrLoad_Component_ParamsRemoteComputer2 );
+#endif
CPPUNIT_TEST( testgetLocalFile_localComputer );
+#ifdef SALOME_TEST_REMOTE
CPPUNIT_TEST( testgetLocalFile_remoteComputer );
+#endif
// CPPUNIT_TEST( testFindOrLoad_Component_ );
// CPPUNIT_TEST( );
// CPPUNIT_TEST( );
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import setenv
import orbmodule
# execute Unit Test
command = ['./TestLifeCycleCORBA']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
# kill containers created by the Container Manager
import Engines
launcher = clt.waitNS("/SalomeLauncher",Engines.SalomeLauncher)
+
launcher.Shutdown()
# kill Test process
addToKillList.killList()
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
# $Header$
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import setenv
import orbmodule
# execute Unit Test
command = ['TestLifeCycleCORBA']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
import LifeCycleCORBA_SWIGTest
import unittest
addToKillList.killList()
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
import sys, os,signal,string,commands
+def getCurrentPort():
+ fic=os.environ['OMNIORB_CONFIG']
+ with open(fic,'r') as f:
+ line=f.readline()
+ port=string.split(line,':')[-1][0:4]
+ return port
+
+
+def closeSalome():
+ port = getCurrentPort()
+ try:
+ from PortManager import releasePort
+ print "### release current port:", port
+ releasePort(port)
+ except:
+ pass
+
+
def killNamingService():
"""
kills omniORB4 Naming Service on local machine.
Works only with a single line $OMNIORB_CONFIG like
InitRef = NameService=corbaname::<hostname>:<port>
"""
- fic=os.environ['OMNIORB_CONFIG']
- f=open(fic,'r')
- line=f.readline()
- f.close()
- port=string.split(line,':')[-1][0:4]
+ port = getCurrentPort()
command='ps -eo pid,command | grep "omniNames -start '+str(port)+'" | grep --invert-match grep'
output_com = commands.getoutput(command)
try:
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import setenv
import orbmodule
command = ['./TestNamingService']
valgrind = ['valgrind','--leak-check=full']
#command=valgrind+command #to check memory leaks
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import orbmodule
import TestKiller
# execute Unit Test
command = ['./TestSALOMEDS']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
-# kill Test process
+# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import orbmodule
import TestKiller
# execute Unit Test
command = ['./TestSALOMEDSImpl']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
-# kill Test process
+# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-import sys, os,signal,string,commands
+import sys, signal,string,commands
+import subprocess
import runSalome
import setenv
# execute Unit Test
command = ['./TestSALOMELocalTrace']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
# no process to kill
-exit(ret)
\ No newline at end of file
+exit(ret)
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import orbmodule
import TestKiller
# execute Unit Test
command = ['./TestSALOMETraceCollector']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
-# kill Test process
+# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+exit(ret)
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import setenv
import orbmodule
# execute Unit Test
command = ['./UnitTests']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
# kill containers created by the Container Manager
# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)
#
import sys, os,signal,string,commands
+import subprocess
import runSalome
import orbmodule
import TestKiller
# execute Unit Test
command = ['./TestUtils']
-ret = os.spawnvp(os.P_WAIT, command[0], command)
+ret = subprocess.call(command)
# kill Test process
TestKiller.killProcess(runSalome.process_id)
-exit(ret)
\ No newline at end of file
+TestKiller.closeSalome()
+exit(ret)