Changeset 316 for branches/new-datamodel/src/unit_tests
- Timestamp:
- 09/27/10 20:26:49 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/new-datamodel/src/unit_tests/exporter_xtm1.0_test.lisp ¶
r306 r316 391 391 return (identified-construct item))) 392 392 (t100-start-revision (d::start-revision (first (d::versions t100))))) 393 394 393 (d:get-fragments t100-start-revision) 395 394 (let ((t100-fragment (loop for item in (elephant:get-instances-by-class 'FragmentC) 396 395 when (eq (topic item) t100) 397 396 return item))) 398 399 397 (with-open-file (stream *out-xtm1.0-file* :direction :output) 400 398 (write-string (export-xtm-fragment t100-fragment :xtm-format '1.0) stream)))) … … 444 442 (handler-case (delete-file *out-xtm1.0-file*)(error () )) ;deletes file - if exist 445 443 (export-xtm *out-xtm1.0-file* :revision fixtures::revision1 :xtm-format '1.0) 446 (let ((document (dom:document-element (cxml:parse-file *out-xtm1.0-file* (cxml-dom:make-dom-builder)))) 444 (let ((document 445 (dom:document-element 446 (cxml:parse-file *out-xtm1.0-file* (cxml-dom:make-dom-builder)))) 447 447 (t100-occurrences-resourceData (list "The ISO 19115 standard ..." "2003-01-01"))) ;local value->no type 448 448 (check-document-structure document 47 7 :ns-uri *xtm1.0-ns*) … … 1122 1122 (loop for item in (elephant:get-instances-by-class 'd:PersistentIdC) 1123 1123 when (string= (uri item) new-t100-psi) 1124 return (identified-construct item ))))1124 return (identified-construct item :revision fixtures::revision3)))) 1125 1125 (d:get-fragments fixtures::revision3) 1126 1126 (let ((fragment (loop for item in (elephant:get-instances-by-class 'd:FragmentC) … … 1129 1129 (with-open-file (stream *out-xtm1.0-file* :direction :output) 1130 1130 (write-string (export-xtm-fragment fragment :xtm-format '1.0) stream)))) 1131 1132 1131 (let ((document 1133 1132 (dom:document-element 1134 1133 (cxml:parse-file *out-xtm1.0-file* (cxml-dom:make-dom-builder))))) 1135 (check-document-structure document 6 0:ns-uri *xtm1.0-ns*)1134 (check-document-structure document 9 1 :ns-uri *xtm1.0-ns*) 1136 1135 (loop for topic across (xpath-child-elems-by-qname document *xtm1.0-ns* "topic") 1137 1136 do (loop for subjectIndicatorRef across (xpath-child-elems-by-qname … … 1146 1145 ((string= href core-display-psi) 1147 1146 (check-topic-id topic)) 1147 ((string= href constants:*type-instance-psi*) 1148 (check-topic-id topic)) 1149 ((string= href constants:*type-psi*) 1150 (check-topic-id topic)) 1151 ((string= href constants:*instance-psi*) 1152 (check-topic-id topic)) 1148 1153 ((string= href t50a-psi) 1149 1154 (check-topic-id topic)) … … 1155 1160 (check-topic-id topic) 1156 1161 (check-single-instanceOf document topic t3-psi :xtm-format '1.0) 1157 (loop for occurrence across (xpath-child-elems-by-qname topic *xtm1.0-ns* "occurrence") 1162 (loop for occurrence across (xpath-child-elems-by-qname 1163 topic *xtm1.0-ns* "occurrence") 1158 1164 do (let ((resourceRef 1159 1165 (let ((resourceRef-nodes 1160 (xpath-child-elems-by-qname occurrence *xtm1.0-ns* "resourceRef"))) 1166 (xpath-child-elems-by-qname 1167 occurrence *xtm1.0-ns* "resourceRef"))) 1161 1168 (is (= (length resourceRef-nodes) 1)) 1162 (dom:get-attribute-ns (elt resourceRef-nodes 0) *xtm1.0-xlink* "href"))) 1169 (dom:get-attribute-ns (elt resourceRef-nodes 0) 1170 *xtm1.0-xlink* "href"))) 1163 1171 (instanceOf 1164 1172 (let ((instanceOf-nodes 1165 (xpath-child-elems-by-qname occurrence *xtm1.0-ns* "instanceOf"))) 1173 (xpath-child-elems-by-qname 1174 occurrence *xtm1.0-ns* "instanceOf"))) 1166 1175 (is (= (length instanceOf-nodes) 1)) 1167 1176 (let ((topicRef-nodes 1168 1177 (xpath-child-elems-by-qname 1169 (elt instanceOf-nodes 0) *xtm1.0-ns* "topicRef"))) 1178 (elt instanceOf-nodes 0) *xtm1.0-ns* 1179 "topicRef"))) 1170 1180 (is (= (length topicRef-nodes) 1)) 1171 1181 (get-subjectIndicatorRef-by-ref … … 1174 1184 (elt topicRef-nodes 0) *xtm1.0-xlink* "href")))))) 1175 1185 (cond 1176 ((string= resourceRef (first new-t100-occurrence-resourceRef-merge-2)) 1186 ((string= resourceRef 1187 (first new-t100-occurrence-resourceRef-merge-2)) 1177 1188 (is (string= instanceOf t55-psi))) 1178 ((string= resourceRef (second new-t100-occurrence-resourceRef-merge-2)) 1189 ((string= resourceRef 1190 (second new-t100-occurrence-resourceRef-merge-2)) 1179 1191 (is (string= instanceOf t55-psi))) 1180 1192 (t
Note: See TracChangeset
for help on using the changeset viewer.