1 # $Id: Ping.pm,v 1.3 2006-06-21 16:10:18 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Ping;
11 use ZOOM::IRSpy::Test;
13 @ISA = qw(ZOOM::IRSpy::Test);
18 my $irspy = $this->irspy();
19 my $pod = $irspy->pod();
21 $pod->callback(ZOOM::Event::CONNECT, \&connected);
22 my $err = $pod->wait($irspy);
29 my($conn, $irspy, $rs, $event) = @_;
31 my $rec = $irspy->record($conn);
32 $irspy->log("irspy_test", $conn->option("host"), " connected");
33 ### Note the successful connection in $rec
38 # Some of this Pod-using code may be useful.
40 #$pod->option(elementSetName => "b");
41 #$pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search);
42 #$pod->callback(ZOOM::Event::RECV_RECORD, \&got_record);
43 ##$pod->callback(exception => \&exception_thrown);
44 #$pod->search_pqf("the");
45 #my $err = $pod->wait();
46 #die "$pod->wait() failed with error $err" if $err;
48 #sub completed_search {
49 # my($conn, $state, $rs, $event) = @_;
50 # print $conn->option("host"), ": found ", $rs->size(), " records\n";
51 # $state->{next_to_fetch} = 0;
52 # $state->{next_to_show} = 0;
53 # request_records($conn, $rs, $state, 2);
58 # my($conn, $state, $rs, $event) = @_;
61 # # Sanity-checking assertions. These should be impossible
62 # my $ns = $state->{next_to_show};
63 # my $nf = $state->{next_to_fetch};
65 # die "next_to_show > next_to_fetch ($ns > $nf)";
66 # } elsif ($ns == $nf) {
67 # die "next_to_show == next_to_fetch ($ns)";
71 # my $i = $state->{next_to_show}++;
72 # my $rec = $rs->record($i);
73 # print $conn->option("host"), ": record $i is ", render_record($rec), "\n";
74 # request_records($conn, $rs, $state, 3)
75 # if $i == $state->{next_to_fetch}-1;
80 #sub exception_thrown {
81 # my($conn, $state, $rs, $exception) = @_;
82 # print "Uh-oh! $exception\n";
86 #sub request_records {
87 # my($conn, $rs, $state, $count) = @_;
89 # my $i = $state->{next_to_fetch};
90 # ZOOM::Log::log("irspy", "requesting $count records from $i");
91 # $rs->records($i, $count, 0);
92 # $state->{next_to_fetch} += $count;
98 # return "undefined" if !defined $rec;
99 # return "'" . $rec->render() . "'";