Back to index

salome-kernel  6.5.0
Public Member Functions | Public Attributes
LifeCycleCORBA_SWIGTest.LifeCycleCORBA_SWIGTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test001_FindOrLoad_Component_LaunchContainer
def test002_FindOrLoad_Component_SameInstance
def test003_FindOrLoad_Component_PythonInCppContainer
def test004_FindOrLoad_Component_PythonSameInstance
def test005_FindOrLoad_Component_UnknownInCatalog
def test006_FindOrLoad_Component_LaunchContainerHostname
def test007_FindOrLoad_Component_SameContainer
def test008_FindOrLoad_Component_UnknownMachine

Public Attributes

 lcc

Detailed Description

Definition at line 37 of file LifeCycleCORBA_SWIGTest.py.


Member Function Documentation

Definition at line 38 of file LifeCycleCORBA_SWIGTest.py.

00038 
00039     def setUp(self):
00040         import LifeCycleCORBA
00041         self.lcc = LifeCycleCORBA.LifeCycleCORBA()
00042         pass

Definition at line 43 of file LifeCycleCORBA_SWIGTest.py.

00043 
00044     def tearDown(self):
00045         pass
    
get a local container (no hostname given),
load an engine, check that the CORBA object is not null.
check narrow        

Definition at line 46 of file LifeCycleCORBA_SWIGTest.py.

00046 
00047     def test001_FindOrLoad_Component_LaunchContainer(self):
00048         """
00049         get a local container (no hostname given),
00050         load an engine, check that the CORBA object is not null.
00051         check narrow        
00052         """
00053         containerName = "swMyContainer"
00054         comp=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00055         self.assertNotEqual(comp,None)
00056         testComp=comp._narrow(Engines.TestComponent)
00057         self.assertNotEqual(testComp,None)
00058         pass

Check FindOrLoad_Component.
Call 2 times FindOrLoad_Component with the same parameters,
check if we get the same engine      

Definition at line 59 of file LifeCycleCORBA_SWIGTest.py.

00059 
00060     def test002_FindOrLoad_Component_SameInstance(self):
00061         """
00062         Check FindOrLoad_Component.
00063         Call 2 times FindOrLoad_Component with the same parameters,
00064         check if we get the same engine      
00065         """
00066         containerName = "swMyContainer"
00067         cp1=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00068         self.assertNotEqual(cp1,None)
00069         cp2=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00070         self.assertNotEqual(cp2,None)
00071         m1=cp1._narrow(Engines.TestComponent)
00072         self.assertNotEqual(m1,None)
00073         m2=cp2._narrow(Engines.TestComponent)
00074         self.assertNotEqual(m2,None)
00075         name1=m1._get_instanceName()
00076         name2=m2._get_instanceName()
00077         self.assertEqual(name1,name2)
00078         pass

Check FindOrLoad_Component with Python Component on C++ Container,
load an engine, check that the CORBA object is not null.
check narrow

Definition at line 79 of file LifeCycleCORBA_SWIGTest.py.

00079 
00080     def test003_FindOrLoad_Component_PythonInCppContainer(self):
00081         """
00082         Check FindOrLoad_Component with Python Component on C++ Container,
00083         load an engine, check that the CORBA object is not null.
00084         check narrow
00085         """
00086         containerName = "swMyContainer"
00087         cp1=self.lcc.FindOrLoad_Component(containerName,"SALOME_TestComponentPy")
00088         self.assertNotEqual(cp1,None)
00089         m1=cp1._narrow(Engines.TestComponent)
00090         self.assertNotEqual(m1,None)
00091         pass        

Check FindOrLoad_Component with Python Component on C++ Container,
Call 2 times FindOrLoad_Component with the same parameters,
check if we get the same engine,

Definition at line 92 of file LifeCycleCORBA_SWIGTest.py.

00092 
00093     def test004_FindOrLoad_Component_PythonSameInstance(self):
00094         """
00095         Check FindOrLoad_Component with Python Component on C++ Container,
00096         Call 2 times FindOrLoad_Component with the same parameters,
00097         check if we get the same engine,
00098         """
00099         containerName = "swMyContainer"
00100         cp1=self.lcc.FindOrLoad_Component(containerName,"SALOME_TestComponentPy")
00101         self.assertNotEqual(cp1,None)
00102         cp2=self.lcc.FindOrLoad_Component(containerName,"SALOME_TestComponentPy")
00103         self.assertNotEqual(cp2,None)
00104         m1=cp1._narrow(Engines.TestComponent)
00105         self.assertNotEqual(m1,None)
00106         m2=cp2._narrow(Engines.TestComponent)
00107         self.assertNotEqual(m2,None)
00108         name1=m1._get_instanceName()
00109         name2=m2._get_instanceName()
00110         self.assertEqual(name1,name2)
00111         pass

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 
only KERNEL, SalomeTestComponent and SALOME_TestComponentPy

Definition at line 112 of file LifeCycleCORBA_SWIGTest.py.

00112 
00113     def test005_FindOrLoad_Component_UnknownInCatalog(self):
00114         """
00115         Check FindOrLoad_Component with a component name not in catalog.
00116         See list of catalog given to module catalog server.
00117         Here, we work with KERNEL_SRC/resources/KERNELCatalog.xml that contains 
00118         only KERNEL, SalomeTestComponent and SALOME_TestComponentPy
00119         """
00120         containerName = "swMyContainer"
00121         cp1=self.lcc.FindOrLoad_Component(containerName,"MyNewComponent")
00122         self.assertEqual(cp1,None)
00123         pass

Check FindOrLoad_Component with hostname given.
get a local container : getHostName()/componentName,
load an engine, check that the CORBA object is not null.
check narrow

Definition at line 124 of file LifeCycleCORBA_SWIGTest.py.

00124 
00125     def test006_FindOrLoad_Component_LaunchContainerHostname(self):
00126         """
00127         Check FindOrLoad_Component with hostname given.
00128         get a local container : getHostName()/componentName,
00129         load an engine, check that the CORBA object is not null.
00130         check narrow
00131         """
00132         containerName = Utils_Identity.getShortHostName()
00133         containerName += "/swTheContainer"
00134         cp1=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00135         self.assertNotEqual(cp1,None)
00136         m1=cp1._narrow(Engines.TestComponent)
00137         self.assertNotEqual(m1,None)
00138         pass

Here is the call graph for this function:

Check FindOrLoad_Component with and without local hostname given.
We must get the same container, the same instance of component

Definition at line 139 of file LifeCycleCORBA_SWIGTest.py.

00139 
00140     def test007_FindOrLoad_Component_SameContainer(self):
00141         """
00142         Check FindOrLoad_Component with and without local hostname given.
00143         We must get the same container, the same instance of component
00144         """
00145         containerName = "swAContainer"
00146         cp1=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00147         self.assertNotEqual(cp1,None)
00148         containerName = Utils_Identity.getShortHostName()
00149         containerName += "/swAContainer"
00150         cp2=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00151         self.assertNotEqual(cp2,None)
00152         m1=cp1._narrow(Engines.TestComponent)
00153         self.assertNotEqual(m1,None)
00154         m2=cp2._narrow(Engines.TestComponent)
00155         self.assertNotEqual(m2,None)
00156         name1=m1._get_instanceName()
00157         name2=m2._get_instanceName()
00158         self.assertEqual(name1,name2)
00159         c1=m1.GetContainerRef()
00160         self.assertNotEqual(c1,None)
00161         c2=m2.GetContainerRef()
00162         self.assertNotEqual(c2,None)
00163         cname1=c1._get_name()
00164         cname2=c2._get_name()
00165         self.assertEqual(cname1,cname2)
00166         hostname1=c1.getHostName()
00167         hostname2=c2.getHostName()
00168         self.assertEqual(hostname1,hostname2)
00169         pidc1=c1.getPID()
00170         pidc2=c2.getPID()
00171         self.assertEqual(pidc1,pidc2)        
00172         pass
    

Here is the call graph for this function:

Check FindOrLoad_Component: check behaviour when ask for an unknown
computer. We must catch a Salome Exception with "unknown host" message

Definition at line 173 of file LifeCycleCORBA_SWIGTest.py.

00173 
00174     def test008_FindOrLoad_Component_UnknownMachine(self):
00175         """
00176         Check FindOrLoad_Component: check behaviour when ask for an unknown
00177         computer. We must catch a Salome Exception with "unknown host" message
00178         """
00179         containerName = "aFarAwayContainer"
00180         containerName += "/swTheContainer"
00181         try:
00182             cp1=self.lcc.FindOrLoad_Component(containerName,"SalomeTestComponent")
00183         except RuntimeError,ex :
00184             self.assertEqual(ex.args[0],'unknown host')
00185         pass
       

Member Data Documentation

Definition at line 40 of file LifeCycleCORBA_SWIGTest.py.


The documentation for this class was generated from the following file: