[isidorus-cvs] r7 - in trunk/src: . atom model unit_tests
Christoph Ludwig
cludwig at common-lisp.net
Sat Jan 31 19:23:44 UTC 2009
Author: cludwig
Date: Sat Jan 31 19:23:44 2009
New Revision: 7
Log:
fix <dependency> in collection feed; fix <updated> in snapshot and fragments feed
Added:
trunk/src/unit_tests/atom-conf.lisp
- copied, changed from r6, /trunk/src/atom/conf.lisp
Modified:
trunk/src/atom/atom.lisp
trunk/src/atom/collection.lisp
trunk/src/atom/conf.lisp
trunk/src/atom/confreader.lisp
trunk/src/atom/fragments.lisp
trunk/src/atom/snapshots.lisp
trunk/src/isidorus.asd
trunk/src/model/changes.lisp
trunk/src/unit_tests/atom_test.lisp
trunk/src/unit_tests/fixtures.lisp
trunk/src/unit_tests/unittests-constants.lisp
Modified: trunk/src/atom/atom.lisp
==============================================================================
--- trunk/src/atom/atom.lisp (original)
+++ trunk/src/atom/atom.lisp Sat Jan 31 19:23:44 2009
@@ -2,7 +2,7 @@
(:use :cl :cxml :constants :xml-tools :datamodel :drakma)
(:export :collection-feed
:defsite
- :depends-on
+ :dependency
:entries
:feed
:feed-to-elem
Modified: trunk/src/atom/collection.lisp
==============================================================================
--- trunk/src/atom/collection.lisp (original)
+++ trunk/src/atom/collection.lisp Sat Jan 31 19:23:44 2009
@@ -1,8 +1,8 @@
(in-package :atom)
(defclass collection-feed (feed)
- ((depends-on :accessor depends-on
- :initarg :depends-on :initform nil
+ ((dependency :accessor dependency
+ :initarg :dependency :initform nil
:type list
:documentation "URLs of the feeds that this feed depends on")
(source-locator-prefix
@@ -12,8 +12,8 @@
(defmethod feed-to-elem ((feed collection-feed))
(setf (updated feed) (get-most-recent-datetime-for-tm (id feed)))
- (when (depends-on feed)
- (to-elem "e:depends-on" (depends-on feed))))
+ (dolist (dependency (dependency feed))
+ (to-elem "e:dependency" dependency)))
(defclass collection-entry (entry)
((link-type :accessor link-type
Modified: trunk/src/atom/conf.lisp
==============================================================================
--- trunk/src/atom/conf.lisp (original)
+++ trunk/src/atom/conf.lisp Sat Jan 31 19:23:44 2009
@@ -31,7 +31,7 @@
(relative-path "worms")
(author "Isidor")
(source-locator-prefix "http://psi.egovpt.org/tm/worms/")
- (depends-on "http://london.ztt.fh-worms.de:8000/feeds/egov-ontology")
+ (dependency "http://london.ztt.fh-worms.de:8000/feeds/egov-ontology")
(snapshots-feed
(id "http://psi.egovpt.org/tm/worms/snapshots")
Modified: trunk/src/atom/confreader.lisp
==============================================================================
--- trunk/src/atom/confreader.lisp (original)
+++ trunk/src/atom/confreader.lisp Sat Jan 31 19:23:44 2009
@@ -68,7 +68,7 @@
:id (get-confvalue 'id (rest feed))
:title (get-confvalue 'title (rest feed))
:source-locator-prefix source-locator-prefix
- :depends-on (get-conflist 'depends-on (rest feed))
+ :dependency (get-conflist 'dependency (rest feed))
:author (get-confvalue 'author (rest feed))
:path collection-url)))
Modified: trunk/src/atom/fragments.lisp
==============================================================================
--- trunk/src/atom/fragments.lisp (original)
+++ trunk/src/atom/fragments.lisp Sat Jan 31 19:23:44 2009
@@ -19,6 +19,7 @@
(to-elem "e:TopicSI" (psi entry)))
(defmethod feed-to-elem ((feed fragments-feed))
+ (setf (updated feed) (get-most-recent-datetime-for-tm (tm-id feed)))
(to-elem "e:ServerSrcLocatorPrefix" (source-locator-prefix feed)))
(defmethod entries ((feed fragments-feed))
Modified: trunk/src/atom/snapshots.lisp
==============================================================================
--- trunk/src/atom/snapshots.lisp (original)
+++ trunk/src/atom/snapshots.lisp Sat Jan 31 19:23:44 2009
@@ -16,6 +16,7 @@
(to-link (link entry) "alternate" "application/x-tm+xml;version=1.0"))
(defmethod feed-to-elem ((feed snapshots-feed))
+ (setf (updated feed) (get-most-recent-datetime-for-tm (tm-id feed)))
(to-elem "e:ServerSrcLocatorPrefix" (source-locator-prefix feed)))
(defmethod entries ((feed snapshots-feed))
Modified: trunk/src/isidorus.asd
==============================================================================
--- trunk/src/isidorus.asd (original)
+++ trunk/src/isidorus.asd Sat Jan 31 19:23:44 2009
@@ -80,6 +80,7 @@
(:static-file "sample_objects.xtm")
(:static-file "t100.xtm")
(:static-file "atom_test.xtm")
+ (:file "atom-conf")
(:file "unittests-constants"
:depends-on ("dangling_topicref.xtm"
"inconsistent.xtm"
@@ -91,7 +92,8 @@
"duplicate_identifier.xtm"
"inconsistent_2_0.xtm"
"sample_objects.xtm"
- "t100.xtm"))
+ "t100.xtm"
+ "atom-conf"))
(:file "fixtures"
:depends-on ("unittests-constants"))
(:file "importer_test"
Modified: trunk/src/model/changes.lisp
==============================================================================
--- trunk/src/model/changes.lisp (original)
+++ trunk/src/model/changes.lisp Sat Jan 31 19:23:44 2009
@@ -26,6 +26,7 @@
(pushnew (start-revision vi) revision-set))
(sort revision-set #'<)))
+
(defun find-associations-for-topic (top)
"find all associations of this topic"
(let
Copied: trunk/src/unit_tests/atom-conf.lisp (from r6, /trunk/src/atom/conf.lisp)
==============================================================================
--- /trunk/src/atom/conf.lisp (original)
+++ trunk/src/unit_tests/atom-conf.lisp Sat Jan 31 19:23:44 2009
@@ -31,7 +31,7 @@
(relative-path "worms")
(author "Isidor")
(source-locator-prefix "http://psi.egovpt.org/tm/worms/")
- (depends-on "http://london.ztt.fh-worms.de:8000/feeds/egov-ontology")
+ (dependency "http://london.ztt.fh-worms.de:8000/feeds/egov-ontology")
(snapshots-feed
(id "http://psi.egovpt.org/tm/worms/snapshots")
Modified: trunk/src/unit_tests/atom_test.lisp
==============================================================================
--- trunk/src/unit_tests/atom_test.lisp (original)
+++ trunk/src/unit_tests/atom_test.lisp Sat Jan 31 19:23:44 2009
@@ -52,9 +52,9 @@
(datetime-revision1
(atom::datetime-in-iso-format fixtures::revision1))
(collection-feed-string
- (format nil "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Topicmaps on psi.egovpt.org</a:title><a:id>http://london.ztt.fh-worms.de:8000/feeds</a:id><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds\" rel=\"self\"></a:link><a:updated>~a</a:updated><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Data behind the portal of the city of Worms</a:title><a:id>http://psi.egovpt.org/tm/worms/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"alternate\" type=\"application/atom+xml\"></a:link><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"collection-feed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>eGov Reference Ontology</a:title><a:id>http://psi.egovpt.org/tm/egov-ontology/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"alternate\" type=\"application/atom+xml\"></a:link><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"collection-feed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry></a:feed>" datetime-revision3 datetime-revision3 datetime-revision1))
+ (format nil "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Topicmaps on psi.egovpt.org</a:title><a:id>http://london.ztt.fh-worms.de:8000/feeds</a:id><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds\" rel=\"self\"></a:link><a:updated>~a</a:updated><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Data behind the portal of the city of Worms</a:title><a:id>http://psi.egovpt.org/tm/worms/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"alternate\" type=\"application/atom+xml\"></a:link><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"http://www.egovpt.org/sdshare/collectionfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>eGov Reference Ontology</a:title><a:id>http://psi.egovpt.org/tm/egov-ontology/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"alternate\" type=\"application/atom+xml\"></a:link><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/egov-ontology\" rel=\"http://www.egovpt.org/sdshare/collectionfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry></a:feed>" datetime-revision3 datetime-revision3 datetime-revision1))
(worms-feed-string
- (format nil "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Data behind the portal of the city of Worms</a:title><a:id>http://london.ztt.fh-worms.de:8000/feeds/worms</a:id><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"self\"></a:link><e:depends-on>http://london.ztt.fh-worms.de:8000/feeds/egov-ontology</e:depends-on><a:updated>~a</a:updated><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Snapshots of the Worms data</a:title><a:id>http://psi.egovpt.org/tm/worms/snapshots/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/snapshots\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/snapshots\" rel=\"http://www.egovpt.org/sdshare/snapshotsfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>A list of all change fragments for the Worms data</a:title><a:id>http://psi.egovpt.org/tm/worms/fragments/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/fragments\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/fragments\" rel=\"http://www.egovpt.org/sdshare/fragmentsfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry></a:feed>" datetime-revision3 datetime-revision3 datetime-revision3)))
+ (format nil "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Data behind the portal of the city of Worms</a:title><a:id>http://london.ztt.fh-worms.de:8000/feeds/worms</a:id><a:author><a:name>Isidor</a:name></a:author><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms\" rel=\"self\"></a:link><e:dependency>http://london.ztt.fh-worms.de:8000/feeds/egov-ontology</e:dependency><a:updated>~a</a:updated><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>Snapshots of the Worms data</a:title><a:id>http://psi.egovpt.org/tm/worms/snapshots/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/snapshots\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/snapshots\" rel=\"http://www.egovpt.org/sdshare/snapshotsfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry><a:entry xmlns:a=\"http://www.w3.org/2005/Atom\" xmlns:e=\"http://www.egovpt.org/sdshare/\"><a:title>A list of all change fragments for the Worms data</a:title><a:id>http://psi.egovpt.org/tm/worms/fragments/entry</a:id><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/fragments\" rel=\"alternate\"></a:link><a:link href=\"http://london.ztt.fh-worms.de:8000/feeds/worms/fragments\" rel=\"http://www.egovpt.org/sdshare/fragmentsfeed\" type=\"application/atom+xml\"></a:link><a:updated>~a</a:updated></a:entry></a:feed>" datetime-revision3 datetime-revision3 datetime-revision3)))
(is
(string=
collection-feed-string
@@ -114,6 +114,10 @@
(find 'atom::snapshots-feed
(atom:subfeeds ont-feed)
:key #'type-of)))))
+ (format t "~a"
+ (cxml:with-xml-output
+ (cxml:make-string-sink :canonical t)
+ (atom:feed-to-elem snapshots-feed)))
)))
(test test-collection-configuration ()
@@ -174,7 +178,7 @@
(is-false
(set-exclusive-or
'(() ("http://london.ztt.fh-worms.de:8000/feeds/egov-ontology"))
- (mapcar #'atom:depends-on collection-feeds) :test #'equal))
+ (mapcar #'atom:dependency collection-feeds) :test #'equal))
;;test types for feeds
(is-false
Modified: trunk/src/unit_tests/fixtures.lisp
==============================================================================
--- trunk/src/unit_tests/fixtures.lisp (original)
+++ trunk/src/unit_tests/fixtures.lisp Sat Jan 31 19:23:44 2009
@@ -132,7 +132,7 @@
;;test configuration
;(defparameter *tm-feed* nil)
(setf atom:*base-url* "http://london.ztt.fh-worms.de:8000")
- (load "atom/conf.lisp"))
+ (load *atom-conf.lisp*))
(def-fixture atom-test-db ()
(setf *XTM-TM* *NOTIFICATIONBASE-TM*)
Modified: trunk/src/unit_tests/unittests-constants.lisp
==============================================================================
--- trunk/src/unit_tests/unittests-constants.lisp (original)
+++ trunk/src/unit_tests/unittests-constants.lisp Sat Jan 31 19:23:44 2009
@@ -18,7 +18,8 @@
:*inconsistent_2_0.xtm*
:*sample_objects.xtm*
:*t100.xtm*
- :*atom_test.xtm*))
+ :*atom_test.xtm*
+ :*atom-conf.lisp*))
(in-package :unittests-constants)
@@ -75,3 +76,7 @@
(defparameter *atom_test.xtm*
(asdf:component-pathname
(asdf:find-component *unit-tests-component* "atom_test.xtm")))
+
+(defparameter *atom-conf.lisp*
+ (asdf:component-pathname
+ (asdf:find-component *unit-tests-component* "atom-conf")))
More information about the Isidorus-cvs
mailing list