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") the its subsections.
6 package ZOOM::IRSpy::Test::Search::Bath;
12 use ZOOM::IRSpy::Test;
13 our @ISA = qw(ZOOM::IRSpy::Test);
15 use ZOOM::IRSpy::Utils qw(isodate);
19 [ author => 1003 ], # 5.A.0.1
20 [ title => 4 ], # 5.A.0.2
21 [ subject => 21 ], # 5.A.0.3
22 [ any => 1016 ], # 5.A.0.4
30 start_search($conn, 0);
35 my($conn, $qindex) = @_;
37 return ZOOM::IRSpy::Status::TEST_GOOD
38 if $qindex >= @bath_queries;
40 my $ref = $bath_queries[$qindex];
41 my($name, $use_attr) = @$ref;
43 my $query = "\@attr 1=$use_attr \@attr 2=3 \@attr 3=3 \@attr 4=2 \@attr 5=100 \@attr 6=1 the";
44 $conn->irspy_search_pqf($query, { qindex => $qindex }, {},
45 ZOOM::Event::ZEND, \&found,
46 "exception", \&error);
47 return ZOOM::IRSpy::Status::TASK_DONE;
52 my($conn, $task, $udata, $event) = @_;
54 my $qindex = $udata->{qindex};
55 my $ref = $bath_queries[$qindex];
56 my($name, $use_attr) = @$ref;
58 my $n = $task->{rs}->size();
60 $conn->log("irspy_test",
61 "bath search #$qindex ('$name') found $n record",
63 my $rec = $conn->record();
64 $rec->append_entry("irspy:status",
65 "<irspy:search_bath name='$name' ok='1'>" .
66 isodate(time()) . "</irspy:search_bath>");
68 return start_search($conn, $qindex+1);
73 my($conn, $task, $udata, $exception) = @_;
75 $conn->log("irspy_test", "bath search had error: $exception");
76 my $rec = $conn->record();
77 $rec->append_entry("irspy:status", "<irspy:search_bath ok='0'>" .
78 isodate(time()) . "</irspy:search_bath>");
79 zoom_error_timeout_update($conn, $exception);
80 return ZOOM::IRSpy::Status::TASK_DONE;