1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 cm= salome.lcc.getContainerManager()
27 rm= salome.lcc.getResourcesManager()
29 class TestContainerManager(unittest.TestCase):
32 <!DOCTYPE ResourcesCatalog>
34 <machine hostname="claui2c6" >
36 <machine hostname="clt10br" >
45 rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
46 p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="start",resource_params=rp)
47 co=cm.GiveContainer( p )
48 self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
49 co=cm.GiveContainer( p )
50 self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
54 rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
55 p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="get",resource_params=rp)
56 co=cm.GiveContainer( p )
57 self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
58 co=cm.GiveContainer( p )
59 self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
63 rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
64 p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="getorstart",resource_params=rp)
65 co=cm.GiveContainer( p )
66 self.assertEqual(co._get_name(), "/Containers/claui2c6/MyContainer")
67 co=cm.GiveContainer( p )
68 self.assertEqual(co._get_name(), "/Containers/clt10br/MyContainer")
71 if __name__ == '__main__':
72 suite = unittest.TestLoader().loadTestsFromTestCase(TestContainerManager)
73 unittest.TextTestRunner().run(suite)