Cluster test
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 16 Dec 2013 21:07:24 +0000 (22:07 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 16 Dec 2013 21:07:24 +0000 (22:07 +0100)
test/pz.1.xml [new file with mode: 0644]
test/pz.2.xml [new file with mode: 0644]
test/pz.3.xml [new file with mode: 0644]
test/pz.4.xml [new file with mode: 0644]
test/run_pazpar2.sh
test/test_cluster.sh [new file with mode: 0755]
test/test_cluster.urls [new file with mode: 0755]
test/test_cluster_1.res [new file with mode: 0644]
test/test_cluster_2.res [new file with mode: 0644]
test/test_cluster_3.res [new file with mode: 0644]

diff --git a/test/pz.1.xml b/test/pz.1.xml
new file mode 100644 (file)
index 0000000..a59aaa0
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol2</metadata>
+</record>
+</pz:cluster>
diff --git a/test/pz.2.xml b/test/pz.2.xml
new file mode 100644 (file)
index 0000000..f899c96
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol3</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol2</metadata>
+</record>
+</pz:cluster>
diff --git a/test/pz.3.xml b/test/pz.3.xml
new file mode 100644 (file)
index 0000000..ffdf34e
--- /dev/null
@@ -0,0 +1,6 @@
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
diff --git a/test/pz.4.xml b/test/pz.4.xml
new file mode 100644 (file)
index 0000000..f87b885
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol4</metadata>
+</record>
+</pz:cluster>
index dd23b33..de6c021 100755 (executable)
@@ -9,6 +9,9 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
+YAZ_ZTEST_XML_FETCH=${srcdir}/
+export YAZ_ZTEST_XML_FETCH
+
 # terminate pazpar2 if test takes more than this (in seconds)
 WAIT=120
 
diff --git a/test/test_cluster.sh b/test/test_cluster.sh
new file mode 100755 (executable)
index 0000000..e64b961
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+TEST=`basename $0 .sh`
+# srcdir might be set by make
+srcdir=${srcdir:-"."}
+
+exec ${srcdir}/run_pazpar2.sh --ztest --icu $TEST
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
diff --git a/test/test_cluster.urls b/test/test_cluster.urls
new file mode 100755 (executable)
index 0000000..13fc5cf
--- /dev/null
@@ -0,0 +1,3 @@
+http://localhost:9763/search.pz2?command=init
+http://localhost:9763/search.pz2?session=1&command=search&query=4
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
diff --git a/test/test_cluster_1.res b/test/test_cluster_1.res
new file mode 100644 (file)
index 0000000..c09ee34
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<init><status>OK</status><session>1</session><protocol>1</protocol><keepAlive>50000</keepAlive>
+</init>
\ No newline at end of file
diff --git a/test/test_cluster_2.res b/test/test_cluster_2.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_cluster_3.res b/test/test_cluster_3.res
new file mode 100644 (file)
index 0000000..80cf35c
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>23</total>
+<start>0</start>
+<num>1</num>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol3</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol3</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol2</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="970776754">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol1</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="459409883">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol4</md-title>
+ </location>
+ <count>4</count>
+ <relevance>89257</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol</recid>
+</hit>
+</show>
\ No newline at end of file