def test_createApplication_namespaced(self): # Automatically clean up redhawk.setTrackApps(True) # Create Application from $SDRROOT path app = self._rhDom.createApplication("simple_ns.c2_comp") self.assertNotEqual(app, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 1) self.assertEquals(len(self._rhDom.apps), 1) app2 = self._rhDom.createApplication("c2_comp") self.assertNotEqual(app2, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 2) self.assertEquals(len(self._rhDom.apps), 2) app.releaseObject() self.assertEquals(len(self._rhDom._get_applications()), 1) self.assertEquals(len(self._rhDom.apps), 1) self.assertRaises(CF.DomainManager.ApplicationInstallationError,self._rhDom.createApplication, "this.should.fail.c2_comp") # Use exit functions from module to release other launched app redhawk.core._cleanUpLaunchedApps() self.assertEquals(len(self._rhDom.apps), 0) self.assertEquals(len(self._rhDom._get_applications()), 0)
def test_createApplication1(self): # Automatically clean up redhawk.setTrackApps(True) # Create Application from $SDRROOT path app = self._rhDom.createApplication("/waveforms/TestCppProps/TestCppProps.sad.xml") self.assertNotEqual(app, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 1) self.assertEquals(len(self._rhDom.apps), 1) # Ensure that api() works. try: app.api() except: self.fail('App.api() raised an exception') app2 = self._rhDom.createApplication("TestCppProps") self.assertNotEqual(app2, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 2) self.assertEquals(len(self._rhDom.apps), 2) app.releaseObject() self.assertEquals(len(self._rhDom._get_applications()), 1) self.assertEquals(len(self._rhDom.apps), 1) # Use exit functions from module to release other launched app redhawk.core._cleanUpLaunchedApps() self.assertEquals(len(self._rhDom.apps), 0) self.assertEquals(len(self._rhDom._get_applications()), 0)
def __init__(self, domainName=None, verbose=False, parent = None,name = None,fl = 0): redhawk.setTrackApps(False) self.verbose = verbose self.currentDomain = "" self.apps = [] self.devMgrs = [] self.odmListener = None self.log = logging.getLogger(BrowseWindow.__name__) if not domainName: domainName = self.findDomains() BrowseWindowBase.__init__(self,parent,name,fl, domainName) self._requests = Queue.Queue() self.worker = self.WorkThread(self._requests) if not domainName: return self.debug('Domain:', domainName) self.connect(self.worker, SIGNAL('refreshApplications()'), self.refreshApplications) self.connect(self.worker, SIGNAL('refreshDeviceManagers()'), self.refreshDeviceManagers) self.connect(self.worker, SIGNAL('parseDomainManager()'), self.parseDomainManager) self.connect(self.worker, SIGNAL('parseApplications()'), self.parseApplications) self.connect(self.worker, SIGNAL('parseAllDeviceManagers()'), self.parseAllDeviceManagers) self.connect(self.worker, SIGNAL('setupDomain()'), self.setupDomain) self.connect(self.worker, SIGNAL('cleardomMgrItem()'), self.cleardomMgrItem) self.connect(self.worker, SIGNAL('cleardevMgrItem()'), self.cleardevMgrItem) self.connect(self.worker, SIGNAL('clearappsItem()'), self.clearappsItem) self.connect(self.worker, SIGNAL('setWindowTitle(QString)'), self.setWindowTitle) self.connect(self.worker, SIGNAL('releaseApplication(QString)'), self.releaseApplication) self.connect(self.worker, SIGNAL('shutdownDeviceManager(QString)'), self.shutdownDeviceManager) self.connect(self.worker, SIGNAL('refreshProperty(QString,QString,QString)'), self.refreshProperty) self.worker.start() self.updateDomain(domainName)
def tearDown(self): # Do all application shutdown before calling the base class tearDown, # or failures will probably occur. redhawk.core._cleanUpLaunchedApps() scatest.CorbaTestCase.tearDown(self) # need to let event service clean up event channels...... # cycle period is 10 milliseconds time.sleep(0.1) redhawk.setTrackApps(False)
def __init__(self, domainName=None, verbose=False, parent=None, name=None, fl=0): redhawk.setTrackApps(False) self.verbose = verbose self.currentDomain = "" self.apps = [] self.devMgrs = [] self.odmListener = None self.log = logging.getLogger(BrowseWindow.__name__) if not domainName: domainName = self.findDomains() BrowseWindowBase.__init__(self, parent, name, fl, domainName) self._requests = Queue.Queue() self.worker = self.WorkThread(self._requests) self.debug('Domain:', domainName) self.connect(self.worker, SIGNAL('refreshApplications()'), self.refreshApplications) self.connect(self.worker, SIGNAL('refreshDeviceManagers()'), self.refreshDeviceManagers) self.connect(self.worker, SIGNAL('parseDomainManager()'), self.parseDomainManager) self.connect(self.worker, SIGNAL('parseApplications()'), self.parseApplications) self.connect(self.worker, SIGNAL('parseAllDeviceManagers()'), self.parseAllDeviceManagers) self.connect(self.worker, SIGNAL('setupDomain()'), self.setupDomain) self.connect(self.worker, SIGNAL('cleardomMgrItem()'), self.cleardomMgrItem) self.connect(self.worker, SIGNAL('cleardevMgrItem()'), self.cleardevMgrItem) self.connect(self.worker, SIGNAL('clearappsItem()'), self.clearappsItem) self.connect(self.worker, SIGNAL('setWindowTitle(QString)'), self.setWindowTitle) self.connect(self.worker, SIGNAL('releaseApplication(QString)'), self.releaseApplication) self.connect(self.worker, SIGNAL('shutdownDeviceManager(QString)'), self.shutdownDeviceManager) self.connect(self.worker, SIGNAL('refreshProperty(QString,QString,QString)'), self.refreshProperty) self.worker.start() if not domainName: return self.updateDomain(domainName)
def test_cleanup_multiple_waves(self): # Automatically clean up redhawk.setTrackApps(True) # Create Application from $SDRROOT path app = self._rhDom.createApplication("/waveforms/TestCppProps/TestCppProps.sad.xml") self.assertNotEqual(app, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 1) self.assertEquals(len(self._rhDom.apps), 1) app2 = self._rhDom.createApplication("TestCppProps") self.assertNotEqual(app2, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 2) self.assertEquals(len(self._rhDom.apps), 2) app3 = self._rhDom.createApplication("TestCppProps") self.assertNotEqual(app3, None, "Application not created") self.assertEquals(len(self._rhDom._get_applications()), 3) self.assertEquals(len(self._rhDom.apps), 3) # Use exit functions from module to release launched apps redhawk.core._cleanUpLaunchedApps() self.assertEquals(len(self._rhDom.apps), 0) self.assertEquals(len(self._rhDom._get_applications()), 0)