Esempio n. 1
0
from Rambler.PersistenceService import InMemoryDataMapper
# Sigh, all these import's have to be done in the proper order
##from Rambler import ZODBPool, ZODBMapper
##from ZODB import FileStorage, Persistent, DB
##from tempfile import mktemp

##tempdir = '/tmp' # Just for now

##filename = mktemp()
##storage = FileStorage.FileStorage(filename)
##db = DB(storage, cache_size=1000)
##Server.registerService(ZODBPool.ZODBConnectionPool(db, 6), "ZODBPool")

from Rambler.ciRelationService import ciRelationService
RS = Server.registerService(ciRelationService, "RelationService")
Server.loadDescriptor('widget.xml')
#RS.registerRelation("relation", Promiscuous())
ES = Server.getService("EventService")
ES.publishEvent("Initializing", Server, "") # Needed to init the ZODB properly

from Rambler.tests.Widget import Widget, WidgetHome
#Server.loadConfig(Widget, 'Widget.cfg')
#Server.registerEntity(WidgetHome, Widget)


# Commit the transaction server starts at init
Server.txn.commit(0)


Esempio n. 2
0
from Rambler import Server
Server.init("giop:tcp::6666")


# Sigh, all these import's have to be done in the proper order
from Rambler import ZODBPool, ZODBMapper
from ZODB import FileStorage, Persistent, DB
from tempfile import mktemp

tempdir = '/tmp' # Just for now

filename = mktemp()
storage = FileStorage.FileStorage(filename)
db = DB(storage, cache_size=1000)
Server.registerService(ZODBPool.ZODBConnectionPool(db, 6), "ZODBPool")

from Widget import Widget, WidgetHome
Server.loadConfig(Widget, 'Widget.cfg')
Server.registerEntity(WidgetHome, Widget)

# Commit the transaction server starts at init
Server.txn.commit(0)


from threading import Thread
from time import time, sleep
from thread import get_ident


class Test(unittest.TestCase):
import logging

logging.basicConfig()
# logging.getLogger("EventChannel").setLevel(logging.DEBUG)
# logging.getLogger("Rambler").setLevel(logging.DEBUG)
# logging.getLogger("ZODBPool").setLevel(logging.DEBUG)


from Rambler import Server

Server.init("giop:tcp::6666")

# from Rambler.PersistenceService import PersistenceService, InMemoryDataMapper
from Rambler.PSQLPool import PSQLPool

Server.registerService(PSQLPool("host=dev2", 20), "PSQLPool")

Server.loadDescriptor("widget.xml")

import Rambler.PostgresMappers

tid = Server.txn.get_transaction_name()
Server.getService("EventService").publishEvent("Initializing", Server, tid)


# from tempfile import mktemp
# from threading import Thread
from time import time

# from thread import get_ident
from Rambler.tests.Widget import Widget
import unittest
import logging
logging.basicConfig()
log = logging.getLogger("EventChannel")
log.setLevel(logging.DEBUG)

from omniORB import importIDL
importIDL('Widget.idl', ['-I../idl'])

from Rambler import Server
Server.init("giop:tcp::6666")
#Server.loadDescriptor('widget.xml')

#from Rambler.tests.Widget import Widget
from Rambler.PSQLPool import PSQLPool
Server.registerService(PSQLPool("",10), "PSQLPool")

from Rambler.HiLowKeyGenService import HiLowKeyGenService, IncrementalKeyGenService, Key
Server.registerService(HiLowKeyGenService, "KeyGenService")
Server.registerService(IncrementalKeyGenService, "IKeyGenService")

from Rambler.SQLDescriptionService import PostgresSQLDescriptionService
sqld=Server.registerService(PostgresSQLDescriptionService, "SQLDescriptionService")


from Rambler.PostgresMappers import PostgresEntityMapper, PostgresRelationMapper, PostgresKeyMapper

ED = Server.getService("EntityDescriptionService")
MS = Server.getService("MappingService")

from Rambler.ciRelationService import SingleRelationRecord, ManyRelationRecord, RelationDiary