1 # $Id: Example_Bib1.pm,v 1.1 2006-10-02 13:02:58 sondberg Exp $
3 # This is an example test probe. The assumptions are:
5 # 1. We should reuse as much as possible of the existing framework
6 # 2. Each method is called with a method that inherits from the ZOOM class
7 # 3. The notion of a Pod is dropped, because each connection is completely
9 # 4 The wait method should block program execution and control is passed to
11 # 5. The "handle" property can be more or less institutionalized. But I think
12 # we need a way to share information between methods and callbacks...
13 # 6. We'll need to discuss how we setup the order in which the tests are
14 # carried out. I don't like the idea that all connections must be in the
15 # same test state all the time. I *think* that this can be done multi
16 # threaded - conceptually (not the perl way of doing threads). Thus the
17 # method continue(1/0)
19 package ZOOM::IRSpy::Test::Search::Example_Bib1;
26 use ZOOM::IRSpy::Test;
27 our @ISA = qw(ZOOM::IRSpy::Test);
28 our @Bib1_Attr = qw(1 2 3 4 5 6 7 8 9);
32 my $this = shift(); ## Connection object
33 my $irspy = $this->irspy(); ## Each connection shares the irspy object
35 ## On your own risk "handle reference" - we simply gonna need that!
36 my $handle = $this->{'handle'};
38 ## Callbacks can be overwritten - but they exist in the Test base class
39 ## such that you don't *need* to overwrite them everytime you write a
40 ## new testing module...
42 $this->callback(ZOOM::Event::RECV_SEARCH, \&found);
44 foreach my $attr (@Bib1_Attr) {
45 $this->search_pqf('@attr 1=' . $attr . ' water' );
46 $handle->{'bib1_attr'} = $attr;
47 $this->wait(); ## I assume this wait blocks execution!
50 $this->continue(1); ## Perform the next test in the sequence
51 #$this->continue(0); ## Perform the next test in the sequence
59 my $irspy = $this->irspy();
60 my $handle = $this->{'handle'};
61 my $bib1_attr = $handle->{'bib1_attr'};
62 my $rs = $this->getResultSet();
63 my $attr = $href->{'attr'};
65 my $rec = $irspy->record($conn);
67 $irspy->log("irspy_test", $conn->option("host"),
68 " Bib-1 attribute=$attr search found $n record",
71 $rec->append_entry("irspy:status", "<irspy:search set='bib1' attr='$attr'" .
72 " ok='1'>" . $irspy->isodate(time()) .