New test marcxml
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 Oct 2003 09:18:55 +0000 (09:18 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 Oct 2003 09:18:55 +0000 (09:18 +0000)
configure.in
test/Makefile.am
test/malxml/test1.sh
test/marcxml/Makefile.am [new file with mode: 0644]
test/marcxml/m1.xml [new file with mode: 0644]
test/marcxml/m2.xml [new file with mode: 0644]
test/marcxml/m3.xml [new file with mode: 0644]
test/marcxml/record.abs [new file with mode: 0644]
test/marcxml/test1.sh [new file with mode: 0755]
test/marcxml/zebra.cfg [new file with mode: 0644]

index 6403204..a6d526a 100644 (file)
@@ -1,5 +1,5 @@
 dnl Zebra, Index Data Aps, 1995-2003
-dnl $Id: configure.in,v 1.85 2003-09-26 10:36:27 adam Exp $
+dnl $Id: configure.in,v 1.86 2003-10-07 09:18:55 adam Exp $
 dnl
 AC_INIT(include/zebraver.h)
 AM_INIT_AUTOMAKE(idzebra,1.3.13)
@@ -390,6 +390,7 @@ AC_OUTPUT([
   test/config/Makefile
   perl/Makefile.PL test/xelm/Makefile
   test/dmoz/Makefile test/xpath/Makefile test/sort/Makefile test/zsh/Makefile
+  test/marcxml/Makefile
   examples/Makefile examples/gils/Makefile examples/zthes/Makefile
   idzebra.spec
 ])
index f4141bc..f587ffe 100644 (file)
@@ -1,3 +1,3 @@
 
-SUBDIRS=api gils malxml config usmarc dmoz xpath sort xelm cddb rusmarc zsh
+SUBDIRS=api gils malxml config usmarc dmoz xpath sort xelm cddb rusmarc zsh marcxml
 
index b2bdbd8..6cda301 100755 (executable)
@@ -1,4 +1,9 @@
 #!/bin/sh
 LOG=test1.log
-../../index/zebraidx -l $LOG init
+rm -f $LOG
+if ../../index/zebraidx -l $LOG -V|grep Expat >/dev/null; then
+        ../../index/zebraidx -l$LOG init
+else
+        exit 0
+fi
 ../../index/zebraidx -l $LOG update f1.xml
diff --git a/test/marcxml/Makefile.am b/test/marcxml/Makefile.am
new file mode 100644 (file)
index 0000000..a75b504
--- /dev/null
@@ -0,0 +1,9 @@
+# $Id: Makefile.am,v 1.1 2003-10-07 09:18:56 adam Exp $
+
+check_SCRIPTS = test1.sh
+
+TESTS = $(check_SCRIPTS)
+
+EXTRA_DIST = zebra.cfg record.abs m1.xml m2.xml m3.xml \
+ $(check_SCRIPTS)
+
diff --git a/test/marcxml/m1.xml b/test/marcxml/m1.xml
new file mode 100644 (file)
index 0000000..0a61202
--- /dev/null
@@ -0,0 +1,32 @@
+<record xmlns="http://www.loc.gov/MARC21/slim">
+  <leader>00366nam  22001698a 4500</leader>
+  <controlfield tag="001">   11224466   </controlfield>
+  <controlfield tag="003">DLC  </controlfield>
+  <controlfield tag="005">00000000000000.0  </controlfield>
+  <controlfield tag="008">910710c19910701nju           00010 eng    </controlfield>
+  <datafield tag="010" ind1=" " ind2=" ">
+    <subfield code="a">   11224466 </subfield>
+  </datafield>
+  <datafield tag="040" ind1=" " ind2=" ">
+    <subfield code="a">DLC</subfield>
+    <subfield code="c">DLC</subfield>
+  </datafield>
+  <datafield tag="050" ind1="0" ind2="0">
+    <subfield code="a">123-xyz</subfield>
+  </datafield>
+  <datafield tag="100" ind1="1" ind2="0">
+    <subfield code="a">Jack Collins</subfield>
+  </datafield>
+  <datafield tag="245" ind1="1" ind2="0">
+    <subfield code="a">How to program a computer</subfield>
+  </datafield>
+  <datafield tag="260" ind1="1" ind2=" ">
+    <subfield code="a">Penguin</subfield>
+  </datafield>
+  <datafield tag="263" ind1=" " ind2=" ">
+    <subfield code="a">8710</subfield>
+  </datafield>
+  <datafield tag="300" ind1=" " ind2=" ">
+    <subfield code="a">p. cm.</subfield>
+  </datafield>
+</record>
diff --git a/test/marcxml/m2.xml b/test/marcxml/m2.xml
new file mode 100644 (file)
index 0000000..561b5db
--- /dev/null
@@ -0,0 +1,32 @@
+<record xmlns="http://www.loc.gov/MARC21/slim">
+  <leader>00366nam  22001698a 4500</leader>
+  <controlfield tag="001">   11224467   </controlfield>
+  <controlfield tag="003">DLC  </controlfield>
+  <controlfield tag="005">00000000000000.0  </controlfield>
+  <controlfield tag="008">910710c19910701nju           00010 eng    </controlfield>
+  <datafield tag="010" ind1=" " ind2=" ">
+    <subfield code="a">   11224467 </subfield>
+  </datafield>
+  <datafield tag="040" ind1=" " ind2=" ">
+    <subfield code="a">DLC</subfield>
+    <subfield code="c">DLC</subfield>
+  </datafield>
+  <datafield tag="050" ind1="0" ind2="0">
+    <subfield code="a">123-xyz</subfield>
+  </datafield>
+  <datafield tag="100" ind1="1" ind2="0">
+    <subfield code="a">Jack Collins</subfield>
+  </datafield>
+  <datafield tag="245" ind1="1" ind2="0">
+    <subfield code="a">How to program a computer</subfield>
+  </datafield>
+  <datafield tag="260" ind1="1" ind2=" ">
+    <subfield code="a">Penguin</subfield>
+  </datafield>
+  <datafield tag="263" ind1=" " ind2=" ">
+    <subfield code="a">8710</subfield>
+  </datafield>
+  <datafield tag="300" ind1=" " ind2=" ">
+    <subfield code="a">p. cm.</subfield>
+  </datafield>
+</record>
diff --git a/test/marcxml/m3.xml b/test/marcxml/m3.xml
new file mode 100644 (file)
index 0000000..794d81e
--- /dev/null
@@ -0,0 +1,73 @@
+<record xmlns="http://www.loc.gov/MARC21/slim">
+  <leader>01369cam  2200265 i 4500</leader>
+  <controlfield tag="001">   73090924 //r82  </controlfield>
+  <controlfield tag="003">DLC  </controlfield>
+  <controlfield tag="005">19820524000000.0  </controlfield>
+  <controlfield tag="008">760609s1974    nyua     b    10110 eng    </controlfield>
+  <datafield tag="010" ind1=" " ind2=" ">
+    <subfield code="a">   73090924 //r82</subfield>
+  </datafield>
+  <datafield tag="040" ind1=" " ind2=" ">
+    <subfield code="a">DLC</subfield>
+    <subfield code="c">DLC</subfield>
+    <subfield code="d">DLC</subfield>
+  </datafield>
+  <datafield tag="050" ind1="0" ind2="0">
+    <subfield code="a">RC71.3</subfield>
+    <subfield code="b">.W67 1971</subfield>
+  </datafield>
+  <datafield tag="082" ind1="0" ind2="0">
+    <subfield code="a">616.07/575/02854</subfield>
+  </datafield>
+  <datafield tag="111" ind1="2" ind2="0">
+    <subfield code="a">Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera,</subfield>
+    <subfield code="c">Washington University,</subfield>
+    <subfield code="d">1971.</subfield>
+  </datafield>
+  <datafield tag="245" ind1="1" ind2="0">
+    <subfield code="a">Computer processing of dynamic images from an Anger scintillation camera :</subfield>
+    <subfield code="b">the proceedings of a workshop /</subfield>
+    <subfield code="c">cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr.</subfield>
+  </datafield>
+  <datafield tag="260" ind1="0" ind2=" ">
+    <subfield code="a">New York :</subfield>
+    <subfield code="b">Society of Nuclear Medicine,</subfield>
+    <subfield code="c">[c1974]</subfield>
+  </datafield>
+  <datafield tag="300" ind1=" " ind2=" ">
+    <subfield code="a">xiv, p. :</subfield>
+    <subfield code="b">ill. ;</subfield>
+    <subfield code="c">24 cm.</subfield>
+  </datafield>
+  <datafield tag="504" ind1=" " ind2=" ">
+    <subfield code="a">Includes bibliographical references and index.</subfield>
+  </datafield>
+  <datafield tag="650" ind1=" " ind2="0">
+    <subfield code="a">Radioisotope scanning</subfield>
+    <subfield code="x">Data processing</subfield>
+    <subfield code="x">Congresses.</subfield>
+  </datafield>
+  <datafield tag="650" ind1=" " ind2="0">
+    <subfield code="a">Scintillation cameras</subfield>
+    <subfield code="x">Congresses.</subfield>
+  </datafield>
+  <datafield tag="650" ind1=" " ind2="0">
+    <subfield code="a">Imaging systems in medicine</subfield>
+    <subfield code="x">Data processing</subfield>
+    <subfield code="x">Congresses.</subfield>
+  </datafield>
+  <datafield tag="700" ind1="1" ind2="0">
+    <subfield code="a">Larson, Kenneth B.</subfield>
+  </datafield>
+  <datafield tag="700" ind1="1" ind2="0">
+    <subfield code="a">Cox, Jerome R. </subfield>
+  </datafield>
+  <datafield tag="710" ind1="2" ind2="0">
+    <subfield code="a">Washington University, St. Louis.</subfield>
+    <subfield code="b">Biomedical Computer Laboratory.</subfield>
+  </datafield>
+  <datafield tag="710" ind1="2" ind2="0">
+    <subfield code="a">Washington University, St. Louis.</subfield>
+    <subfield code="b">Nuclear Medicine Division.</subfield>
+  </datafield>
+</record>
diff --git a/test/marcxml/record.abs b/test/marcxml/record.abs
new file mode 100644 (file)
index 0000000..e11c423
--- /dev/null
@@ -0,0 +1,13 @@
+# $Id: record.abs,v 1.1 2003-10-07 09:18:56 adam Exp $
+
+name marcxml
+attset bib1.att
+
+esetname F @
+esetname B @
+
+xpath disable
+
+xelm /record/datafield[@tag="100"]/subfield[@code="a"] author:w
+xelm /record/datafield[@tag="245"]/subfield            title:w
+
diff --git a/test/marcxml/test1.sh b/test/marcxml/test1.sh
new file mode 100755 (executable)
index 0000000..58bb388
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+LOG=test1.log
+rm -f $LOG
+if ../../index/zebraidx -l $LOG -V|grep Expat >/dev/null; then
+       ../../index/zebraidx -l$LOG init
+else
+       exit 0
+fi
+../../index/zebraidx -l$LOG update m*.xml
+../../index/zebrasrv -l$LOG unix:socket &
+sleep 1
+../api/testclient unix:socket '@and @attr 1=1003 jack @attr 1=4 computer' >tmp1
+echo 'Result count: 2' >tmp2
+kill `cat zebrasrv.pid` || exit 1
+diff tmp1 tmp2 || exit 2
+rm -f tmp1 tmp2
diff --git a/test/marcxml/zebra.cfg b/test/marcxml/zebra.cfg
new file mode 100644 (file)
index 0000000..3a675e1
--- /dev/null
@@ -0,0 +1,17 @@
+# Simple Zebra configuration file
+# $Id: zebra.cfg,v 1.1 2003-10-07 09:18:56 adam Exp $
+#
+# Where the schema files, attribute files, etc are located.
+profilePath: .:../../tab
+
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: gils.att
+attset: explain.att
+
+recordtype: grs.xml
+
+#storekeys: 1
+#storedata: 1
+#recordId: (bib1,identifier-standard)
+isam: b