Пример #1
0
import CDB
import xml.dom.minidom
import datetime
import numpy as np

from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
all_comp = client.availableComponents()
#
# DAL
#
dal = ACSCorba.cdb()
#
# WDAL
#
cdb_obj = ACSCorba.getClient().getService('CDB')
dal_ = cdb_obj._narrow(CDB.WDAL)

prof = {}
prof_wdal = {}
for comp in all_comp:
    print comp.name
    curl = "MACI/Components/"+comp.name
    #
    # DAO
    #
    t0 = datetime.datetime.utcnow()
    xmlstring = dal.get_DAO(curl)
    t1 = datetime.datetime.utcnow()
    delta = (t1 - t0)#.total_seconds()
    prof[comp.name] = (delta.microseconds + 0.0 + (delta.seconds + delta.days * 24 * 3600) * 10 ** 6) / 10 ** 6
Пример #2
0
 def test_ok(self, clientmock):
     self.assertEqual(False, ACSCorba.getClient() is None)
Пример #3
0
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
# MA 02111-1307  USA
#
# @(#) $Id: acspyTestAcsCORBA.py,v 1.1.1.1 2012/03/07 17:41:01 acaproni Exp $
###############################################################################
'''
Tests CORBA access.
'''
from Acspy.Util import ACSCorba
###############################################################################
if __name__ == '__main__':
    print 'Manager corbaloc: %s' % ACSCorba.getManagerCorbaloc()
    print 'ORB: %s' % ACSCorba.getORB()
    print 'POA ROOT: %s' % ACSCorba.getPOARoot()
    print 'POA Manager: %s' % ACSCorba.getPOAManager()
    print 'Manager: %s' % ACSCorba.getManager()
    print 'Client: %s' % ACSCorba.getClient()
    print 'Log: %s' % ACSCorba.log()
    print 'LogFactory: %s' % ACSCorba.logFactory()
    print 'NotifyEventChannelFactory: %s' % ACSCorba.notifyEventChannelFactory()
    print 'ArchivingChannel: %s' % ACSCorba.archivingChannel()
    print 'LoggingChannel: %s' % ACSCorba.loggingChannel()
    print 'InterfaceRepository: %s' % ACSCorba.interfaceRepository()
    print 'CDB: %s' % ACSCorba.cdb()
    print 'ACSLogSvc: %s' % ACSCorba.acsLogSvc()
    print 'NameService: %s' % ACSCorba.nameService()
Пример #4
0
 def test_client_exists(self):
     ACSCorba.SINGLETON_CLIENT = 'foo'
     self.assertEqual('foo', ACSCorba.getClient())
Пример #5
0
    def test_create_fault(self, clientmock):
        def raiser(*args):
            raise Exception("Boom!")

        clientmock.side_effect = raiser
        self.assertEqual(True, ACSCorba.getClient() is None)
Пример #6
0
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307  USA
#
# @(#) $Id: acspyTestAcsCORBA.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $
###############################################################################
'''
Tests CORBA access.
'''
from Acspy.Util import ACSCorba
###############################################################################
if __name__ == '__main__':
    print 'Manager corbaloc: %s' % ACSCorba.getManagerCorbaloc()
    print 'ORB: %s' % ACSCorba.getORB()
    print 'POA ROOT: %s' % ACSCorba.getPOARoot()
    print 'POA Manager: %s' % ACSCorba.getPOAManager()
    print 'Manager: %s' % ACSCorba.getManager()
    print 'Client: %s' % ACSCorba.getClient()
    print 'Log: %s' % ACSCorba.log()
    print 'LogFactory: %s' % ACSCorba.logFactory()
    print 'NotifyEventChannelFactory: %s' % ACSCorba.notifyEventChannelFactory(
    )
    print 'ArchivingChannel: %s' % ACSCorba.archivingChannel()
    print 'LoggingChannel: %s' % ACSCorba.loggingChannel()
    print 'InterfaceRepository: %s' % ACSCorba.interfaceRepository()
    print 'CDB: %s' % ACSCorba.cdb()
    print 'ACSLogSvc: %s' % ACSCorba.acsLogSvc()
    print 'NameService: %s' % ACSCorba.nameService()
Пример #7
0
 def test_ok(self, clientmock):
     self.assertEqual(False, ACSCorba.getClient() is None)
Пример #8
0
    def test_create_fault(self, clientmock):
        def raiser(*args):
            raise Exception("Boom!")

        clientmock.side_effect = raiser
        self.assertEqual(True, ACSCorba.getClient() is None)
Пример #9
0
 def test_client_exists(self):
     ACSCorba.SINGLETON_CLIENT = 'foo'
     self.assertEqual('foo', ACSCorba.getClient())
Пример #10
0
 def test_client_exists(self):
     ACSCorba.SINGLETON_CLIENT = "foo"
     self.assertEqual("foo", ACSCorba.getClient())