[isidorus-cvs] r403 - trunk/src/unit_tests

Lukas Giessmann lgiessmann at common-lisp.net
Fri Apr 1 13:30:30 UTC 2011


Author: lgiessmann
Date: Fri Apr  1 09:30:30 2011
New Revision: 403

Log:
TM-SPARQL: finsihed the unit-tests for the special-uri tms:scope

Modified:
   trunk/src/unit_tests/sparql_test.lisp
   trunk/src/unit_tests/sparql_test.xtm

Modified: trunk/src/unit_tests/sparql_test.lisp
==============================================================================
--- trunk/src/unit_tests/sparql_test.lisp	(original)
+++ trunk/src/unit_tests/sparql_test.lisp	Fri Apr  1 09:30:30 2011
@@ -1858,6 +1858,30 @@
 	   r-1))))
 
 
+(test test-all-7
+  "Tests the entire module with the file sparql_test.xtm"
+  (with-fixture with-tm-filled-db ("data_base" *sparql_test.xtm*)
+    (tm-sparql:init-tm-sparql)
+    (let* ((q-1 (concat
+		 "PREFIX tms:<http://www.networkedplanet.com/tmsparql/>
+                  SELECT * WHERE {
+                   <http://some.where/ii/zb/occurrence> tms:scope ?scope.
+                   ?owner tms:scope <http://some.where/tmsparql/de>"
+                 "}"))
+	   (r-1 (tm-sparql:result (make-instance 'TM-SPARQL:SPARQL-Query :query q-1))))
+      (is-true (= (length r-1) 2))
+      (map 'list #'(lambda(item)
+		     (cond ((string= (getf item :variable) "scope")
+			    (is (string= (first (getf item :result))
+					 "<http://some.where/tmsparql/de>")))
+			   ((string= (getf item :variable) "owner")
+			    (is (string= (first (getf item :result))
+					 "<http://some.where/ii/zb/occurrence>")))
+			   (t
+			    (is-true (format t "bad variable-name found")))))
+	   r-1))))
+
+
 
 
 ;TODO: tms:scope, tms:value, complex filter

Modified: trunk/src/unit_tests/sparql_test.xtm
==============================================================================
--- trunk/src/unit_tests/sparql_test.xtm	(original)
+++ trunk/src/unit_tests/sparql_test.xtm	Fri Apr  1 09:30:30 2011
@@ -191,6 +191,7 @@
       <tm:value>Der Zauberlehrling</tm:value>
     </tm:name>
     <tm:occurrence>
+      <tm:itemIdentity href="http://some.where/ii/zb/occurrence"/>
       <tm:type><tm:topicRef href="#poem-content"/></tm:type>
       <tm:scope><tm:topicRef href="#de"/></tm:scope>
       <tm:resourceData datatype="http://www.w3.org/2001/XMLSchema#string">Hat der alte Hexenmeister




More information about the Isidorus-cvs mailing list