From e4f457b4f7d81abea5cd5acedc424bc3fef1dca2 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 17 Oct 2006 16:20:00 +0000 Subject: [PATCH] New --- lib/ZOOM/IRSpy/Test/Search/DBDate.pm | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/ZOOM/IRSpy/Test/Search/DBDate.pm diff --git a/lib/ZOOM/IRSpy/Test/Search/DBDate.pm b/lib/ZOOM/IRSpy/Test/Search/DBDate.pm new file mode 100644 index 0000000..9005e47 --- /dev/null +++ b/lib/ZOOM/IRSpy/Test/Search/DBDate.pm @@ -0,0 +1,56 @@ +# $Id: DBDate.pm,v 1.1 2006-10-17 16:20:00 mike Exp $ + +# This plugin tests searching on BIB-1 access-point 1011 (Date/time +# added to db), the significance of which is that this search +# "succeeds" on some of our test databases +# (e.g. bagel.indexdata.com:210/marc) and fails on others +# (e.g. z3950.loc.gov:7090/Voyager gives error 114 "Unsupported Use +# attribute"). This allows us to test IRSpy's differing behaviour +# when a test succeeds or fails. + +package ZOOM::IRSpy::Test::Search::DBDate; + +use 5.008; +use strict; +use warnings; + +use ZOOM::IRSpy::Test; +our @ISA = qw(ZOOM::IRSpy::Test); + + +sub start { + my $class = shift(); + my($conn) = @_; + + $conn->irspy_search_pqf('@attr 1=1011 mineral', undef, + ZOOM::Event::RECV_SEARCH, \&found, + "exception", \&error); +} + + +sub found { + my($conn, $task, $__UNUSED_udata, $event) = @_; + + my $n = $task->{rs}->size(); + $conn->log("irspy_test", + "DB-date search found $n record", $n==1 ? "" : "s"); + my $rec = $conn->record(); + $rec->append_entry("irspy:status", "" . + isodate(time()) . ""); + + return ZOOM::IRSpy::Status::TASK_DONE; +} + + +sub error { + my($conn, $task, $__UNUSED_udata, $exception) = @_; + + $conn->log("irspy_test", "DB-date search had error: $exception"); + my $rec = $conn->record(); + $rec->append_entry("irspy:status", "" . + isodate(time()) . ""); + return ZOOM::IRSpy::Status::TEST_BAD; +} + + +1; -- 1.7.10.4