[isidorus-cvs] r170 - in trunk/src: model unit_tests xml/xtm

Lukas Giessmann lgiessmann at common-lisp.net
Thu Dec 10 18:23:13 UTC 2009


Author: lgiessmann
Date: Thu Dec 10 13:23:13 2009
New Revision: 170

Log:
fixed ticket #50 --> some unit-test have to be adapted; changed the delete-construct method in the data model --> if a reified construct is deleted the reifier-topic is also deleted

Modified:
   trunk/src/model/datamodel.lisp
   trunk/src/unit_tests/reification_test.lisp
   trunk/src/xml/xtm/core_psis.xtm

Modified: trunk/src/model/datamodel.lisp
==============================================================================
--- trunk/src/model/datamodel.lisp	(original)
+++ trunk/src/model/datamodel.lisp	Thu Dec 10 13:23:13 2009
@@ -642,7 +642,9 @@
   (dolist (id (item-identifiers construct))
     (delete-construct id))
   (when (reifier construct)
-    (remove-reifier construct)))
+    (let ((reifier-topic (reifier construct)))
+      (remove-reifier construct)
+      (delete-construct reifier-topic))))
 
 (defgeneric item-identifiers-p (constr)
   (:documentation "Test for the existence of item identifiers")

Modified: trunk/src/unit_tests/reification_test.lisp
==============================================================================
--- trunk/src/unit_tests/reification_test.lisp	(original)
+++ trunk/src/unit_tests/reification_test.lisp	Thu Dec 10 13:23:13 2009
@@ -296,13 +296,8 @@
 			  t)
 		 (condition () nil)))
       (is-false (occurrences homer))
-      (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 12))
-      (is-true (handler-case 
-		   (progn (d::delete-construct reifier-occurrence)
-			  t)
-		 (condition () nil)))))
       (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 11))
-      (elephant:close-store))))
+      (elephant:close-store))))))
 
 
 (test test-xtm2.0-reification
@@ -365,13 +360,8 @@
 			  t)
 		 (condition () nil)))
       (is-false (occurrences homer))
-      (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 12))
-      (is-true (handler-case 
-		   (progn (d::delete-construct reifier-occurrence)
-			  t)
-		 (condition () nil)))))
       (is (= (length (elephant:get-instances-by-class 'd:TopicC)) 11))
-      (elephant:close-store))))
+      (elephant:close-store))))))
 
 
 (test test-xtm1.0-reification-exporter

Modified: trunk/src/xml/xtm/core_psis.xtm
==============================================================================
--- trunk/src/xml/xtm/core_psis.xtm	(original)
+++ trunk/src/xml/xtm/core_psis.xtm	Thu Dec 10 13:23:13 2009
@@ -51,24 +51,24 @@
     </name>
   </topic>
 
-  <topic id="superclass-subclass">
-    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#superclass-subclass"/>
+  <topic id="supertype-subtype">
+    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#supertype-subtype"/>
     <name>
-      <value>superclass-subclass</value>
+      <value>supertype-subtype</value>
     </name>
   </topic>
 
-  <topic id="superclass">
-    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#superclass"/>
+  <topic id="supertype">
+    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#supertype"/>
     <name>
-      <value>superclass</value>
+      <value>supertype</value>
     </name>
   </topic>
 
-  <topic id="subclass">
-    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#subclass"/>
+  <topic id="subtype">
+    <subjectIdentifier href="http://www.topicmaps.org/xtm/1.0/core.xtm#subtype"/>
     <name>
-      <value>subclass</value>
+      <value>subtype</value>
     </name>
   </topic>
 




More information about the Isidorus-cvs mailing list