1 # Copyright (C) 2007-2008 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
22 #from TestLifeCycleCORBA import *
29 host = Utils_Identity.getShortHostName()
30 #host = os.getenv( 'HOST' )
32 lcc = LifeCycleCORBA.LifeCycleCORBA()
35 obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
36 comp=obj._narrow(Engines.TestComponent)
39 #param['hostname']='cli76cc'
40 param['hostname']=host
41 param['container_name']='FactoryServer'
42 comp=lcc.FindOrLoad_Component(param,'SalomeTestComponent')
43 engine=lcc.FindComponent(param,'SalomeTestComponent')
46 print 'lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent") failed'
51 orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
52 obj = orb.resolve_initial_references("NameService")
53 rootContext = obj._narrow(CosNaming.NamingContext)
55 context_name.append(CosNaming.NameComponent( 'ContainerManager' , 'object' ) )
56 ContainerManager = rootContext.resolve( context_name )
59 myContainerparamsCPP = Engines.MachineParameters( 'myContainer' , host , 'osf' , 0 , 0 , 0 , 0 , 0 )
60 computerlistCPP = [host]
61 containerCPP = ContainerManager.FindOrStartContainer( myContainerparamsCPP , computerlistCPP )
64 ComponentparamsCPP['hostname']=host
65 ComponentparamsCPP['container_name']='myContainer'
66 compCPP=lcc.FindOrLoad_Component(ComponentparamsCPP,'SalomeTestComponent')
68 engineCPP=lcc.FindComponent(ComponentparamsCPP,'SalomeTestComponent')
71 print 'ContainerManager.FindOrStartContainer( myContainerparams , computerlist ) C++ failed'
74 myContainerparamsPy = Engines.MachineParameters( 'myContainerPy' , host , 'osf' , 0 , 0 , 0 , 0 , 0 )
75 computerlistPy = [host]
76 containerPy = ContainerManager.FindOrStartContainer( myContainerparamsPy , computerlistPy )
79 ComponentparamsPy['hostname']=host
80 ComponentparamsPy['container_name']='myContainerPy'
81 compPy=lcc.FindOrLoad_Component(ComponentparamsPy,'SALOME_TestComponentPy')
83 enginePy=lcc.FindComponent(ComponentparamsPy,'SALOME_TestComponentPy')
86 print 'ContainerManager.FindOrStartContainer( myContainerparams , computerlist ) Python failed'