1 # This tests the main searches specified The Bath Profile, Release 2.0,
2 # http://www.collectionscanada.gc.ca/bath/tp-bath2-e.htm
3 # Specifically section 5.A.0 ("Functional Area A: Level 0 Basic
4 # Bibliographic Search and Retrieval") and its subsections:
5 # http://www.collectionscanada.gc.ca/bath/tp-bath2.7-e.htm#a
7 package ZOOM::IRSpy::Test::Search::Bath;
13 use ZOOM::IRSpy::Test;
14 our @ISA = qw(ZOOM::IRSpy::Test);
16 use ZOOM::IRSpy::Utils qw(isodate);
20 [ author => 1003 ], # 5.A.0.1
21 [ title => 4 ], # 5.A.0.2
22 [ subject => 21 ], # 5.A.0.3
23 [ any => 1016 ], # 5.A.0.4
31 start_search($conn, 0);
36 my($conn, $qindex) = @_;
38 return ZOOM::IRSpy::Status::TEST_GOOD
39 if $qindex >= @bath_queries;
41 my $ref = $bath_queries[$qindex];
42 my($name, $use_attr) = @$ref;
44 my $query = "\@attr 1=$use_attr \@attr 2=3 \@attr 3=3 \@attr 4=2 \@attr 5=100 \@attr 6=1 the";
45 $conn->irspy_search_pqf($query, { qindex => $qindex }, {},
46 ZOOM::Event::ZEND, \&search_complete,
47 "exception", \&search_complete);
48 return ZOOM::IRSpy::Status::TASK_DONE;
53 my($conn, $task, $udata, $event) = @_;
54 my $ok = ref $event && $event->isa("ZOOM::Exception") ? 0 : 1;
56 my $qindex = $udata->{qindex};
57 my $ref = $bath_queries[$qindex];
58 my($name, $use_attr) = @$ref;
60 my $n = $task->{rs}->size();
62 $conn->log("irspy_test", "bath search #$qindex ('$name') ",
63 $ok ? ("found $n record", $n==1 ? "" : "s") :
66 my $rec = $conn->record();
67 $rec->append_entry("irspy:status",
68 "<irspy:search_bath name='$name' ok='$ok'>" .
69 isodate(time()) . "</irspy:search_bath>");
71 return start_search($conn, $qindex+1);