Add test for POST of service.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 24 Sep 2009 06:41:30 +0000 (08:41 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 24 Sep 2009 06:41:30 +0000 (08:41 +0200)
Add test script, config files, etc for POST of service for command=init.
These were accidently omitted in commit
fdf549621a2712e2e7fafd5966bbbf9a5c891adf.

test/test_post.cfg [new file with mode: 0644]
test/test_post.sh [new file with mode: 0755]
test/test_post_1.res [new file with mode: 0644]
test/test_post_2.res [new file with mode: 0644]
test/test_post_3.res [new file with mode: 0644]
test/test_post_urls [new file with mode: 0644]

diff --git a/test/test_post.cfg b/test/test_post.cfg
new file mode 100644 (file)
index 0000000..7939ada
--- /dev/null
@@ -0,0 +1,18 @@
+<?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"/>
+    
+    <service>
+      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
+    </service>
+  </server>
+  
+  
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/test_post.sh b/test/test_post.sh
new file mode 100755 (executable)
index 0000000..c25a574
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+
+# srcdir might be set by make
+srcdir=${srcdir:-"."}
+
+# Test using test_http.cfg
+exec ${srcdir}/run_pazpar2.sh test_post
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
diff --git a/test/test_post_1.res b/test/test_post_1.res
new file mode 100644 (file)
index 0000000..ae5db74
--- /dev/null
@@ -0,0 +1 @@
+<init><status>OK</status><session>1</session><protocol>1</protocol></init>
\ No newline at end of file
diff --git a/test/test_post_2.res b/test/test_post_2.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/test_post_3.res b/test/test_post_3.res
new file mode 100644 (file)
index 0000000..d687e45
--- /dev/null
@@ -0,0 +1,8 @@
+<show>
+<status>OK</status>
+<activeclients>0</activeclients>
+<merged>0</merged>
+<total>0</total>
+<start>0</start>
+<num>0</num>
+</show>
diff --git a/test/test_post_urls b/test/test_post_urls
new file mode 100644 (file)
index 0000000..c5eda38
--- /dev/null
@@ -0,0 +1,5 @@
+marc_service.xml
+http://localhost:9763/search.pz2?command=init
+http://localhost:9763/search.pz1?session=1&command=search&query=computer
+1
+http://localhost:9763/search.pz1?session=1&command=show