]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py
Salome HOME
Apply modifications according to changes in KERNEL API.
[modules/yacs.git] / src / yacsloader_swig / Test / StdAloneYacsLoaderTest1.py
index 776905907b0062f84865162a7244ba5786c76599..05af101181435eb312f6bbd1c0f3861c66da334a 100644 (file)
@@ -129,6 +129,47 @@ class StdAloneYacsLoaderTest1(unittest.TestCase):
     self.assertEqual(p.getChildByName("node2").getOutputPort("o1").get(),['aaa','bcbcbc'])
     pass
 
+  def test3(self):
+    fname="BugInConcurrentLaunchDftCont.xml"
+    p=self.r.createProc("pr")
+    ti=p.createType("int","int")
+    cont=p.createContainer("DefaultContainer","Salome")
+    cont.setProperty("container_name","FactoryServer")
+    b=self.r.createBloc("Bloc") ; p.edAddChild(b)
+    #
+    nb=4
+    outs=[]
+    for i in xrange(nb):
+      node=self.r.createScriptNode("Salome","node%d"%i)
+      node.setExecutionMode("remote")
+      node.setContainer(cont)
+      outs.append(node.edAddOutputPort("i",ti))
+      node.setScript("i=%d"%i)
+      b.edAddChild(node)
+    #
+    node=self.r.createScriptNode("Salome","nodeEnd")
+    node.setExecutionMode("remote")
+    node.setContainer(cont)
+    res=node.edAddOutputPort("res",ti)
+    p.edAddChild(node)
+    l=[]
+    for i in xrange(nb):
+      elt="i%d"%i
+      inp=node.edAddInputPort(elt,ti) ; l.append(elt)
+      p.edAddChild(node)
+      p.edAddLink(outs[i],inp)
+    node.setScript("res="+"+".join(l))
+    p.edAddCFLink(b,node)
+    #
+    for i in xrange(10):
+      p.init()
+      ex = pilot.ExecutorSwig()
+      self.assertEqual(p.getState(),pilot.READY)
+      ex.RunW(p,0)
+      self.assertEqual(res.get(),6)
+      self.assertEqual(p.getState(),pilot.DONE)
+    pass
+
   def tearDown(self):
     del self.r
     del self.l