Example #1
0

# 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):
    def setUp(self):
        self.ps = Server.getService("PersistenceService")
        self.ms = Server.getService("MappingService")
Example #2
0

# 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 MoneyWidget import MoneyWidget, MoneyWidgetHome
Server.loadConfig(MoneyWidget, 'MoneyWidget.cfg')
Server.registerEntity(MoneyWidgetHome, MoneyWidget)

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

orb = Server.orb
MoneyWidgetHome = orb.string_to_object("corbaname:rir:#moneyWidgetHome")

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

import epo

class Test(unittest.TestCase):