New tests for facets
authorDennis Schafroth <dennis@indexdata.com>
Tue, 27 Jul 2010 11:39:04 +0000 (13:39 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Tue, 27 Jul 2010 11:39:04 +0000 (13:39 +0200)
test/test_facets.cfg [new file with mode: 0644]
test/test_facets.sh [new file with mode: 0755]
test/test_facets_1.res [new file with mode: 0644]
test/test_facets_2.res [new file with mode: 0644]
test/test_facets_3.res [new file with mode: 0644]
test/test_facets_4.res [new file with mode: 0644]
test/test_facets_5.res [new file with mode: 0644]
test/test_facets_6.res [new file with mode: 0644]
test/test_facets_urls [new file with mode: 0644]

diff --git a/test/test_facets.cfg b/test/test_facets.cfg
new file mode 100644 (file)
index 0000000..65287b7
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  <!-- Used by test_http.sh -->
+  <server>
+    <listen port="9763"/>
+    <proxy host="localhost"/>
+    
+    <service>
+      <include src="z3950_indexdata_com_marc.xml"/>
+      <targetprofiles type="local" src="../zeerex/records/"/>
+      <metadata name="url" merge="unique"/>
+      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
+      <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
+      <metadata name="isbn"/>
+      <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
+               termlist="yes"/>
+      <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" />
+      <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
+      <metadata name="id"/>
+      <metadata name="lccn" merge="unique"/>
+      <metadata name="description" brief="yes" merge="longest" rank="3"/>
+      
+      <metadata name="test-usersetting" brief="yes" setting="postproc"/>
+      <metadata name="test" setting="parameter"/>
+      <metadata name="test-usersetting-2" brief="yes"/>
+    </service>
+
+    <include src="*_service.xml"/> 
+    <include src="no_such_service.xml"/>
+
+  </server>
+  
+  
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/test_facets.sh b/test/test_facets.sh
new file mode 100755 (executable)
index 0000000..9633012
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+
+# srcdir might be set by make
+srcdir=${srcdir:-"."}
+
+yaz-ztest -l ztest.log @:9999 & 
+ZTEST_PID=$!
+echo "ZTEST PID: $ZTEST_PID" 
+
+# Test using test_http.cfg
+${srcdir}/run_pazpar2.sh test_facets
+
+kill $ZTEST_PID
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
diff --git a/test/test_facets_1.res b/test/test_facets_1.res
new file mode 100644 (file)
index 0000000..81ff9ff
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<init><status>OK</status><session>1</session><protocol>1</protocol></init>
\ No newline at end of file
diff --git a/test/test_facets_2.res b/test/test_facets_2.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_facets_3.res b/test/test_facets_3.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_facets_4.res b/test/test_facets_4.res
new file mode 100644 (file)
index 0000000..1e4328b
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>6</merged>
+<total>7</total>
+<start>0</start>
+<num>6</num>
+<hit>
+
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author><location id="localhost:9999/db1" name="db1">
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author></location>
+<location id="localhost:9999/db1" name="db1">
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author></location>
+<count>2</count>
+<relevance>36996</relevance>
+<recid>title how to program a computer author jack collins</recid>
+</hit>
+<hit>
+
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="localhost:9999/db1" name="db1">
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date></location>
+<relevance>30830</relevance>
+<recid>title computer science technology</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="localhost:9999/db1" name="db1">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Hebrew and Greek; introductions in English</md-description>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description></location>
+<relevance>30830</relevance>
+<recid>title the computer bible</recid>
+</hit>
+<hit>
+
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="localhost:9999/db1" name="db1">
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description></location>
+<relevance>12845</relevance>
+<recid>title the puget sound region author mairs john w</recid>
+</hit>
+<hit>
+
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date><location id="localhost:9999/db1" name="db1">
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date></location>
+<relevance>9249</relevance>
+<recid>title computer processing of dynamic images from an anger scintillation camera</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date><location id="localhost:9999/db1" name="db1">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date></location>
+<relevance>0</relevance>
+<recid>title reconstruction tomography in diagnostic radiology and nuclear medicine</recid>
+</hit>
+</show>
diff --git a/test/test_facets_5.res b/test/test_facets_5.res
new file mode 100644 (file)
index 0000000..8b8a807
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>localhost:9999/db1</id>
+<name>db1</name>
+<hits>7</hits>
+<diagnostic>0</diagnostic>
+<records>7</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_facets_6.res b/test/test_facets_6.res
new file mode 100644 (file)
index 0000000..28e0267
--- /dev/null
@@ -0,0 +1,28 @@
+<termlist>
+<activeclients>0</activeclients>
+<list name="xtargets">
+<term>
+<id>localhost:9999/db1</id>
+<name>db1</name>
+<frequency>7</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+</list>
+<list name="author">
+<term><name>author0</name><frequency>100</frequency></term>
+<term><name>author1</name><frequency>90</frequency></term>
+<term><name>author2</name><frequency>80</frequency></term>
+<term><name>author3</name><frequency>70</frequency></term>
+<term><name>author4</name><frequency>60</frequency></term>
+</list>
+<list name="title">
+</list>
+<list name="date">
+<term><name>date0</name><frequency>100</frequency></term>
+<term><name>date1</name><frequency>90</frequency></term>
+<term><name>date2</name><frequency>80</frequency></term>
+<term><name>date3</name><frequency>70</frequency></term>
+<term><name>date4</name><frequency>60</frequency></term>
+</list>
+</termlist>
diff --git a/test/test_facets_urls b/test/test_facets_urls
new file mode 100644 (file)
index 0000000..a2bbb9b
--- /dev/null
@@ -0,0 +1,6 @@
+http://localhost:9763/search.pz2?command=init&clear=1
+http://localhost:9763/search.pz2?session=1&command=settings&pz:name%5Blocalhost:9999%2Fdb1%5D=db1&pz:requestsyntax%5Blocalhost:9999%2Fdb1%5D=usmarc&pz:nativesyntax%5Blocalhost:9999%2Fdb1%5D=txml&pz:xslt%5Blocalhost:9999%2Fdb1%5D=tmarc.xsl&pz:termlist_term_count%5Blocalhost:9999%2Fdb1%5D=5
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
+http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=bytarget
+http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Ctitle%2Cdate