Commit ce663632 authored by Barry Warsaw's avatar Barry Warsaw

For alignment with ZODB4, renaming these storages for ZODB3 3.2.

bsddb3Storage becomes BDBStorage
Full becomes BDBFullStorage
Minimal becomes BDBMinimalStorage

Removing MinimalReplicated.py, Packless.py, and base.py
parent 8706e6a1
......@@ -38,10 +38,9 @@ class FileStorageConfig:
class BerkeleyStorageConfig:
def getConfig(self, path, create, read_only):
# Full always creates and doesn't have a read_only flag
return """\
<Storage>
type Full
type BDBFullStorage
name %s
read_only %s
</Storage>""" % (path, read_only)
......@@ -77,7 +76,7 @@ class BDBReconnectionTests(
test_classes = [FileStorageConnectionTests, FileStorageReconnectionTests]
try:
from bsddb3Storage.Full import Full
from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError:
pass
else:
......
......@@ -160,14 +160,14 @@ class FileStorageTests(GenericTests):
class BDBTests(FileStorageTests):
"""ZEO backed by a Berkeley Full storage."""
"""ZEO backed by a Berkeley full storage."""
def getStorage(self):
self._envdir = tempfile.mktemp()
# Return a 1-tuple
return """\
<Storage>
type Full
type BDBFullStorage
name %s
</Storage>
""" % self._envdir
......@@ -176,7 +176,7 @@ class BDBTests(FileStorageTests):
test_classes = [FileStorageTests]
try:
from bsddb3Storage.Full import Full
from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError:
pass
else:
......
......@@ -93,7 +93,7 @@ def convertClientStorageArgs(addr=None, **kw):
def convertBDBStorageArgs(**kw):
from bsddb3Storage.BerkeleyBase import BerkeleyConfig
from BDBStorage.BerkeleyBase import BerkeleyConfig
config = BerkeleyConfig()
for name in dir(BerkeleyConfig):
if name.startswith('_'):
......@@ -116,6 +116,7 @@ storage_types = {
'MappingStorage': ('ZODB.MappingStorage', None),
'TemporaryStorage': ('Products.TemporaryFolder.TemporaryStorage', None),
'ClientStorage': ('ZEO.ClientStorage', convertClientStorageArgs),
'Full': ('bsddb3Storage.Full', convertBDBStorageArgs),
'Minimal': ('bsddb3Storage.Minimal', convertBDBStorageArgs),
'BDBFullStorage': ('BDBStorage.BDBFullStorage', convertBDBStorageArgs),
'BDBMinimalStorage': ('BDBStorage.BDBMinimalStorage',
convertBDBStorageArgs),
}
......@@ -38,7 +38,7 @@ class StorageTestCase(unittest.TestCase):
except:
pass
try:
# Full storage creates a directory
# BDBFullStorage storage creates a directory
if os.path.isdir(self.tmpfn):
shutil.rmtree(self.tmpfn)
else:
......@@ -117,12 +117,12 @@ class StorageTestCase(unittest.TestCase):
def testFullStorage(self):
try:
from bsddb3Storage.Full import Full
from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError:
return
sample = """
<Storage>
type Full
type BDBFullStorage
name %s
cachesize 1000
</Storage>
......@@ -132,24 +132,24 @@ class StorageTestCase(unittest.TestCase):
rootconf = ZConfig.loadfile(io)
storageconf = rootconf.getSection("Storage")
cls, args = StorageConfig.getStorageInfo(storageconf)
self.assertEqual(cls, Full)
self.assertEqual(cls, BDBFullStorage)
# It's too hard to test the config instance equality
args = args.copy()
del args['config']
self.assertEqual(args, {"name": self.tmpfn})
self.storage = StorageConfig.createStorage(storageconf)
self.assert_(isinstance(self.storage, Full))
self.assert_(isinstance(self.storage, BDBFullStorage))
# XXX _config isn't public
self.assert_(self.storage._config.cachesize, 1000)
def testMinimalStorage(self):
try:
from bsddb3Storage.Minimal import Minimal
from BDBStorage.BDBMinimalStorage import BDBMinimalStorage
except ImportError:
return
sample = """
<Storage>
type Minimal
type BDBMinimalStorage
name %s
cachesize 1000
</Storage>
......@@ -159,13 +159,13 @@ class StorageTestCase(unittest.TestCase):
rootconf = ZConfig.loadfile(io)
storageconf = rootconf.getSection("Storage")
cls, args = StorageConfig.getStorageInfo(storageconf)
self.assertEqual(cls, Minimal)
self.assertEqual(cls, BDBMinimalStorage)
# It's too hard to test the config instance equality
args = args.copy()
del args['config']
self.assertEqual(args, {"name": self.tmpfn})
self.storage = StorageConfig.createStorage(storageconf)
self.assert_(isinstance(self.storage, Minimal))
self.assert_(isinstance(self.storage, BDBMinimalStorage))
# XXX _config isn't public
self.assert_(self.storage._config.cachesize, 1000)
......
......@@ -33,7 +33,7 @@ import operator
from time import time as now
from ZODB.FileStorage import FileStorage
#from bsddb3Storage.Full import Full
#from BDBStorage.BDBFullStorage import BDBFullStorage
#from Standby.primary import PrimaryStorage
#from Standby.config import RS_PORT
from ZODB.Transaction import Transaction
......@@ -281,7 +281,7 @@ def main():
if replay:
storage = FileStorage(storagefile)
#storage = Full(storagefile)
#storage = BDBFullStorage(storagefile)
#storage = PrimaryStorage('yyz', storage, RS_PORT)
t0 = now()
p = ZEOParser(maxtxns, report, storage)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment