1 # Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
2 # PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #from TestLifeCycleCORBA import *
27 host = Utils_Identity.getShortHostName()
28 #host = os.getenv( 'HOST' )
30 lcc = LifeCycleCORBA.LifeCycleCORBA()
33 obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
34 comp=obj._narrow(Engines.TestComponent)
37 #param['hostname']='cli76cc'
38 param['hostname']=host
39 param['container_name']='FactoryServer'
40 comp=lcc.FindOrLoad_Component(param,'SalomeTestComponent')
41 engine=lcc.FindComponent(param,'SalomeTestComponent')
44 print 'lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent") failed'
49 orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
50 obj = orb.resolve_initial_references("NameService")
51 rootContext = obj._narrow(CosNaming.NamingContext)
53 context_name.append(CosNaming.NameComponent( 'ContainerManager' , 'object' ) )
54 ContainerManager = rootContext.resolve( context_name )
57 myContainerparamsCPP = Engines.MachineParameters( 'myContainer' , host , 'osf' , 0 , 0 , 0 , 0 , 0 )
58 computerlistCPP = [host]
59 containerCPP = ContainerManager.FindOrStartContainer( myContainerparamsCPP , computerlistCPP )
62 ComponentparamsCPP['hostname']=host
63 ComponentparamsCPP['container_name']='myContainer'
64 compCPP=lcc.FindOrLoad_Component(ComponentparamsCPP,'SalomeTestComponent')
66 engineCPP=lcc.FindComponent(ComponentparamsCPP,'SalomeTestComponent')
69 print 'ContainerManager.FindOrStartContainer( myContainerparams , computerlist ) C++ failed'
72 myContainerparamsPy = Engines.MachineParameters( 'myContainerPy' , host , 'osf' , 0 , 0 , 0 , 0 , 0 )
73 computerlistPy = [host]
74 containerPy = ContainerManager.FindOrStartContainer( myContainerparamsPy , computerlistPy )
77 ComponentparamsPy['hostname']=host
78 ComponentparamsPy['container_name']='myContainerPy'
79 compPy=lcc.FindOrLoad_Component(ComponentparamsPy,'SALOME_TestComponentPy')
81 enginePy=lcc.FindComponent(ComponentparamsPy,'SALOME_TestComponentPy')
84 print 'ContainerManager.FindOrStartContainer( myContainerparams , computerlist ) Python failed'