[elephant-cvs] CVS elephant/tests
ieslick
ieslick at common-lisp.net
Wed Apr 26 17:53:56 UTC 2006
Update of /project/elephant/cvsroot/elephant/tests
In directory clnet:/tmp/cvs-serv12311/tests
Modified Files:
testindexing.lisp testmigration.lisp
Log Message:
Significant additions to the 0.6.0 release on the trunk. Updates to
documentation, 0.5.0 compliance, final on 0.6.0 features. There are
one or two BDB interactions on migration to work out but this should
be a nearly code complete 0.6.0 release. Please start testing and
evaluating this - especially the ability to open and tag 0.5.0 databases.
Features:
- Database version tagging
- Support for 0.5.0 namespaces & databases
- New migration system
- class indexing without slot indexing
- various bug fixes
- reverted fast allegro/sbcl string support to
allow 0.5.0 databases to work correctly. I
couldn't find a good way to work around this
without creating infinite headaches
- validated that running db_deadlock will stop all
lisp freezes that I've encountered. This has to
be run each time a DB environment is opened/created
so eventually should be made part of the open-controller
functionality for the BDB backend
--- /project/elephant/cvsroot/elephant/tests/testindexing.lisp 2006/03/01 18:57:34 1.15
+++ /project/elephant/cvsroot/elephant/tests/testindexing.lisp 2006/04/26 17:53:45 1.16
@@ -209,7 +209,8 @@
(values
(eq (length r1) 1)
(signals-error (get-instances-by-value 'idx-five-del 'slot1 1))
- (null (get-value 'idx-five-del (elephant::controller-class-root *store-controller*))))))
+ (null (get-index (get-value 'idx-five-del (elephant::controller-class-root *store-controller*))
+ 'slot1)))))
t t t)
(deftest indexing-reconnect-db
@@ -368,24 +369,24 @@
;; create 500 objects, write each object's slots
+(defvar normal-index nil)
+
(defclass stress-normal ()
((stress1 :accessor stress1 :initarg :stress1 :initform nil :index nil)
(stress2 :accessor stress2 :initarg :stress2 :initform nil :index nil))
(:metaclass persistent-metaclass))
+(defun normal-stress-setup (count class-name &rest inst-args)
+ (setf normal-index (make-btree))
+ (dotimes (i count)
+ (setf (get-value i normal-index) (apply #'make-instance class-name :stress1 i inst-args))))
+
(defclass stress-index ()
((stress1 :accessor stress1 :initarg :stress1 :initform nil :index t)
(stress2 :accessor stress2 :initarg :stress2 :initform 2 :index t)
(stress3 :accessor stress3 :initarg :stress3 :initform 3 :index nil))
(:metaclass persistent-metaclass))
-(defvar normal-index nil)
-
-(defun normal-stress-setup (count class-name &rest inst-args)
- (setf normal-index (make-btree))
- (dotimes (i count)
- (setf (get-value i normal-index) (apply #'make-instance class-name :stress1 i inst-args))))
-
(defun indexed-stress-setup (count class-name &rest inst-args)
(dotimes (i count)
(apply #'make-instance class-name :stress1 i inst-args)))
--- /project/elephant/cvsroot/elephant/tests/testmigration.lisp 2006/03/07 14:12:22 1.11
+++ /project/elephant/cvsroot/elephant/tests/testmigration.lisp 2006/04/26 17:53:45 1.12
@@ -13,14 +13,6 @@
(in-package :ele-tests)
-;; TEST TODO:
-;; - inhibited slot copy & user overloading of migrate methodss
-;; - proper use of clearing the tracking of copies
-;; (oids not same over two copys of same object)
-;; - whole repository migration (write comparison method to sanity check)
-;; - transient slot migration is correct (online transfer of state to new repos)
-;; -
-
(deftest remove-element
(if (or (not (boundp '*test-spec-secondary*))
(null *test-spec-secondary*))
@@ -173,14 +165,15 @@
;; (format t "Opening store~%")
(let ((*auto-commit* nil)
(sc2 (open-store *test-spec-secondary* :recover t))
- (sc1 (open-store *test-spec-primary* :recover t)))
- (declare (special *auto-commit*))
+ (sc1 (open-store *test-spec-primary* :recover t))
+ (*store-controller* nil))
+ (declare (special *auto-commit* *store-controller*))
(unwind-protect
;; ensure class index is initialized in sc1
(progn
(setf (elephant::%index-cache (find-class 'ipfoo)) nil)
(find-class-index 'ipfoo :sc sc1)
-;; (format t "Making objects~%")
+ (format t "Making objects~%")
(with-transaction (:store-controller sc2)
(drop-instances (get-instances-by-class 'ipfoo) :sc sc2))
(with-transaction (:store-controller sc1)
@@ -188,12 +181,12 @@
(make-instance 'ipfoo :slot1 1 :sc sc1)
(make-instance 'ipfoo :slot1 10 :sc sc1)
(make-instance 'ipfoo :slot1 20 :sc sc1))
-;; (format t "Migrating~%")
+ (format t "Migrating~%")
(migrate sc2 sc1)
;; Make sure our ipfoo class now points at a cache in sc2!
(assert (equal (elephant::controller-spec sc2)
(:dbcn-spc-pst (elephant::%index-cache (find-class 'ipfoo)))))
-;; (format t "Fetching~%")
+ (format t "Fetching~%")
(let ((fm1 (get-instances-by-value 'ipfoo 'slot1 1))
(fm2 (get-instances-by-value 'ipfoo 'slot1 10))
(fm3 (get-instances-by-value 'ipfoo 'slot1 20))
More information about the Elephant-cvs
mailing list