[Zope-Checkins] CVS: Zope3/src/ZEO/tests - Cache.py:1.11.10.1
CommitLockTests.py:1.18.10.1 ConnectionTests.py:1.52.4.1
InvalidationTests.py:1.10.10.1 ThreadTests.py:1.8.4.1
Jeremy Hylton
jeremy at zope.com
Wed Mar 31 17:05:44 EST 2004
Update of /cvs-repository/Zope3/src/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv16247/src/ZEO/tests
Modified Files:
Tag: jeremy-txn-branch
Cache.py CommitLockTests.py ConnectionTests.py
InvalidationTests.py ThreadTests.py
Log Message:
ZODB.Transaction -> transaction.
=== Zope3/src/ZEO/tests/Cache.py 1.11 => 1.11.10.1 ===
--- Zope3/src/ZEO/tests/Cache.py:1.11 Wed Feb 18 16:27:40 2004
+++ Zope3/src/ZEO/tests/Cache.py Wed Mar 31 17:05:43 2004
@@ -13,9 +13,10 @@
##############################################################################
"""Tests of the ZEO cache"""
-from ZODB.Transaction import Transaction
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle
+
+from transaction import Transaction
class TransUndoStorageWithCache:
=== Zope3/src/ZEO/tests/CommitLockTests.py 1.18 => 1.18.10.1 ===
--- Zope3/src/ZEO/tests/CommitLockTests.py:1.18 Wed Feb 18 16:27:40 2004
+++ Zope3/src/ZEO/tests/CommitLockTests.py Wed Mar 31 17:05:43 2004
@@ -16,8 +16,8 @@
import threading
import time
-from ZODB.Transaction import Transaction
from persistent.TimeStamp import TimeStamp
+import transaction
from ZODB.tests.StorageTestBase import zodb_pickle, MinPO
import ZEO.ClientStorage
@@ -97,7 +97,7 @@
self._storages = []
def _start_txn(self):
- txn = Transaction()
+ txn = transaction.Transaction()
self._storage.tpc_begin(txn)
oid = self._storage.new_oid()
self._storage.store(oid, ZERO, zodb_pickle(MinPO(1)), '', txn)
@@ -112,7 +112,7 @@
for i in range(self.NUM_CLIENTS):
storage = self._duplicate_client()
- txn = Transaction()
+ txn = transaction.Transaction()
tid = self._get_timestamp()
t = WorkerThread(self, storage, txn)
=== Zope3/src/ZEO/tests/ConnectionTests.py 1.52 => 1.52.4.1 ===
--- Zope3/src/ZEO/tests/ConnectionTests.py:1.52 Thu Feb 26 19:31:52 2004
+++ Zope3/src/ZEO/tests/ConnectionTests.py Wed Mar 31 17:05:43 2004
@@ -29,13 +29,15 @@
from ZEO.tests import forker
from ZODB.DB import DB
-from ZODB.Transaction import get_transaction, Transaction
from ZODB.POSException import ReadOnlyError, ConflictError
from ZODB.tests.StorageTestBase import StorageTestBase
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase \
import zodb_pickle, zodb_unpickle, handle_all_serials, handle_serials
+import transaction
+from transaction import Transaction
+
ZERO = '\0'*8
class TestServerStub(ZEO.ServerStub.StorageServer):
@@ -465,7 +467,7 @@
zLOG.LOG("checkReconnection", zLOG.INFO,
"Error after server restart; retrying.",
error=sys.exc_info())
- get_transaction().abort()
+ transaction.abort()
# Give the other thread a chance to run.
time.sleep(0.1)
zLOG.LOG("checkReconnection", zLOG.INFO, "finished")
@@ -552,7 +554,7 @@
r1 = c1.root()
r1["a"] = MinPO("a")
- get_transaction().commit()
+ transaction.commit()
db2 = DB(self.openClientStorage())
r2 = db2.open().root()
@@ -560,7 +562,7 @@
self.assertEqual(r2["a"].value, "a")
r2["b"] = MinPO("b")
- get_transaction().commit()
+ transaction.commit()
# make sure the invalidation is received in the other client
for i in range(10):
=== Zope3/src/ZEO/tests/InvalidationTests.py 1.10 => 1.10.10.1 ===
--- Zope3/src/ZEO/tests/InvalidationTests.py:1.10 Tue Jan 6 20:46:14 2004
+++ Zope3/src/ZEO/tests/InvalidationTests.py Wed Mar 31 17:05:43 2004
@@ -16,6 +16,8 @@
import time
from random import Random
+import transaction
+
from BTrees.check import check, display
from BTrees.OOBTree import OOBTree
@@ -70,8 +72,7 @@
self.step = step
self.sleep = sleep
self.added_keys = []
- self.cn = self.db.open()
- self.cn.setLocalTransaction()
+ self.cn = self.db.open(txn_mgr=transaction.TransactionManager())
self.cn.sync()
def doStep(self):
=== Zope3/src/ZEO/tests/ThreadTests.py 1.8 => 1.8.4.1 ===
--- Zope3/src/ZEO/tests/ThreadTests.py:1.8 Thu Feb 26 19:31:52 2004
+++ Zope3/src/ZEO/tests/ThreadTests.py Wed Mar 31 17:05:43 2004
@@ -15,9 +15,8 @@
import threading
-from ZODB.Transaction import Transaction
+import transaction
from ZODB.tests.StorageTestBase import zodb_pickle, MinPO
-
import ZEO.ClientStorage
ZERO = '\0'*8
@@ -25,7 +24,7 @@
class BasicThread(threading.Thread):
def __init__(self, storage, doNextEvent, threadStartedEvent):
self.storage = storage
- self.trans = Transaction()
+ self.trans = transaction.Transaction()
self.doNextEvent = doNextEvent
self.threadStartedEvent = threadStartedEvent
self.gotValueError = 0
More information about the Zope-Checkins
mailing list