1 # $Id: Bib1.pm,v 1.4 2006-10-02 13:02:10 sondberg Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Search::Bib1;
12 use ZOOM::IRSpy::Test;
13 our @ISA = qw(ZOOM::IRSpy::Test);
14 our @Bib1_Attr = qw(1 2 3 4 5 6 7 8 9);
19 my $irspy = $this->irspy();
20 my $pod = $irspy->pod();
22 $pod->callback(ZOOM::Event::RECV_SEARCH, \&found);
23 $pod->callback("exception", \&error_handler);
24 $pod->callback(ZOOM::Event::ZEND, \&continue);
26 foreach my $attr (@Bib1_Attr) {
27 $pod->search_pqf('@attr 1=' . $attr . ' water' );
28 $irspy->{'handle'}->{'attr'} = $attr;
29 my $err = $pod->wait($irspy);
37 my($conn, $irspy, $rs, $event) = @_;
38 my $href = $irspy->{'handle'};
39 my $attr = $href->{'attr'};
41 my $rec = $irspy->record($conn);
43 $irspy->log("irspy_test", $conn->option("host"),
44 " Bib-1 attribute=$attr search found $n record",
47 $rec->append_entry("irspy:status", "<irspy:search set='bib1' attr='$attr'" .
48 " ok='1'>" . $irspy->isodate(time()) .
55 my ($conn, $irspy, $rs, $event) = @_;
62 sub error_handler { maybe_connected(@_, 0) }
65 my($conn, $irspy, $rs, $event, $ok) = @_;
67 $irspy->log("irspy_test", $conn->option("host"),
68 ($ok ? "" : " not"), " connected");
69 my $rec = $irspy->record($conn);
70 $rec->append_entry("irspy:status", "<irspy:probe ok='$ok'>" .
71 $irspy->isodate(time()) . "</irspy:probe>");
72 $conn->option(pod_omit => 1) if !$ok;