1 # $Id: DBDate.pm,v 1.2 2006-10-25 10:49:51 mike Exp $
3 # This plugin tests searching on BIB-1 access-point 1011 (Date/time
4 # added to db), the significance of which is that this search
5 # "succeeds" on some of our test databases
6 # (e.g. bagel.indexdata.com:210/marc) and fails on others
7 # (e.g. z3950.loc.gov:7090/Voyager gives error 114 "Unsupported Use
8 # attribute"). This allows us to test IRSpy's differing behaviour
9 # when a test succeeds or fails.
11 package ZOOM::IRSpy::Test::Search::DBDate;
17 use ZOOM::IRSpy::Test;
18 our @ISA = qw(ZOOM::IRSpy::Test);
25 $conn->irspy_search_pqf('@attr 1=1011 mineral', undef, {},
26 ZOOM::Event::RECV_SEARCH, \&found,
27 "exception", \&error);
32 my($conn, $task, $__UNUSED_udata, $event) = @_;
34 my $n = $task->{rs}->size();
35 $conn->log("irspy_test",
36 "DB-date search found $n record", $n==1 ? "" : "s");
37 my $rec = $conn->record();
38 $rec->append_entry("irspy:status", "<irspy:search_dbdate ok='1'>" .
39 isodate(time()) . "</irspy:search_dbdate>");
41 return ZOOM::IRSpy::Status::TASK_DONE;
46 my($conn, $task, $__UNUSED_udata, $exception) = @_;
48 $conn->log("irspy_test", "DB-date search had error: $exception");
49 my $rec = $conn->record();
50 $rec->append_entry("irspy:status", "<irspy:search_dbdate ok='0'>" .
51 isodate(time()) . "</irspy:search_dbdate>");
52 return ZOOM::IRSpy::Status::TEST_BAD;