def test_ApplicationStartOrder(self):
self._nb_domMgr, self._domMgr = self.launchDomainManager(endpoint="giop:tcp::5679", dbURI=self._dbfile)
self._nb_devMgr, devMgr = self.launchDeviceManager("/nodes/test_BasicTestDevice_node/DeviceManager.dcd.xml")
self._domMgr.installApplication("/waveforms/CommandWrapperStartOrderTests/CommandWrapperWithOrder.sad.xml")
appFact = self._domMgr._get_applicationFactories()[0]
app = appFact.create(appFact._get_name(), [], [])
app.start()
comps = app._get_registeredComponents()
for c in comps:
self.assertEquals(c.componentObject._get_started(), True)
# Kill the domainMgr
os.kill(self._nb_domMgr.pid, signal.SIGTERM)
# TODO if SIGKILL is used (simulating a nodeBooter unexpected abort,
# the IOR and the newly spawned domain manager do not work
if not self.waitTermination(self._nb_domMgr):
self.fail("Domain Manager Failed to Die")
# Start the domainMgr again
self._nb_domMgr, newDomMgr = self.launchDomainManager(endpoint="giop:tcp::5679", dbURI=self._dbfile)
# Components should all still be started
for c in comps:
self.assertEquals(c.componentObject._get_started(), True)
# Stop application to make sure that start order Resource variables were recovered properly
app = newDomMgr._get_applications()[0]
app.stop()
for c in comps:
self.assertEquals(c.componentObject._get_started(), False)
# Start components to make sure that start also works
app.start()
for c in comps:
self.assertEquals(c.componentObject._get_started(), True)
test_09_DomainPersistence.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录